/* Archival Effects — Component Styling using Museum Design System

   Applies Stitch design elements (spotlighting, matting, grid, vignette)
   to specific components: cards, buttons, focus elements, and interactive states.

   Live: 2026-09-22
*/

/* ========== CARD COMPONENTS ========== */

/* Primary card with full museum treatment */
.card-archival {
  background: var(--color-paper);
  border: 1px solid rgba(197, 160, 89, 0.25);
  padding: 1.5rem;
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.95),
              0 0 40px rgba(212, 175, 55, 0.08);
  transition: all var(--duration-long) var(--easing-standard);
  position: relative;
}

.card-archival:hover {
  border-color: rgba(197, 160, 89, 0.5);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.95),
              0 0 50px rgba(212, 175, 55, 0.12);
}

/* Gridded card variant */
.card-archival.gridded {
  background-image:
    linear-gradient(to right, rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: 0 0, 0 0;
  background-attachment: local;
}

/* ========== BUTTONS ========== */

/* Primary curatorial button */
.btn-primary-curatorial {
  background: var(--color-accent);
  color: var(--color-paper);
  border: none;
  padding: 12px 24px;
  font-family: var(--font-family-primary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.04);
}

.btn-primary-curatorial:hover {
  background: var(--color-accent-highlight);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.25), inset 0 0 20px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.btn-primary-curatorial:active {
  transform: translateY(0);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

/* Secondary outlined button */
.btn-secondary-outline {
  background: transparent;
  color: var(--color-ink);
  border: 1px solid rgba(197, 160, 89, 0.4);
  padding: 12px 24px;
  font-family: var(--font-family-primary);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
}

.btn-secondary-outline:hover {
  background: rgba(197, 160, 89, 0.08);
  border-color: rgba(197, 160, 89, 0.6);
  color: var(--color-accent);
}

/* Tertiary link button */
.btn-tertiary-link {
  background: none;
  border: none;
  color: rgba(197, 160, 89, 0.8);
  text-decoration: none;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: 0.1em;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--duration-short) var(--easing-standard);
}

.btn-tertiary-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: rgba(197, 160, 89, 0.6);
  transition: width var(--duration-medium) var(--easing-standard);
}

.btn-tertiary-link:hover {
  color: var(--color-accent);
}

.btn-tertiary-link:hover::after {
  width: 100%;
}

/* ========== BUTTERFLY MARK CYPHER ========== */

.butterfly-mark {
  filter: drop-shadow(0 0 8px rgba(255, 87, 0, 0.6));
  transition: filter var(--duration-medium) var(--easing-standard),
              transform var(--duration-medium) var(--easing-standard);
  will-change: transform, filter;
}

.butterfly-mark:hover {
  filter: drop-shadow(0 0 16px rgba(255, 87, 0, 0.9));
  transform: scale(1.1) rotate(5deg);
}

/* ========== TOUCH TARGET OPTIMIZATION (44px Minimum) ========== */

/* WCAG AA compliance: all interactive elements minimum 44×44px touch target */
button:not(.btn-icon-small),
a[href]:not(.link-inline),
.waypoint-link,
.nav-drawer-item,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
.icon-button {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Icon buttons in navbar/header */
.app-bar-icon,
.app-bar-menu-btn,
.app-bar-search-btn,
.nav-drawer-close-btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Smaller icon buttons (allowed if within grouped targets) */
.btn-icon-small {
  min-width: 36px;
  min-height: 36px;
}

/* Inline links can be smaller if sufficient spacing */
.link-inline {
  min-width: auto;
  min-height: auto;
  padding: 4px 8px;
}

/* Ensure focus states have adequate target area */
*:focus-visible {
  outline-offset: 2px;
}

/* ========== FOCUS STATES ========== */

/* Enhanced focus ring for keyboard navigation */
.focus-ring-archival:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

/* Focus ring for buttons */
button.focus-ring-archival:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

/* ========== BADGE & METADATA CHIPS ========== */

.badge-archival {
  display: inline-block;
  background: rgba(24, 24, 27, 0.8);
  border: 1px solid rgba(153, 144, 124, 0.3);
  color: rgba(197, 160, 89, 0.9);
  padding: 4px 10px;
  font-family: var(--font-family-primary);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 0;
  transition: all var(--duration-medium) var(--easing-standard);
}

.badge-archival:hover {
  border-color: rgba(197, 160, 89, 0.6);
  background: rgba(24, 24, 27, 1);
  color: var(--color-accent);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.15);
}

/* ========== FORM INPUTS ========== */

.input-archival {
  background: var(--color-paper);
  border: 1px solid rgba(245, 242, 235, 0.15);
  color: var(--color-ink);
  padding: 12px 14px;
  font-family: "EB Garamond", serif;
  font-size: 14px;
  transition: all var(--duration-medium) var(--easing-standard);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5);
}

.input-archival::placeholder {
  color: rgba(168, 163, 152, 0.6);
}

.input-archival:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.5),
              0 0 0 3px rgba(212, 175, 55, 0.1);
  background: rgba(19, 19, 21, 0.8);
}

/* ========== SECTION HEADERS ========== */

.section-header-archival {
  position: relative;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.section-header-archival::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    rgba(197, 160, 89, 0.3) 10%,
    rgba(197, 160, 89, 0.3) 90%,
    transparent 100%);
}

.section-header-archival h2 {
  font-family: var(--font-family-primary);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--color-accent);
  margin: 0 0 0.5rem 0;
}

/* ========== VITRINE PRESENTATION ========== */

/* Museum vitrine container for art/photos */
.vitrine-frame {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .vitrine-frame {
    grid-template-columns: 1fr;
  }
}

.vitrine-image {
  background: var(--color-paper);
  min-height: 340px;
  display: grid;
  place-items: center;
  padding: 1rem;
  border: 1px solid rgba(197, 160, 89, 0.2);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.95),
              0 0 30px rgba(212, 175, 55, 0.06);
}

.vitrine-image img {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.vitrine-metadata {
  padding: 1rem;
  background: rgba(19, 19, 21, 0.5);
  border: 1px solid rgba(197, 160, 89, 0.15);
}

.vitrine-metadata h4 {
  font-size: 2rem;
  font-family: var(--font-family-primary);
  color: var(--color-accent);
  margin: 0.2rem 0 1rem;
}

.vitrine-metadata p {
  font-family: "EB Garamond", serif;
  color: var(--color-ink);
  margin: 0.5rem 0;
  line-height: 1.65;
}

/* ========== ANIMATION SEQUENCES ========== */

/* Staggered reveal for list items */
.reveal-staggered > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-extra-long) var(--easing-elastic),
              transform var(--duration-extra-long) var(--easing-elastic);
}

.reveal-staggered.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-staggered > *:nth-child(1) { transition-delay: var(--delay-0); }
.reveal-staggered > *:nth-child(2) { transition-delay: var(--delay-1); }
.reveal-staggered > *:nth-child(3) { transition-delay: var(--delay-2); }
.reveal-staggered > *:nth-child(4) { transition-delay: var(--delay-3); }
.reveal-staggered > *:nth-child(5) { transition-delay: var(--delay-4); }

/* ========== ACCESSIBILITY ========== */

/* High contrast mode adjustments */
@media (prefers-contrast: more) {
  .card-archival {
    border-color: rgba(212, 175, 55, 0.5);
  }

  .hairline-frame {
    border-color: rgba(197, 160, 89, 0.6);
  }

  .badge-archival {
    border-color: rgba(197, 160, 89, 0.8);
  }
}

/* ========== VITRINE INSPECTION VIEWER ========== */

.vitrine-inspection-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 1;
  transition: opacity var(--duration-long) var(--easing-standard);
}

.vitrine-inspection-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.vitrine-inspection-viewer {
  position: relative;
  width: 100%;
  max-width: 90vw;
  max-height: 90vh;
  background: var(--color-paper);
  border: 1px solid rgba(212, 175, 55, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inspection-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: grab;
  transition: transform var(--duration-medium) var(--easing-standard);
}

.inspection-image:active {
  cursor: grabbing;
}

.inspection-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: var(--z-sticky);
}

.inspection-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(19, 19, 21, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 0px;
}

.btn-inspect {
  background: transparent;
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--color-accent);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
  padding: 0;
}

.btn-inspect:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.inspection-zoom-level {
  font-family: var(--font-family-mono);
  font-size: 11px;
  color: var(--color-accent);
  min-width: 60px;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.crosshair-reticle {
  width: 32px;
  height: 32px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  color: var(--color-accent);
  opacity: 0.6;
  transition: opacity var(--duration-medium) var(--easing-standard);
}

.crosshair-icon {
  width: 100%;
  height: 100%;
}

.btn-inspect-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(19, 19, 21, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.2);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-medium) var(--easing-standard);
  z-index: var(--z-sticky-high);
}

.btn-inspect-close:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .vitrine-inspection-overlay {
    padding: 1rem;
  }

  .inspection-toolbar {
    flex-direction: column;
  }

  .btn-inspect {
    width: 36px;
    height: 36px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .card-archival,
  .btn-primary-curatorial,
  .btn-secondary-outline,
  .btn-tertiary-link,
  .input-archival,
  .badge-archival,
  .vitrine-frame {
    transition: none !important;
  }

  .btn-primary-curatorial:hover,
  .btn-primary-curatorial:active {
    transform: none !important;
  }

  .reveal-staggered > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
