/* ==========================================================================
   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 lives in narpo-tokens.css. Re-declaring it here
       let two blocks disagree about the grid, so it is deliberately absent. */
    --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, var(--mn-on-slate, #f1eee9));
    background-color: var(--narpo-hero-bg, var(--mn-slate-deep, #0a1423));

    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, var(--mn-slate-deep, #0a1423));
    color: var(--mn-on-slate, #f1eee9);
    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, #d99e3f);
    z-index: 2;
}

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

/* ==========================================================================
   MANCHESTER HERO
   The previous hero was a navy slab closed by a flat blue stripe. This one
   is a slate plate: the branch's bee held as a watermark off the right edge,
   a short brass rule marking the head, and the Sillitoe chequer closing the
   band instead of a colour fill.
   ========================================================================== */

/* The 5px accent rules are redundant now the chequer closes the band. */
.narpo-hero-cover[style*="--narpo-hero-band-color"]::before,
.narpo-hero-cover[style*="--narpo-hero-band-color"]::after {
    display: none;
}

/* --- The arms, held as a watermark ---------------------------------------
   Sits in the content well so it tracks the grid, then bleeds off the right
   edge — the one deliberate grid-break on the page.

   The bee is the fallback and the arms are the override, scoped to the
   `narpo-has-arms` body class rather than to `--mn-arms` alone: that is the
   pattern every other arms placement follows, and it means the band still
   carries a device if the artwork is ever cleared in Site Settings.

   The arms are drawn as a MASK, not as a background image. The artwork is
   full-colour heraldry whose helmet and chequered border are opaque white —
   laid over slate at watermark opacity those read as bright patches rather
   than as one device. Masking a flat colour through its alpha gives the
   silhouette the bee had, in the same ink. Heraldry is also never tilted,
   so the arms drop the bee's -8deg. */
.narpo-hero-cover__inner {
    position: relative;
}

.narpo-hero-cover__inner::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: 50%;
    right: clamp(-6rem, -4vw, -1rem);
    width: clamp(240px, 30vw, 460px);
    aspect-ratio: 1;
    transform: translateY(-50%) rotate(-8deg);
    background: var(--mn-bee) center / contain no-repeat;
    opacity: 0.055;
    pointer-events: none;
}

body.narpo-has-arms .narpo-hero-cover__inner::after {
    width: clamp(190px, 22vw, 330px);
    aspect-ratio: 1086 / 1448;      /* the artwork's own proportions */
    transform: translateY(-50%);
    background: var(--mn-paper, #f7f4ef);
    -webkit-mask: var(--mn-arms) center / contain no-repeat;
    mask: var(--mn-arms) center / contain no-repeat;
    opacity: 0.07;
}

/* Never let the watermark crowd a hero that carries a photograph. */
.narpo-hero-cover:has(.wp-block-cover__image-background) .narpo-hero-cover__inner::after {
    display: none;
}

.narpo-hero-cover__content {
    position: relative;
    z-index: 2;
    max-width: 46ch;
}

/* --- Headline ------------------------------------------------------------ */

.narpo-hero-cover__heading {
    font-family: var(--narpo-font-display, Georgia, serif);
    font-weight: 600;
    letter-spacing: var(--narpo-tracking-display, -0.014em);
    line-height: 1.08;
    text-wrap: balance;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* A short brass rule above the head — the engraved plate edge. */
.narpo-hero-cover__heading::before {
    content: "";
    display: block;
    width: 3.25rem;
    height: 2px;
    margin-bottom: clamp(1rem, 1.6vw, 1.6rem);
    background: var(--mn-brass, #d99e3f);
}

.narpo-hero-cover--tall .narpo-hero-cover__heading {
    font-size: var(--narpo-fs-hero);
    font-weight: 600;
    line-height: 1.06;
    text-shadow: none;          /* weight carries it, not a glow */
    margin: 0 0 1rem;
}

.narpo-hero-cover--compact .narpo-hero-cover__heading {
    font-size: var(--narpo-fs-h1);
    font-weight: 600;
    line-height: 1.08;
}

/* --- Standfirst ---------------------------------------------------------- */

.narpo-hero-cover__subtitle {
    color: var(--mn-on-slate-mute, #bbb7af);
    max-width: 52ch;
}
.narpo-hero-cover--compact .narpo-hero-cover__subtitle {
    color: var(--mn-on-slate-mute, #bbb7af);
    font-size: 1rem;
}

/* --- The chequer band ----------------------------------------------------
   Two rows of squares, as worn on the cap band. This is the site's heaviest
   piece of furniture and appears at most twice per page. */
.narpo-hero-cover__band {
    height: var(--mn-chequer-band, 16px);
    background-color: var(--mn-slate-deep, #0a1423);
    background-image: repeating-conic-gradient(
        var(--mn-chequer-a, #0a1423) 0% 25%,
        var(--mn-chequer-b, #f9f6f1) 0% 50%
    );
    background-size: var(--mn-chequer-band, 16px) var(--mn-chequer-band, 16px);
}

@media (max-width: 600px) {
    .narpo-hero-cover__content { max-width: 100%; }
    .narpo-hero-cover__inner::after {
        width: 200px;
        right: -3.5rem;
        opacity: 0.045;
    }
    .narpo-hero-cover__band {
        --mn-chequer-band: 12px;
        height: 12px;
        background-size: 12px 12px;
    }
}
