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

:root {
  --cream:      #FBF7F2;
  --cream-dark: #F0E8DC;
  --brown:      #751535;
  --brown-mid:  #9B2048;
  --terracotta: #C0553A;
  --gold:       #B8883A;
  --sand:       #D4B48A;
  --text:       #2A0A15;
  --text-light: #7A5C42;
  --white:      #FFFFFF;
}

html { scroll-behavior: smooth; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Hero ─────────────────────────────────── */
.hero {
  position: relative;
  height: 100vh;
  min-height: 620px;
  background: #1E0E05; /* fallback while slides load */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Slideshow background */
.hero-slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.4s ease;
  will-change: opacity;
}

.hero-slide.active { opacity: 1; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg,
    rgba(30, 14, 5, 0.82) 0%,
    rgba(30, 14, 5, 0.55) 60%,
    rgba(30, 14, 5, 0.70) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.hero-content {
  color: var(--white);
  max-width: 560px;
}

.hero-eyebrow {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--sand);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: normal;
  letter-spacing: 0.08em;
  line-height: 1;
  color: var(--cream);
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.hero-sub {
  font-style: italic;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--sand);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.hero-cta {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  border: 1px solid var(--sand);
  color: var(--sand);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s;
}

.hero-cta:hover {
  background: var(--sand);
  color: var(--brown);
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.scroll-line {
  display: block;
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--sand));
  margin: 0 auto;
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.15); }
}

/* ── Collection ───────────────────────────── */
.collection-section {
  padding: 6rem 0 5rem;
}

.section-head {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: normal;
  color: var(--brown);
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 0.9rem auto 0;
}

.section-title.left::after { margin-left: 0; }

.section-sub {
  color: var(--text-light);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.6;
}

.collection-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
  font-family: system-ui, sans-serif;
}

.sort-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

.sort-select {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--brown);
  background: var(--white);
  border: 1px solid rgba(58, 31, 13, 0.18);
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.sort-select:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
}

.gallery-card {
  background: var(--white);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 12px rgba(58, 31, 13, 0.08);
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 32px rgba(58, 31, 13, 0.16);
}

.gallery-card:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}

/* Staggered entrance on first render — card-enter is removed (with a per-card
   transition-delay set in JS) once the grid has painted, so cards fade in one by
   one instead of popping in all at once. */
.gallery-card.card-enter {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--cream-dark);
  position: relative;
}

.card-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  transition: transform 0.45s ease;
}

.gallery-card:hover .card-canvas { transform: scale(1.06); }

.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.card-title {
  font-size: 1rem;
  font-weight: normal;
  color: var(--brown);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.card-desc {
  font-family: system-ui, sans-serif;
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

/* Loading dots */
.gallery-loading {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 5rem 0;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--sand);
  border-radius: 50%;
  animation: dotBounce 1.2s ease-in-out infinite both;
}

.dot:nth-child(2) { animation-delay: 0.15s; }
.dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── About ────────────────────────────────── */
.about-section {
  padding: 5rem 0;
  background: var(--brown);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

.about-text .section-title { color: var(--cream); }
.about-text .section-title::after { background: var(--sand); }

.about-text p {
  font-family: system-ui, sans-serif;
  color: var(--sand);
  font-size: 0.9rem;
  line-height: 1.75;
  margin-top: 1rem;
  max-width: 520px;
}

.accent-line {
  width: 1px;
  height: 160px;
  background: linear-gradient(to bottom, transparent, var(--sand), transparent);
  opacity: 0.4;
}

/* ── Footer ───────────────────────────────── */
.site-footer {
  background: var(--brown);
  border-top: 1px solid rgba(117, 21, 53, 0.15);
  padding: 2rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cream);
  font-family: Georgia, serif;
}

.footer-copy {
  font-family: system-ui, sans-serif;
  font-size: 0.78rem;
  color: rgba(212,180,138,0.5);
  letter-spacing: 0.04em;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.footer-social {
  display: flex;
  gap: 1.1rem;
  align-items: center;
}

.footer-social-link {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212,180,138,0.55);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-social-link:hover { color: var(--sand); }

.footer-admin-link {
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(212,180,138,0.4);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-admin-link:hover { color: var(--sand); }

/* ── Cookie consent bar ───────────────────── */
.cookie-bar[hidden] { display: none; }
.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.9rem 2rem;
  background: var(--text);
  color: var(--cream);
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1.55;
  box-shadow: 0 -3px 16px rgba(0,0,0,0.22);
}

.cookie-msg { margin: 0; }

.cookie-link {
  color: var(--sand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-link:hover { color: var(--cream); }

.cookie-btn {
  flex-shrink: 0;
  padding: 0.45rem 1.4rem;
  background: transparent;
  color: var(--sand);
  border: 1px solid rgba(212,180,138,0.45);
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cookie-btn:hover {
  background: var(--brown);
  color: var(--cream);
  border-color: var(--brown);
}

/* ── Lightbox ─────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
}

.lightbox.open { display: flex; align-items: center; justify-content: center; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 4, 2, 0.88);
  cursor: pointer;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  width: min(94vw, 1160px);
  height: 88vh;
  overflow: hidden;
  animation: lbIn 0.28s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}

@keyframes lbIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

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

.lightbox-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 10;
  background: rgba(0,0,0,0.55);
  border: none;
  color: white;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover { background: var(--terracotta); }

/* Left: image viewer */
.lb-viewer {
  flex: 0 0 62%;
  display: flex;
  flex-direction: column;
  background:var(--cream-dark);
  min-width: 0;
  min-height: 0;
  transition: flex-basis 0.35s ease;
}

/* Tapping the info text enlarges it (image viewer yields space); tapping back on
   the image returns to the regular split. See lb-viewer/lightbox-info below and
   the responsive column-layout overrides for the portrait-mobile equivalent. */
.lightbox-panel.text-expanded .lb-viewer { flex-basis: 22%; }

.lb-img-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  will-change: opacity;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.lightbox-canvas.lb-active { opacity: 1; }

/* Thumbnail strip */
.lb-strip {
  flex: 0 0 auto;
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.45);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}

.lb-strip::-webkit-scrollbar { height: 3px; }
.lb-strip::-webkit-scrollbar-track { background: transparent; }
.lb-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 99px; }

.lb-thumb {
  flex: 0 0 4rem;
  height: 4rem;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.45;
  border: 2px solid transparent;
  transition: opacity 0.18s, border-color 0.18s;
  -webkit-user-drag: none;
}

.lb-thumb:hover { opacity: 0.78; }
.lb-thumb.active { opacity: 1; border-color: var(--gold); }

/* Nav buttons */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.38);
  border: none;
  color: white;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lb-nav:hover { background: rgba(0,0,0,.72); }
.lb-prev { left: 0.75rem; }
.lb-next { right: 0.75rem; }

/* Slideshow play/pause button */
.lb-play-pause {
  position: absolute;
  bottom: 0.65rem;
  left: 0.75rem;
  z-index: 3;
  background: rgba(0,0,0,0.42);
  border: none;
  color: rgba(255,255,255,0.85);
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  font-size: 0.55rem;
  letter-spacing: -0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.lb-play-pause:hover { background: rgba(0,0,0,0.7); color: #fff; }

/* Slideshow progress bar — thin strip at the bottom of the stage */
.lb-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.12);
  z-index: 3;
  overflow: hidden;
}
.lb-progress-bar {
  height: 100%;
  width: 0;
  background: var(--gold);
}
@keyframes lbProgressFill {
  from { width: 0; }
  to   { width: 100%; }
}

/* Loading spinner — shown while first image loads, hidden in swapLbCanvases() */
.lb-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.lb-loading[hidden] { display: none; }
.lb-spin-ring {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.75);
  border-radius: 50%;
  animation: lbSpin 0.7s linear infinite;
}
@keyframes lbSpin { to { transform: rotate(360deg); } }

/* Card image dots */
.card-img-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  pointer-events: none;
}
.card-img-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  display: block;
}
.card-img-dots span:first-child {
  background: rgba(255,255,255,.95);
}

/* Right: info panel */
.lightbox-info {
  flex: 0 0 38%;
  min-width: 0;
  overflow-y: auto;
  padding: 2.75rem 2.25rem 2.25rem;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: flex-basis 0.35s ease;
}

.lightbox-panel.text-expanded .lightbox-info { flex-basis: 78%; }

.lightbox-title {
  font-size: 1.45rem;
  font-weight: normal;
  color: var(--brown);
  letter-spacing: 0.04em;
  line-height: 1.3;
  margin-bottom: 0.9rem;
}

.lightbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-bottom: 0.75rem;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
}

.lightbox-meta:empty { margin-bottom: 0; }

.lightbox-price {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #2E7D52;
  margin-bottom: 1rem;
}

.lightbox-desc {
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* Engagement row: views + likes in lightbox info panel */
.lb-engagement {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
}

.lb-stat {
  display: inline-flex;
  align-items: center;
}

.lb-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: 1px solid var(--cream-dark);
  border-radius: 2rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  line-height: 1.4;
}

.lb-like-btn:hover { background: var(--cream-dark); color: var(--brown); border-color: var(--sand); }
.lb-like-btn.liked { color: var(--brown); border-color: var(--sand); background: var(--cream-dark); }
.lb-like-btn:disabled { opacity: 0.5; cursor: default; pointer-events: none; }

.lb-share-btn {
  display: inline-flex;
  align-items: center;
  background: none;
  border: 1px solid var(--cream-dark);
  border-radius: 2rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
  line-height: 1.4;
  margin-left: auto;
}
.lb-share-btn:hover { background: var(--cream-dark); color: var(--brown); border-color: var(--sand); }

/* Card stats: view count + like count under each card */
.card-stats {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.card-stat {
  font-family: system-ui, sans-serif;
  font-size: 0.7rem;
  color: var(--text-light);
  opacity: 0.65;
}

.lightbox-desc:not(:empty) {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--cream-dark);
}

/* ── Feedback section in lightbox ──────────── */
.lb-feedback {
  border-top: 1px solid var(--cream-dark);
  padding-top: 1.1rem;
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lb-fb-entry {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--cream-dark);
}

.lb-fb-entry:last-child { border-bottom: none; }

.lb-fb-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.lb-fb-name {
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brown);
}

.lb-fb-date {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  color: var(--text-light);
  opacity: 0.7;
}

.lb-fb-text {
  font-family: system-ui, sans-serif;
  font-size: 0.83rem;
  color: var(--text);
  line-height: 1.55;
}

.lb-feedback-title {
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.lb-feedback-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lb-feedback-name,
.lb-feedback-text {
  width: 100%;
  font-family: system-ui, sans-serif;
  font-size: 0.83rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--cream-dark);
  border-radius: 0.35rem;
  background: var(--cream);
  color: var(--text);
  resize: none;
  outline: none;
  transition: border-color 0.18s;
}

.lb-feedback-name:focus,
.lb-feedback-text:focus { border-color: var(--sand); }

.lb-feedback-submit {
  align-self: flex-end;
  background: var(--brown);
  color: #fff;
  border: none;
  border-radius: 0.35rem;
  padding: 0.4rem 1.1rem;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.18s;
}

.lb-feedback-submit:hover { background: var(--brown-mid); }
.lb-feedback-submit:disabled { opacity: 0.5; cursor: default; }

.lb-feedback-thanks {
  font-family: system-ui, sans-serif;
  font-size: 0.83rem;
  color: #2E7D52;
  padding: 0.4rem 0;
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
  .about-inner  { grid-template-columns: 1fr; }
  .accent-line  { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }

  /* Lightbox: full-screen on portrait mobile */
  .lightbox-panel {
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
    background: var(--cream-dark);
    animation: lbSlideUp 0.3s ease;
  }

  .lb-viewer { flex: 0 0 auto; position: relative; }

  /* Full-width square stage: flex-basis = 100vw (explicit, no auto-resolution needed on iOS).
     max-height caps it on short phones. belt-and-suspenders height property for non-flex fallback. */
  .lb-img-stage {
    flex: 0 0 100vw;
    width: 100%;
    height: 100vw;
    max-height: 55vh;
    min-height: 200px;
    transition: max-height 0.35s ease;
  }

  /* Portrait has no side-by-side split to shrink, so the image stage itself
     collapses to free up room for the enlarged text below it. */
  .lightbox-panel.text-expanded .lb-img-stage { max-height: 22vh; }

  /* Thumbnail rail overlays the bottom of the image/video instead of sitting in its
     own row below it, so the media keeps the full square instead of being squeezed. */
  .lb-strip {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
    z-index: 1;
  }

  .lb-thumb { flex: 0 0 3rem; height: 3rem; }

  /* Lift controls that would otherwise sit under the overlaid thumbnail rail. */
  .lb-play-pause { bottom: 4.4rem; }
  .lb-progress   { bottom: 4.4rem; }

  .lightbox-close {
    top: max(0.75rem, env(safe-area-inset-top));
    right: max(0.75rem, env(safe-area-inset-right));
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.3rem;
  }

  .lightbox-info {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.25rem 1.25rem 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    gap: 0;
  }

  .lightbox-desc:not(:empty) { margin-top: 0; }
  .lightbox-title { font-size: 1.1rem; margin-bottom: 0.6rem; }
  .lightbox-desc  { padding-top: 0.75rem; }
}

/* Landscape phone: side-by-side layout (same shape as desktop) */
@media (max-width: 768px) and (orientation: landscape) {
  .lightbox.open { align-items: center; }

  .lightbox-panel {
    flex-direction: row;
    width: 96vw;
    height: 92vh;
    height: 92dvh;
    max-height: none;
    border-radius: 0.5rem;
    animation: lbIn 0.28s ease;
  }

  /* Restore desktop-style flex sizing for landscape */
  .lb-viewer    { flex: 0 0 58%; position: static; }
  .lb-img-stage { flex: 1; height: auto; max-height: none; }
  .lightbox-info { flex: 1; }

  .lightbox-panel.text-expanded .lb-viewer    { flex-basis: 20%; }
  .lightbox-panel.text-expanded .lightbox-info { flex: 1 1 80%; }

  /* Landscape has room for the thumbnail rail in its own row, same as desktop —
     undo the portrait-only overlay treatment. */
  .lb-strip      { position: static; background: rgba(0, 0, 0, 0.45); }
  .lb-play-pause { bottom: 0.65rem; }
  .lb-progress   { bottom: 0; }
}
