/* =============================================================================
   16-gallery.css — Gallery page: photo grid and full-screen photo viewer
   ============================================================================= */

/* ---------- Default — page shell ---------- */

.gallery-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
}

.gallery-page__main {
  flex: 1;
  padding-block: calc(var(--header-offset, 4rem) + 2rem) 4rem;
}

.gallery-page__container {
  max-width: var(--container-max);
}

.gallery-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 2rem;
  font-size: var(--text-small);
  font-weight: var(--weight-semibold);
  color: var(--color-primary);
  text-decoration: none;
}

.gallery-page__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  font-weight: var(--weight-regular);
  line-height: 1.2;
  color: var(--color-text);
  text-align: center;
}

.gallery-page__intro {
  margin: 0 0 2rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---------- Default — tiles ---------- */

.gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap);
}

.gallery__item {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  text-align: center;
  cursor: pointer;
  color: inherit;
}

.gallery__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background: var(--color-panel);
}

.gallery__name {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  font-weight: var(--weight-regular);
  line-height: 1.2;
  color: var(--color-text);
}

/* ---------- States — hover ---------- */

.gallery-page__back:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.gallery__item:hover .gallery__photo {
  border-color: var(--color-primary);
}

/* ---------- Responsive — 576px up ---------- */

@media (min-width: 576px) {
  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Responsive — 1024px up ---------- */

@media (min-width: 1024px) {
  .gallery__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
