/*
  gallery-albums.css — Album-style gallery (gallery.html only)
  ──────────────────────────────────────────────────────────────
  Loaded after main.css; uses its design tokens (--brand, --accent-*,
  --radius-*, --shadow-*, --font-*). Does not depend on gallery.css.

  Sections
    Hero              .gx-hero
    Highlights strip  .gx-strip
    Filters           .gx-filters
    Album cards       .gx-albums / .gx-album
    Album dialog      .gx-dialog / .gx-grid
    Lightbox          .gx-lightbox
    CTA               .gx-cta
*/

/* ── Accent per album (ink = darker shade, readable on light bg) ── */
.gx-album, .gx-hero { --accent: var(--accent-blue); --accent-bg: var(--accent-blue-bg); --accent-ink: #1D5F8F; }
[data-accent="orange"] { --accent: var(--accent-orange); --accent-bg: var(--accent-orange-bg); --accent-ink: #A85400; }
[data-accent="blue"]   { --accent: var(--accent-blue);   --accent-bg: var(--accent-blue-bg);   --accent-ink: #1D5F8F; }
[data-accent="green"]  { --accent: var(--accent-green);  --accent-bg: var(--accent-green-bg);  --accent-ink: #44711B; }
[data-accent="purple"] { --accent: var(--accent-purple); --accent-bg: var(--accent-purple-bg); --accent-ink: #5B4677; }
[data-accent="yellow"] { --accent: var(--accent-yellow); --accent-bg: var(--accent-yellow-bg); --accent-ink: #7F6200; }

.gx-page { background: var(--cream); }

.gx-eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink, var(--brand));
}

.gx-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.gx-btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.gx-btn-primary:hover { transform: translateY(-2px); background: var(--brand-dark); }
.gx-btn-ghost { background: transparent; color: var(--brand); border-color: var(--border); }
.gx-btn-ghost:hover { border-color: var(--brand); }

/* ═══════════════ HERO ═══════════════ */
.gx-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 80px;
  background:
    radial-gradient(circle at 88% 12%, var(--accent-bg) 0, transparent 42%),
    radial-gradient(circle at 6% 92%, var(--brand-xlight) 0, transparent 40%),
    var(--cream);
}
.gx-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.gx-hero h1 {
  margin: 14px 0 18px;
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 4.4vw, 3.3rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--brand);
  letter-spacing: -0.01em;
}
.gx-hero h1 em { font-style: normal; color: var(--accent-ink); }
.gx-hero-sub {
  max-width: 34em;
  font-size: 1.08rem;
  color: var(--text-mid);
}
.gx-latest {
  margin-top: 32px;
  padding: 20px 22px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.gx-latest-title {
  margin: 4px 0 2px;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-dark);
}
.gx-latest-meta { font-size: 0.92rem; color: var(--text-light); margin-bottom: 14px; }

.gx-hero-art {
  position: relative;
  aspect-ratio: 5 / 4;
}
.gx-hero-art img {
  position: absolute;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
}
.gx-hero-main  { inset: 0 14% 12% 0; width: 86%; height: 88%; }
.gx-hero-small { width: 40%; aspect-ratio: 1; border: 6px solid var(--white); }
.gx-hero-small.one { right: 0; bottom: 0; }
.gx-hero-small.two { right: 4%; top: -6%; width: 28%; }

/* ═══════════════ HIGHLIGHTS STRIP ═══════════════ */
.gx-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}
.gx-section-head h2 {
  margin-top: 6px;
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--brand);
}
.gx-strip-section { padding: 64px 0 24px; background: var(--white); }
.gx-strip {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.gx-strip-track {
  display: flex;
  gap: 16px;
  width: max-content;
  padding: 8px 0 28px;
  animation: gx-scroll 40s linear infinite;
}
.gx-strip.paused .gx-strip-track { animation-play-state: paused; }
@keyframes gx-scroll { to { transform: translateX(-50%); } }
.gx-strip-item {
  flex: none;
  height: 220px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--brand-xlight);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}
.gx-strip-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.gx-strip-item img { height: 100%; width: auto; object-fit: cover; }

/* ═══════════════ FILTERS ═══════════════ */
.gx-albums-section { padding: 56px 0 88px; }
.gx-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gx-filter {
  min-height: 44px;
  padding: 10px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  font-family: var(--font-head);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-mid);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.gx-filter:hover { border-color: var(--brand); color: var(--brand); }
.gx-filter[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.gx-count { margin: 18px 0 30px; font-size: 0.92rem; color: var(--text-light); }

/* ═══════════════ ALBUM CARDS ═══════════════ */
.gx-albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
  gap: 36px 28px;
}
.gx-album { display: flex; }
.gx-album[hidden] { display: none; }
.gx-album-open {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}
.gx-album-open:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.gx-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  background: var(--brand-xlight);
}
.gx-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.gx-album-open:hover .gx-cover > img { transform: scale(1.05); }
.gx-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.94);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dark);
}
.gx-peek {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
}
.gx-peek img {
  width: 54px;
  height: 54px;
  margin-left: -14px;
  border: 3px solid var(--white);
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}
.gx-meta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  padding: 22px 24px 24px;
}
.gx-meta .gx-view { margin-top: auto; padding-top: 14px; }
.gx-meta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  width: 44px;
  height: 4px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}
.gx-tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-bg);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.gx-title {
  margin: 12px 0 6px;
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-dark);
}
.gx-date { font-size: 0.9rem; color: var(--text-light); }
.gx-view {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
}
.gx-album-open:hover .gx-view { text-decoration: underline; text-underline-offset: 4px; }
.gx-photos { display: none; }

/* ═══════════════ ALBUM DIALOG ═══════════════ */
html.gx-locked { overflow: hidden; }
.gx-dialog, .gx-lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
}
.gx-dialog { background: var(--cream); color: var(--text-dark); }
.gx-dialog::backdrop { background: rgba(0, 24, 69, 0.6); }
.gx-dialog-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px calc(env(safe-area-inset-bottom, 0px) + 48px);
}
.gx-dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: -28px -24px 24px;
  padding: 24px 24px 18px;
  background: rgba(253, 251, 245, 0.95);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}
.gx-dialog-title {
  margin: 8px 0 4px;
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--brand);
}
.gx-dialog-meta { font-size: 0.92rem; color: var(--text-light); }
.gx-dialog-desc { max-width: 46em; margin-bottom: 28px; font-size: 1.04rem; color: var(--text-mid); }
.gx-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand);
  cursor: pointer;
}
.gx-close:hover { border-color: var(--brand); }

/* Justified rows: each tile grows in proportion to its aspect ratio (--r) */
.gx-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.gx-grid::after { content: ''; flex-grow: 999999; }
.gx-tile {
  flex-grow: calc(var(--r) * 100);
  flex-basis: calc(var(--r) * 210px);
  aspect-ratio: var(--r);
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--brand-xlight);
  cursor: zoom-in;
}
.gx-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s;
}
.gx-tile:hover img { transform: scale(1.04); }

/* ═══════════════ LIGHTBOX ═══════════════ */
.gx-lightbox { background: rgba(0, 17, 46, 0.96); color: #fff; }
.gx-lightbox::backdrop { background: rgba(0, 17, 46, 0.96); }
.gx-lb-stage {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
}
.gx-lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
}
.gx-lb-counter { font-family: var(--font-head); font-weight: 700; opacity: 0.85; }
.gx-lightbox .gx-close { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); color: #fff; }
.gx-lb-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 12px 0;
  touch-action: pan-y;
}
.gx-lb-figure img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.gx-lb-caption { text-align: center; font-size: 0.98rem; opacity: 0.85; min-height: 1.5em; }
.gx-lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  font-size: 1.6rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.gx-lb-nav:hover { background: rgba(255,255,255,0.26); }
.gx-lb-prev { left: 8px; }
.gx-lb-next { right: 8px; }

/* ═══════════════ CTA ═══════════════ */
.gx-cta {
  max-width: 760px;
  margin: 72px auto 0;
  padding: 44px 32px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}
.gx-cta h2 { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; color: var(--brand); margin-bottom: 10px; }
.gx-cta p { color: var(--text-mid); margin-bottom: 24px; }
.gx-cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 900px) {
  .gx-hero { padding: 44px 0 56px; }
  .gx-hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .gx-hero-art { max-width: 560px; }
}
@media (max-width: 600px) {
  .gx-strip-item { height: 160px; }
  .gx-tile { flex-basis: calc(var(--r) * 130px); }
  .gx-lb-nav { width: 44px; height: 44px; font-size: 1.3rem; }
  .gx-dialog-inner { padding-left: 16px; padding-right: 16px; }
  .gx-dialog-head { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

/* Visitors who ask for less motion: no auto-scroll, swipeable row instead */
@media (prefers-reduced-motion: reduce) {
  .gx-strip { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .gx-strip-track { animation: none; }
  .gx-pause { display: none; }
  .gx-album-open, .gx-cover > img, .gx-tile img, .gx-strip-item { transition: none; }
  .gx-album-open:hover, .gx-strip-item:hover { transform: none; }
  .gx-album-open:hover .gx-cover > img, .gx-tile:hover img { transform: none; }
}
