/* ==========================================================================
   MeythUs Club — Editorial Gallery & Lightbox Experience
   Seamlessly extends css/styles.css using exact MeythUs brand tokens.
   ========================================================================== */

/* ══════════════════════════════════════════
   SHARED GALLERY UTILITIES & SKELETONS
   ══════════════════════════════════════════ */
.gallery-img-frame {
  position: relative;
  overflow: hidden;
  background: linear-gradient(110deg, #ede9e3 8%, #f6f3ef 18%, #ede9e3 33%);
  background-size: 200% 100%;
  animation: galleryShimmer 1.6s linear infinite;
}

.gallery-img-frame.is-loaded {
  animation: none;
  background: #1f1f1f;
}

.gallery-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.gallery-img-frame.is-loaded img {
  opacity: 1;
  transform: scale(1);
}

@keyframes galleryShimmer {
  to {
    background-position-x: -200%;
  }
}

/* Collection Pill Badges */
.collection-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 50px;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.collection-pill--october {
  background: rgba(233, 66, 16, 0.92);
  color: var(--white);
}

.collection-pill--september {
  background: rgba(240, 180, 9, 0.94);
  color: var(--deep-dark);
}

.collection-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

/* ══════════════════════════════════════════
   HOMEPAGE: GALLERY PREVIEW SECTION
   ══════════════════════════════════════════ */
.gallery-preview-section {
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.gallery-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.gallery-preview-intro {
  max-width: 600px;
}

.gallery-preview-intro .section-title {
  margin-bottom: 14px;
}

.gallery-preview-intro .section-title::after {
  content: '';
  display: block;
  width: 64px;
  height: 4px;
  background: linear-gradient(to right, var(--orange), var(--gold));
  border-radius: 2px;
  margin-top: 16px;
}

.gallery-preview-lead {
  font-size: 17px;
  color: var(--body-text);
  line-height: 1.75;
}

.gallery-preview-collections {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.preview-collection-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 50px;
  background: var(--cream);
  border: 1px solid var(--border);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
  transition: all 0.25s ease;
}

.preview-collection-chip:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(233, 66, 16, 0.1);
}

.preview-collection-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.preview-collection-chip--oct .chip-dot {
  background: var(--orange);
}

.preview-collection-chip--sep .chip-dot {
  background: var(--gold);
}

.preview-collection-chip .chip-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--body-text);
  opacity: 0.75;
}

/* Asymmetrical Editorial Mosaic Grid (12-column desktop) */
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 22px;
  gap: 18px;
}

/* Curated editorial span rhythm for 8 preview tiles — keeps natural landscape breathing room */
.gallery-mosaic .gallery-tile:nth-child(1) { grid-column: span 7; grid-row: span 11; }
.gallery-mosaic .gallery-tile:nth-child(2) { grid-column: span 5; grid-row: span 11; }
.gallery-mosaic .gallery-tile:nth-child(3) { grid-column: span 4; grid-row: span 9; }
.gallery-mosaic .gallery-tile:nth-child(4) { grid-column: span 4; grid-row: span 9; }
.gallery-mosaic .gallery-tile:nth-child(5) { grid-column: span 4; grid-row: span 9; }
.gallery-mosaic .gallery-tile:nth-child(6) { grid-column: span 5; grid-row: span 10; }
.gallery-mosaic .gallery-tile:nth-child(7) { grid-column: span 3; grid-row: span 10; }
.gallery-mosaic .gallery-tile:nth-child(8) { grid-column: span 4; grid-row: span 10; }

/* Shared Gallery Tile Card */
.gallery-tile {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(232, 228, 223, 0.7);
  background: #1f1f1f;
  padding: 0;
  text-align: left;
  width: 100%;
  display: block;
  box-shadow: 0 10px 30px rgba(26, 26, 26, 0.06);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
}

.gallery-tile:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 48px rgba(26, 26, 26, 0.16);
  border-color: rgba(233, 66, 16, 0.35);
}

.gallery-tile:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

.gallery-tile .gallery-img-frame {
  width: 100%;
  height: 100%;
}

.gallery-tile:hover .gallery-img-frame.is-loaded img {
  transform: scale(1.06);
}

/* Tile Overlays */
.gallery-tile-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.gallery-tile-expand {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease;
}

.gallery-tile:hover .gallery-tile-expand,
.gallery-tile:focus-visible .gallery-tile-expand {
  opacity: 1;
  transform: scale(1);
}

.gallery-tile-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(20, 20, 20, 0.86) 0%,
    rgba(20, 20, 20, 0.28) 42%,
    rgba(20, 20, 20, 0) 70%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.gallery-tile:hover .gallery-tile-overlay,
.gallery-tile:focus-visible .gallery-tile-overlay {
  opacity: 1;
}

.gallery-tile-caption {
  color: var(--white);
  font-family: var(--heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  transform: translateY(8px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.gallery-tile:hover .gallery-tile-caption,
.gallery-tile:focus-visible .gallery-tile-caption {
  transform: translateY(0);
}

/* Homepage Gallery CTA Footer */
.gallery-preview-footer {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.gallery-preview-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gallery-meta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--orange-light);
  color: var(--orange);
  font-family: var(--heading);
  font-weight: 800;
  font-size: 16px;
}

.gallery-meta-text strong {
  display: block;
  font-family: var(--heading);
  font-size: 16px;
  color: var(--charcoal);
}

.gallery-meta-text span {
  font-size: 14px;
  color: var(--body-text);
}

.btn-explore-gallery {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 36px;
  border-radius: 50px;
  background: var(--charcoal);
  color: var(--white);
  font-family: var(--body);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(51, 51, 51, 0.2);
}

.btn-explore-gallery svg {
  transition: transform 0.3s ease;
}

.btn-explore-gallery:hover {
  background: var(--orange);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(233, 66, 16, 0.35);
}

.btn-explore-gallery:hover svg {
  transform: translateX(4px);
}

/* ══════════════════════════════════════════
   DEDICATED GALLERY PAGE — HERO BANNER
   ══════════════════════════════════════════ */
.gallery-page-hero {
  position: relative;
  background: var(--deep-dark);
  padding: 150px 0 88px;
  overflow: hidden;
  color: var(--white);
}

.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  opacity: 0.22;
  transform: scale(1.03);
}

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(22, 22, 22, 0.94) 0%,
    rgba(233, 66, 16, 0.28) 52%,
    rgba(22, 22, 22, 0.95) 100%
  );
}

.gallery-hero-watermark {
  position: absolute;
  right: 4%;
  top: 52%;
  transform: translateY(-50%);
  width: 380px;
  max-width: 38vw;
  opacity: 0.055;
  pointer-events: none;
  z-index: 1;
}

.gallery-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

/* Breadcrumbs */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--gold);
}

.breadcrumb-sep {
  color: var(--orange);
  font-size: 11px;
}

.breadcrumb [aria-current="page"] {
  color: var(--gold);
}

.gallery-page-title {
  font-size: clamp(2.6rem, 5.2vw, 4.3rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.06;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.gallery-page-title .highlight {
  color: var(--orange);
}

.gallery-page-subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.75;
  max-width: 620px;
  margin-bottom: 34px;
}

.gallery-hero-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.gallery-hero-stat {
  display: flex;
  flex-direction: column;
  padding-right: 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.gallery-hero-stat:last-child {
  border-right: none;
  padding-right: 0;
}

.gallery-hero-stat strong {
  font-family: var(--heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.1;
}

.gallery-hero-stat span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255, 255, 255, 0.58);
  margin-top: 4px;
}

/* ══════════════════════════════════════════
   STICKY FILTER TOOLBAR
   ══════════════════════════════════════════ */
.gallery-toolbar-wrap {
  position: sticky;
  top: 66px;
  z-index: 900;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease;
}

.gallery-toolbar-wrap.is-stuck {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.gallery-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--charcoal);
  font-family: var(--body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-filter-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-1px);
}

.gallery-filter-btn.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
  box-shadow: 0 6px 20px rgba(233, 66, 16, 0.28);
}

.gallery-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 50px;
  background: rgba(51, 51, 51, 0.08);
  font-size: 12px;
  font-weight: 700;
  color: inherit;
}

.gallery-filter-btn.is-active .gallery-filter-count {
  background: rgba(255, 255, 255, 0.24);
  color: var(--white);
}

.gallery-toolbar-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--body-text);
  opacity: 0.8;
}

.gallery-toolbar-hint svg {
  color: var(--orange);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   DEDICATED GALLERY COLLECTIONS & EDITORIAL GRID
   ══════════════════════════════════════════ */
.gallery-main {
  background: var(--cream);
  padding: 72px 0 96px;
  min-height: 60vh;
}

.gallery-collection {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.gallery-collection + .gallery-collection {
  margin-top: 84px;
  padding-top: 72px;
  border-top: 1px solid var(--border);
}

.gallery-collection.is-hidden {
  display: none;
}

.gallery-collection.is-entering {
  animation: galleryCollectionEnter 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.collection-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.collection-header-text {
  max-width: 640px;
}

.collection-edition {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

.collection-edition--october {
  color: var(--orange);
}

.collection-edition--september {
  color: #b88700;
}

.collection-title {
  font-size: clamp(1.9rem, 3.2vw, 2.75rem);
  font-weight: 800;
  color: var(--charcoal);
  margin-bottom: 10px;
}

.collection-desc {
  font-size: 16px;
  color: var(--body-text);
  line-height: 1.7;
}

.collection-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 50px;
  background: var(--white);
  border: 1px solid var(--border);
  font-family: var(--heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--charcoal);
  white-space: nowrap;
}

/* Art-Directed 12-Column Editorial Masonry Cadence
   Preserves natural landscape proportions (~3:2 / 5:4) while creating
   varied visual hierarchy without awkward vertical cropping. */
.editorial-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  align-items: stretch;
}

.editorial-grid .gallery-tile {
  aspect-ratio: 3 / 2;
  grid-column: span 4;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s ease,
              border-color 0.3s ease;
}

.editorial-grid .gallery-tile.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

.editorial-grid .gallery-tile.is-revealed:hover {
  transform: translateY(-5px);
}

/* Repeating 10-card editorial cycle for rich asymmetrical storytelling:
   Cycle 1-2:  Hero duo (7 + 5)
   Cycle 3-5:  Classic editorial trio (4 + 4 + 4)
   Cycle 6-7:  Balanced feature spread (6 + 6)
   Cycle 8-10: Asymmetric trio (5 + 3.5 -> 5 + 4 + 3? No, 12 cols: 4 + 5 + 3 or 5 + 7 + 4+4+4)
   Let's keep every single row totaling EXACTLY 12 columns so there are NEVER orphan gaps!
   10-item repeating rhythm:
     #1 (7 cols) + #2 (5 cols) = 12 cols
     #3 (4 cols) + #4 (4 cols) + #5 (4 cols) = 12 cols
     #6 (5 cols) + #7 (7 cols) = 12 cols
     #8 (6 cols) + #9 (6 cols) = 12 cols
     #10... cycles! Wait: 9 items per cycle divides nicely!
   Let's use a 9-item editorial cycle:
     Row A (2 items):  pos 1 -> 7 cols, pos 2 -> 5 cols  (height matched via aspect-ratio override on desktop!)
     Row B (3 items):  pos 3 -> 4 cols, pos 4 -> 4 cols, pos 5 -> 4 cols
     Row C (2 items):  pos 6 -> 5 cols, pos 7 -> 7 cols
     Row D (2 items):  pos 8 -> 6 cols, pos 9 -> 6 cols
   Every row is 12 cols! Let's check remainders for 19 (Nov) and 40 (Oct):
     19 = 9 + 9 + 1 (last single item spans 12 or let's handle :last-child cleanly!)
     40 = 9*4 + 4 -> 2 + 2 = 4 (last 4 items = pos 1(7)+pos 2(5), then pos 3(6)+pos 4(6)!)
   Using explicit editorial size classes assigned cleanly by JS guarantees ZERO uneven last rows for ANY photo count! */
.editorial-grid .gallery-tile.tile--span-7 {
  grid-column: span 7;
  aspect-ratio: 16 / 10;
}

.editorial-grid .gallery-tile.tile--span-5 {
  grid-column: span 5;
  aspect-ratio: auto;
  min-height: 280px;
}

.editorial-grid .gallery-tile.tile--span-6 {
  grid-column: span 6;
  aspect-ratio: 3 / 2;
}

.editorial-grid .gallery-tile.tile--span-4 {
  grid-column: span 4;
  aspect-ratio: 3 / 2;
}

.editorial-grid .gallery-tile.tile--span-12 {
  grid-column: span 12;
  aspect-ratio: 21 / 10;
}

/* Gallery Page Back-to-Home / Join Banner */
.gallery-bottom-cta {
  background: var(--orange);
  padding: 80px 0;
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.gallery-bottom-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.08) 0%, transparent 50%, rgba(255, 255, 255, 0.08) 100%);
  pointer-events: none;
}

.gallery-bottom-cta-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
}

.gallery-bottom-cta .section-title {
  color: var(--white);
  margin-bottom: 16px;
}

.gallery-bottom-cta p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 17px;
  margin-bottom: 32px;
}

.gallery-bottom-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════
   PROFESSIONAL FULLSCREEN LIGHTBOX
   ══════════════════════════════════════════ */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: rgba(12, 12, 14, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Lightbox Header */
.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.lightbox-meta-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.lightbox-counter {
  font-family: var(--heading);
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.05em;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-icon-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  transform: scale(1.06);
}

.lightbox-icon-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Lightbox Stage */
.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 84px;
  user-select: none;
  touch-action: pan-y;
}

.lightbox-figure {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.lightbox-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(1240px, calc(100vw - 168px));
  max-height: calc(100vh - 230px);
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 230px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: scale(0.975);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-img.is-visible {
  opacity: 1;
  transform: scale(1);
}

.lightbox-spinner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--orange);
  animation: lightboxSpin 0.8s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox-spinner.is-active {
  opacity: 1;
}

@keyframes lightboxSpin {
  to {
    transform: rotate(360deg);
  }
}

.lightbox-caption {
  margin-top: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.88);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 500;
  max-width: 680px;
  line-height: 1.45;
}

/* Prev / Next Buttons */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.25s ease;
}

.lightbox-nav:hover {
  background: var(--orange);
  border-color: var(--orange);
  transform: translateY(-50%) scale(1.06);
}

.lightbox-nav--prev { left: 22px; }
.lightbox-nav--next { right: 22px; }

/* Filmstrip Thumbnails */
.lightbox-filmstrip-wrap {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 24px 16px;
  background: rgba(0, 0, 0, 0.32);
}

.lightbox-filmstrip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 66, 16, 0.6) transparent;
  padding-bottom: 4px;
  justify-content: safe center;
}

.lightbox-thumb {
  flex: 0 0 auto;
  width: 66px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: #222;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lightbox-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.lightbox-thumb:hover {
  opacity: 0.85;
}

.lightbox-thumb.is-active {
  opacity: 1;
  border-color: var(--orange);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════
   RESPONSIVE DESIGN
   ══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .gallery-mosaic {
    grid-auto-rows: 19px;
    gap: 14px;
  }
}

@media (max-width: 992px) {
  /* Homepage Mosaic -> Intentional 2-col editorial rhythm on tablet */
  .gallery-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
    gap: 16px;
  }

  .gallery-mosaic .gallery-tile:nth-child(n) {
    grid-column: span 1;
    grid-row: auto;
    aspect-ratio: 3 / 2;
  }

  .gallery-mosaic .gallery-tile:nth-child(1),
  .gallery-mosaic .gallery-tile:nth-child(6) {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
  }

  /* Dedicated Gallery -> Intentional 2-col tablet rhythm (zero orphans via .tile--mobile-wide) */
  .editorial-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .editorial-grid .gallery-tile.tile--span-7,
  .editorial-grid .gallery-tile.tile--span-5,
  .editorial-grid .gallery-tile.tile--span-6,
  .editorial-grid .gallery-tile.tile--span-4,
  .editorial-grid .gallery-tile.tile--span-12 {
    grid-column: span 1;
    aspect-ratio: 3 / 2;
    min-height: 0;
  }

  .editorial-grid .gallery-tile.tile--mobile-wide {
    grid-column: span 2;
    aspect-ratio: 16 / 10;
  }

  .gallery-toolbar-wrap {
    top: 62px;
  }

  .gallery-toolbar-hint {
    display: none;
  }

  .lightbox-stage {
    padding: 16px 64px;
  }

  .lightbox-img-wrap {
    max-width: calc(100vw - 128px);
  }
}

@media (max-width: 640px) {
  .gallery-preview-header {
    margin-bottom: 28px;
    gap: 18px;
  }

  /* Intentional mobile editorial rhythm: featured wide + paired tiles */
  .gallery-mosaic {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gallery-mosaic .gallery-tile {
    border-radius: 14px;
  }

  .gallery-mosaic .gallery-tile:nth-child(1),
  .gallery-mosaic .gallery-tile:nth-child(6) {
    grid-column: span 2;
    aspect-ratio: 16 / 10;
  }

  .gallery-mosaic .gallery-tile:nth-child(2),
  .gallery-mosaic .gallery-tile:nth-child(3),
  .gallery-mosaic .gallery-tile:nth-child(4),
  .gallery-mosaic .gallery-tile:nth-child(5),
  .gallery-mosaic .gallery-tile:nth-child(7),
  .gallery-mosaic .gallery-tile:nth-child(8) {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }

  .gallery-tile-top {
    top: 10px;
    left: 10px;
    right: 10px;
  }

  .collection-pill {
    padding: 4px 9px;
    font-size: 10px;
    letter-spacing: 1px;
  }

  .gallery-preview-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    margin-top: 32px;
  }

  .btn-explore-gallery {
    justify-content: center;
    width: 100%;
  }

  /* Dedicated gallery mobile */
  .gallery-page-hero {
    padding: 120px 0 56px;
  }

  .gallery-page-subtitle {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .gallery-hero-stats {
    gap: 18px;
  }

  .gallery-hero-stat {
    padding-right: 18px;
  }

  .gallery-hero-stat strong {
    font-size: 22px;
  }

  .gallery-toolbar {
    padding: 12px 0;
  }

  .gallery-filters {
    width: 100%;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .gallery-filter-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
    gap: 5px;
    white-space: nowrap;
  }

  .gallery-filter-count {
    min-width: 20px;
    height: 19px;
    padding: 0 5px;
    font-size: 11px;
  }

  .gallery-main {
    padding: 44px 0 64px;
  }

  .gallery-collection + .gallery-collection {
    margin-top: 56px;
    padding-top: 48px;
  }

  .editorial-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .editorial-grid .gallery-tile {
    border-radius: 12px;
  }

  .editorial-grid .gallery-tile.tile--span-7,
  .editorial-grid .gallery-tile.tile--span-5,
  .editorial-grid .gallery-tile.tile--span-6,
  .editorial-grid .gallery-tile.tile--span-4,
  .editorial-grid .gallery-tile.tile--span-12 {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }

  .editorial-grid .gallery-tile.tile--mobile-wide {
    grid-column: span 2;
    aspect-ratio: 3 / 2;
  }

  /* Mobile Lightbox */
  .lightbox-header {
    padding: 14px 16px;
  }

  .lightbox-stage {
    padding: 12px 14px;
  }

  .lightbox-img-wrap {
    max-width: calc(100vw - 28px);
    max-height: calc(100vh - 220px);
  }

  .lightbox-img {
    max-height: calc(100vh - 220px);
    border-radius: 8px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    background: rgba(20, 20, 20, 0.72);
  }

  .lightbox-nav--prev { left: 10px; }
  .lightbox-nav--next { right: 10px; }

  .lightbox-caption {
    font-size: 13px;
    margin-top: 10px;
    padding: 0 8px;
  }

  .lightbox-filmstrip-wrap {
    padding: 10px 12px 14px;
  }

  .lightbox-thumb {
    width: 54px;
    height: 38px;
  }
}

/* Always show clean caption subtly on touch devices where hover doesn't exist */
@media (hover: none) {
  .gallery-tile-overlay {
    opacity: 0.9;
    background: linear-gradient(
      to top,
      rgba(20, 20, 20, 0.74) 0%,
      rgba(20, 20, 20, 0) 48%
    );
    padding: 12px;
  }

  .gallery-tile-caption {
    transform: translateY(0);
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-img-frame {
    animation: none;
  }

  .gallery-img-frame img,
  .gallery-tile,
  .editorial-grid .gallery-tile,
  .lightbox,
  .lightbox-img {
    transition: none !important;
    animation: none !important;
  }

  .editorial-grid .gallery-tile {
    opacity: 1;
    transform: none;
  }
}
