/* Reusable Card Micro-Interactions */

/* Card Hover: Lift + Shadow + Background Shift */
.card-interactive {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card-interactive:hover {
  background-color: var(--color-surface-hover);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
  border-color: var(--color-gold-alt);
}

.card-interactive:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-gold-alt), 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* Image Hover: Zoom + Border Glow */
.card-image {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.card-interactive:hover .card-image {
  transform: scale(1.08);
  box-shadow: inset 0 0 0 1px var(--color-gold-alt), 0 0 16px rgba(212, 175, 55, 0.3);
}

/* Focus Ring: All Interactive Elements */
.card-interactive a:focus-visible,
.card-interactive button:focus-visible,
.card-interactive:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-gold-alt);
  border-radius: 0;
}

/* Text Links in Cards: Gold on Hover */
.card-interactive a {
  transition: color 150ms ease;
}

.card-interactive a:hover {
  color: var(--color-gold-alt);
}

/* Icon Rotation in Links */
.card-interactive a .material-symbols-outlined {
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms ease;
  display: inline-block;
}

.card-interactive a:hover .material-symbols-outlined {
  transform: rotate(45deg);
  color: var(--color-gold-alt);
}

/* Accession Number Highlight */
.card-accession {
  transition: all 150ms ease;
}

.card-interactive:hover .card-accession {
  color: var(--color-gold-alt);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* Mobile: Active State Instead of Hover */
@media (hover: none) and (pointer: coarse) {
  .card-interactive:active {
    background-color: var(--color-surface-hover);
    transform: translateY(-2px);
  }

  .card-interactive:active .card-image {
    transform: scale(1.05);
  }
}

/* Image Loading Skeleton */
.card-image.loading {
  animation: skeletonShimmer 1.5s infinite;
}

@keyframes skeletonShimmer {
  0%, 100% {
    background-color: var(--color-surface-variant);
  }
  50% {
    background-color: rgba(212, 175, 55, 0.1);
  }
}

/* Staggered Entrance Animation */
.card-interactive.reveal-elem {
  opacity: 0;
  transform: translateY(-24px);
  animation: cardReveal 300ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.card-interactive.reveal-elem:nth-child(1) {
  animation-delay: 0ms;
}

.card-interactive.reveal-elem:nth-child(2) {
  animation-delay: 50ms;
}

.card-interactive.reveal-elem:nth-child(3) {
  animation-delay: 100ms;
}

.card-interactive.reveal-elem:nth-child(4) {
  animation-delay: 150ms;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button & Link Styling — Consistent Across Page */

/* Primary Action Buttons */
.btn-primary,
[class*="btn-"] {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover,
[class*="btn-"]:hover {
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.btn-primary:focus-visible,
[class*="btn-"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-gold-alt);
}

/* Icon Rotation on Button Hover */
.btn-primary .material-symbols-outlined,
[class*="btn-"] .material-symbols-outlined {
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), color 150ms ease;
  display: inline-block;
}

.btn-primary:hover .material-symbols-outlined,
[class*="btn-"]:hover .material-symbols-outlined {
  transform: rotate(45deg);
  color: var(--color-gold-alt);
}

/* Generic Link Hover Styling */
a:not([class]) {
  transition: color 150ms ease;
}

a:not([class]):hover {
  color: var(--color-gold-alt);
}

a:not([class]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-gold-alt);
}

/* Footer Links — Focus Rings */
footer a {
  transition: color 150ms ease;
}

footer a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-gold-alt);
  border-radius: 0;
}

/* Image Hover Glows — Master Vitrine & Juxtaposition */
img[src*="artworks"],
img[src*="medium"],
img[src*="plate"] {
  transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

img[src*="artworks"]:hover,
img[src*="medium"]:hover,
img[src*="plate"]:hover {
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.3), inset 0 0 0 1px var(--color-gold-alt);
}

/* Spectrogram Block Hover — Decade Visualization */
.barcode-line {
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.barcode-line:hover {
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
  filter: brightness(1.1);
}

/* Text Entrance Animations */
h2, h3, p {
  animation: textReveal 400ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes textReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Metadata Label Styling — Emphasize Uncertainty */
.text-on-surface-variant,
.text-outline-variant {
  transition: color 150ms ease;
}

/* Section Headers — Gold Emphasis on Hover */
section h2 {
  transition: color 200ms ease;
}

section:hover h2 {
  color: var(--color-gold-light);
}

/* Audio Player Enhancements */
#play-pause-btn {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

#play-pause-btn:hover {
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

#play-pause-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-gold-alt);
}

#play-icon {
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

#play-pause-btn:hover #play-icon {
  transform: scale(1.1);
}

/* Transcript Expand/Collapse — Smooth Animation */
.transcript-toggle {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.transcript-toggle:hover {
  color: var(--color-gold-alt);
}

.transcript-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.transcript-content.expanded {
  max-height: 500px;
}

/* Search Button Enhanced Styling */
#search-btn,
[class*="search"] {
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

#search-btn:hover,
[class*="search"]:hover {
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

#search-btn:focus-visible,
[class*="search"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-paper), 0 0 0 4px var(--color-gold-alt);
}

/* Prefers Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .card-interactive,
  .card-image,
  .card-interactive a,
  .card-interactive a .material-symbols-outlined,
  .card-accession,
  .card-image.loading,
  .btn-primary,
  [class*="btn-"],
  a:not([class]) {
    transition: none;
    animation: none;
  }

  .card-interactive:hover,
  .card-interactive:active,
  .btn-primary:hover,
  [class*="btn-"]:hover {
    transform: none;
  }

  .card-interactive:hover .card-image,
  .card-interactive:active .card-image,
  .btn-primary:hover .material-symbols-outlined,
  [class*="btn-"]:hover .material-symbols-outlined {
    transform: none;
  }
}
