/* Home Museum — "पूजा पत्रिका" theme: ornamental invitation-card frame */

:root {
  --color-bg: #fbf1de;
  --color-surface: #fff9ec;
  --color-surface-2: #fdf1dc;
  --color-text: #3a0f16;
  --color-muted: #7a5c46;
  --color-primary: #7a1e2b;
  --color-primary-hover: #611722;
  --color-primary-soft: rgba(122, 30, 43, 0.08);
  --color-gold: #8f6224;
  --color-gold-soft: rgba(143, 98, 36, 0.14);
  --color-border: rgba(143, 98, 36, 0.32);
  --color-play-text: #f6e6c4;
  --color-banner: #f6e7be;
  --color-banner-border: #d9b96a;
  --color-error: #9a1f1f;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(58, 15, 22, 0.08);
  --shadow-md: 0 10px 26px rgba(58, 15, 22, 0.12);
  --max: 640px;
  --max-wide: 1080px;
  --tap: 48px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 160ms;
  --dur: 260ms;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
  /* Reverted from "Yatra One" (Google Font) after repeated font/legibility
     complaints — system-ui renders instantly, offline, with guaranteed
     Devanagari coverage on every device. Weight/spacing carry the "display"
     feel instead (each --font-display usage pairs it with font-weight: 700). */
  --font-display: var(--font);
}

/* Dark mode intentionally removed — the "पत्रिका" (invitation card) look is
   paper/ivory by nature, and an auto-switching brown palette on some phones
   was confusing family members ("theme changed on its own"). The site now
   always shows the same warm palette regardless of the device's OS setting. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background:
    radial-gradient(900px 480px at 8% -8%, var(--color-primary-soft), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, var(--color-gold-soft), transparent 52%),
    var(--color-bg);
}

img { max-width: 100%; display: block; }
button, a { font: inherit; }
button { touch-action: manipulation; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: var(--color-play-text);
  padding: 0.75rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}

.skip-link:focus { left: 0; top: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--color-bg) 80%, transparent);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-mark {
  width: 1.15rem;
  height: 1.45rem;
  flex-shrink: 0;
  color: var(--color-gold);
  transition: transform var(--dur) var(--ease);
}

.brand:hover .brand-mark { transform: scale(1.12) rotate(-4deg); }

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-family {
  font-size: 0.76rem;
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Hidden until English guide content exists for the docx-based items (§ audio-scripts).
   Remove this rule to bring the toggle back once English text is written. */
.lang-toggle { display: none; }

.lang-toggle {
  flex-shrink: 0;
  min-height: var(--tap);
  padding: 0 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.lang-toggle:hover { border-color: var(--color-gold); }
.lang-toggle:active { transform: scale(0.96); }
.lang-toggle [data-lang-label] { transition: color var(--dur-fast) var(--ease); }
.lang-toggle [data-lang-label].active { font-weight: 800; color: var(--color-primary); }
.lang-sep { opacity: 0.4; margin: 0 0.3rem; }

/* ---------- Ornamental frame around the whole content card ---------- */

.main {
  position: relative;
  max-width: var(--max);
  margin: 1.1rem auto 2rem;
  padding: 1.7rem 1.35rem 2.3rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1.5px var(--color-gold),
    0 0 0 6px var(--color-bg),
    0 0 0 7.5px var(--color-gold),
    var(--shadow-md);
}

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  color: var(--color-gold);
  opacity: 0.85;
  z-index: 1;
  pointer-events: none;
}

.corner svg { width: 100%; height: 100%; }
.c-tl { top: 0.85rem; left: 0.85rem; }
.c-tr { top: 0.85rem; right: 0.85rem; transform: scaleX(-1); }
.c-bl { bottom: 0.85rem; left: 0.85rem; transform: scaleY(-1); }
.c-br { bottom: 0.85rem; right: 0.85rem; transform: scale(-1, -1); }

.app { min-height: 45vh; position: relative; z-index: 2; }

.loading, .error-box, .empty-note {
  text-align: center;
  color: var(--color-muted);
  padding: 2.5rem 1rem;
}

.state-icon {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 1rem;
  color: var(--color-gold);
  opacity: 0.85;
}

.loading .state-icon { animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-box h1 { color: var(--color-error); font-size: 1.3rem; margin: 0 0 0.5rem; }

.error-detail { font-size: 0.76rem; opacity: 0.6; margin-top: 0.4rem; }

.retry-btn {
  margin-top: 1rem;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-gold);
  background: var(--color-surface-2);
  color: var(--color-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.site-footer {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1.25rem 1.1rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.84rem;
}

/* ---------- Scallop divider ---------- */

.scallop {
  height: 9px;
  margin: 0.7rem 0 1.5rem;
  background-image: radial-gradient(circle at 5px 0, transparent 5px, var(--color-gold) 5.5px, transparent 6px);
  background-size: 10px 10px;
  background-repeat: repeat-x;
  opacity: 0.6;
}

/* ---------- Home ---------- */

.home-hero { text-align: center; }

.home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.home-hero h1 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(1.9rem, 7vw, 2.5rem);
  line-height: 1.25;
  color: var(--color-primary);
}

.home-hero p { margin: 0 auto; color: var(--color-muted); max-width: 40ch; }

/* ---------- Decoration video (whole-shrine "आरास", home page only) ---------- */

.decoration-section {
  margin: 1.3rem 0 1.6rem;
  padding: 0.9rem 0.9rem 1rem;
  text-align: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.decoration-title {
  margin: 0 0 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary);
}

.decoration-video {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-gold);
  background: #000;
  display: block;
  margin: 0 auto;
}

.decoration-caption {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.decoration-copyright {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--color-muted);
  opacity: 0.75;
}

/* Chromium's native "download" glyph in the controls bar respects
   controlsList="nodownload" already; this just keeps the video from being
   picked up by drag-to-desktop gestures on desktop browsers. */
.decoration-video { -webkit-user-drag: none; user-select: none; }

.decoration-error {
  margin: 0.6rem 0 0;
  padding: 1.4rem 1rem;
  border: 1.5px dashed var(--color-gold);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-size: 0.88rem;
  background: var(--color-gold-soft);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.item-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: visible;
  box-shadow: var(--shadow-sm);
  min-height: 100%;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* The hidden state lives only inside the keyframes, never in the base rule, so
   content stays visible if the animation is unsupported or never ticks. */
@media (prefers-reduced-motion: no-preference) {
  .item-card {
    animation: card-in var(--dur) var(--ease) both;
    animation-delay: calc(var(--i, 0) * 45ms);
  }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-gold); }
.item-card:active { transform: scale(0.98); }

.item-card-media { position: relative; margin: 0.4rem 0.4rem 0; border-radius: 6px; overflow: hidden; }

.item-card-img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  background: var(--color-gold-soft);
}

/* AI reference sheets are dense multi-panel diagrams on a white ground —
   cover-cropping them at thumbnail size would slice into the panel labels,
   so they get letterboxed in full instead of cropped. */
.item-card-img.is-ref {
  object-fit: contain;
  background: #fbfaf7;
  padding: 0.3rem;
}

.item-card-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-play-text);
  border: 2px solid var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm);
}

.item-card-body {
  padding: 0.7rem 0.7rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  text-align: center;
}

.item-card-title { font-weight: 700; font-size: 0.94rem; line-height: 1.32; }
.item-card-meta { font-size: 0.78rem; color: var(--color-muted); font-variant-numeric: tabular-nums; }

.visited-pill {
  margin-top: 0.3rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: var(--color-gold-soft);
  color: var(--color-gold);
}

.visited-pill svg { width: 0.8rem; height: 0.8rem; }

/* ---------- Item detail ---------- */

.banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--color-banner);
  border: 1px solid var(--color-banner-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.1rem;
  font-size: 0.88rem;
  text-align: left;
  animation: fade-down var(--dur) var(--ease);
}

.banner svg { flex-shrink: 0; width: 1.1rem; height: 1.1rem; color: var(--color-gold); }

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

article { text-align: center; }

.item-eyebrow {
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.item-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-primary);
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  line-height: 1.25;
}

.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: var(--color-gold);
  margin: 0.55rem 0;
}

.flourish .ln { width: 28px; height: 1px; background: currentColor; opacity: 0.7; }
.flourish svg { width: 0.7rem; height: 0.7rem; }

.item-meta {
  color: var(--color-muted);
  font-size: 0.93rem;
  margin: 0.2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem 0.9rem;
}

.item-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.item-meta svg { width: 1rem; height: 1rem; color: var(--color-gold); flex-shrink: 0; }

.duration {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Player: mudra (seal) button + dori (thread) progress ---------- */

.player {
  margin: 1.5rem 0;
  padding: 0.5rem 0.5rem 0.2rem;
  text-align: center;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.skip-btn {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  border: 1.5px solid var(--color-gold);
  background: var(--color-surface-2);
  color: var(--color-gold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.skip-btn:hover { background: var(--color-gold-soft); }
.skip-btn:active { transform: scale(0.92); }
.skip-btn svg { width: 1.15rem; height: 1.15rem; }
.skip-btn.skip-fwd svg { transform: scaleX(-1); }

.play-btn {
  position: relative;
  width: 4.6rem;
  height: 4.6rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 3px double var(--color-gold);
  background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--color-primary) 78%, white 10%), var(--color-primary) 65%);
  color: var(--color-play-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--color-primary-soft);
  transition: transform var(--dur-fast) var(--ease);
}

.play-btn:active { transform: scale(0.94); }
.play-btn:disabled, .skip-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.play-btn svg { width: 1.8rem; height: 1.8rem; }

.play-btn::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--color-gold);
  opacity: 0;
}

.play-btn.is-playing::after { animation: pulse-ring 1.8s var(--ease) infinite; }

@keyframes pulse-ring {
  0% { opacity: 0.55; transform: scale(0.94); }
  100% { opacity: 0; transform: scale(1.16); }
}

.play-btn:focus-visible,
.skip-btn:focus-visible,
.lang-toggle:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 3px;
}

.player-label {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted);
}

.audio-error { margin: 0.85rem 0 0; color: var(--color-error); font-size: 0.88rem; }

.progress-wrap { position: relative; margin: 1.2rem auto 0; max-width: 320px; }

.progress-bar {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--color-primary) calc(var(--pct, 0) * 1%), transparent 0),
    repeating-linear-gradient(90deg, var(--color-gold) 0 3px, transparent 3px 7px);
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-gold);
  box-shadow: var(--shadow-sm);
  margin-top: -4.5px;
}

.progress-bar::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid var(--color-gold);
}

.progress-bar::-moz-range-track { height: 6px; border-radius: 999px; background: transparent; }

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 0.45rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- Gallery ---------- */

.gallery-wrap { margin: 0.4rem 0 1.2rem; }

.gallery {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.1rem 0.5rem;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar { display: none; }

.gallery img {
  flex: 0 0 78%;
  scroll-snap-align: center;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-gold);
  background: var(--color-gold-soft);
  cursor: zoom-in;
  transition: transform var(--dur-fast) var(--ease);
}

/* AI reference sheets (front/side/detail panels + printed labels) shown at
   their own native ratio so nothing is cropped or letterboxed. */
.gallery img.is-ref {
  aspect-ratio: 1376 / 768;
  object-fit: contain;
  background: #fbfaf7;
  padding: 0.4rem;
}

.gallery img:active { transform: scale(0.97); }

.gallery-dots { display: flex; justify-content: center; gap: 0.4rem; margin-top: 0.6rem; }

.gallery-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.gallery-dots span.active { background: var(--color-primary); transform: scale(1.3); }

/* ---------- Narrative (story-guide items) ---------- */

.narrative { text-align: left; }

.symbol-medallion {
  width: 4.4rem;
  height: 4.4rem;
  margin: 0.4rem auto 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  box-shadow: 0 0 0 4px var(--color-surface), 0 0 0 5px var(--color-gold-soft);
  object-fit: cover;
}

.guide-intro {
  margin: 0 auto 2rem;
  max-width: 34ch;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.05rem, 4.1vw, 1.24rem);
  line-height: 1.55;
  color: var(--color-primary);
  text-wrap: balance;
}

.granth-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 1.1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--color-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

.granth-line svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.2rem; color: var(--color-gold); }

.darshanik {
  margin: 2rem 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--color-primary);
}

.guide-outro {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--color-border);
}

.next-guide {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--color-muted);
}

@media (prefers-reduced-motion: no-preference) {
  .movement {
    animation: card-in 420ms var(--ease) both;
    animation-delay: calc(var(--i, 0) * 110ms);
  }
}

.movement + .movement { margin-top: 1.9rem; }

/* No text-transform here: section headings must read exactly as written
   in the source guide, including their original capitalisation. */
.movement-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--color-primary);
  text-wrap: balance;
}

.movement-label .ln {
  flex: 1;
  max-width: 34px;
  height: 1px;
  background: var(--color-gold);
  opacity: 0.7;
}

.movement p {
  margin: 0 0 0.95rem;
  line-height: 1.78;
  max-width: 62ch;
}

.movement p:last-child { margin-bottom: 0; }

/* No drop cap: source paragraphs open with list markers ("१)"), which a
   floated first letter would mangle. */

.item-subtitle {
  margin: 0.35rem auto 0;
  max-width: 30ch;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-muted);
}

/* ---------- Story ---------- */

.story {
  border-top: 1px solid var(--color-border);
  padding-top: 1.1rem;
  text-align: left;
}

.story h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-align: center;
}

.story h2 svg { width: 1.05rem; height: 1.05rem; color: var(--color-gold); }
.story p { margin: 0; white-space: pre-wrap; }

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.6rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--color-gold);
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.back-home svg { width: 1.05rem; height: 1.05rem; }
.back-home:hover { background: var(--color-gold-soft); }
.back-home:active { transform: scale(0.97); }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 6, 9, 0.92);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: fade-in var(--dur) var(--ease);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox[hidden] { display: none; }

.lightbox img { max-height: 90dvh; max-width: 100%; object-fit: contain; border-radius: 10px; }

.lightbox-close, .lightbox-nav {
  position: absolute;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease);
}

.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox-close { top: 0.85rem; right: 0.85rem; width: var(--tap); height: var(--tap); }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; }
.lightbox-prev { left: 0.6rem; }
.lightbox-next { right: 0.6rem; }
.lightbox-nav[hidden] { display: none; }

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

/* ---------- Responsive ---------- */

@media (min-width: 560px) {
  .gallery img { flex-basis: 55%; }
}

@media (min-width: 860px) {
  .main { max-width: 760px; padding: 2.2rem 2rem 2.6rem; }
  .item-grid { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
}
