/*
 * Leader Hero block.
 *
 * Full-width black banner. The editable copy (a core heading + paragraph(s)
 * via InnerBlocks) sits on the left, aligned to the site content edge; the
 * image fills the full height of the band on the right and bleeds to the page
 * edge, with its left corners curved.
 *
 * The block defaults to "full" alignment, so the theme (Kadence) breaks the
 * section out to the viewport width; this stylesheet paints the band and lays
 * out the two sides. Loaded on the front end (only where the block is used)
 * and in the editor (via block.json editorStyle), so the canvas matches.
 */

.leader-hero {
    /* Mirrors the Leader Products content width for a consistent inner measure. */
    --lp-content: 1180px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    min-height: clamp(340px, 34vw, 480px);
    background: #000;
    color: #fff;
}

/* Left: editable copy, padded so its left edge lines up with the centered
   site content column (the band itself spans the full viewport). */
.leader-hero__text {
    flex: 1 1 460px;
    align-self: center;
    padding: 3.5rem 2rem;
    padding-left: max(2rem, calc((100vw - var(--lp-content)) / 2));
}

/* Reset theme margins on the core blocks; vertical rhythm is re-applied below.
   Zeroing the heading's default top margin also keeps the copy vertically
   centered in the band. */
.leader-hero :where(h1, h2, h3, p, ul, ol) {
    margin: 0;
}

/* Front-end: InnerBlocks output is wrapped in .acf-innerblocks-container, where
   the heading/paragraphs render as siblings. (In the editor, Gutenberg's own
   block spacing handles the gaps.) */
.leader-hero .acf-innerblocks-container > * + * {
    margin-top: 1.25rem;
}

/* Copy colour. The doubled `.leader-hero.leader-hero` bumps specificity to
   (0,2,1) so it beats the theme's editor heading rules (e.g. Kadence's
   `.editor-styles-wrapper h1`, which is what rendered the title dark-on-black
   in the canvas). No !important, so a per-block colour choice still wins. */
.leader-hero.leader-hero :is(h1, h2, h3, h4, h5, h6) {
    color: #fff;
}

.leader-hero.leader-hero :is(p, li) {
    color: #e9e9e9;
}

.leader-hero.leader-hero a {
    color: #fff;
    text-decoration: underline;
}

/* Headline styling for the seeded title block. */
.leader-hero .leader-hero__title {
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    font-size: clamp(2rem, 4.5vw, 3.5rem);
}

.leader-hero .leader-hero__body {
    max-width: 46ch;
    font-size: 1rem;
    line-height: 1.7;
}

/* Right: image fills the band top-to-bottom and bleeds to the page edge. */
.leader-hero__media {
    position: relative;
    flex: 1 1 460px;
    align-self: stretch;
    min-height: inherit;
    overflow: hidden;
}

.leader-hero__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Editor placeholder when no image is set yet, so the layout stays visible. */
.leader-hero__image--placeholder {
    background: repeating-linear-gradient(
        45deg,
        #1a1a1a,
        #1a1a1a 12px,
        #222 12px,
        #222 24px
    );
}

/* Lift the RichText placeholder out of dark-on-black in the editor. */
.leader-hero [data-rich-text-placeholder]::after,
.leader-hero [data-rich-text-placeholder]::before {
    color: rgba(255, 255, 255, 0.5);
}

/* Stack on smaller screens: image first (full-bleed), copy below. */
@media (max-width: 920px) {
    .leader-hero {
        min-height: 0;
    }

    /* order:-1 moves the image above the copy visually while keeping the
       heading first in the DOM (good for reading order / SEO). */
    .leader-hero__media {
        order: -1;
        flex-basis: 100%;
        min-height: 220px;
    }

    .leader-hero__text {
        flex-basis: 100%;
        align-self: auto;
        padding: 2.5rem 1.25rem;
    }

    /* Bump the copy a touch so it reads better on small screens. */
    .leader-hero .leader-hero__title {
        font-size: clamp(2.25rem, 7vw, 2.75rem);
    }

    .leader-hero .leader-hero__body {
        font-size: 1.0625rem;
    }
}
