/* Hero block — supplementary styles beyond Tailwind utilities. */

/* Stacking context for the overlay pseudo-elements — without `isolation: isolate`
   ::before / ::after can leak into a parent stacking context if a parent has
   transform/filter/etc. */
.block-hero {
    position: relative;
    isolation: isolate;
}

/* Tint layer — flat colour, or a linear-gradient when --hero-tint-image is set
   (used by the 'gradient' preset). Sits above the section's background-image /
   video, below the content. */
.block-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: var(--hero-tint-color, transparent);
    background-image: var(--hero-tint-image, none);
    /* --hero-strength-multiplier (default 1) is bumped to 1.5 by the boost
       overlay-strength option. Browser clamps opacity > 1 back to 1. */
    opacity: calc(var(--hero-tint-opacity, 0) * var(--hero-strength-multiplier, 1));
    pointer-events: none;
}

/* Vignette layer — radial fade, dark at the corners. Strength 0..1.
   Renders transparent (no visual cost) when --hero-vignette-strength is 0. */
.block-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, calc(var(--hero-vignette-strength, 0) * var(--hero-strength-multiplier, 1))) 100%
    );
    pointer-events: none;
}

/* Height variants — aligned with Breakout's own height presets
   (blocks/breakout/breakout.css): medium/large/full already matched
   exactly (50vh/70vh/100vh); only `small` differed (was 40vh here vs.
   Breakout's 30vh) — brought in line so the same height label reads
   the same regardless of which block it's on. */
.block-hero--height-small {
    min-height: 30vh;
}

/* A small-height hero with default spacing gets spacious padding so the
   reduced min-height still reads as a deliberate section, not a cramped band.
   `!important` is required ONLY because `.lcms-spacing-default` itself uses it
   (the spacing-utility cascade contract — see lcms-core.css "Block Spacing
   Classes"). This two-class selector already out-specifies the one-class
   utility, so if that contract is ever moved to @layer, drop the `!important`
   here too. This is the single downstream coupling of that contract (I12). */
.block-hero--height-small.lcms-spacing-default {
    padding-top: var(--block-spacing-spacious) !important;
    padding-bottom: var(--block-spacing-spacious) !important;
}

.block-hero--height-medium {
    min-height: 50vh;
}

.block-hero--height-large {
    min-height: 70vh;
}

.block-hero--height-full {
    min-height: 100vh;
}

/* Ensure the inner container fills the flex parent (section is flex items-end).
   z-index 3 sits above ::before (1) and ::after (2). */
.block-hero__inner {
    position: relative;
    z-index: 3;
    width: 100%;
}

/* Video background — fills the section, hidden on mobile for performance.
   Tint/vignette pseudo-elements continue to apply to the poster/image fallback. */
.block-hero__video-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

@media (max-width: 767px) {
    .block-hero__video-bg {
        display: none;
    }
}

/* When video bg is active, suppress the CSS background-image on desktop
   so the video is visible (background-image acts as poster/mobile fallback). */
@media (min-width: 768px) {
    .block-hero--has-video-bg {
        background-image: none !important;
    }
}

/* Media column — feature image and video embed. */
.block-hero__media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.block-hero__embed iframe {
    width: 100%;
    height: 100%;
}

/* Layout — left/right 2-column grid (60/40 split for media support) */
.block-hero__grid {
    display: block;
}

@media (min-width: 768px) {
    .block-hero__grid {
        display: grid;
        grid-template-columns: 3fr 2fr;
        gap: 3rem;
        align-items: center;
    }

    /* Force content to fill its grid column so heading/subtitle width
       is determined by the column (3fr ≈ 60%), not text length. */
    .block-hero__grid .block-hero__content {
        width: 100%;
    }

    .block-hero__spacer {
        display: block;
    }
}
/* ─────────────────────────────────────────────────────────────
   minimal variant — pared-back page header. White background,
   dark text, tight vertical spacing. No image, overlay, or buttons.
   ─────────────────────────────────────────────────────────────── */

.block-hero--minimal {
    background: var(--color-bg-primary, #ffffff);
    color: var(--color-text-primary, #101010);
}

.block-hero--minimal .block-hero-minimal__inner {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .block-hero--minimal .block-hero-minimal__inner {
        padding-top: 2.5rem;
        padding-bottom: 2.5rem;
    }
}

.block-hero-minimal--align-left   { text-align: left; }
.block-hero-minimal--align-center { text-align: center; }
.block-hero-minimal--align-right  { text-align: right; }

.block-hero-minimal__title {
    color: var(--color-text-primary, #101010);
    margin: 0;
}

.block-hero-minimal__subheading {
    margin-top: 0.5rem;
    max-width: 60ch;
}

.block-hero-minimal--align-center .block-hero-minimal__subheading {
    margin-left: auto;
    margin-right: auto;
}

.block-hero-minimal--align-right .block-hero-minimal__subheading {
    margin-left: auto;
}

/* ─────────────────────────────────────────────────────────────
   entrance animations (B46) — first-paint motion for the hero,
   distinct from the universal scroll-in fade every block gets.
   Applied to the content (and the media column, slightly staggered)
   on page load via CSS animation — no JS, no IntersectionObserver.
   The heading stays in the DOM and is only opacity/transform-
   animated, so Largest Contentful Paint isn't delayed.
   prefers-reduced-motion disables it entirely (content visible).
   ───────────────────────────────────────────────────────────── */

.block-hero--entrance .block-hero__content,
.block-hero--entrance .block-hero__media {
    animation-duration: 600ms;
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    /* `both` applies the start state before the run (no flash of the
       final frame) and holds the end state after. */
    animation-fill-mode: both;
}

/* Media column trails the content for a gentle stagger. */
.block-hero--entrance .block-hero__media {
    animation-delay: 120ms;
}

.block-hero--entrance-fade-up .block-hero__content,
.block-hero--entrance-fade-up .block-hero__media {
    animation-name: lcms-hero-fade-up;
}
@keyframes lcms-hero-fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.block-hero--entrance-fade-in .block-hero__content,
.block-hero--entrance-fade-in .block-hero__media {
    animation-name: lcms-hero-fade-in;
}
@keyframes lcms-hero-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.block-hero--entrance-scale-in .block-hero__content,
.block-hero--entrance-scale-in .block-hero__media {
    animation-name: lcms-hero-scale-in;
}
@keyframes lcms-hero-scale-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: none; }
}

/* slide-side — heading slides in from the left, media from the right. */
.block-hero--entrance-slide-side .block-hero__content {
    animation-name: lcms-hero-slide-left;
}
.block-hero--entrance-slide-side .block-hero__media {
    animation-name: lcms-hero-slide-right;
}
@keyframes lcms-hero-slide-left {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: none; }
}
@keyframes lcms-hero-slide-right {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: none; }
}

/* stagger — the content's children fade up one after another (icon →
   badge → heading → subtitle → buttons), rather than the content block
   moving as a single unit. Direct children animate with an incremental
   delay; the order follows the DOM, so whichever optional pieces are
   present cascade in sequence. `stagger-slow` is the same cascade with
   the per-child delay doubled for a more deliberate, drawn-out reveal. */
.block-hero--entrance-stagger .block-hero__content > *,
.block-hero--entrance-stagger .block-hero__media,
.block-hero--entrance-stagger-slow .block-hero__content > *,
.block-hero--entrance-stagger-slow .block-hero__media {
    animation-name: lcms-hero-fade-up;
    animation-duration: 600ms;
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-fill-mode: both;
}
.block-hero--entrance-stagger .block-hero__content > *:nth-child(1) { animation-delay: 0ms; }
.block-hero--entrance-stagger .block-hero__content > *:nth-child(2) { animation-delay: 80ms; }
.block-hero--entrance-stagger .block-hero__content > *:nth-child(3) { animation-delay: 160ms; }
.block-hero--entrance-stagger .block-hero__content > *:nth-child(4) { animation-delay: 240ms; }
.block-hero--entrance-stagger .block-hero__content > *:nth-child(5) { animation-delay: 320ms; }
.block-hero--entrance-stagger .block-hero__content > *:nth-child(n+6) { animation-delay: 400ms; }

/* slow stagger — per-child delay doubled (80ms → 160ms steps). */
.block-hero--entrance-stagger-slow .block-hero__content > *:nth-child(1) { animation-delay: 0ms; }
.block-hero--entrance-stagger-slow .block-hero__content > *:nth-child(2) { animation-delay: 160ms; }
.block-hero--entrance-stagger-slow .block-hero__content > *:nth-child(3) { animation-delay: 320ms; }
.block-hero--entrance-stagger-slow .block-hero__content > *:nth-child(4) { animation-delay: 480ms; }
.block-hero--entrance-stagger-slow .block-hero__content > *:nth-child(5) { animation-delay: 640ms; }
.block-hero--entrance-stagger-slow .block-hero__content > *:nth-child(n+6) { animation-delay: 800ms; }

@media (prefers-reduced-motion: reduce) {
    .block-hero--entrance .block-hero__content,
    .block-hero--entrance .block-hero__content > *,
    .block-hero--entrance .block-hero__media {
        animation: none;
    }
}
