/*
 * gallery.css — Gallery grid tiles & lightbox
 */

/* ── Teaser section (homepage) ─────────────────────────────────── */

.gallery-teaser__eyebrow {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--clr-accent);
  margin-bottom: var(--space-2);
  text-align: center;
}

/* Base font styling shared with other section titles - css/layout.css */
.gallery-teaser__title {
  text-align: center;
  margin-bottom: var(--space-8);
}

.gallery-teaser__actions {
  text-align: center;
  margin-top: var(--space-8);
}

/* ── Section titles (full gallery page) ────────────────────────── */

/* Base font styling shared with other section titles - css/layout.css */
.gallery-section__title {
  margin-bottom: var(--space-6);
}

.gallery-section__title:not(:first-child) {
  margin-top: var(--space-12);
}

/* ── Grid (shared by teaser + full gallery page) ───────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-6);
}

.gallery-tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
}

.gallery-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-fast) var(--ease-out);
}

.gallery-tile:hover .gallery-tile__img {
  transform: scale(1.04);
}

.gallery-tile__title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.gallery-tile:hover .gallery-tile__title {
  opacity: 1;
}

.gallery-tile__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
}

/* ── Lightbox ───────────────────────────────────────────────────── */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: var(--space-6);
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox__content {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 85vh;
  width: 100%;
}

.gallery-lightbox__content img,
.gallery-lightbox__content iframe {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  margin: 0 auto;
  border: 0;
  border-radius: var(--radius-sm);
}

.gallery-lightbox__content iframe {
  aspect-ratio: 16 / 9;
  height: auto;
}

.gallery-lightbox__caption {
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  font-size: var(--text-sm);
  margin-top: var(--space-3);
}

.gallery-lightbox__close,
.gallery-lightbox__prev,
.gallery-lightbox__next {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: var(--text-2xl);
  cursor: pointer;
  line-height: 1;
  padding: var(--space-2);
}

.gallery-lightbox__close {
  top: calc(-1 * var(--space-10));
  right: 0;
}

.gallery-lightbox__prev {
  left: calc(-1 * var(--space-12));
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox__next {
  right: calc(-1 * var(--space-12));
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 700px) {
  .gallery-lightbox__prev { left: var(--space-1); }
  .gallery-lightbox__next { right: var(--space-1); }
  .gallery-lightbox__close { top: var(--space-1); right: var(--space-1); }
}
