/**
 * Stella Mortgage Theme — editor-block-hero.css
 *
 * Loaded in the block editor via enqueue_block_editor_assets.
 * Renders the Mortgage Hero block with full visual fidelity inside
 * Gutenberg, and forces the block to break out of the content-width
 * column (alignfull behaviour) in the editor canvas.
 *
 * Selector anatomy:
 *   .is-root-container          — Gutenberg WP ≥ 6.2 canvas wrapper
 *   .wp-block[data-type="…"]   — block wrapper div added by Gutenberg
 *   .alignfull / .alignwide     — alignment class added by core
 *   .acf-block-preview          — ACF preview wrapper in edit mode
 */

/* ============================================================
   1. FULL-WIDTH BREAKOUT IN THE EDITOR CANVAS
   ============================================================ */

/* Modern Gutenberg (WP 6.x) — root padding-aware alignments */
.is-root-container > .wp-block[data-type="acf/mortgage-hero"] {
    max-width: none !important;
    width: 100% !important;
}

.is-root-container > .wp-block[data-type="acf/mortgage-hero"].alignfull {
    margin-left:  calc(-1 * var(--wp--style--root--padding-left,  28px)) !important;
    margin-right: calc(-1 * var(--wp--style--root--padding-right, 28px)) !important;
    width:  calc(100% + var(--wp--style--root--padding-left, 28px) + var(--wp--style--root--padding-right, 28px)) !important;
    max-width: none !important;
}

/* Fallback for older Gutenberg / without theme.json padding-aware */
.editor-styles-wrapper .wp-block[data-type="acf/mortgage-hero"],
.editor-styles-wrapper .wp-block[data-type="acf/mortgage-hero"].alignfull {
    max-width: none !important;
    margin-left:  -28px !important;
    margin-right: -28px !important;
    width: calc(100% + 56px) !important;
}

/* The ACF preview div itself must fill its parent */
.wp-block[data-type="acf/mortgage-hero"] .acf-block-preview,
.wp-block[data-type="acf/mortgage-hero"] > div {
    width: 100% !important;
    max-width: none !important;
    overflow: hidden !important;
}

/* ============================================================
   2. GOOGLE FONTS (editor doesn't inherit frontend @import)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   3. CSS DESIGN TOKENS (mirror main.css :root)
   ============================================================ */
:root {
    --navy:        #0D1B2A;
    --navy-mid:    #162840;
    --slate:       #2C4A7A;
    --slate-light: #4A6FA5;
    --gold:        #C4973A;
    --gold-light:  #D9AF60;
    --gold-dim:    rgba(196,151,58,0.12);
    --gold-border: rgba(196,151,58,0.28);
    --white:       #FFFFFF;
    --off-white:   #F7F6F2;
    --fog:         #EEF1F7;
    --text:        #18243A;
    --muted:       #5A6882;
    --border:      #DDE3EE;
    --border-light:#E8ECF5;
    --font-display:'Cormorant Garamond', Georgia, serif;
    --font-body:   'Manrope', system-ui, sans-serif;
    --radius:      6px;
    --radius-lg:   14px;
    --radius-xl:   22px;
}

/* ============================================================
   4. HERO SECTION LAYOUT
   ============================================================ */
.hero {
    min-height: 88vh;
    display: flex;
    align-items: center;
    padding-top: 72px;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.hero .container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 28px;
    width: 100%;
    box-sizing: border-box;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            105deg,
            #F2EFE9 0%,
            #F2EFE9 38%,
            rgba(242,239,233,0.82) 52%,
            rgba(13,27,42,0.18) 70%,
            rgba(13,27,42,0.10) 100%
        ),
        url('https://images.unsplash.com/photo-1570129477492-45c003edd2be?w=1800&q=80')
        center / cover no-repeat;
}

.hero-ribbon {
    position: absolute;
    bottom: 0; left: 0;
    width: 300px; height: 300px;
    border: 1px solid rgba(196,151,58,0.15);
    border-radius: 50%;
    transform: translate(-50%, 50%);
    pointer-events: none;
}
.hero-ribbon::after {
    content: '';
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(196,151,58,0.08);
    border-radius: 50%;
}

/* ── Grid ── */
.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 64px;
    align-items: center;
    width: 100%;
    padding: 56px 0;
    box-sizing: border-box;
}

/* ── Pill ── */
.hero-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 0 2px 14px;
    border-left: 2px solid var(--gold);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 30px;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    font-family: var(--font-body);
}
.hero-pill-dot { display: none; }

/* ── Headline ── */
.hero-h1 {
    font-family: var(--font-display);
    font-size: clamp(48px, 6.8vw, 86px);
    line-height: 1.02;
    color: var(--navy);
    font-weight: 400;
    letter-spacing: -0.3px;
    margin-bottom: 24px;
}
.hero-h1 em {
    font-style: italic;
    color: var(--navy);
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-decoration-thickness: 4px;
    text-underline-offset: 10px;
}

/* ── Subheadline ── */
.hero-sub {
    font-size: 17px;
    color: var(--muted);
    line-height: 1.8;
    max-width: 470px;
    margin-bottom: 36px;
    font-family: var(--font-body);
}

/* ── CTA Buttons ── */
.hero-ctas {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 52px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    padding: 13px 28px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.1px;
    transition: all 0.22s;
    white-space: nowrap;
    text-decoration: none;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-navy    { background: var(--navy); color: #fff; }

/* ── Stats ── */
.hero-stats {
    display: flex;
    gap: 44px;
    padding-top: 36px;
    border-top: 1px solid rgba(13,27,42,0.12);
}
.stat-n {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    color: var(--navy);
    line-height: 1;
}
.stat-l {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-family: var(--font-body);
}

/* ============================================================
   5. PROFILE CARD
   ============================================================ */
.hero-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 0;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(13,27,42,0.10),
        0 16px 56px rgba(13,27,42,0.08);
    text-align: center;
}
.profile-ring {
    width: 100%;
    height: 265px;
    border-radius: 0;
    overflow: hidden;
    background: var(--navy-mid);
}
.profile-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}
.card-name {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--navy);
    font-weight: 400;
    letter-spacing: -0.3px;
    padding: 22px 22px 0;
}
.card-title {
    font-size: 10.5px;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 6px 0 4px;
    font-family: var(--font-body);
}
.card-nmls {
    font-size: 11.5px;
    color: var(--muted);
    margin-bottom: 18px;
    font-family: var(--font-body);
}
.card-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 20px;
}
.card-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-body);
    text-decoration: none;
}
.card-link.gold  { background: var(--gold); color: var(--navy); }
.card-link.ghost { border: 1px solid var(--border); color: var(--text); background: transparent; }
.card-vi-badge {
    margin: 14px 20px 20px;
    padding: 9px 12px;
    background: var(--fog);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 11.5px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: var(--font-body);
}

/* ============================================================
   6. LIGHT TEXT THEME OVERRIDES
   ============================================================ */
.acf-block-hero.light-theme .hero-h1        { color: #fff; }
.acf-block-hero.light-theme .hero-h1 em     { color: #fff; text-decoration-color: var(--gold); }
.acf-block-hero.light-theme .hero-pill       { color: rgba(255,255,255,0.8); }
.acf-block-hero.light-theme .hero-sub        { color: rgba(255,255,255,0.7); }
.acf-block-hero.light-theme .hero-stats      { border-top-color: rgba(255,255,255,0.15); }
.acf-block-hero.light-theme .stat-n          { color: #fff; }
.acf-block-hero.light-theme .stat-l          { color: rgba(255,255,255,0.5); }

/* dark text theme */
.acf-block-hero.dark-theme .hero-h1 { color: var(--navy); }
.acf-block-hero.dark-theme .hero-h1 em { color: var(--navy); text-decoration-color: var(--gold); }
.acf-block-hero.dark-theme .hero-pill { color: var(--text); }
.acf-block-hero.dark-theme .hero-sub { color: var(--muted); }
.acf-block-hero.dark-theme .hero-stats { border-top-color: rgba(255,255,255,0.15); }
.acf-block-hero.dark-theme .stat-n { color: var(--navy); }
.acf-block-hero.dark-theme .stat-l { color: var(--muted); }

/* ============================================================
   7. NO-PROFILE VARIANT
   ============================================================ */
.hero.hero--no-profile .hero-inner {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}
.hero.hero--no-profile .hero-sub {
    max-width: 100%;
}

/* ============================================================
   8. EDITOR TOOLBAR & BLOCK OUTLINE RESETS
      Prevent the editor blue outline from collapsing the block
   ============================================================ */
.wp-block[data-type="acf/mortgage-hero"] > .block-editor-block-list__block-selection-button {
    z-index: 10 !important;
}

/* Stop the Gutenberg content-width constraint from shrinking the block */
.wp-block[data-type="acf/mortgage-hero"] {
    contain: none !important;
}
