/* ============================================================
   PLUSFAB -- PAGE INTRO "TITLE BLOCK" (2026-10-01)
   ------------------------------------------------------------
   Presentation layer over the shared universal module
   (/web/partials/page_intro.php + /web/assets/css/page-intro.css).
   Markup, content contract and the shared file are untouched; every
   rule is scoped to body.tpl-plusfab_industrial so it wins regardless
   of load order (the shared CSS is linked inline by the partial).

   The intro is the page-title band for inner pages WITHOUT a hero, so
   it follows the inner-hero language: a deep-graphite plate like a
   drawing's title block --
     - faint technical-drawing grid, fading out to the edges;
     - copper registration brackets at two corners;
     - steel bottom rule with a 72px copper segment (header detail);
     - eyebrow = PlusFab section label (copper rule), Archivo title;
     - Center: perforated dot strip separates the lead paragraph;
     - Left (desktop): two-column title block -- heading on the left,
       lead paragraph on the right behind a steel rule.
============================================================ */

body.tpl-plusfab_industrial .page-intro-section {
    --pi-pad: clamp(56px, 32px + 4vw, 104px);
    --pi-steel: #C5CBD0;
    --pi-copper: var(--mt-accent, #B8733A);
    /* copper segment x = the Bootstrap container's text edge. Background-
       position % is relative to (width − 72px), so 50% − (container/2 −
       gutter − 36px). Overridden per breakpoint below. */
    --pi-seg-x: 12px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding-top: var(--pi-pad);
    padding-bottom: calc(var(--pi-pad) + 4px);
    background:
        /* steel bottom rule + copper segment (sits on the band's edge) */
        linear-gradient(var(--pi-copper), var(--pi-copper)) left var(--pi-seg-x) bottom 0 / 72px 3px no-repeat,
        linear-gradient(#3A4047, #3A4047) 0 100% / 100% 3px no-repeat,
        /* soft light from the top-left, like a lit workshop wall */
        radial-gradient(ellipse 80% 120% at 15% 0%, rgba(197, 203, 208, 0.10), transparent 60%),
        linear-gradient(180deg, #1A1D21 0%, #131619 100%);
    border-bottom: 0;
    color: #fff;
}

@media (min-width: 576px)  { body.tpl-plusfab_industrial .page-intro-section { --pi-seg-x: calc(50% - 222px); } }
@media (min-width: 768px)  { body.tpl-plusfab_industrial .page-intro-section { --pi-seg-x: calc(50% - 312px); } }
@media (min-width: 992px)  { body.tpl-plusfab_industrial .page-intro-section { --pi-seg-x: calc(50% - 432px); } }
@media (min-width: 1200px) { body.tpl-plusfab_industrial .page-intro-section { --pi-seg-x: calc(50% - 522px); } }
@media (min-width: 1400px) { body.tpl-plusfab_industrial .page-intro-section { --pi-seg-x: calc(50% - 612px); } }

/* The intro IS the page header when it is the first module: sit flush
   under the site header (the dark plate supplies its own breathing room).
   The platform shell keeps its 64px separation for every other first
   module; template-scoped, mirrors 04-pages.css's hero-first exception. */
body.tpl-plusfab_industrial .web-page-shell:has(> section.page-intro-section:first-of-type) {
    padding-top: 0;
}

/* 1. Drawing grid — fades out towards the edges */
body.tpl-plusfab_industrial .page-intro-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: center top;
    -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 40%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 90% at 50% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

/* 2. Copper registration brackets (top-left / bottom-right) */
body.tpl-plusfab_industrial .page-intro-section > .container { position: relative; }
body.tpl-plusfab_industrial .page-intro-section > .container::before,
body.tpl-plusfab_industrial .page-intro-section > .container::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border: 0 solid var(--pi-copper);
    pointer-events: none;
}
body.tpl-plusfab_industrial .page-intro-section > .container::before {
    top: calc(var(--pi-pad) * -0.55);
    left: 12px;
    border-top-width: 2px;
    border-left-width: 2px;
}
body.tpl-plusfab_industrial .page-intro-section > .container::after {
    bottom: calc(var(--pi-pad) * -0.55);
    right: 12px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* 3. Text block */
body.tpl-plusfab_industrial .page-intro-section .pgi-inner {
    position: relative;
    max-width: 860px;
}

body.tpl-plusfab_industrial .page-intro-section .pgi-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 0.75rem;
    font-weight: var(--mt-weight-semibold, 600);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--pi-steel);
}
body.tpl-plusfab_industrial .page-intro-section .pgi-eyebrow::before,
body.tpl-plusfab_industrial .page-intro-section--center .pgi-eyebrow::after {
    content: "";
    flex-shrink: 0;
    width: 28px;
    height: 2px;
    background: var(--pi-copper);
}

body.tpl-plusfab_industrial .page-intro-section .pgi-title {
    font-family: var(--mt-font-heading, "Archivo", sans-serif);
    font-size: clamp(2rem, 1.35rem + 2.1vw, 3.1rem);
    font-weight: var(--mt-weight-bold, 700);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 18px;
    text-wrap: balance;
}
body.tpl-plusfab_industrial .page-intro-section .pgi-title:last-child { margin-bottom: 0; }

body.tpl-plusfab_industrial .page-intro-section .pgi-subtitle {
    font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
    font-weight: 500;
    line-height: 1.55;
    color: #DDE1E4;
    margin: 0;
    text-wrap: pretty;
}

body.tpl-plusfab_industrial .page-intro-section .pgi-lead {
    position: relative;
    font-size: 1rem;
    line-height: 1.75;
    color: #A9B1B8;
    margin: 0;
    text-wrap: pretty;
}

/* Center: perforated dot strip between the heading group and the lead */
body.tpl-plusfab_industrial .page-intro-section--center .pgi-inner > * + .pgi-lead {
    margin-top: 28px;
    padding-top: 28px;
}
body.tpl-plusfab_industrial .page-intro-section--center .pgi-inner > * + .pgi-lead::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 96px;
    height: 4px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(197, 203, 208, 0.55) 1.3px, transparent 1.6px) 0 50% / 8px 4px repeat-x;
}
body.tpl-plusfab_industrial .page-intro-section--center .pgi-lead {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Left: lead paragraph sits under a steel rule on small screens… */
body.tpl-plusfab_industrial .page-intro-section--left .pgi-inner > * + .pgi-lead {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid rgba(197, 203, 208, 0.18);
}
body.tpl-plusfab_industrial .page-intro-section--left .pgi-inner > * + .pgi-lead::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--pi-copper);
}

/* …and becomes a two-column title block on desktop. */
@media (min-width: 992px) {
    body.tpl-plusfab_industrial .page-intro-section--left .pgi-inner:has(> .pgi-lead):has(> .pgi-title) {
        max-width: none;
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        column-gap: clamp(40px, 5vw, 88px);
        align-items: start;
    }
    body.tpl-plusfab_industrial .page-intro-section--left .pgi-inner:has(> .pgi-lead):has(> .pgi-title) > :not(.pgi-lead) {
        grid-column: 1;
        justify-self: start;
    }
    body.tpl-plusfab_industrial .page-intro-section--left .pgi-inner:has(> .pgi-lead):has(> .pgi-title) > .pgi-lead {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: end;
        margin-top: 0;
        padding: 6px 0 6px 32px;
        border-top: 0;
        border-left: 1px solid rgba(197, 203, 208, 0.20);
    }
    body.tpl-plusfab_industrial .page-intro-section--left .pgi-inner:has(> .pgi-lead):has(> .pgi-title) > .pgi-lead::before {
        top: 0;
        left: -1px;
        width: 2px;
        height: 40px;
    }
}

/* ============================================================
   CONTEXT VARIANT — intro placed UNDER A HERO ("drawing sheet").
   When a page also has a hero (inner .hero-industrial or the home
   .mt-hero), a second dark band would stack two heavy plates. The
   intro then switches to a light industrial-grey sheet: same grid,
   brackets, rules and layout, re-toned for a light ground, at the
   section-heading scale (the hero already carries the page title).
   Pure CSS sibling context — no markup or content change.
============================================================ */
body.tpl-plusfab_industrial .hero-industrial ~ .page-intro-section,
body.tpl-plusfab_industrial .mt-hero ~ .page-intro-section {
    --pi-pad: clamp(48px, 28px + 3.5vw, 88px);
    --pi-steel: #8A939B;
    background:
        linear-gradient(var(--pi-copper), var(--pi-copper)) left var(--pi-seg-x) bottom 0 / 72px 2px no-repeat,
        linear-gradient(#D5DADE, #D5DADE) 0 100% / 100% 1px no-repeat,
        linear-gradient(180deg, #F3F4F5 0%, #FFFFFF 100%);
    color: var(--ally-navy-700, #1E2226);
}
body.tpl-plusfab_industrial .hero-industrial ~ .page-intro-section::before,
body.tpl-plusfab_industrial .mt-hero ~ .page-intro-section::before {
    background-image:
        linear-gradient(rgba(30, 34, 38, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 34, 38, 0.05) 1px, transparent 1px);
}
body.tpl-plusfab_industrial .hero-industrial ~ .page-intro-section .pgi-title,
body.tpl-plusfab_industrial .mt-hero ~ .page-intro-section .pgi-title {
    font-size: clamp(1.9rem, 1.3rem + 1.6vw, 2.6rem);
    color: var(--ally-navy-700, #1E2226);
}
body.tpl-plusfab_industrial .hero-industrial ~ .page-intro-section .pgi-subtitle,
body.tpl-plusfab_industrial .mt-hero ~ .page-intro-section .pgi-subtitle {
    color: #3A4047;
}
body.tpl-plusfab_industrial .hero-industrial ~ .page-intro-section .pgi-lead,
body.tpl-plusfab_industrial .mt-hero ~ .page-intro-section .pgi-lead {
    color: #5A636B;
}
body.tpl-plusfab_industrial .hero-industrial ~ .page-intro-section--center .pgi-inner > * + .pgi-lead::before,
body.tpl-plusfab_industrial .mt-hero ~ .page-intro-section--center .pgi-inner > * + .pgi-lead::before {
    background-image: radial-gradient(circle, rgba(30, 34, 38, 0.38) 1.3px, transparent 1.6px);
}
body.tpl-plusfab_industrial .hero-industrial ~ .page-intro-section--left .pgi-inner > * + .pgi-lead,
body.tpl-plusfab_industrial .mt-hero ~ .page-intro-section--left .pgi-inner > * + .pgi-lead {
    border-color: #D5DADE;
}

/* Mobile */
@media (max-width: 575.98px) {
    body.tpl-plusfab_industrial .page-intro-section .pgi-eyebrow {
        font-size: 0.7rem;
        letter-spacing: 0.14em;
    }
    body.tpl-plusfab_industrial .page-intro-section > .container::before,
    body.tpl-plusfab_industrial .page-intro-section > .container::after {
        width: 16px;
        height: 16px;
    }
    body.tpl-plusfab_industrial .page-intro-section .pgi-lead { font-size: 0.95rem; }
}
