/*
==========================================================
HERO BLOCK — hero.css
ByDeNero Custom Hero Styling
==========================================================
WHAT IT IS:
Variant-based hero block. The base styles define the homepage
two-column grid layout (content left, portrait card right).
Variant classes override this base for inner pages.

WHAT IT DOES:
Base (homepage): eyebrow, subheading, heading, paragraph, CTA
buttons on the left; rotated portrait card + glass panel on the
right; diagonal polygon cutout decorating the bottom-right.

inner_banner variant: compact inner-page banner. Cutout hidden.
  - With portrait image: switches to portrait-as-background layout.
    hero_layout becomes single-column (display: block); hero_visual
    wraps both the full-bleed portrait img AND hero_content so the
    content card floats over the photo. Glass panel and portrait
    card component not used in this mode.
  - Without portrait image: standard two-column layout with
    cutout and glass panel hidden.

default variant: single-column content-only hero, no visual system.

HOW TO USE:
1. Add the Hero block in the WordPress block editor.
2. Fill in Heading (required), plus optional fields.
3. Set Section Variant (default = homepage feature).
4. For inner pages: choose inner-banner. Upload a portrait image
   to activate the portrait-as-background layout.
5. Set overlay opacity (0–100) when using a bg image.

Active render template: hero-v2.php (block.json points here).
hero.php exists in the folder but is unused (OPcache workaround).
All values use ByDeNero CSS tokens from style.css.
==========================================================
*/

/* Hero wrapper */
.hero_block {
    position: relative;
    width: 100%;
    min-height: 820px;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--color-bg-dark);
    margin: 0;
    padding: 4.5rem 0 6rem;
    overflow: hidden;
    border-bottom-left-radius: 65px;

}

/* Hero Style — Full Width */
.hero_style_full-width {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: calc(-1 * var(--space-16));
}

/* Hero Style — Contained */
.hero_style_contained {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    border-radius: 32px;
}

/* Overlay */
.hero_overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ambient glow behind hero */
.hero_block::before {
    content: "";
    position: absolute;
    inset: auto 0 -10% 0;
    height: 78%;
    background:
        radial-gradient(circle at 22% 56%, rgba(162, 89, 255, 0.32), transparent 40%),
        radial-gradient(circle at 62% 42%, rgba(162, 89, 255, 0.22), transparent 30%),
        radial-gradient(circle at 78% 44%, rgba(108, 164, 255, 0.18), transparent 34%);
    filter: blur(48px);
    pointer-events: none;
    z-index: 1;
}

/* Inner content */
.hero_inner {
    position: relative;
    z-index: 2;
}

/* 2-column layout */
.hero_layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
    align-items: center;
    gap: 1.5rem;
}

.hero_content {
    max-width: 640px;
    position: relative;
    z-index: 3;
    margin-left: var(--wrapper-padding);
}

.hero_align_center .hero_layout {
    grid-template-columns: 1fr;
}

.hero_align_center .hero_content {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.hero_align_center .hero_visual {
    margin: 0 auto;
}

.hero_align_right .hero_layout {
    grid-template-columns: 0.95fr 1.05fr;
}

.hero_align_right .hero_content {
    margin-left: auto;
    text-align: right;
}

/* eyebrow */
.hero_eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem 0;
    padding: 0.55rem 0.95rem;
    border: 1px solid rgba(162, 89, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: var(--font-accent);
    font-size: 0.76rem;
    font-weight: var(--weight-semi);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 18px rgba(162, 89, 255, 0.08);
}

/* optional ACF subheading */
.hero_subheading {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: var(--weight-semi);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-secondary);
    opacity: 0.95;
    margin: 0 0 1.15rem 0;
}

/* Heading */
.hero_heading {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4vw, 4.9rem);
    font-weight: var(--weight-bold);
    color: var(--color-text-inverse);
    line-height: 0.96;
    letter-spacing: -0.03em;
    margin: 0 0 1.1rem 1.1rem;
    max-width: 13ch;
    text-shadow:
        0 0 18px rgba(162, 89, 255, 0.08),
        0 10px 30px rgba(0, 0, 0, 0.32);
}

.hero_align_center .hero_heading,
.hero_align_right .hero_heading {
    max-width: none;
}

.hero_heading_line {
    display: block;
}

.hero_heading_line_1 {
    margin-left: 0;
}

.hero_heading_line_2 {
    margin-left: 0;
}

.hero_heading_line_3 {
    margin-left: 0;
}

.hero_heading_accent {
    display: inline-block;
    background: linear-gradient(
        135deg,
        var(--color-accent) 0%,
        var(--color-accent-hover) 42%,
        var(--color-secondary) 100%
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

/* Paragraph */
.hero_paragraph {
    font-size: clamp(1rem, 1.4vw, 1.16rem);
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.75;
    margin: 0 0 2rem 0;
    max-width: 42ch;
}

/* CTA buttons row */
.hero_cta_row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.hero_align_center .hero_cta_row {
    justify-content: center;
}

.hero_align_right .hero_cta_row {
    justify-content: flex-end;
}

/* Secondary CTA */
.hero_cta_secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0.95rem 1.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--color-white);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 0 18px rgba(108, 164, 255, 0.08);
}

.hero_cta_secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--color-white);
    text-decoration: none;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 0 24px rgba(108, 164, 255, 0.12);
}

.hero_visual {
    position: relative;
    min-height: 660px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* right-side cutout — shape wrapper only, no background on this element */
.hero_visual_cutout {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 1000px;
    height: 91%;
    overflow: hidden;
    clip-path: polygon(
        0% 100%,
        10% 100%,
        14% 99%,
        18% 96%,
        23% 89%,
        47% 16%,
        50% 10%,
        54% 6%,
        60% 4%,
        90% 4%,
        95% 5%,
        98% 8%,
        100% 14%,
        100% 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* background lives on a child layer — keeps it out of the clip-path compositing conflict */
.hero_visual_cutout::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--color-bg-dark);
    background-image: var(--cutout-grid-url);
    background-size: 400px auto;
    background-repeat: repeat;
    background-position: center top;
    background-attachment: fixed;
}

@media (max-width: 1199px) {
    .hero_visual_cutout {
        width: 760px;
        height: 82%;
        right: 0;
        bottom: 0;
    }
}

@media (max-width: 899px) {
    .hero_visual_cutout {
        display: none;
    }
}

/* Glass panel — sits behind the portrait card */
.hero_visual_glass_panel {
    position: absolute;
    right: 10px;
    bottom: 38px;
    width: 490px;
    height: 580px;
    border-radius: 28px;
    background: rgba(10, 15, 44, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 2;
    transform: rotate(-7deg);
    pointer-events: none;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.hero_visual_glass_panel::before {
    content: "";
    position: absolute;
    inset: -24px;
    background: rgba(162, 89, 255, 0.14);
    filter: blur(34px);
    z-index: 0;
    pointer-events: none;
    border-radius: 36px;
}

.hero_visual_glass_panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow:
        0 0 0 1px rgba(162, 89, 255, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    z-index: 1;
}

/* Portrait glow — ambient light behind the card */
.hero_portrait_glow {
    position: absolute;
    right: 22px;
    bottom: 44px;
    width: 450px;
    aspect-ratio: 0.78 / 1;
    transform: rotate(-7deg);
    background: radial-gradient(
        ellipse at 50% 55%,
        rgba(162, 89, 255, 0.30) 0%,
        rgba(108, 164, 255, 0.16) 45%,
        transparent 72%
    );
    filter: blur(22px);
    z-index: 2;
    pointer-events: none;
}

/* Portrait card */
.hero_portrait_card {
    position: absolute;
    right: 35px;
    bottom: 62px;
    width: 400px;
    aspect-ratio: 0.78 / 1;
    transform: rotate(-7deg);
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 22px 42px rgba(0, 0, 0, 0.34));
}

.hero_portrait_card::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: -2px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(108, 164, 255, 0.18) 18%,
        rgba(162, 89, 255, 0.9) 50%,
        rgba(108, 164, 255, 0.18) 82%,
        transparent 100%
    );
    filter: blur(0.3px);
    z-index: 4;
    pointer-events: none;
}

.hero_portrait_card_inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(10, 15, 44, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 0 2px rgba(162, 89, 255, 0.16),
        0 0 28px rgba(162, 89, 255, 0.22),
        0 0 54px rgba(108, 164, 255, 0.12);
}

.hero_portrait_card_inner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(162, 89, 255, 0.95) 0%,
        rgba(212, 114, 255, 0.55) 45%,
        rgba(108, 164, 255, 0.95) 100%
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0.9;
    z-index: 3;
    pointer-events: none;
}

.hero_portrait_card_inner::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 15, 44, 0.14), rgba(10, 15, 44, 0.42)),
        radial-gradient(circle at 50% 35%, rgba(162, 89, 255, 0.12), transparent 46%);
    z-index: 2;
    pointer-events: none;
}

.hero_portrait_card_inner .hero_portrait_edge_glow {
    display: none;
}

.hero_portrait_img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: brightness(0.84) saturate(0.94) contrast(1.04);
}

/* Portrait stack — 1025px to 1199px (desktop grid, smaller viewport) */
@media (max-width: 1199px) {
    .hero_visual_glass_panel {
        right: 8px;
        bottom: 26px;
        width: 400px;
        height: 475px;
        transform: rotate(-5deg);
    }

    .hero_portrait_glow {
        right: 16px;
        bottom: 32px;
        width: 365px;
        transform: rotate(-5deg);
    }

    .hero_portrait_card {
        right: 26px;
        bottom: 40px;
        width: 315px;
        transform: rotate(-6deg);
    }
}

/* Portrait stack — 900px to 1024px (single-column layout, visual is full width) */
@media (max-width: 1024px) {
    .hero_visual_glass_panel {
        right: 6px;
        bottom: 18px;
        width: 325px;
        height: 390px;
        transform: rotate(-4deg);
    }

    .hero_portrait_glow {
        right: 12px;
        bottom: 24px;
        width: 295px;
        transform: rotate(-4deg);
    }

    .hero_portrait_card {
        right: 20px;
        bottom: 32px;
        width: 255px;
        transform: rotate(-5deg);
    }
}

/* Portrait stack — below 900px, hide everything */
@media (max-width: 899px) {
    .hero_visual_glass_panel,
    .hero_portrait_glow,
    .hero_portrait_card {
        display: none;
    }
}

/* alignment helpers */
.hero_align_left .hero_inner { text-align: left; }
.hero_align_center .hero_inner { text-align: center; }
.hero_align_right .hero_inner { text-align: right; }

/* Large Desktop */
@media (min-width: 1200px) {
    .hero_layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
        gap: 1rem;
    }

    .hero_content {
        max-width: 720px;
        margin-left: var(--wrapper-padding);
    }

    .hero_heading {
        font-size: 3.6rem;
        max-width: 14.5ch;
        margin-left: 1.1rem;
    }
}

/* Tablet — 900px to 1024px stays 2-column, only adjust spacing and content */
@media (max-width: 1024px) {
    .hero_block {
        min-height: auto;
        padding: 6rem 0 5rem;
    }

    .hero_content {
        margin-left: 0;
    }

    .hero_heading {
        max-width: none;
    }
}

/* Below 900px — collapse to single column, hide entire right-side visual system */
@media (max-width: 899px) {
    .hero_layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero_visual,
    .hero_visual_cutout,
    .hero_visual_glass_panel,
    .hero_portrait_card,
    .hero_portrait_glow {
        display: none;
    }

    .hero_block {
        border-bottom-right-radius: 65px;
    }

    .hero_block::after {
        content: "";
        position: absolute;
        left: 8%;
        right: 8%;
        bottom: 0;
        height: 2px;
        background: linear-gradient(
            90deg,
            rgba(162, 89, 255, 0.06) 0%,
            rgba(108, 164, 255, 0.12) 14%,
            rgba(162, 89, 255, 0.40) 28%,
            rgba(212, 114, 255, 0.95) 50%,
            rgba(162, 89, 255, 0.40) 72%,
            rgba(108, 164, 255, 0.12) 86%,
            rgba(162, 89, 255, 0.06) 100%
        );
        pointer-events: none;
        z-index: 10;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .hero_block {
        padding: 7rem 0 4rem;
    }

    .hero_eyebrow,
    .hero_subheading {
        margin-left: auto;
        margin-right: auto;
    }

    .hero_eyebrow {
        font-size: 0.68rem;
        letter-spacing: 0.12em;
    }

    .hero_subheading {
        font-size: 0.82rem;
    }

    .hero_content {
        margin-left: 0;
        text-align: center;
    }

    .hero_heading {
        font-size: clamp(2.25rem, 9vw, 3rem);
        line-height: 1.02;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
    }

    .hero_heading_accent {
        display: block;
        max-width: 100%;
        overflow-wrap: normal;
    }

    .hero_paragraph {
        font-size: 1rem;
        line-height: 1.7;
        max-width: 32ch;
        margin-left: auto;
        margin-right: auto;
    }

    .hero_cta_row {
        justify-content: center;
        flex-direction: column;
        align-items: stretch;
    }

    .hero_cta_primary,
    .hero_cta_secondary {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero_block {
        padding: 6.5rem 0 3.5rem;
    }
}

/* ===================================================
   HERO VARIANTS
   Variant rules come after all base rules so they
   cascade correctly and two-class specificity wins.
   =================================================== */

/* Default — clean content-only hero for inner pages */
.hero_variant_default .hero_visual_cutout,
.hero_variant_default .hero_visual_glass_panel,
.hero_variant_default .hero_portrait_glow,
.hero_variant_default .hero_portrait_card,
.hero_variant_default .hero_visual {
    display: none;
}

.hero_variant_default .hero_layout {
    grid-template-columns: 1fr;
}

.hero_variant_default .hero_content {
    max-width: 820px;
    margin-left: 0;
}

.hero_variant_default.hero_block {
    border-bottom-right-radius: 65px;
}

/* Homepage Feature — full custom visual system intact; all base hero styles apply as-is */

/* ===================================================
   INNER BANNER VARIANT
   Reusable two-column inner-page hero.
   Diagonal polygon cutout hidden — replaced by a
   rounded-square panel on the right column.
   Portrait stack is upright (no rotation).
   Background gradient/overlay controlled by
   body.page-{slug} in style.css §10.
   =================================================== */

/* Block sizing, corners, and base inner-page background.
   Lighter than the homepage base color — works via variant class alone.
   body.page-{slug} in style.css overrides this for per-page intensity. */
.hero_variant_inner_banner.hero_block {
    min-height: 580px;
    padding: 4rem 0 5rem;
    border-bottom-left-radius: 65px;
    border-bottom-right-radius: 65px;
    background: linear-gradient(
        150deg,
        rgba(13, 20, 56, 1)  0%,
        rgba(10, 15, 44, 1)  55%,
        rgba(8,  12, 36, 1)  100%
    );
}

/* Hide the diagonal polygon cutout */
.hero_variant_inner_banner .hero_visual_cutout {
    display: none;
}

/* Glass panel not used on inner-banner */
.hero_variant_inner_banner .hero_visual_glass_panel {
    display: none;
}

/* Portrait sits below the gradient overlay — z-index: 0 and 1 */
.hero_variant_inner_banner .hero_portrait_glow {
    right: 74px;
    bottom: 42px;
    width: 310px;
    transform: none;
    z-index: 0;
}

.hero_variant_inner_banner .hero_portrait_card {
    right: 86px;
    bottom: 52px;
    width: 295px;
    transform: none;
    z-index: 1;
}

/* 1025px–1199px */
@media (max-width: 1199px) {
    .hero_variant_inner_banner .hero_portrait_glow {
        right: 52px;
        bottom: 30px;
        width: 258px;
    }

    .hero_variant_inner_banner .hero_portrait_card {
        right: 60px;
        bottom: 38px;
        width: 244px;
    }
}

/* 900px–1024px */
@media (max-width: 1024px) {
    .hero_variant_inner_banner .hero_portrait_glow {
        right: 36px;
        bottom: 22px;
        width: 208px;
    }

    .hero_variant_inner_banner .hero_portrait_card {
        right: 42px;
        bottom: 28px;
        width: 196px;
    }
}

/* ── Portrait-as-background layout ──────────────────────────────────
   Used when inner_banner + portrait_image are both set.
   hero_layout becomes single-column; hero_visual wraps the portrait
   img AND hero_content so the content card floats over the photo.
   ─────────────────────────────────────────────────────────────────── */

.hero_layout_portrait_bg {
    display: block;
}

.hero_layout_portrait_bg .hero_visual {
    position: relative;
    width: 100%;
    min-height: 480px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.hero_portrait_bg_img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 1;
    display: block;
    pointer-events: none;
}

.hero_layout_portrait_bg .hero_content {
    position: relative;
    z-index: 2;
    margin-left: var(--wrapper-padding);
}
