/* ==========================================================================
   Gallery — Horizontal-scroll, sticky category display, data-driven
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════════════════
   TOP NAV PILLS
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Gallery Section Heading ─────────────────────────────────────────────── */
.gallery-section-heading {
  text-align: center;
  padding: var(--space-16) var(--space-6) var(--space-4);
  background: var(--color-bg, #FAF8F5);
}

.gallery-section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.1;
}

/* ══════════════════════════════════════════════════════════════════════════
   CATEGORY CARDS (horizontal row — click to expand)
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-cards-wrap {
  padding: var(--space-6) var(--space-6) var(--space-8);
  background: var(--color-bg, #FAF8F5);
}

/* Default: centered row */
.gallery-cards-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  justify-items: center;
  gap: 0.25rem 0;
  max-width: 640px;
  margin: 0 auto;
}

/* ── M shape (Modeling): 3 peaks top, 2 valleys bottom ──────────────────── */
/* Reading left→right: peak, valley, peak, valley, peak */
.page-model .gallery-cat-card:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
.page-model .gallery-cat-card:nth-child(2) { grid-column: 2 / 4; grid-row: 2; }
.page-model .gallery-cat-card:nth-child(3) { grid-column: 3 / 5; grid-row: 1; }
.page-model .gallery-cat-card:nth-child(4) { grid-column: 4 / 6; grid-row: 2; }
.page-model .gallery-cat-card:nth-child(5) { grid-column: 5 / 7; grid-row: 1; }

/* ── UGC: same M shape ──────────────────────────────────────────────────── */
.page-ugc .gallery-cat-card:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
.page-ugc .gallery-cat-card:nth-child(2) { grid-column: 2 / 4; grid-row: 2; }
.page-ugc .gallery-cat-card:nth-child(3) { grid-column: 3 / 5; grid-row: 1; }
.page-ugc .gallery-cat-card:nth-child(4) { grid-column: 4 / 6; grid-row: 2; }
.page-ugc .gallery-cat-card:nth-child(5) { grid-column: 5 / 7; grid-row: 1; }

.gallery-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  width: 120px;
  transition: transform 200ms ease;
}

.gallery-cat-card:hover { transform: translateY(-4px); }

.gallery-cat-card-img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-surface-2, #F5F0EB);
  border: 3px solid transparent;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.gallery-cat-card.active .gallery-cat-card-img {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 169, 138, 0.20);
}

.gallery-cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-cat-card-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: var(--text-xl);
  opacity: 0.5;
}

.gallery-cat-card-label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--color-muted);
  transition: color 200ms ease;
}

.gallery-cat-card.active .gallery-cat-card-label {
  color: var(--color-accent);
}

@media (max-width: 480px) {
  .gallery-cards-row { max-width: 360px; }
  .gallery-cat-card { width: 90px; }
  .gallery-cat-card-img { width: 64px; height: 64px; }
  .gallery-cat-card-label { font-size: 0.6rem; letter-spacing: 0.08em; }
}

/* ══════════════════════════════════════════════════════════════════════════
   EXPANDABLE PANEL (opens below category cards)
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-expand-area,
.ugc-expand-area {
  background: var(--color-bg, #FAF8F5);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 400ms ease, opacity 300ms ease;
}

.gallery-expand-area.open,
.ugc-expand-area.open {
  max-height: 2000px;
  opacity: 1;
  padding-bottom: var(--space-12);
}

.gallery-expand-header,
.ugc-expand-header {
  text-align: center;
  padding: var(--space-8) var(--space-6) var(--space-4);
}

.gallery-expand-number {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.3em;
  display: block;
  margin-bottom: var(--space-2);
}

.gallery-expand-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: var(--space-3);
}

.gallery-expand-desc {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

.gallery-nav {
  position: relative;
  z-index: 10;
  background: var(--color-bg, #FAF8F5);
  border-bottom: 1px solid var(--color-divider);
}

.gallery-nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.gallery-nav-item {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-muted);
  text-decoration: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: none;
  white-space: nowrap;
}

.gallery-nav-item:hover { color: var(--color-text); }

.gallery-nav-item.active {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: rgba(184, 134, 11, 0.06);
}

/* ══════════════════════════════════════════════════════════════════════════
   STICKY CATEGORY DISPLAY (transitions between category names on scroll)
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-cat-display {
  position: sticky;
  top: 56px;          /* below gallery-nav */
  z-index: 90;
  background: var(--color-surface-2, #F5F0EB);
  padding: var(--space-12) var(--space-6) var(--space-8);
  will-change: auto;
}

@media (min-width: 768px) {
  .gallery-cat-display {
    top: 120px;        /* desktop-nav(64) + gallery-nav(56) */
  }
}

.gallery-cat-display-inner {
  display: grid;
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  justify-items: center;
}

/* All slides stacked in one grid cell; only .active is visible */
.gallery-cat-slide {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 300ms ease, transform 300ms ease;
  pointer-events: none;
  will-change: opacity, transform;
}

.gallery-cat-slide.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.gallery-cat-number {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.3em;
  display: block;
  margin-bottom: var(--space-2);
}

.gallery-cat-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 300;
  color: var(--color-text);
  line-height: 1.05;
  margin-bottom: var(--space-3);
}

.gallery-cat-name em { font-style: italic; }

.gallery-cat-desc {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════
   CATEGORY SECTION
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-cat {
  background: var(--color-bg, #FAF8F5);
  min-height: 60vh;
  scroll-margin-top: 180px;
  padding-bottom: var(--space-16);
}

@media (max-width: 767px) {
  .gallery-cat {
    scroll-margin-top: 60px;
    min-height: auto;
  }
}

.gallery-cat + .gallery-cat {
  border-top: 1px solid var(--color-divider);
}

/* ══════════════════════════════════════════════════════════════════════════
   HORIZONTAL SCROLL STRIP (shared by flat + runway)
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-hscroll {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding: var(--space-6) var(--space-6) var(--space-8);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

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

/* ══════════════════════════════════════════════════════════════════════════
   IMAGE CARD (flat categories)
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-card {
  position: relative;
  flex-shrink: 0;
  width: clamp(300px, 38vw, 420px);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-surface-2, #F5F0EB);
  cursor: pointer;
  scroll-snap-align: start;
}

.gallery-card--feature {
  width: clamp(400px, 52vw, 580px);
  aspect-ratio: 16 / 10;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms ease;
}

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

/* Dark overlay on hover */
.gallery-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
  z-index: 1;
}

.gallery-card:hover::after { opacity: 0.2; }

/* Caption — slides up on hover */
.gallery-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-5) var(--space-4) var(--space-4);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 100%);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 400ms var(--ease-out), opacity 400ms var(--ease-out);
  z-index: 2;
}

.gallery-card:hover .gallery-card-overlay {
  transform: translateY(0);
  opacity: 1;
}

.gallery-card-caption {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: #fff;
}

.gallery-card-credit {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-accent);
  margin-top: var(--space-1);
}

/* ══════════════════════════════════════════════════════════════════════════
   RUNWAY SHOW CARD (inside horizontal scroll)
   ══════════════════════════════════════════════════════════════════════════ */

.runway-show-card {
  flex-shrink: 0;
  width: clamp(380px, 46vw, 560px);
  scroll-snap-align: start;
}

/* ── Show Name ──────────────────────────────────────────────────────────── */
.runway-show-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--color-text);
  padding-left: var(--space-3);
  border-left: 3px solid var(--color-accent);
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

/* ── Season Pills ───────────────────────────────────────────────────────── */
.runway-season-pills {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-left: var(--space-3);
}

.runway-pill {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-divider);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: color var(--duration-fast) ease, border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.runway-pill.active,
.runway-pill:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(184, 134, 11, 0.06);
}

/* ── Hero Image ─────────────────────────────────────────────────────────── */
.runway-hero {
  position: relative;
  width: 100%;
  height: 380px;
  overflow: hidden;
  background: var(--color-surface-2, #F5F0EB);
  cursor: pointer;
}

.runway-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 300ms ease;
}

.runway-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 300ms ease;
}

.runway-hero:hover .runway-hero-overlay { opacity: 1; }

.runway-hero-overlay p {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: #fff;
  letter-spacing: 0.05em;
}

/* ── Filmstrip ──────────────────────────────────────────────────────────── */
.runway-filmstrip {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  margin-top: 3px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.runway-filmstrip::-webkit-scrollbar { display: none; }

.runway-thumb {
  flex-shrink: 0;
  height: 100px;
  border: none;
  background: var(--color-surface-2, #F5F0EB);
  padding: 0;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--duration-fast) ease;
}

.runway-thumb.active,
.runway-thumb:hover { opacity: 1; }

.runway-thumb img {
  height: 100px;
  width: auto;
  object-fit: cover;
  display: block;
}

.runway-thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 75px;
  height: 100px;
  color: var(--color-accent);
  font-size: var(--text-sm);
}

/* ══════════════════════════════════════════════════════════════════════════
   PLACEHOLDER & COMING SOON
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2, #F5F0EB);
}

.gallery-ph span {
  color: var(--color-accent);
  font-size: var(--text-lg);
  opacity: 0.5;
}

.gallery-coming-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: var(--space-12) var(--space-6);
}

.gallery-coming-soon p {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-muted);
  opacity: 0.5;
}

/* ══════════════════════════════════════════════════════════════════════════
   SCROLL REVEAL
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-card,
.runway-show-card {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 500ms var(--ease-out),
    transform 500ms var(--ease-out);
  transition-delay: calc(var(--si, 0) * 100ms);
}

.gallery-cat.revealed .gallery-card,
.gallery-cat.revealed .runway-show-card,
.gallery-expand-area .gallery-card.revealed,
.gallery-expand-area .runway-show-card.revealed,
.ugc-expand-area .gallery-card.revealed,
.ugc-expand-area .runway-show-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Ensure hover transitions work after reveal */
.gallery-cat.revealed .gallery-card img,
.gallery-expand-area .gallery-card.revealed img {
  transition: transform 600ms ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
  .gallery-card {
    width: clamp(260px, 75vw, 340px);
  }

  .gallery-card--feature {
    width: clamp(300px, 85vw, 400px);
  }

  .runway-show-card {
    width: clamp(300px, 82vw, 400px);
  }

  .runway-hero { height: 280px; }

  .gallery-hscroll {
    gap: var(--space-3);
    padding: var(--space-4) var(--space-4) var(--space-6);
  }

  .gallery-cat-display {
    padding: var(--space-6) var(--space-4) var(--space-4);
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .gallery-cat-slide {
    transition: none !important;
  }

  .gallery-card,
  .runway-show-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .gallery-card img { transition: none !important; }
}

/* ══════════════════════════════════════════════════════════════════════════
   ENTERTAINMENT — Tabbed headshot gallery (entertainment.html)
   ══════════════════════════════════════════════════════════════════════════ */

.gallery-section {
  padding: var(--space-24, 6rem) var(--space-6, 1.5rem);
  background: var(--color-bg, #fff);
}

@media (min-width: 768px) {
  .gallery-section { padding: var(--space-24, 6rem) var(--space-16, 4rem); }
}

@media (min-width: 1024px) {
  .gallery-section { padding: var(--space-24, 6rem) var(--space-24, 6rem); }
}

.gallery-section .gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-section .gallery-header {
  margin-bottom: var(--space-10, 2.5rem);
}

.gallery-section .gallery-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--color-fg, #0D0D0D);
}

/* Tab bar */
.gallery-section .gallery-tabs {
  display: flex;
  gap: var(--space-3, 0.75rem);
  flex-wrap: wrap;
  margin-bottom: var(--space-10, 2.5rem);
}

@media (max-width: 639px) {
  .gallery-section .gallery-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-2, 0.5rem);
  }
  .gallery-section .gallery-tabs::-webkit-scrollbar { display: none; }
}

.gallery-section .gallery-tab {
  font-family: var(--font-body);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: var(--space-2, 0.5rem) var(--space-6, 1.5rem);
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--color-border, rgba(13,13,13,0.12));
  background: transparent;
  color: var(--color-muted, rgba(13,13,13,0.5));
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.gallery-section .gallery-tab:hover {
  border-color: var(--color-accent, #C9A98A);
  color: var(--color-fg, #0D0D0D);
}

.gallery-section .gallery-tab[aria-selected="true"] {
  background: var(--color-accent, #C9A98A);
  color: #fff;
  border-color: var(--color-accent, #C9A98A);
}

/* Grid */
.gallery-section .gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6, 1.5rem);
}

@media (max-width: 639px) {
  .gallery-section .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3, 0.75rem); }
}

.gallery-section .gallery-grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1023px) and (min-width: 640px) {
  .gallery-section .gallery-grid--3col { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 639px) {
  .gallery-section .gallery-grid--3col { grid-template-columns: repeat(2, 1fr); gap: var(--space-3, 0.75rem); }
}

/* Cards — override the modeling scroll-reveal opacity:0 */
.gallery-section .gallery-card {
  position: relative;
  width: auto;
  flex-shrink: initial;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-xl, 1rem);
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(155deg, var(--color-surface-2, #F5F0EB) 0%, var(--color-divider, #E8E0D8) 100%);
  opacity: 1;
  transform: none;
  scroll-snap-align: initial;
}

.gallery-section .gallery-card::after { display: none; }

/* Placeholder icon */
.gallery-section .gallery-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-section .gallery-card-placeholder svg {
  width: 48px;
  height: 48px;
  color: var(--color-muted);
  opacity: 0.25;
}

/* Credit overlay */
.gallery-section .gallery-card-credit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: var(--space-4, 1rem);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.50) 0%, transparent 50%);
  opacity: 0;
  transform: none;
  transition: opacity 300ms ease;
  z-index: auto;
}

.gallery-section .gallery-card:hover .gallery-card-credit { opacity: 1; }

.gallery-section .gallery-card-credit span {
  font-family: var(--font-body);
  font-size: var(--text-xs, 0.75rem);
  color: #fff;
}
