/* ============================================================
   gallery.css — GallerySection

   White background (color-surface-page). Standalone section —
   no ClayBackground dependency, no z-index stacking concerns.

   Three layouts:
   - Desktop (≥ 1360px):  3-col × 2-row grid
   - Tablet  (768–1359px): 2-col × 3-row grid
   - Mobile  (< 768px):   horizontal scroll row, fixed-size photos

   All spacing via token variables. Token mode handles
   desktop ↔ mobile value switches automatically.
   Only structural layout changes need explicit media queries.
   ============================================================ */


/* ============================================================
   GallerySection — outer container
   Vertical flex column. Children fill full width.
   Padding-top and gap both: space-layout-2xl (100px desktop / 44px mobile).
   overflow: hidden clips the mobile horizontal scroll row.
   ============================================================ */

.gallery-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-layout-2xl);
  padding-top: var(--space-layout-2xl);
  background-color: var(--color-surface-page);
  box-sizing: border-box;
  overflow: hidden;
}


/* ============================================================
   GalleryHeading
   Text style: Heading/Display — Alphabet Soup Regular
     Desktop/tablet: 96px (--type-size-display)
     Mobile: 40px   (token override)
   Desktop + tablet: centred.
   Mobile: left-aligned.
   Padding L/R: space-layout-2xl (100px desktop / 44px mobile).
   ============================================================ */

.gallery-heading {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: var(--space-layout-2xl);
  padding-right: var(--space-layout-2xl);
  box-sizing: border-box;
}

.gallery-heading__text {
  font-family: var(--type-family-display);
  letter-spacing: 0.03em;
  font-size: var(--type-size-display);
  font-weight: var(--type-weight-regular);
  line-height: 1;
  color: var(--color-text-default);
  margin: 0;
}

@media (max-width: 767px) {
  .gallery-heading {
    justify-content: flex-start;
  }
}


/* ============================================================
   GalleryGrid
   CSS Grid, fills full section width.
   Padding L/R differs from GalleryHeading — intentional (per design).

   Desktop:  3-col, gap space-layout-lg (44px), padding space-layout-xl (80px)
   Tablet:   2-col, gap space-layout-md (20px), padding space-layout-md (20px)
   Mobile:   flex row, overflow-x: auto, padding space-layout-md (20px)
   ============================================================ */

.gallery-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-layout-lg);
  padding-left: var(--space-layout-xl);
  padding-right: var(--space-layout-xl);
  box-sizing: border-box;
}

/* Tablet: 2-column layout */
@media (max-width: 1359px) and (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-layout-md);
    padding-left: var(--space-layout-md);
    padding-right: var(--space-layout-md);
  }
}

/* Mobile: horizontal scroll row */
@media (max-width: 767px) {
  .gallery-grid {
    display: flex;
    flex-direction: row;
    gap: var(--space-layout-md);
    padding-left: var(--space-layout-md);
    padding-right: var(--space-layout-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / Edge */
  }

  .gallery-grid::-webkit-scrollbar {
    display: none;                /* Chrome / Safari */
  }
}


/* ============================================================
   GalleryPhoto
   border-radius: 16px (--radius-card), overflow: hidden clips image.
   Inner <img> fills via object-fit: cover.

   Desktop/tablet: landscape aspect ratio (443 / 301 ≈ 1.47 : 1).
                   Width is responsive — fills grid column.
   Mobile: square fixed at 274 × 274px.
   ============================================================ */

.gallery-photo {
  border-radius: var(--radius-card);
  overflow: hidden;
  aspect-ratio: 443 / 301;
  width: 100%;
  box-shadow: var(--shadow-photo);
}

.gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile: fixed square */
@media (max-width: 767px) {
  .gallery-photo {
    flex: 0 0 274px;
    width: 274px;
    height: 274px;
    aspect-ratio: 1 / 1;
  }
}
