/* ==========================================================================
   Block: gallery-carousel — the Photography feature (src/blocks/gallery-carousel.html)
   Figma "Photography" 5041:2 at 1920 (page y):
     eyebrow  x106 y1275            title  x106 y1326 (48px Blauer Nue Regular, 59 box) → 26 under the eyebrow
     rule     x103 y1427, 125×2     → 42 under the title box
     controls right edge x1820, top y1344 (18 under the title top): filter 254×46 · prev 66×46 · next 66×46, 10 apart
     track    y1469 → 41 under the rule; 778 tall; photos from x109, 31px gaps, bleeding off the right edge
     CTA      290×46 green pill, right edge x1820, y2304 → 57 under the track
   Section padding = what is left of the Figma gaps once the neighbours' own padding is counted:
     top    hero intro bottom 1114 → eyebrow 1275 = 161, the hero keeps 120 below it → 41
     bottom CTA bottom 2350 → numbered-cards eyebrow 2497 = 147, numbered-cards keeps 70 above it → 77
   ========================================================================== */

.block-gallery-carousel {
  --gc-h: min(40.52vw, 778px);          /* the photo row: 778 at 1920 */
  --gc-gap: min(1.615vw, 31px);         /* 1276 → 1307 */
  --gc-inset: min(0.47vw, 9px);         /* the photos start at x109, 9px inside the gutter */
  padding: min(2.14vw, 41px) 0 min(4.01vw, 77px);
}

/* ---- Head: eyebrow / title + controls / rule ---------------------------------- */
.block-gallery-carousel__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "eyebrow  eyebrow"
    "title    controls"
    "rule     rule";
  align-items: start;
}
.block-gallery-carousel__eyebrow { grid-area: eyebrow; margin-left: 6px; }   /* dot x106 */
.block-gallery-carousel__title {
  grid-area: title;
  margin: 26px 0 0 6px;                 /* eyebrow bottom 1300 → title 1326; x106 */
  font-family: var(--font-display);
  font-weight: 400;                     /* Blauer Nue Regular, sentence case */
  font-size: 48px;
  line-height: 1.23;                    /* 59px box */
}
.block-gallery-carousel__rule {
  grid-area: rule;
  margin: 42px 0 0 3px;                 /* title bottom 1385 → line 1427; x103 */
  border-top-width: 2px;
}

/* ---- Controls: filter pill + prev / next ---------------------------------------- */
.block-gallery-carousel__controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 44px 0 -46px;                 /* 26 (the title's margin) + 18: pill top 1344; the negative bottom keeps the
                                           pills (1344→1390) from growing the title row, so the rule stays at 1427 */
}
.block-gallery-carousel__filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 254px;                     /* grows for a long term name ("Professional services") */
  height: 46px;
  padding: 0 22px;                      /* "Filter" at x1436; the arrow ends 22 from the right */
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 1;
  text-transform: capitalize;
  white-space: nowrap;
  transition: background-color .25s ease;
}
.block-gallery-carousel__filter:hover { background: rgba(99, 249, 162, .1); }
.block-gallery-carousel__filter:has(select:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.block-gallery-carousel__filter-icon { flex: 0 0 auto; width: 12px; height: 17px; color: var(--accent); }
/* The real control: a native select stretched invisibly over the pill (native keyboard / screen-reader /
   phone picker); the pill's label mirrors the chosen option. */
.block-gallery-carousel__select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: inherit;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  font-size: 16px;                      /* ≥16 so iOS never zooms on focus */
  cursor: pointer;
}

.block-gallery-carousel__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 46px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent);
  transition: background-color .25s ease, color .25s ease;
}
.block-gallery-carousel__arrow svg { width: 34px; height: 14px; }
.block-gallery-carousel__arrow--prev svg { transform: scaleX(-1); }
.block-gallery-carousel__arrow:hover,
.block-gallery-carousel__arrow:focus-visible { background: var(--accent); color: var(--black); }
.block-gallery-carousel__arrow:disabled { opacity: .35; cursor: default; }
.block-gallery-carousel__arrow:disabled:hover { background: transparent; color: var(--accent); }

/* ---- Track: a full-bleed scroll-snap row (under both gutters) ------------------- */
.block-gallery-carousel__stage {
  margin: 40px calc(var(--gutter) * -1) 0;   /* rule bottom 1429 → photos 1469 */
}
.block-gallery-carousel__track {
  position: relative;                   /* the script reads each slide's offsetLeft against it */
  display: flex;
  align-items: flex-start;
  gap: var(--gc-gap);
  padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--gc-inset));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: calc(var(--gutter) + var(--gc-inset));
  overscroll-behavior-x: contain;       /* a sideways trackpad swipe at either end never navigates back / forward */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  transition: opacity .28s ease;        /* = js/shared/photo-filter.js SWAP_MS */
}
.block-gallery-carousel__track::-webkit-scrollbar { display: none; }
.block-gallery-carousel__track.is-swapping { opacity: 0; }
.block-gallery-carousel__track:focus-visible { outline-offset: -2px; }
@media (pointer: fine) { .block-gallery-carousel__track { cursor: grab; } }
.block-gallery-carousel__track.is-dragging {        /* js: mouse drag — snap off while the pointer drags */
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}
.block-gallery-carousel__item {
  flex: 0 0 auto;
  height: var(--gc-h);
  background: #1a1a1a;                  /* while the lazy photo loads */
  scroll-snap-align: start;
}
.block-gallery-carousel__item[hidden] { display: none; }
.block-gallery-carousel__photo {
  width: auto;                          /* from the width/height attributes' aspect ratio */
  max-width: none;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}

/* ---- CTA: green pill under the track, right-aligned ----------------------------- */
.block-gallery-carousel__foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 57px;                     /* track bottom 2247 → pill 2304 */
}
.block-gallery-carousel__cta {
  --wipe-fill: var(--bg);               /* filled green pill: the reverse wipe (css/base.css .btn--wipe) */
  --wipe-txt: var(--accent);
  gap: 20px;
  min-width: 290px;
  padding: 0 24px 0 20px;               /* label x1550, arrow ends 1796 */
  justify-content: space-between;
}
.block-gallery-carousel__cta:hover,
.block-gallery-carousel__cta:focus-visible { --wipe-edge: var(--accent); }
.block-gallery-carousel__cta svg { flex: 0 0 auto; width: 26px; height: 15px; }

/* ---- Tablet: the controls drop under the rule ----------------------------------- */
@media (max-width: 1024px) {
  .block-gallery-carousel__head {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "eyebrow" "title" "rule" "controls";
  }
  .block-gallery-carousel__controls { margin: 32px 0 0; flex-wrap: wrap; }
  .block-gallery-carousel__stage { margin-top: 32px; }
  .block-gallery-carousel__foot { margin-top: 40px; }
}

/* ---- Mobile (derived — Mobile Category 4148:2776 language, 402 wide) --------------
   20px gutters · 16px eyebrow → 36px title → 64px rule → full-width filter pill → a 250px swipe track
   (the next photo peeks; no arrows) → the CTA pill full width. */
@media (max-width: 640px) {
  .block-gallery-carousel {
    --gc-h: min(62vw, 250px);
    --gc-gap: 12px;
    --gc-inset: 0px;
    padding: 46px 0 48px;
  }
  .block-gallery-carousel__eyebrow { margin-left: 0; }
  .block-gallery-carousel__title { margin: 12px 0 0; font-size: 36px; line-height: 1.222; }
  .block-gallery-carousel__rule { width: 64px; margin: 28px 0 0; }
  .block-gallery-carousel__controls { margin: 28px 0 0; }
  .block-gallery-carousel__filter { flex: 1 1 auto; min-width: 0; font-size: 20px; }
  .block-gallery-carousel__arrow { display: none; }
  .block-gallery-carousel__stage { margin-top: 24px; }
  /* a landscape is capped at 82vw (a gentle centre crop, ≈4:3) so the next photo always peeks */
  .block-gallery-carousel__item { max-width: 82vw; }
  .block-gallery-carousel__photo { width: 100%; }
  .block-gallery-carousel__foot { margin-top: 32px; }
  .block-gallery-carousel__cta { width: 100%; min-width: 0; height: 46px; font-size: 20px; }
}
