/* ===========================================================================
   FLUID LAYER — loaded last, after styles.css / landing*.css
   ---------------------------------------------------------------------------
   The site was built on fixed pixel rhythm: a 1280px container, 40px gutters,
   112px section padding, and type that stopped growing at laptop width. That
   produces three problems this file fixes:

     1. Big screens waste space. Everything stayed in a 1280px column on a
        1920 or 2560 monitor, so the page looked like a small site centred in
        a lot of grey.
     2. Section gaps were tuned for a laptop and read as huge gaps there and
        on anything larger.
     3. Nothing scaled between the fixed breakpoints, so sizes jumped at 980
        and 720 instead of tracking the viewport.

   The approach is one fluid scale driven by clamp(min, preferred-vw, max).
   Every value below is "never smaller than X, never larger than Y, and
   proportional to the viewport in between", which is what makes a layout
   work at 320px and at 2560px without a breakpoint for each.
   =========================================================================== */

:root{
  /* Container. Was a hard 1280px. 90vw lets it genuinely grow on a large
     monitor; the 1640px ceiling stops body text reaching an unreadable
     line length. The 1120px floor is inert on phones (a block element
     cannot exceed its parent) and only matters from ~1245px up. */
  --maxw: clamp(1120px, 92vw, 3200px);

  /* Page gutter. Was 40px desktop / 22px mobile, with a jump between. */
  --gutter: clamp(18px, 3.2vw, 56px);

  /* Vertical rhythm. Was 112px flat, 72px under 720px. 5.6vw reaches the
     104px ceiling at ~1860px, so a laptop now sits near 80px instead of
     112px — the "huge gap" — while a phone gets a tight 44px. */
  --section-y: clamp(44px, 5.2vw, 96px);
  --section-y-tight: clamp(32px, 3.8vw, 72px);

  /* Gap between blocks inside a section (grids, card rows). */
  --block-gap: clamp(20px, 2.6vw, 48px);
}

/* ---- container + rhythm ---- */
.wrap{
  max-width: var(--maxw);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
section{ padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section-tight{ padding-top: var(--section-y-tight); padding-bottom: var(--section-y-tight); }

/* ---- type: raise the ceilings so headings keep growing past a laptop ----
   The clamps already existed; they just topped out at 88/56/34px, which is
   why nothing got bigger on a larger screen. Minimums come down slightly so
   long headings stop crowding a 320px phone. */
.split-head--xl{ font-size: clamp(32px, 5.4vw, 104px); }
.split-head--lg{ font-size: clamp(26px, 4.0vw, 68px); }
.split-head--md{ font-size: clamp(21px, 2.6vw, 40px); }

/* ===========================================================================
   OVERFLOW FIXES — each one measured, not guessed
   =========================================================================== */

/* The homepage hero was cut off on every phone under ~420px.
   .hero-v2-visual sets aspect-ratio:1/.8 together with min-height:320px, so
   its min-content width resolved to 320/0.8 = 400px. A grid item's automatic
   minimum size is min-content, so that 400px became the floor for the whole
   hero grid and the copy beside it overflowed with it. min-width:0 removes
   that automatic minimum and lets the column shrink to the screen. */
.hero-v2-grid > *{ min-width: 0; }
@media (max-width: 980px){
  .hero-v2-visual{ min-height: 0; }
}

/* General safety net: any grid or flex child can do what the hero did.
   min-width:0 costs nothing and prevents the whole class of bug. */
.hero-v2-grid, .split-block, .founder-block, .section-head-row,
.export-block, .contact-grid, .lp-hero-grid, .lp-close-grid{ min-width: 0; }

/* Tables must never be able to push a layout wider than the screen.
   The site already scrolls .spec-table/.spec-mini under 860px; this caps
   them at every width and covers the landing-page comparison table too. */
table{ max-width: 100%; }
.spec-mini, .spec-table, .lp-compare{ max-width: 100%; }

/* ===========================================================================
   FOOTER — rows become a real grid
   ---------------------------------------------------------------------------
   Was fixed 1.3fr .8fr .8fr 1.2fr, stepping to 2 columns at 980 and 1 at 720.
   auto-fit + minmax lets the columns decide for themselves: four across on a
   desktop, two on a tablet, one on a phone, with no breakpoint to maintain.
   min(100%, 210px) is what stops the track overflowing a 320px screen.
   =========================================================================== */
.footer-grid--v2{
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: clamp(24px, 2.6vw, 44px);
}
/* wide screens: give the contact column room for the office address on one line */
@media (min-width: 1100px){
  .footer-grid--v2{ grid-template-columns: 1.15fr .75fr .75fr 1.6fr; }
  .footer-col .footer-address{ white-space: nowrap; }
}

/* ===========================================================================
   LANDING PAGES — same scale, their own container and section classes
   =========================================================================== */
.lp-wrap{
  max-width: var(--maxw);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.lp-section{ padding-top: var(--section-y); padding-bottom: var(--section-y); }
.lp-section--flush{ padding-bottom: 0; }
.lp-cta, .lp-close, .lp-cert{
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}
.lp-hero{ padding-top: clamp(96px, 9vw, 150px); }

/* The spec tables could still out-size their column by a few pixels at
   ~1024px, where the mobile scroll rule no longer applies. overflow-wrap
   lowers the table's min-content width, so a tight cell wraps instead of
   pushing the table wider. It only breaks when there is genuinely no room. */
.spec-mini th, .spec-mini td,
.spec-table th, .spec-table td{ overflow-wrap: anywhere; }

/* On a phone the footer link lists ran one item per row, which made the
   footer several screens tall. Two columns halves that without shrinking
   the tap targets. minmax(0,1fr) rather than 1fr so a long label wraps
   instead of widening the track. */
@media (max-width: 720px){
  .footer-col ul{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
  }
}

/* ===========================================================================
   CENTRED PAGE HEADERS
   ---------------------------------------------------------------------------
   A plain page header was pinned to the left of the container. That read fine
   at a fixed 1280px, but the fluid container above takes the page to 1640px,
   which strands the title with ~900px of empty space beside it on a large
   screen. Centring the block keeps the page composed at every width.

   Pages WITH header art (.page-header--visual: applications, quality, faq)
   are excluded on purpose: the artwork fills the right-hand side, so those
   headers are already balanced and centring them would collide with it.

   .split-head and .breadcrumb are flex rows, so they need justify-content;
   text-align alone would not move them.
   =========================================================================== */
.page-header:not(.page-header--visual) > .wrap{ text-align: center; }

.page-header:not(.page-header--visual) .breadcrumb,
.page-header:not(.page-header--visual) .split-head,
.page-header:not(.page-header--visual) .eyebrow,
.page-header:not(.page-header--visual) .catalog-kpis{
  justify-content: center;
}

/* Centred prose is hard to track back past roughly 70 characters, so cap the
   measure and centre the block itself rather than letting it run the full
   1640px. Where a paragraph carries an inline max-width, that narrower value
   wins and these auto margins still centre it. */
.page-header:not(.page-header--visual) .body,
.page-header:not(.page-header--visual) .body-lg{
  margin-left: auto;
  margin-right: auto;
  max-width: min(68ch, 100%);
}

/* ===========================================================================
   CENTRED SECTION HEADS
   ---------------------------------------------------------------------------
   A heading block that sits directly above a full-width grid has nothing to
   its right, so at 1640px it reads as stranded rather than as a deliberate
   asymmetry. These are centred; genuine two-column splits (hero, founder,
   split-block, anything with media beside the copy) are deliberately left
   alone, because there the empty side is filled by the other column.
   =========================================================================== */

/* Landing pages already shipped .lp-head--center for three of their sections.
   The other four heads all sit above full-width bodies (steps, cards, range,
   scenes), so centring them makes the page consistent instead of mixed. */
.lp-head{
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* Product catalogue: the category title, its spec tags and its intro sit
   above a full-width product grid. .category-block-head is a flex row, so it
   needs justify-content as well as text-align. */
.category-block-head{ justify-content: center; }
.category-block .body{
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

/* The catalogue toolbar could not fill the row because .quick-find is capped
   at 420px, so its flex-grow had nothing to give. Centre it so it sits under
   the now-centred header instead of hanging off the left edge. */
.catalog-toolbar{ justify-content: center; }

/* A .section-head-row is display:flex with justify-content:space-between.
   With two children (heading + note) it justifies across the full width and
   is already balanced. With only one child, space-between leaves the heading
   hard left with the entire container empty beside it. :has() is what lets
   CSS tell those two cases apart, so only the stranded ones are centred.
   Where :has() is unsupported the head simply stays left-aligned - the
   behaviour it has today - so this degrades without breaking anything. */
.section-head-split:has(.section-head-row > *:only-child){ text-align: center; }
.section-head-row:has(> *:only-child){ justify-content: center; }
.section-head-split:has(.section-head-row > *:only-child) .split-head{ justify-content: center; }

/* The ISI badge sits directly after such a head and is inline-flex, so it
   needs its own centring rather than inheriting text-align. */
.section-head-split:has(.section-head-row > *:only-child) + .isi-badge{
  display: flex;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* Raising the .split-head--lg ceiling to 68px made some two-part section
   heads too wide to sit beside their note, so the note wrapped underneath and
   left the right-hand side empty - the very imbalance this file is fixing.
   Letting the heading shrink (it is itself a wrapping flex row, so it breaks
   between its two words as designed) keeps heading and note on one line and
   fills the width. A flex-basis of auto would still wrap, because with flex-wrap an item
   moves to the next line at its base size before any shrink factor applies -
   so the basis has to be 0. Only above 1024px, where there is room for both. */
@media (min-width: 1024px){
  .section-head-row > .split-head{ flex: 1 1 0; min-width: 0; }
  .section-head-row > .body-lg{ flex: 0 0 440px; }
}

/* ===========================================================================
   BRAND TAGLINE IN THE HEADER
   ---------------------------------------------------------------------------
   The logo artwork carries "Elite piping solutions, build to last." but the
   header lockup only showed the wordmark. .brand-lockup is a flex row, so the
   wordmark and tagline are wrapped in .brand-text to stack them as a column
   without disturbing the logo beside them.
   =========================================================================== */
.brand-text{
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.05;
  min-width: 0;
}
.brand-tag{
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 3px;
  white-space: nowrap;
}
/* On the dark landing header the muted ink would disappear. */
.lp-nav .brand-tag{ color: rgba(255,255,255,.62); }
.lp-nav.stuck .brand-tag{ color: var(--ink-mute); }
/* Below this the header needs the room for the logo and the menu button. */
/* Phones keep the tagline (the client wants it on every device); it just tightens to fit. */
@media (max-width: 420px){ .brand-tag{ font-size: 8.5px; letter-spacing: 0.02em; margin-top: 2px; } }
@media (max-width: 340px){ .brand-tag{ font-size: 7.5px; letter-spacing: 0; } }

/* ===========================================================================
   FOOTER BRAND CENTRED
   =========================================================================== */
.footer-col--brand{ text-align: center; }
.footer-col--brand .footer-logo{ margin-left: auto; margin-right: auto; }
.footer-col--brand p{ margin-left: auto; margin-right: auto; }
.footer-social{ justify-content: center; }

/* ===========================================================================
   LONG LISTS BECOME GRIDS
   ---------------------------------------------------------------------------
   Four items stacked one per row read as a long scroll, especially on a
   phone. These all become 2 x 2, which is the shape the content actually is.
   =========================================================================== */

/* Standards strip under the hero: 4 items in a row that wrapped to 4 rows. */
.standards-strip .wrap{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 32px;
  justify-content: initial;
}
@media (max-width: 1100px){
  .standards-strip .wrap{ grid-template-columns: repeat(2, 1fr); }
}

/* "Four reasons clients stay" stayed 4-across, then went to a single column
   on a phone. 2 x 2 holds the shape all the way down. */
@media (max-width: 640px){
  .why-grid{ grid-template-columns: 1fr 1fr; }
}

/* "Why the right product matters" - four long points in one column inside a
   half-width split. Two columns from tablet up halves the scroll; below that
   the lines would be too narrow to read, so it stays single-column. */
@media (min-width: 760px){
  .check-list{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 32px;
  }
}

/* ===========================================================================
   LANDING FAQ - TWO COLUMNS INSTEAD OF ONE LONG SCROLL
   ---------------------------------------------------------------------------
   The FAQ sat in a 0.8fr / 1.2fr split, so five questions ran down a narrow
   right-hand column. Stacking the intro on top (centred, like the other
   section heads) frees the full width for a two-column question list, which
   roughly halves the scroll. align-items:start keeps each question at the top
   of its cell so opening one does not shift the other column.
   =========================================================================== */
@media (min-width: 900px){
  .lp-faq-grid{
    grid-template-columns: 1fr;
    gap: clamp(24px, 2.6vw, 40px);
  }
  .lp-faq-grid > :first-child{
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
  .lp-faq{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 clamp(32px, 3.4vw, 64px);
    align-items: start;
  }
}

/* ---------------------------------------------------------------------------
   PHOTO BAND — product-render variant
   The default band lays a dark gradient over the lower half of the image so
   white caption text reads against a photograph. The brand product shots are
   rendered on white, where that gradient just turns the products grey. This
   variant keeps the surface light, sizes the render to fit rather than crop,
   and sets the caption in dark ink underneath it.
   ------------------------------------------------------------------------- */
.photo-band--product{ height:auto; background:#f2f2f0; }
.photo-band--product img{
  height:clamp(240px, 34vw, 400px);
  object-fit:contain;
  padding:30px 0 10px;
  background:transparent;
}
.photo-band--product .photo-band-cap{
  position:static;
  background:none;
  color:var(--ink);
  padding:0 0 34px;
}
.photo-band--product .photo-band-cap .eyebrow{ color:var(--ink-mute); opacity:1; }
.photo-band--product .photo-band-cap h3{ color:var(--ink); }

/* ---------------------------------------------------------------------------
   SPLIT-BLOCK IMAGE — portrait variant
   The default box is 4:3 with the image contained and padded, which suits a
   product cut-out on white. A standing portrait in that box sits small and
   letterboxed, so this variant turns the box portrait and lets the photo fill
   it edge to edge.
   ------------------------------------------------------------------------- */
.split-block .img--portrait{ aspect-ratio:4/5; background:#edeeec; }
.split-block .img--portrait img{ object-fit:cover; padding:0; }

/* ---------------------------------------------------------------------------
   HEADER NAV — eight items
   "Why Choose" made the bar eight items wide, which wrapped a label onto a
   second line between roughly 1000px and 1400px. Labels are kept on one line
   and the spacing tightens through that band; below 1150px the social row
   steps aside, since the same icons sit in the footer.
   ------------------------------------------------------------------------- */
.nav-links a{ white-space:nowrap; }

@media (min-width: 981px) and (max-width: 1400px){
  .nav-links{ gap:20px; }
  .nav-links a{ font-size:12.5px; }
}
@media (min-width: 981px) and (max-width: 1180px){
  .nav-links{ gap:15px; }
  .nav-social{ display:none; }
}

/* ---------------------------------------------------------------------------
   VALUES GRID — four-card variant
   The base grid is built for the five core values on the About page, so a
   four-card set leaves a fifth cell showing the grid's own background as an
   empty grey block. This variant matches the column count to the cards, and
   drops to 2x2 rather than 3-across so the second row is never half empty.
   ------------------------------------------------------------------------- */
.values-grid--four{ grid-template-columns:repeat(4,1fr); }
@media (max-width: 1100px){ .values-grid--four{ grid-template-columns:repeat(2,1fr); } }
@media (max-width: 720px){  .values-grid--four{ grid-template-columns:1fr; } }

/* product band: photo and caption side by side on wide screens, so the band has no empty half */
@media (min-width: 900px){
  .photo-band--product{
    display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr); align-items:center;
    gap:var(--block-gap); padding:var(--section-y-tight) max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  }
  .photo-band--product img{ height:clamp(280px, 30vw, 520px); padding:0; }
  .photo-band--product .photo-band-cap{ padding:0; }
  .photo-band--product .photo-band-cap .wrap{ padding:0; max-width:none; }
  .photo-band--product .photo-band-cap h3{ font-size:clamp(22px, 2.2vw, 38px); }
}
