/* ==========================================================================
   Old Hill Masjid - "Beyond premium" Gallery stylesheet  (v2, cinematic)
   --------------------------------------------------------------------------
   Shared by gallery.html (hub) and gallery-collection.html (single collection).
   Deep navy cinematic ground so the photography glows; gold hairlines; Amiri
   for display; light "breather" sections for text. NO tiled geometric SVG
   textures anywhere (banned). Depth comes from gradients, soft vignettes and a
   single fine grain layer (fractal noise, not symbols).
   ========================================================================== */

/* ---------- ROOT TOKENS ---------- */
:root {
  --navy:        #0B1F3A;
  --navy-deep:   #0D2040;
  --ground:      #071021;   /* gallery-at-night ground (darker than navy) */
  --ground-2:    #0A1A33;   /* raised dark panel */
  --ground-3:    #0E2244;   /* card on dark */
  --gold:        #C9A84C;
  --gold-light:  #D9B85A;
  --gold-muted:  #8A6F1F;
  --teal:        #0D9B8A;
  --teal-light:  #6DD4DF;

  --breather:      #F6F1E8; /* warm bone light section */
  --breather-cool: #EEF2F7; /* cool paper light section */

  --on-dark:        rgba(255,255,255,0.92);
  --on-dark-soft:   rgba(255,255,255,0.72);
  --on-dark-faint:  rgba(255,255,255,0.55);
  --on-light:       #1B2433;
  --on-light-soft:  #46556B;

  --hairline:       rgba(201,168,76,0.34);
  --hairline-soft:  rgba(255,255,255,0.10);

  --font-display: 'Amiri', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.2,.7,.2,1);
  --arch: 46% 46% 12px 12px / 40% 40% 12px 12px;

  /* Single fine grain layer (fractal noise -> film grain, no symbols). */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- RESET + BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--on-dark);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0 0 0.5em;
  line-height: 1.18;
  letter-spacing: 0.005em;
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 2.4rem); }
.wrap--narrow { max-width: 940px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- EYEBROW ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.74rem; font-weight: 600;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
  display: inline-flex; align-items: center; gap: 0.7rem;
}
.eyebrow::before, .eyebrow::after {
  content: ''; display: inline-block; width: 26px; height: 1px;
  background: var(--gold); opacity: 0.7; flex-shrink: 0;
}
.eyebrow--center { justify-content: center; }
.eyebrow--solo::before, .eyebrow--solo::after { display: none; }
.eyebrow--teal { color: var(--teal-light); }
.eyebrow--teal::before, .eyebrow--teal::after { background: var(--teal-light); }
.eyebrow--dark { color: var(--gold-muted); }
.eyebrow--dark::before, .eyebrow--dark::after { background: var(--gold-muted); }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.9rem; border-radius: 999px;
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.84rem; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: transform 220ms var(--ease), background-color 220ms var(--ease), color 220ms var(--ease), box-shadow 220ms var(--ease);
}
.btn i { width: 16px; height: 16px; }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 16px 32px -12px rgba(201,168,76,0.5); }
.btn--gold-outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn--gold-outline:hover { background: var(--gold); color: var(--navy); transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 3px; }

.glink {
  display: inline-flex; align-items: center; gap: 0.45rem;
  color: var(--gold); text-decoration: none; font-weight: 600;
  font-size: 0.9rem; letter-spacing: 0.02em;
  border-bottom: 1px solid var(--hairline); padding-bottom: 2px;
  transition: gap 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.glink:hover { gap: 0.7rem; color: var(--gold-light); border-bottom-color: var(--gold); }
.glink:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 3px; }
.glink i { width: 15px; height: 15px; }

/* ---------- SKIP LINK ---------- */
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 2000;
  background: var(--gold); color: var(--navy);
  padding: 10px 18px; border-radius: 8px; font-weight: 700;
  text-decoration: none; transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; }

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 750ms var(--ease), transform 750ms var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
.reveal.revealed { opacity: 1; transform: none; }

/* ==========================================================================
   PAGE HERO (cinematic, shared)
   ========================================================================== */
.page-hero {
  position: relative; min-height: 340px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--on-dark);
  background:
    radial-gradient(120% 90% at 50% -10%, #16335f 0%, rgba(22,51,95,0) 55%),
    linear-gradient(180deg, #0c2347 0%, #0a1c39 45%, var(--ground) 100%);
  padding: 132px 1.25rem 3.4rem; overflow: hidden;
}
.page-hero--hub { min-height: min(86vh, 720px); }
/* glows + vignette for depth (no geometric texture) */
.page-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 82% 22%, rgba(13,155,138,0.22), transparent 70%),
    radial-gradient(46% 52% at 14% 82%, rgba(201,168,76,0.18), transparent 72%),
    radial-gradient(120% 120% at 50% 120%, rgba(0,0,0,0.55), transparent 60%);
}
/* fine film grain */
.page-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--grain); background-size: 180px 180px;
  opacity: 0.05; mix-blend-mode: overlay;
}
/* optional feature image behind the hero content (Ken Burns when present) */
.page-hero__media { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; }
.page-hero__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,16,33,0.55), rgba(7,16,33,0.82)); }
@media (prefers-reduced-motion: no-preference) {
  .page-hero__media img { animation: kenburns 26s var(--ease) both alternate infinite; }
}
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.14); } }

.page-hero__content { position: relative; z-index: 2; max-width: 880px; }
.page-hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 700;
  margin: 0.4rem 0 0.7rem; color: #fff; letter-spacing: 0.01em;
}
.page-hero__sub { color: var(--on-dark-soft); font-size: clamp(1rem, 1.6vw, 1.14rem); margin: 0 auto 1.7rem; max-width: 60ch; }
.page-hero__actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.9rem; }

/* ayah block (kept from the previous gallery) */
.page-hero__ayah {
  margin: 0 auto; max-width: 64ch; font-family: var(--font-body);
  font-size: 0.92rem; font-style: italic; color: var(--on-dark-soft);
  line-height: 1.7; padding: 1.3rem 1.25rem 0; border-top: 1px solid var(--hairline);
}
.page-hero__ayah-ar {
  display: block; font-family: var(--font-display); font-style: normal;
  font-size: 1.5rem; color: #fff; letter-spacing: 0.02em;
  direction: rtl; line-height: 1.95; margin: 0 0 0.7rem;
}
.page-hero__ayah-cite {
  display: block; font-style: normal; margin-top: 0.5rem; font-size: 0.76rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
}
.page-hero__back {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem;
  color: var(--on-dark-soft); text-decoration: none; font-size: 0.8rem;
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  transition: gap 200ms var(--ease), color 200ms var(--ease);
}
.page-hero__back:hover { gap: 0.85rem; color: var(--gold); }
.page-hero__back:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 3px; }
.page-hero__back i { width: 15px; height: 15px; }
.page-hero__meta { display: flex; gap: 1.4rem; flex-wrap: wrap; justify-content: center; margin-top: 1.1rem; font-size: 0.84rem; color: var(--on-dark-soft); }
.page-hero__meta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.page-hero__meta i { width: 15px; height: 15px; color: var(--gold); }

/* scroll cue at foot of the hub hero */
.page-hero__cue {
  position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%);
  z-index: 2; color: var(--on-dark-faint); display: inline-flex; flex-direction: column;
  align-items: center; gap: 0.3rem; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none;
}
.page-hero__cue i { width: 20px; height: 20px; color: var(--gold); }
@media (prefers-reduced-motion: no-preference) { .page-hero__cue i { animation: cuebob 2.4s ease-in-out infinite; } }
@keyframes cuebob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (max-width: 768px) {
  .page-hero { min-height: 280px; padding-top: 104px; padding-bottom: 2.4rem; }
  .page-hero--hub { min-height: 80vh; }
  .page-hero__ayah-ar { font-size: 1.28rem; }
}

/* ==========================================================================
   LIGHT "BREATHER" SECTIONS
   ========================================================================== */
.breather { background: var(--breather); color: var(--on-light); padding: clamp(2.6rem, 5vw, 4rem) 0; }
.breather--cool { background: var(--breather-cool); }
.breather__lead {
  max-width: 60ch; margin: 0 auto; text-align: center;
  font-size: clamp(1.08rem, 2vw, 1.28rem); color: var(--on-light); line-height: 1.75;
}
.breather__note { text-align: center; color: var(--on-light-soft); font-size: 0.92rem; margin: 1rem auto 0; max-width: 56ch; }

/* Gallery stats band: mirrors the homepage stats (teal serif numbers, gold
   hairline dividers, uppercase labels), themed for the light breather. */
.g-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 920px;
  margin: clamp(2.2rem, 4vw, 3rem) auto 0;
  position: relative;
}
.g-stat { text-align: center; padding: 1rem 1.5rem; position: relative; }
.g-stat + .g-stat::before {
  content: '';
  position: absolute; left: 0; top: 12%; bottom: 12%;
  width: 1px; background: var(--hairline);
}
.g-stat__num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--teal);
  margin: 0; line-height: 1; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.g-stat__label {
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 700;
  color: var(--on-light);
  letter-spacing: 0.2em; text-transform: uppercase;
  margin: 1rem 0 0; opacity: 0.9;
}
@media (max-width: 768px) {
  .g-stats { grid-template-columns: 1fr; gap: 0.5rem; }
  .g-stat + .g-stat::before { left: 12%; right: 12%; top: 0; bottom: auto; width: auto; height: 1px; }
  .g-stat__num { font-size: clamp(1.9rem, 8vw, 2.4rem); }
}

/* ==========================================================================
   SECTION SCAFFOLD (dark)
   ========================================================================== */
.section { padding: clamp(3rem, 6vw, 5rem) 0; position: relative; }
.section--ground { background: var(--ground); }
.section--ground-2 { background: var(--ground-2); }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.section-head h2 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section-head p { color: var(--on-dark-soft); margin: 0.4rem auto 0; max-width: 54ch; }
.hr-gold { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--hairline), transparent); }

/* ==========================================================================
   COLLECTIONS (hub) - editorial cover rows
   ========================================================================== */
.collections { display: flex; flex-direction: column; gap: clamp(2.5rem, 5vw, 4.5rem); }
.coll {
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.coll:nth-child(even) { grid-template-columns: 0.95fr 1.05fr; }
.coll:nth-child(even) .coll__media { order: 2; }
.coll:nth-child(even) .coll__body { order: 1; }
.coll__body { max-width: 46ch; }
.coll__index {
  font-family: var(--font-display); font-size: 0.95rem; color: var(--gold);
  letter-spacing: 0.06em; opacity: 0.85; margin: 0 0 0.5rem;
}
.coll__kicker { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--teal-light); margin: 0 0 0.7rem; }
.coll__title { font-size: clamp(1.8rem, 3.6vw, 2.7rem); color: #fff; margin: 0 0 0.7rem; }
.coll__blurb { color: var(--on-dark-soft); font-size: 1.04rem; margin: 0 0 1.3rem; }
.coll__cta { display: inline-flex; }

/* the cover frame: gold hairline, glows on hover, Ken Burns image */
.coll__media {
  position: relative; border-radius: 16px; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--ground-3);
  border: 1px solid var(--hairline);
  box-shadow: 0 30px 60px -34px rgba(0,0,0,0.8);
}
.coll__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 800ms var(--ease), opacity 400ms var(--ease); }
.coll__link { display: block; position: absolute; inset: 0; z-index: 3; }
.coll:hover .coll__media img, .coll__link:focus-visible + .coll__frameedge img { transform: scale(1.05); }
.coll__media::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 50%, rgba(7,16,33,0.5)); }
.coll__badge {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  background: rgba(7,16,33,0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--hairline); color: var(--gold-light);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.coll__badge i { width: 15px; height: 15px; }
.coll__link:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 4px; }
.coll__media:hover { border-color: var(--gold); box-shadow: 0 36px 70px -30px rgba(0,0,0,0.85), inset 0 0 0 1px rgba(201,168,76,0.4); }

/* placeholder ground inside a cover when no image yet (deliberate, not broken) */
.coll__ph, .media-ph {
  position: absolute; inset: 0; z-index: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.55rem; text-align: center; padding: 1rem;
  background:
    radial-gradient(80% 80% at 50% 30%, rgba(201,168,76,0.10), transparent 70%),
    linear-gradient(180deg, var(--ground-3), var(--ground-2));
  color: var(--on-dark-faint);
}
.coll__ph i, .media-ph i { width: 30px; height: 30px; color: var(--gold); opacity: 0.85; }
.coll__ph span, .media-ph span { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.has-image .coll__ph, .has-image .media-ph { display: none; }

@media (max-width: 800px) {
  .coll, .coll:nth-child(even) { grid-template-columns: 1fr; gap: 1.2rem; }
  .coll:nth-child(even) .coll__media, .coll:nth-child(even) .coll__body { order: initial; }
  .coll__media { aspect-ratio: 16 / 10; }
}

/* ==========================================================================
   MEDIA CARDS (films + youtube)
   ========================================================================== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(260px, 30vw, 360px), 1fr)); gap: 1.3rem; }
.media-card {
  position: relative; border-radius: 14px; overflow: hidden;
  background: var(--ground-3); border: 1px solid var(--hairline-soft);
  transition: transform 240ms var(--ease), border-color 240ms var(--ease), box-shadow 240ms var(--ease);
}
.media-card:hover { transform: translateY(-3px); border-color: var(--hairline); box-shadow: 0 22px 44px -24px rgba(0,0,0,0.7); }
.media-card__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ground-2); }
.media-card__frame img, .media-card__frame video, .media-card__frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0;
}
.media-card__play {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: rgba(7,16,33,0.28); border: 0; cursor: pointer; color: #fff; width: 100%;
  transition: background-color 240ms var(--ease);
}
.media-card__play:hover { background: rgba(7,16,33,0.12); }
.media-card__play:focus-visible { outline: 3px solid var(--teal-light); outline-offset: -3px; }
.media-card__play span.dot {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(201,168,76,0.92); color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,0.6); transition: transform 240ms var(--ease);
}
.media-card__play:hover span.dot { transform: scale(1.08); }
.media-card__play span.dot i { width: 26px; height: 26px; margin-left: 3px; }
.media-card__cap { padding: 0.95rem 1.1rem 1.1rem; }
.media-card__cap h3 { font-family: var(--font-body); font-weight: 700; font-size: 1.02rem; color: #fff; margin: 0 0 0.25rem; letter-spacing: 0; }
.media-card__cap p { color: var(--on-dark-soft); font-size: 0.88rem; margin: 0; }
.media-card__soon {
  position: absolute; top: 0.8rem; right: 0.8rem; z-index: 3;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-light); background: rgba(7,16,33,0.6); border: 1px solid var(--hairline);
  padding: 0.25rem 0.6rem; border-radius: 999px;
}

/* ==========================================================================
   SUPPORT CTA BAND (the one primary CTA)
   ========================================================================== */
.gp-cta {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 100% at 50% 0%, rgba(13,155,138,0.28), transparent 70%),
    linear-gradient(135deg, #0B1F3A 0%, #0D2040 55%, #0D4A42 100%);
  color: #fff; text-align: center; padding: clamp(3.2rem, 6vw, 5rem) 1.25rem;
}
.gp-cta::after { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: var(--grain); background-size: 180px 180px; opacity: 0.05; mix-blend-mode: overlay; }
.gp-cta > * { position: relative; z-index: 1; }
.gp-cta h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.5rem); }
.gp-cta p { color: var(--on-dark-soft); max-width: 52ch; margin: 0 auto 1.9rem; }

/* ==========================================================================
   COLLECTION DETAIL: mosaic + tiles
   ========================================================================== */
.gc { padding: clamp(2.6rem, 5vw, 4.4rem) 0; }
.gc__group-head { max-width: 60ch; margin: 0 auto clamp(1.4rem, 3vw, 2.2rem); text-align: center; }
.gc__group-head h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 0.4rem; }
.gc__group-head p { color: var(--on-dark-soft); margin: 0 auto; max-width: 54ch; }
.gc__group-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; margin-top: 0.8rem; font-size: 0.8rem; color: var(--on-dark-faint); }
.gc__group-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.gc__group-meta i { width: 14px; height: 14px; color: var(--gold); }
.gc__group { padding: clamp(1.6rem, 3vw, 2.6rem) 0; }
.gc__group + .gc__group { border-top: 1px solid var(--hairline-soft); }

.mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 18vw, 210px), 1fr));
  gap: 0.7rem; grid-auto-flow: dense;
}
.g-cell { aspect-ratio: 1 / 1; min-width: 0; }
.g-cell--featured { grid-column: span 2; grid-row: span 2; }
.g-cell > .tile { width: 100%; height: 100%; }

.gc__nav {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 2rem; border-top: 1px solid var(--hairline-soft);
}
.gc__nav a { max-width: 46%; text-decoration: none; }
.gc__nav a span { display: block; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--on-dark-faint); }
.gc__nav a strong { color: #fff; font-weight: 600; }
.gc__nav a:hover strong { color: var(--gold); }
.gc__nav a:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 3px; }
.gc__empty { text-align: center; max-width: 52ch; margin: 0 auto; padding: 3rem 1rem; color: var(--on-dark-soft); }

/* ==========================================================================
   TILE (image frame) - shared
   ========================================================================== */
.tile {
  position: relative; display: block; width: 100%; height: 100%; padding: 0;
  border: 0; background: var(--ground-3); cursor: pointer; overflow: hidden;
  border-radius: 12px; box-shadow: 0 1px 0 rgba(0,0,0,0.2);
  transition: transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.tile::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit; border: 1px solid var(--hairline);
  transition: border-color 260ms var(--ease), box-shadow 260ms var(--ease);
}
.tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 600ms var(--ease), opacity 300ms var(--ease);
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 18px 34px -16px rgba(0,0,0,0.7); }
.tile:hover img { transform: scale(1.06); }
.tile:hover::after { border-color: var(--gold); box-shadow: inset 0 0 0 2px rgba(201,168,76,0.5); }
.tile:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 3px; }

/* featured dome-arch (mihrab) tile - kept as ONE tasteful motif, no texture fill */
.tile--featured { border-radius: var(--arch); background: linear-gradient(180deg, rgba(201,168,76,0.16), rgba(201,168,76,0.03)), var(--ground-3); padding: 4px; }
.tile--featured img { border-radius: var(--arch); }
.tile--featured::after { border-radius: var(--arch); border-width: 1.5px; }
.tile--featured .tile__keystone {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; z-index: 3; color: var(--gold);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.tile__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 1.4rem 0.8rem 0.6rem; font-size: 0.72rem; color: #fff;
  letter-spacing: 0.04em; text-align: left;
  background: linear-gradient(to top, rgba(7,16,33,0.85), transparent);
  opacity: 0; transform: translateY(6px); transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}
.tile:hover .tile__cap, .tile:focus-visible .tile__cap { opacity: 1; transform: none; }

/* empty placeholder (photo not added) - plain tinted ground + icon, NO texture */
.tile__placeholder {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.45rem; text-align: center; padding: 0.7rem;
  background: radial-gradient(70% 70% at 50% 35%, rgba(201,168,76,0.10), transparent 72%), linear-gradient(180deg, var(--ground-3), var(--ground-2));
}
.tile__placeholder i { width: 24px; height: 24px; color: var(--gold); opacity: 0.85; }
.tile__placeholder span { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark-faint); }
.tile.has-image .tile__placeholder { display: none; }

/* "+N more" tile */
.tile--more::before { content: ''; position: absolute; inset: 0; z-index: 2; background: linear-gradient(135deg, rgba(7,16,33,0.82), rgba(13,155,138,0.6)); }
.tile--more .tile__more {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.25rem; color: #fff; text-decoration: none;
}
.tile--more .tile__more strong { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; }
.tile--more .tile__more span { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.92; }
.tile--more .tile__more i { width: 18px; height: 18px; margin-top: 0.2rem; }

@media (max-width: 600px) {
  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .g-cell--featured { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 16 / 10; }
}

/* ==========================================================================
   CONSTRUCTION SHOWPIECE: before/after slider + timeline
   ========================================================================== */
.showpiece { background: var(--ground-2); padding: clamp(2.8rem, 5vw, 4.4rem) 0; }
.showpiece + .gc { padding-top: clamp(2.6rem, 5vw, 4rem); }

/* before / after drag slider */
.ba {
  position: relative; width: 100%; aspect-ratio: 16 / 10; max-width: 1000px; margin: 0 auto;
  border-radius: 16px; overflow: hidden; border: 1px solid var(--hairline);
  box-shadow: 0 30px 60px -34px rgba(0,0,0,0.8); user-select: none; touch-action: pan-y;
  background: var(--ground-3);
}
.ba__layer { position: absolute; inset: 0; }
.ba__layer img { width: 100%; height: 100%; object-fit: cover; }
.ba__layer--before { clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.ba__ground { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ba__ground--before { background: linear-gradient(135deg, #11203c, #0c1a32); }
.ba__ground--after { background: linear-gradient(135deg, #163a5e, #0e2748); }
.ba__ground span { font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2.4rem); color: rgba(255,255,255,0.18); letter-spacing: 0.08em; }
.ba__tag {
  position: absolute; bottom: 1rem; z-index: 4; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: #fff;
  background: rgba(7,16,33,0.6); border: 1px solid var(--hairline);
  padding: 0.3rem 0.7rem; border-radius: 999px;
}
.ba__tag--before { left: 1rem; }
.ba__tag--after { right: 1rem; }
.ba__handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); z-index: 5;
  width: 3px; background: var(--gold); transform: translateX(-50%); cursor: ew-resize;
  border: 0; padding: 0;
}
.ba__handle::before { content: ''; position: absolute; inset: 0; width: 44px; left: -22px; cursor: ew-resize; }
.ba__grip {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px -4px rgba(0,0,0,0.6);
}
.ba__grip i { width: 22px; height: 22px; }
.ba__handle:focus-visible { outline: none; }
.ba__handle:focus-visible .ba__grip { outline: 3px solid var(--teal-light); outline-offset: 3px; }
.ba__caption { text-align: center; color: var(--on-dark-soft); font-size: 0.88rem; margin: 1.1rem auto 0; max-width: 52ch; }

/* timeline rail */
.tl { margin-top: clamp(2rem, 4vw, 3rem); }
.tl__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.tl__head h3 { color: #fff; font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 0; }
.tl__btns { display: flex; gap: 0.5rem; }
.tl__btn {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.06); color: #fff; border: 1px solid var(--hairline);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color 200ms var(--ease), transform 200ms var(--ease);
}
.tl__btn:hover { background: var(--gold); color: var(--navy); transform: translateY(-2px); }
.tl__btn:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.tl__btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; background: rgba(255,255,255,0.06); color: #fff; }
.tl__btn i { width: 20px; height: 20px; }
.tl__rail {
  display: flex; gap: 1.1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0.4rem 0.2rem 1.4rem; scrollbar-width: thin; scroll-behavior: smooth;
}
.tl__rail::-webkit-scrollbar { height: 6px; }
.tl__rail::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }
.tl__item { scroll-snap-align: start; flex: 0 0 clamp(220px, 64vw, 300px); }
.tl__date { font-family: var(--font-display); font-size: 1.05rem; color: var(--gold); margin: 0 0 0.5rem; display: flex; align-items: center; gap: 0.55rem; }
.tl__date::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(201,168,76,0.18); flex-shrink: 0; }
.tl__frame { aspect-ratio: 4 / 3; border-radius: 12px; }
.tl__label { color: var(--on-dark-soft); font-size: 0.9rem; margin: 0.7rem 0 0; }

@media (prefers-reduced-motion: reduce) { .tl__rail { scroll-behavior: auto; } }

/* ==========================================================================
   LIGHTBOX v2 (image + video, focus-trapped)
   ========================================================================== */
.lb {
  position: fixed; inset: 0; z-index: 3000;
  display: none; align-items: center; justify-content: center;
  background: rgba(4,10,22,0.95);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 240ms var(--ease);
}
.lb.is-open { display: flex; opacity: 1; }
.lb__stage { position: relative; max-width: min(1180px, 94vw); max-height: 86vh; display: flex; align-items: center; justify-content: center; }
.lb__img, .lb__video {
  max-width: 94vw; max-height: 80vh; width: auto; height: auto;
  border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  border: 1px solid var(--hairline);
  transform: scale(0.98); opacity: 0; transition: transform 300ms var(--ease), opacity 300ms var(--ease);
}
.lb__video { background: #000; }
.lb.is-ready .lb__img, .lb.is-ready .lb__video { transform: none; opacity: 1; }
.lb__caption { position: absolute; left: 0; right: 0; bottom: -2.6rem; text-align: center; color: var(--on-dark-soft); font-size: 0.85rem; letter-spacing: 0.03em; }
.lb__caption b { color: var(--gold); font-weight: 600; }
.lb__btn {
  position: absolute; z-index: 2; width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.22);
  transition: background-color 200ms var(--ease), transform 200ms var(--ease);
}
.lb__btn:hover { background: var(--gold); color: var(--navy); transform: scale(1.06); }
.lb__btn:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.lb__btn i { width: 24px; height: 24px; }
.lb__close { top: 1.25rem; right: 1.25rem; }
.lb__prev { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb__next { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lb__prev:hover, .lb__next:hover { transform: translateY(-50%) scale(1.06); }
.lb__count { position: absolute; top: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 2; color: var(--on-dark-faint); font-size: 0.82rem; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }
@media (max-width: 768px) {
  .lb__prev { left: 0.5rem; } .lb__next { right: 0.5rem; }
  .lb__btn { width: 46px; height: 46px; }
  .lb__caption { bottom: -2.3rem; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .tile, .tile img, .tile__cap, .lb, .lb__img, .lb__video, .lb__btn, .btn, .coll__media img, .media-card { transition: none !important; }
  .tile:hover { transform: none; } .tile:hover img { transform: none; }
  .page-hero__media img { animation: none !important; }
  .page-hero__cue i { animation: none !important; }
}
