/* Slamena Buda - galeria page.

   Loaded only by slamenabuda-gallery.twig (via head_extra), not site-wide, so
   the homepage does not pay for the lightbox styles.

   Reuses the tokens from slamenabuda.css. No data-aos fade-left/fade-right
   anywhere (mobile horizontal overflow rule). */

.gallery-full {
  padding: 120px 0 100px;
  background: var(--paper);
}

.gallery-full .section-head h1,
.gallery-full .section-head h2 {
  font-size: clamp(33px, 4vw, 52px);
  margin-top: 18px;
}

/* ---------- ALBUM JUMP NAV ---------- */
/* Same pill treatment as the menu page, so the two long pages feel related. */
.gal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 42px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.gal-nav a {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 15px;
  background: var(--paper-2);
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}

.gal-nav a:hover,
.gal-nav a:focus-visible {
  color: var(--brown);
  border-color: var(--straw-deep);
  background: var(--paper-3);
}

/* ---------- ALBUMS ---------- */
.gal-album {
  margin-top: 62px;
  /* Offset for the fixed header so an anchor jump does not hide the title. */
  scroll-margin-top: 96px;
}

.gal-album-title {
  font-size: clamp(24px, 2.6vw, 32px);
  padding-bottom: 14px;
  border-bottom: 2px solid var(--straw-deep);
}

.gal-album-desc {
  margin-top: 14px;
  color: var(--ink-soft);
  max-width: 62ch;
}

/* ---------- TILES ---------- */
/* Uniform 4:3 tiles. The source photos mix 1600x900 landscapes with 480x640
   phone portraits; letting each keep its own ratio makes the grid lurch, so the
   tile crops and the lightbox shows the photo uncropped. aspect-ratio fixes the
   box before the image loads, so lazy loading causes no layout shift. */
.gal-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.gal-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper-3);
  cursor: zoom-in;
  /* A button, so it is keyboard reachable and announces itself. */
  appearance: none;
}

.gal-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .9s var(--ease);
}

.gal-tile:hover img,
.gal-tile:focus-visible img {
  transform: scale(1.06);
}

.gal-tile:focus-visible {
  outline: 2px solid var(--straw-deep);
  outline-offset: 3px;
}

/* ---------- LIGHTBOX ---------- */
body.gal-lb-open {
  overflow: hidden;
}

.gal-lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(42, 20, 9, .93);
  backdrop-filter: blur(3px);
}

.gal-lb[hidden] {
  display: none;
}

.gal-lb-fig {
  margin: 0;
  max-width: min(1200px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.gal-lb-fig img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--r);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.gal-lb-fig figcaption {
  color: var(--paper);
  font-size: 14px;
  letter-spacing: .02em;
  text-align: center;
  opacity: .85;
}

.gal-lb-close,
.gal-lb-nav {
  flex: none;
  border: 1px solid rgba(246, 241, 229, .3);
  background: rgba(246, 241, 229, .08);
  color: var(--paper);
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}

.gal-lb-close:hover,
.gal-lb-nav:hover,
.gal-lb-close:focus-visible,
.gal-lb-nav:focus-visible {
  background: rgba(246, 241, 229, .2);
  border-color: var(--straw);
}

.gal-lb-nav {
  width: 48px;
  height: 48px;
  font-size: 30px;
}

.gal-lb-close {
  position: absolute;
  top: 20px;
  right: 22px;
  width: 42px;
  height: 42px;
  font-size: 26px;
}

@media (max-width: 900px) {
  .gallery-full {
    padding: 88px 0 72px;
  }

  .gal-album {
    margin-top: 48px;
  }

  .gal-tiles {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
}

@media (max-width: 560px) {
  .gal-nav {
    gap: 6px;
  }

  .gal-nav a {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* The arrow buttons would crowd the photo on a narrow screen; swipe and the
     close button cover the same ground. */
  .gal-lb-nav {
    display: none;
  }

  .gal-lb {
    padding: 16px;
  }
}
