/* Gallery — matched to live cloudyummy.com/gallery (Playwright compare, Chrome) */

.page-gallery {
  --gallery-column-gap: 14px;
  background: var(--color-gallery-page-bg);
}

/* ---- Hero: same wash as body (Square gallery) ---- */
.gallery-page__hero {
  background: var(--color-gallery-page-bg);
  padding: clamp(2.25rem, 5vw, 3.25rem) var(--space-lg) clamp(1.5rem, 3vw, 2rem);
  text-align: center;
  border-bottom: 1px solid var(--color-black-06);
}

.gallery-page__hero-inner {
  max-width: 40rem;
  margin-inline: auto;
}

.gallery-page__label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  margin: 0 0 0.875rem;
}

.gallery-page__hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 3.8vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--color-text-strong);
  margin: 0 0 0.5rem;
}

.gallery-page__kicker {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 600;
  color: var(--color-text-subtle);
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

.gallery-page__intro {
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 1.8vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text-secondary);
  margin: 0 auto;
  max-width: 34rem;
}

/* ---- Photo collage (bento grid): large hero tile + smaller tiles, repeats every 6 photos ---- */
.gallery-page__mosaic {
  padding: clamp(0.75rem, 2vw, 1.25rem) 0 clamp(2.5rem, 5vw, 4rem);
  background: var(--color-gallery-page-bg);
}

.gallery-page__wrap {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(0.75rem, 2.4vw, 1.5rem);
}

.gallery-page__wrap--collage {
  max-width: min(1240px, 100%);
}

/* Mobile: single column, natural image height */
.gallery-page__collage--bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gallery-column-gap);
  align-items: stretch;
}

.gallery-page__cell {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-gallery-cell-bg);
  box-shadow:
    0 1px 0 var(--color-white-65) inset,
    0 4px 14px var(--color-black-07);
  min-height: 0;
}

.gallery-page__cell img {
  width: 100%;
  height: auto;
  vertical-align: middle;
  display: block;
}

/* Tablet + desktop: images fill tile (object-fit) for collage crop */
@media (min-width: 700px) {
  .gallery-page__collage--bento > .gallery-page__cell {
    position: relative;
    height: 100%;
    min-height: 0;
  }

  .gallery-page__collage--bento > .gallery-page__cell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
}

/* Tablet: 6-column bento (same proportions as desktop 12-col, halved) */
@media (min-width: 700px) and (max-width: 1023px) {
  .gallery-page__collage--bento {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-flow: dense;
    /* Fixed tracks so row spans + absolute imgs layout reliably */
    grid-auto-rows: 11.5rem;
    gap: clamp(10px, 1.8vw, 14px);
  }

  /* Hero + stack + row of three, repeated */
  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 1) {
    grid-column: span 4;
    grid-row: span 2;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 2) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 3) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 4) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 5) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 6) {
    grid-column: span 2;
    grid-row: span 1;
  }
}

/* Desktop: 12-column collage */
@media (min-width: 1024px) {
  .gallery-page__collage--bento {
    grid-template-columns: repeat(12, 1fr);
    grid-auto-flow: dense;
    grid-auto-rows: 12.5rem;
    gap: clamp(12px, 1.6vw, 18px);
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 1) {
    grid-column: span 8;
    grid-row: span 2;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 2) {
    grid-column: span 4;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 3) {
    grid-column: span 4;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 4) {
    grid-column: span 4;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 5) {
    grid-column: span 4;
    grid-row: span 1;
  }

  .gallery-page__collage--bento > .gallery-page__cell:nth-child(6n + 6) {
    grid-column: span 4;
    grid-row: span 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .gallery-page__cell {
    transition: box-shadow 0.25s ease, transform 0.25s ease;
  }

  .gallery-page__cell:hover {
    box-shadow:
      0 1px 0 var(--color-white-75) inset,
      0 14px 36px var(--color-black-12);
    transform: translateY(-3px);
    z-index: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page__cell:hover {
    transform: none;
  }
}
