/* Asmara Bella — Gallery (gallery.html). Immersive dark gallery: a hero with drifting
   photo columns, a sticky filter bar and the photo mosaic (tiles rendered by the page
   script, opened by assets/js/ab-lightbox.js). Shared pieces come from experience.css
   and the mosaic base from design.css. */

body.paper { background-color: var(--ab-night); }
/* Keep italic letters from being cut off by the heading word masks. */
.gal-visit .xp-sw { padding-right: 0.2em; margin-right: -0.2em; }

/* ---------- Hero ---------- */

.gal-hero {
  position: relative;
  overflow: hidden;
  min-height: min(92vh, 900px);
  display: flex;
  align-items: center;
  background: var(--ab-night);
  color: #f0e6d3;
}
.gal-hero-cols {
  position: absolute;
  top: -12%;
  bottom: -12%;
  right: max(var(--xp-gutter), calc((100vw - var(--xp-wrap)) / 2 + var(--xp-gutter)));
  width: min(44vw, 580px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: center;
}
.gal-col { display: flex; flex-direction: column; gap: 16px; will-change: transform; }
.gal-col-mid { margin-top: 18vh; }
.gal-col img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  filter: saturate(0.9) brightness(0.92);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.gal-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--ab-night) 30%, rgba(22, 14, 7, 0.55) 58%, rgba(22, 14, 7, 0.15)),
    linear-gradient(180deg, rgba(22, 14, 7, 0.6), transparent 22%, transparent 78%, var(--ab-night));
}
.gal-hero-copy { position: relative; z-index: 1; width: 100%; padding-top: 70px; padding-bottom: 90px; }
.gal-hero-copy > * { max-width: min(500px, 44vw); }
.gal-hero h1 {
  margin: 0 0 24px;
  font: 600 clamp(56px, 9vw, 128px)/0.95 "Playfair Display", serif;
  letter-spacing: -0.035em;
  color: #fff;
}
.gal-hero h1 em { font-style: italic; font-weight: 500; color: var(--ab-gold-hi); }
.gal-hero-lede { margin: 0 0 36px; font: 400 clamp(18px, 1.7vw, 22px)/1.6 "Playfair Display", serif; color: #e6d9c4; }
.gal-rise { animation: ab-rise 1.2s var(--xp-ease) both; }
.gal-d1 { animation-delay: 0.12s; }
.gal-d2 { animation-delay: 0.26s; }
.gal-d3 { animation-delay: 0.4s; }

/* ---------- Photos ---------- */

.gal-photos { position: relative; background: var(--ab-night); padding: 0 0 clamp(80px, 9vw, 130px); }
.gal-bar {
  position: sticky;
  top: 66px;
  z-index: 20;
  margin-bottom: clamp(26px, 3vw, 40px);
  padding: 14px 0;
  background: rgba(22, 14, 7, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(230, 194, 119, 0.14);
  border-bottom: 1px solid rgba(230, 194, 119, 0.14);
  transition: top 0.45s var(--xp-ease);
}
/* Follow the site header: it shrinks once scrolled and slides away while scrolling down. */
body:has(#ab-nav.ab-scrolled) .gal-bar { top: 58px; }
body:has(#ab-nav.ab-nav-hidden) .gal-bar { top: 0; }
.gal-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.gal-hint { margin: 0; color: #b9ad9a; font-size: 14px; white-space: nowrap; }
.gal-photos .ab-gfilters { margin: 0; justify-content: flex-end; }
.gal-photos .ab-gfilter {
  padding: 10px 18px;
  background: transparent;
  border-color: rgba(230, 194, 119, 0.3);
  color: #f0e6d3;
  font-size: 14px;
}
.gal-photos .ab-gfilter:hover { border-color: var(--ab-gold-hi); color: #fff; }
.gal-photos .ab-gfilter[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--ab-gold-hi), var(--ab-gold));
  border-color: transparent;
  color: var(--ab-night);
  box-shadow: 0 10px 26px -10px rgba(230, 194, 119, 0.55);
}
.gal-photos .ab-gfilter:focus-visible { outline: 3px solid var(--ab-gold-hi); outline-offset: 3px; }
.gal-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.gal-photos .ab-mosaic { grid-auto-rows: clamp(200px, 19vw, 260px); gap: 16px; }
.gal-photos .ab-tile { background: #2a1d10; box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9); border-radius: 20px; }
.gal-photos .ab-tile img { filter: saturate(0.92); }
.gal-photos .ab-tile:hover img { filter: saturate(1.1); }
.gal-photos .ab-tile:focus-visible { outline: 3px solid var(--ab-gold-hi); outline-offset: 4px; }
.gal-photos .ab-tile:focus-visible figcaption small { opacity: 1; }

/* Tiles rise into place as they scroll into view (browsers with scroll-driven animations). */
@supports (animation-timeline: view()) {
  .gal-photos .ab-tile:not(.is-entering) {
    animation: gal-tile-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 70%;
  }
  @keyframes gal-tile-in { from { opacity: 0; transform: translateY(60px) scale(0.94); } }
}

/* ---------- Closing ---------- */

.gal-visit { border-top: 1px solid rgba(230, 194, 119, 0.12); }
.gal-visit-inner { position: relative; z-index: 1; text-align: center; }
.gal-visit-inner .xp-eyebrow::after { content: ""; width: 34px; height: 1px; background: currentColor; opacity: 0.7; }
.gal-visit-inner .xp-display { max-width: 900px; margin-left: auto; margin-right: auto; }
.gal-visit-lede { margin: 0 0 32px; font-size: 18px; color: #e6d9c4; }
.gal-visit .xp-visit-actions { justify-content: center; }
.gal-visit::after { background: radial-gradient(ellipse at center, rgba(22, 14, 7, 0.72), rgba(22, 14, 7, 0.95)); }

/* ---------- Responsive ---------- */

@media (max-width: 899px) {
  .gal-hero { min-height: 88vh; align-items: flex-end; }
  .gal-hero-cols { left: 0; right: 0; width: auto; padding: 0 12px; gap: 10px; opacity: 0.6; }
  .gal-col { gap: 10px; }
  .gal-col img { border-radius: 12px; }
  .gal-hero-shade { background: linear-gradient(180deg, rgba(22, 14, 7, 0.55), rgba(22, 14, 7, 0.35) 30%, rgba(22, 14, 7, 0.88) 62%, var(--ab-night)); }
  .gal-hero-copy { padding-bottom: 60px; }
  .gal-hero-copy > * { max-width: 560px; }
  .gal-bar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .gal-hint { display: none; }
  .gal-photos .ab-gfilters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--xp-gutter));
    padding: 2px var(--xp-gutter);
  }
  .gal-photos .ab-gfilters::-webkit-scrollbar { display: none; }
  .gal-photos .ab-gfilter { flex: 0 0 auto; }
  .gal-photos .ab-mosaic { grid-auto-rows: 170px; gap: 10px; }
}
@media (max-width: 480px) {
  .gal-photos .ab-mosaic { grid-auto-rows: 150px; }
  .gal-photos .ab-tile { border-radius: 14px; }
  .gal-photos .ab-tile figcaption { left: 12px; right: 12px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .gal-rise { animation: none; }
  body:has(#ab-nav.ab-nav-hidden) .gal-bar { top: 58px; transition: none; }
  .gal-photos .ab-tile:not(.is-entering) { animation: none; }
}
