/*
 * One section-header system for the homepage.
 *
 * Why this file exists: every section header on the page had been authored on
 * its own. Measured across site.css, home-extras.css and compliance-sections.css
 * there were eleven different intro-paragraph measures mixing rem, ch and none
 * (24rem, 32rem, 33rem, 35rem, 43rem, 48rem, 43ch, 52ch, 60ch, 62ch, 65ch), six
 * headline measures, five different gaps down to the content, five headers that
 * split headline-left / paragraph-right, and three centred while ten ran left.
 * Reading down the page meant re-finding where each heading started.
 *
 * It loads last, so it settles those values without unpicking the per-section
 * rules first. The declarations it now overrides are dead weight in the older
 * files and can be deleted in a follow-up once the result is confirmed.
 *
 * The rule: headers stack, run left, share one measure, share one gap.
 *
 * Scope note: .section-head on inner pages is deliberately NOT touched here.
 * pages.css gives it sticky and display:block overrides at >=961 that a
 * same-specificity rule in a later file would silently kill.
 */

:root {
    --section-head-measure: var(--headline-measure);
    --section-head-copy: 62ch;
    --section-head-gap: clamp(2rem, 4vw, 3rem);
    --section-head-rhythm: 0.75rem;
}

/* ---------------------------------------------------------------- *
 * Stack. Five of these were two-column headers.
 * ---------------------------------------------------------------- */
.requirements-intro,
.technical-criteria-head,
.business-types-head,
.readiness-intro,
.services-head,
.storage-estimator-intro,
.project-heading,
.press-head,
.process-section-six .process-intro,
.deliverables-intro,
.knowledge-head,
.faq-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    align-items: start;
    gap: var(--section-head-rhythm);
    text-align: left;
}

/* ---------------------------------------------------------------- *
 * One headline measure, one copy measure.
 * ---------------------------------------------------------------- */
.requirements-intro > h2,
.technical-criteria-head h2,
.business-types-head h2,
.readiness-intro h2,
.services-head h2,
.storage-estimator-intro h2,
.project-heading h2,
.press-head h2,
.process-section-six .process-intro h2,
.deliverables-intro h2,
.knowledge-head h2,
.faq-intro h2 {
    max-width: var(--section-head-measure);
    margin: 0;
    margin-inline: 0;
}

.requirements-intro > p,
.technical-criteria-head p,
.business-types-head > p,
.readiness-intro p,
.services-head > p,
.storage-estimator-intro > p,
.project-heading p,
.press-head p,
.process-section-six .process-intro p,
.deliverables-intro p,
.knowledge-head > p,
.faq-intro p {
    max-width: var(--section-head-copy);
    margin: 0;
    margin-inline: 0;
}

/*
 * This one needs the same shape as the rule it replaces: compliance-sections.css
 * targets the paragraph through .technical-criteria-head > div:last-child > p,
 * which outranks a plain descendant selector.
 */
.technical-criteria-head > div:last-child > p {
    max-width: var(--section-head-copy);
}

/* The eyebrow is a flex row, so text-align cannot place it. */
.requirements-intro .eyebrow,
.technical-criteria-head .eyebrow,
.business-types-head .eyebrow,
.readiness-intro .eyebrow,
.services-head .eyebrow,
.storage-estimator-intro .eyebrow,
.project-heading .eyebrow,
.press-head .eyebrow,
.process-section-six .process-intro .eyebrow,
.deliverables-intro .eyebrow,
.knowledge-head .eyebrow,
.faq-intro .eyebrow {
    justify-content: flex-start;
    margin-bottom: 0;
}

/* A button or link closing a header gets the rhythm, not a bespoke margin. */
.deliverables-intro .button,
.project-heading .text-link,
.knowledge-head .text-link,
.services-head .text-link {
    margin-top: var(--section-head-rhythm);
}

/* ---------------------------------------------------------------- *
 * Gap down to the section content.
 * ---------------------------------------------------------------- */
.business-types-head,
.press-head,
.project-heading,
.readiness-intro,
.technical-criteria-head {
    margin-bottom: var(--section-head-gap);
}

/* The process CTAs follow the timeline, so they take the gap above instead. */
.process-section-six .process-actions {
    justify-content: flex-start;
}

/* ---------------------------------------------------------------- *
 * Requirements: the intro column carried the headline, the copy, a photo
 * and a link, so it ran roughly twice the height of the four-item list
 * beside it and left the bottom right of the section empty. The photo and
 * the link now sit on their own full-width rows under both columns.
 * ---------------------------------------------------------------- */
.requirements-layout {
    column-gap: clamp(2rem, 6vw, 5rem);
    row-gap: clamp(2rem, 4vw, 3rem);
}

.requirements-layout > .requirements-media,
.requirements-layout > .requirements-link {
    grid-column: 1 / -1;
}

.requirements-layout > .requirements-media {
    max-width: none;
    margin: 0;
}

.requirements-layout > .requirements-media img {
    width: 100%;
    aspect-ratio: 21 / 8;
    object-fit: cover;
}

/*
 * site.css pins .requirements-intro at >=961w and >=860h. That made sense while
 * the intro also held the photo and the link: a tall column stayed in view.
 * Now the photo is a full-width row underneath both columns, so a pinned intro
 * parks itself on top of that photo as it scrolls past, and because sticky is a
 * positioned box the text paints over the image.
 */
@media (min-width: 961px) and (min-height: 860px) {
    .requirements-intro {
        position: static;
    }
}

@media (max-width: 960px) {
    /* One column already, so the photo needs no span and a shorter crop. */
    .requirements-layout > .requirements-media img {
        aspect-ratio: 16 / 10;
    }
}
