/* ==========================================================================
   NARPO Hero Cover Block
   Full-width cover with a 1400px content well.
   Typography is intentionally left undefined — handled by the site font CSS.
   ========================================================================== */

:root {
    --narpo-content-width: 1400px;
    --narpo-hero-gutter: var(--narpo-section-gutter, clamp(1.25rem, 4vw, 3rem));
}

.narpo-hero-cover.wp-block-cover {
    /* Force full-bleed even when not in a theme that auto-applies alignfull.
       The block is `align: full` so Gutenberg will already add alignfull,
       but this is a belt-and-braces safeguard. */
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    display: flex;
    align-items: var(--narpo-hero-align-v, center);
    justify-content: var(--narpo-hero-align-h, flex-start);

    color: var(--narpo-hero-color, #ffffff);
    background-color: var(--narpo-hero-bg, #001F52);

    overflow: hidden;
    box-sizing: border-box;
}

/* Decorative accent bands — top and bottom — driven by --narpo-hero-band-color.
   Only rendered when the ACF field is set (variable injected as inline style).
   z-index 10 ensures they sit above the background image, overlay, and content. */
.narpo-hero-cover::before,
.narpo-hero-cover::after {
    content: "";
    display: none; /* hidden by default — activated below when variable present */
    position: absolute;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--narpo-hero-band-color);
    z-index: 10;
    pointer-events: none;
}
.narpo-hero-cover::before { top: 0; }
.narpo-hero-cover::after  { bottom: 0; }

.narpo-hero-cover[style*="--narpo-hero-band-color"]::before,
.narpo-hero-cover[style*="--narpo-hero-band-color"]::after {
    display: block;
}

/* Background image fills the entire cover, colour overlay sits above it */
.narpo-hero-cover .wp-block-cover__image-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.narpo-hero-cover .wp-block-cover__background {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Content well — capped to the site's 1400px max width */
.narpo-hero-cover__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--narpo-content-width);
    margin-inline: auto;
    padding-inline: var(--narpo-hero-gutter);
    padding-block: clamp(2rem, 6vw, 5rem);
    display: flex;
    align-items: var(--narpo-hero-align-v, center);
    justify-content: var(--narpo-hero-align-h, flex-start);
    box-sizing: border-box;
}

.narpo-hero-cover__content {
    /* The inner content column — sits inside the 1400px well. */
    max-width: 75ch;
    color: inherit;
    text-align: start;
}

/* Reset only structural styling — leave typography for the site font CSS */
.narpo-hero-cover__heading,
.narpo-hero-cover__subtitle {
    color: inherit;
    margin: 0;
}

.narpo-hero-cover__heading + .narpo-hero-cover__subtitle {
    margin-top: 1.25rem;
}

.narpo-hero-cover__subtitle p {
    margin: 0;
}
.narpo-hero-cover__subtitle p + p {
    margin-top: 0.75em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 782px) {
    .narpo-hero-cover.wp-block-cover {
        /* Cap very tall heroes on mobile to keep content reachable */
        min-height: min(var(--narpo-hero-mobile-cap, 75vh), 100%);
    }

    .narpo-hero-cover__content {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .narpo-hero-cover__inner {
        padding-block: clamp(1.5rem, 12vw, 3rem);
    }
}

/* ==========================================================================
   Editor preview tweaks
   ACF block preview renders inside the canvas iframe; we want the full-bleed
   behaviour to look right there too, even though the canvas isn't 100vw.
   ========================================================================== */

.editor-styles-wrapper .narpo-hero-cover.wp-block-cover {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* --------------------------------------------------------------------------
   Variant: compact (inner-page banner)
   -------------------------------------------------------------------------- */
.narpo-hero-cover--compact.wp-block-cover {
    background-color: var(--narpo-hero-bg, #001F52);
    color: #fff;
    min-height: clamp(220px, 28vw, 360px);
    padding-block: clamp(2rem, 5vw, 4rem);
}
.narpo-hero-cover--compact .narpo-hero-cover__heading {
    font-family: var(--narpo-font-display, inherit);
    font-size: var(--narpo-fs-hero, clamp(1.9rem, 5vw, 4rem));
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 0.5rem;
}
.narpo-hero-cover--compact .narpo-hero-cover__subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
    max-width: 60ch;
}
.narpo-hero-cover--compact .narpo-hero-cover__subtitle p { margin: 0; }

/* --------------------------------------------------------------------------
   Variant: tall (home hero)
   -------------------------------------------------------------------------- */
.narpo-hero-cover--tall .narpo-hero-cover__heading {
    font-family: var(--narpo-font-display, inherit);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 1rem;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
.narpo-hero-cover--tall .narpo-hero-cover__subtitle {
    font-size: var(--narpo-fs-body, 1.05rem);
    line-height: 1.6;
    max-width: 56ch;
}

/* --------------------------------------------------------------------------
   Accent band — thin stripe sitting beneath the hero
   -------------------------------------------------------------------------- */
.narpo-hero-cover__band {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 15px;
    background: var(--narpo-band, #3C7DE5);
    z-index: 2;
}

/* Each repeater-controlled headline line sits on its own row. */
.narpo-hero-cover__heading-line { display: block; }
