/* Photo galleries for the About page.
 *
 * Deliberately a separate stylesheet rather than an addition to style.css:
 * style.css is versioned by ?v=<md5> on every page of the site, so touching it
 * rewrites the asset URL in all 474 pages and forces a full re-upload. This
 * file is loaded by about.html only, and non-hashed assets are served
 * no-cache/must-revalidate, so edits here propagate without a version bump.
 *
 * Uses the design tokens from style.css (--brand, --r-card, --sh-sm, ...).
 */

/* ---------------------------------------------------------------- sections */

.galsec-title { text-align: center; margin-left: auto; margin-right: auto; }

.galsec-intro {
  text-align: center;
  margin: 0 auto 28px;
  max-width: 70ch;
}

/* ------------------------------------------------------------------ track */

.gal-track {
  list-style: none;
  margin: 0;
  padding: 2px 2px 8px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gal-track::-webkit-scrollbar { display: none; }

.gal-track > li {
  flex: 0 0 calc((100% - 32px) / 3);
  min-width: 0;
  scroll-snap-align: start;
}

.gal-item {
  display: block;
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-soft);
  box-shadow: var(--sh-sm);
  cursor: zoom-in;
  transition: box-shadow .25s ease, transform .25s ease;
}
.gal-item:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }

.gal-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform .5s ease;
}
.gal-item:hover img { transform: scale(1.045); }

/* -------------------------------------------------------------- navigation */

.gal-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.gal-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--brand);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--sh-xs);
  transition: background .2s, color .2s, border-color .2s, opacity .2s;
}
.gal-btn:hover:not([disabled]) {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.gal-btn[disabled] {
  opacity: .32;
  cursor: default;
}
.gal-btn svg { width: 18px; height: 18px; display: block; }

/* --------------------------------------------------------------- lightbox */

.lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 28px 20px 22px;
  background: rgba(4, 18, 32, .93);
  backdrop-filter: blur(3px);
}
.lb.open { display: grid; }

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 0;
}

.lb img {
  max-width: min(1180px, 92vw);
  max-height: 74vh;
  width: auto;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  background: #0b1a28;
}

.lb-cap {
  color: #d7e3ee;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  max-width: 70ch;
}

.lb-count {
  color: #8fa6ba;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

/* buttons float over the image */
.lb-close,
.lb-arrow {
  position: absolute;
  border: 0;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .2s;
}
.lb-close:hover,
.lb-arrow:hover { background: rgba(255, 255, 255, .26); }

.lb-close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
}
.lb-close svg { width: 20px; height: 20px; display: block; }

.lb-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}
.lb-arrow svg { width: 24px; height: 24px; display: block; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

body.lb-open { overflow: hidden; }

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .gal-track > li { flex: 0 0 calc((100% - 16px) / 2); }
}

@media (max-width: 620px) {
  .gal-track { gap: 12px; }
  .gal-track > li { flex: 0 0 84%; }
  .gal-btn { width: 40px; height: 40px; }
  .lb { padding: 14px 12px 16px; }
  .lb img { max-height: 62vh; border-radius: var(--r-sm); }
  .lb-arrow { width: 42px; height: 42px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-close { top: 10px; right: 10px; width: 40px; height: 40px; }
}

/* ---------------------------------------------------------- card rows --- */

/* Card rows directly inside the page sections are set to equal height, so
   every row of cards lines up along both the top and the bottom edge even
   when the paragraphs inside them differ in length. This stylesheet is only
   loaded by about.html and es/about.html, so the rule is page-scoped; the
   site-wide grid default in style.css (align-items: start) is left untouched
   and the footer grid is not affected. */
.wrap > section > .grid.grid-2,
.wrap > section > .grid.grid-3,
.wrap > section > .grid.grid-4 { align-items: stretch; }
