/* ==========================================================================
   Siegel — Layout / spacing / column tokens
   Derived from Figma auto-layout, file VjTi5A18yB4EYm0h3k1lPL, 2026-07-29.

   THERE IS NO LAYOUT GRID IN THE FIGMA FILE.
   getLocalGridStyles() = []  and zero frames carry layoutGrids.
   Every column width below is DERIVED from measured auto-layout geometry,
   not read off a grid. Treat this file as the grid system of record.
   ========================================================================== */

:root{

  /* --- Page frame -------------------------------------------------------- */
  --page-w:1440px;          /* desktop design frame */
  --page-w-mobile:393px;    /* mobile design frame */

  /* --- Gutters -----------------------------------------------------------
     Per-section by design. This is a bespoke layout, not a framework — each
     section keeps its own gutter. Reproduce as-is, do not harmonise. */
  --gutter:40px;            /* standard body sections */
  --gutter-footer:60px;     /* footer + partners strip */
  --gutter-feature:36px;    /* "We Only Supply the Best" 63:2700 */
  --content-w:1360px;       /* 1440 - 40 - 40 */
  --content-w-footer:1320px;/* 1440 - 60 - 60 */
  --content-w-feature:1368px;/* 1440 - 36 - 36 */

  /* --- Section rhythm ---------------------------------------------------- */
  --section-py:64px;        /* standard vertical padding */
  --section-py-cta:80px;    /* CTA Banner only */
  --section-gap:72px;       /* heading block -> content */

  /* --- Spacing scale ------------------------------------------------------
     Ranked by actual frequency in the file. */
  --sp-1:4px;
  --sp-2:8px;
  --sp-3:10px;
  --sp-4:12px;
  --sp-5:16px;
  --sp-6:24px;
  --sp-7:30px;
  --sp-8:32px;
  --sp-9:40px;
  --sp-10:48px;
  --sp-11:60px;
  --sp-12:64px;
  --sp-13:72px;
  --sp-14:80px;

  /* Off-scale values that are real and must be reproduced exactly.
     9.0 appears 28 times as 8.971912384033203 / 8.971707344055176 —
     a scaled component. Use 9px unless the client eyeballs a difference. */
  --sp-card-y:13px;         /* product card container padding-block */
  --sp-card-x:14px;         /* product card container padding-inline */
  --sp-badge:9px;           /* was 8.9719... x28 — see BUG-20 */

  /* --- Corner radii ------------------------------------------------------- */
  --r-sm:2px;               /* dominant, x31 */
  --r-md:4px;               /* drifted to 4.008 / 4.42 in places — BUG-20 */
  --r-lg:6px;
  --r-circle:150px;
  --r-pill:9999px;          /* Figma reports 16777200 = its "fully rounded" sentinel */
}

/* ==========================================================================
   CONTAINER
   ========================================================================== */

.container{
  width:calc(100% - (2 * var(--gutter)));
  max-width:var(--content-w);
  margin-inline:auto;
  padding-inline:var(--gutter);
  box-sizing:content-box; /* so max-width stays 1360 CONTENT, not 1360 total */
}
.container--footer{max-width:var(--content-w-footer); padding-inline:var(--gutter-footer)}

.section{padding-block:var(--section-py)}
.section__inner{display:flex; flex-direction:column; gap:var(--section-gap)}

/* ==========================================================================
   COLUMN SYSTEMS — one per section. Verified against measured geometry.
   ========================================================================== */

/* --- 1. Category row carousel  (372:14375) -------------------------------
   Track 1360 visible. Cards 348 wide, gap 32, pitch 380 (348+32 ✓).
   4 x 348 + 3 x 32 = 1488 > 1360 — intentionally overflows. Scroller. */
.cat-row{
  display:flex; gap:32px;
  overflow-x:auto; scroll-snap-type:x mandatory;
  overscroll-behavior-x:contain;
}
.cat-row__card{flex:0 0 348px; scroll-snap-align:start; padding-top:32px}
.cat-row__card .card__image{width:348px; aspect-ratio:1} /* 348 x 348 square */
.cat-row__card .card__bar{height:42px; padding-inline:32px}

/* --- 2. Technologies grid reference (205:22937) ---------------------------
   3 cols, card 433.3, gap 30, pitch 463.3. Kept as a spec comment only — the
   actual component (template-parts/home/technologies.php) uses its own
   .technologies__grid class. A same-named .cat-grid rule here previously
   collided with the unrelated, actively-used .cat-grid on the shop/category
   product listing (template-parts/category/product-section.php), turning it
   into a 3-column grid and squashing the product grid down to 1/3 width. */

/* --- 3. Feature pair  (63:2700) ------------------------------------------
   2 cards 668 wide, gap 30, pitch 698 (668+30 ✓).
   This section uses a 36px gutter / 1368 content width by design — it is NOT
   aligned to the 1360 sections. Reproduce as-is. */
.feature-pair-section{padding-inline:var(--gutter-feature)}
.feature-pair{
  max-width:var(--content-w-feature); margin-inline:auto;
  display:grid; grid-template-columns:repeat(2,1fr); gap:30px;
}
.feature-pair__card{aspect-ratio:668 / 594}

/* --- 4. Bestsellers product row  (89:5526) -------------------------------
   *** READ THIS. Figma's panel says gap: 24. THAT VALUE IS DEAD. ***
   The frame is primaryAxisAlignItems: SPACE_BETWEEN, so itemSpacing is
   ignored. Measured card positions: 0, 348.3, 696.7, 1045 -> pitch 348.33.
   Card is 315 wide, so the REAL gap is 33.333px, not 24.
     4 x 315 = 1260;  1360 - 1260 = 100;  100 / 3 = 33.333 ✓
   Building this with gap:24 leaves the 4th card ~28px short of the right
   edge and misaligns it against every other section. */
.product-row{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:33.3333px;      /* NOT 24 */
  /* equivalent: grid-template-columns:repeat(4,315px); justify-content:space-between */
}
.product-row__card{width:315px}
.product-row__card .card__media{
  height:428px; padding:var(--sp-card-y) var(--sp-card-x);
}
.product-row__card .card__meta{margin-top:12px; display:flex; flex-direction:column; gap:4px}

/* --- 5. Projects slider  (618:9217) --------------------------------------
   Viewport 1360 at x=40. Inner track 2565.5 wide, 6 cells, cell gap 12.
   Wrapper padding 2/0/72/0. Slider padding 0/40/24/0.
   Pagination is 56 wide, centred on the 1440 frame: (1440-56)/2 = 692 ✓ */
.projects{padding-block:2px 72px}
.projects__viewport{
  max-width:var(--content-w); margin-inline:auto;
  overflow-x:auto; padding:0 40px 24px 0;
  scroll-snap-type:x mandatory; overscroll-behavior-x:contain;
}
.projects__track{display:flex; gap:0} /* pair gap sits on .projects__image-card - see home.css */
.projects__dots{width:56px; margin-inline:auto; display:flex; gap:2.9px; align-items:center}
.projects__dots .is-active{width:29.5px; height:5.9px; border-radius:var(--r-pill)}
.projects__dots span{width:5.9px; height:5.9px; border-radius:50%}

/* --- 6. CTA Banner  (83:3507) --------------------------------------------
   Section padding 80/40. Inner 1360 with padding-block 48.
   Content column 848 wide, centred: (1360-848)/2 = 256 ✓ */
.cta{padding:var(--section-py-cta) var(--gutter)}
.cta__inner{max-width:var(--content-w); margin-inline:auto; padding-block:48px}
.cta__col{max-width:848px; margin-inline:auto; display:flex; flex-direction:column; gap:16px}
.cta__actions{display:flex; justify-content:center; gap:16px}

/* --- 7. Footer  (263:18610) ----------------------------------------------
   Uses 60px gutters, not 40. Newsletter bar padding 38/60/23/60.
   Main block padding-block 64 / 128. Legal bar padding 24/60. */
.footer__newsletter{padding:38px var(--gutter-footer) 23px; display:flex; gap:10px}
.footer__newsletter-label{width:480px; padding-bottom:16px}
.footer__newsletter-form{width:786px; display:flex; gap:12px}
.footer__main{padding-block:64px 128px}
.footer__row{padding-left:var(--gutter-footer)}
.footer__legal{padding:24px var(--gutter-footer)}
.footer__legal-row{display:flex; flex-wrap:wrap; gap:48px}

/* --- 8. Nav (328:33112) — real implementation lives in header.css
   (.header-secondary / .header-primary / .header-primary__inner). This was
   an early scaffold with class names never adopted; its .site-header rule
   collided with the real fixed header and inflated its height. Removed. */

/* ==========================================================================
   RESPONSIVE
   Figma defines only 1440 and 393. Everything between is standard fluid
   behaviour: fixed pixel columns become fractions, multi-column collapses in
   the obvious order, gutters step down. No new design decisions.

   Breakpoints:
     >= 1440   design width, values exactly as designed
     1024-1439 fluid — container shrinks, columns stay proportional
     768-1023  tablet — 4-col becomes 2-col, 3-col becomes 2-col
     394-767   large phone — everything single or 2-col, mobile card
     <= 393    mobile design width, values exactly as designed
   ========================================================================== */

/* Fluid desktop — nothing collapses, container just narrows */
@media (max-width:1439px){
  .container{
    width:calc(100% - (2 * var(--gutter)));
    max-width:var(--content-w);
  }
  .feature-pair,.projects__viewport,.cta__inner{max-width:100%}
  .cat-row__card{flex:0 0 clamp(280px,24vw,348px)}
  .product-row__card{width:auto}
}

/* Tablet */
@media (max-width:1023px){
  :root{ --gutter:32px; --gutter-footer:32px; --gutter-feature:32px; --section-py:48px; --section-gap:48px; }
  .cat-grid{grid-template-columns:repeat(2,1fr)}
  .product-row{grid-template-columns:repeat(2,1fr); gap:24px}
  .feature-pair{grid-template-columns:1fr}
  .footer__newsletter{flex-direction:column}
  .footer__newsletter-label,.footer__newsletter-form{width:100%}
  .site-header__menu{display:none} /* hamburger takes over — see 263:19295-19299 */
}

/* Large phone */
@media (max-width:767px){
  :root{ --gutter:16px; --gutter-footer:16px; --gutter-feature:16px; --section-py:40px; --section-gap:32px; }
  .cat-grid,.feature-pair{grid-template-columns:1fr}
  .product-row{grid-template-columns:repeat(2,1fr); gap:12px}
  .cat-row__card{flex:0 0 280px}
  .cta__col{max-width:100%}
  .cta__actions{flex-direction:column}
  .footer__legal-row{gap:24px}
  /* hero unpins — fixed full-bleed video repaints on iOS address-bar resize */
  .hero{position:static; height:auto}
  .site-body{margin-top:0}
}

/* Mobile design width — 393. Values exactly as designed. */
@media (max-width:393px){
  :root{ --content-w:361px; }
}

/* ── Anchor links ────────────────────────────────────────────────────────────
   In-page jumps ease rather than teleport. Landing on a URL that already has a
   hash is still instant, which is correct - there is no "from" position to
   animate out of.

   --anchor-offset is the clearance above a target once it lands, and it has to
   clear the header.

   The header is fixed from 768px up and 151px tall at rest; once the page has
   scrolled at all, header.js tucks the ~30px utility bar and 121px of it stays
   over the viewport. Any anchor jump has scrolled by definition, so 121 is the
   state that matters - 136 clears it with a little air above the heading.

   Below 768px overrides.css makes the header position:absolute, so it scrolls
   away with the page and covers nothing. A large offset there would just open a
   gap, hence the smaller value.

   This is the single place to change it. Do not add per-section margins.
   ---------------------------------------------------------------------------- */

:root {
  /* Mobile default: header scrolls away, so this is breathing room only. */
  --anchor-offset: 24px;
}

@media (min-width: 768px) {
  :root {
    --anchor-offset: 136px;
  }
}

html {
  scroll-behavior: smooth;
}

/* Not :target. anchors.js writes the hash with pushState so the address bar
   stays honest, and pushState does not update :target - the rule never matched
   and sections landed 11px above the fold, slightly clipped.
   Scoped to section-level anchors rather than every [id]: scroll-margin also
   applies to scrollIntoView elsewhere in the theme, and a blanket [id] rule
   would nudge the search overlay's option list as it scrolls through results. */
section[id],
[data-anchor-target] {
  scroll-margin-top: var(--anchor-offset);
}

/* No focus ring on a landed section, in either state.
   anchors.js focuses the target so the keyboard and screen readers carry on
   from there, but the target is a whole page section given tabindex="-1" purely
   as a destination - it is not a control. --btn-stroke-focused is red, so the
   ring this used to draw was a 2px red rectangle around the full width of the
   section, which reads as a rendering fault rather than a focus indicator.
   The scroll itself is the "you are here", and WCAG 2.4.7 governs interactive
   elements, not scroll destinations. */
[data-anchor-landed]:focus,
[data-anchor-landed]:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
