/* ============================================================
   GWW ADVANCED ROOT-CAUSE V1.23.3.27.1
   ------------------------------------------------------------
   IMPORTANT STRUCTURE:
   The Advanced root owns breadcrumb + hero.
   Fact strip/page grid/main/cards are siblings later in .content-site.
   Therefore body:has(#advanced-root) is the correct page scope.
   ============================================================ */

@supports selector(body:has(#gww-advanced-profile-root)) {

    body:has(#gww-advanced-profile-root),
    body:has(#gww-advanced-business-root) {
        --gww327-deep:#020a13;
        --gww327-navy:#06192d;
        --gww327-navy2:#0a2543;
        --gww327-card:#091b2e;
        --gww327-card2:#0c2238;
        --gww327-gold:#d8ab4e;
        --gww327-gold-soft:#f3d48a;
        --gww327-copy:#edf3f8;
        --gww327-muted:#b6c3d0;
        --gww327-line:rgba(216,171,78,.52);
        --gww327-shadow:0 16px 36px rgba(0,0,0,.22);
    }

    /* ---------- PAGE BACKGROUND ---------- */

    body:has(#gww-advanced-profile-root) .content-site,
    body:has(#gww-advanced-business-root) .content-site {
        color:var(--gww327-copy) !important;
        background:
            linear-gradient(
                180deg,
                #06111f 0%,
                #091827 48%,
                #06111f 100%
            ) !important;
    }

    /* ---------- PROFESSIONAL HERO ---------- */

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root {
        color:#fff !important;
        background:var(--gww327-deep) !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-hero {
        position:relative !important;
        isolation:isolate !important;
        overflow:hidden !important;
        color:#fff !important;
        background:
            linear-gradient(
                135deg,
                #020a13 0%,
                #06192d 58%,
                #0a2948 100%
            ) !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-hero::after {
        content:"" !important;
        position:absolute !important;
        inset:0 !important;
        z-index:1 !important;
        pointer-events:none !important;
        border-radius:0 !important;
        background:
            linear-gradient(
                126deg,
                transparent 0 69%,
                rgba(216,171,78,.92) 69.1% 69.38%,
                transparent 69.52%
            ),
            linear-gradient(
                126deg,
                transparent 0 74%,
                rgba(216,171,78,.30) 74.1% 74.3%,
                transparent 74.46%
            )
            !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-hero-inner {
        position:relative !important;
        z-index:4 !important;
    }

    /*
     * Do NOT set width/height/grid-column here.
     * The canonical public-image-position renderer remains authoritative
     * for Left/Center/Right, X/Y, crop and Profile Image Size.
     */
    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-photo-card {
        visibility:visible !important;
        opacity:1 !important;
        overflow:hidden !important;
        border:2px solid var(--gww327-gold) !important;
        border-radius:12px !important;
        background:#fff !important;
        box-shadow:
            0 24px 52px rgba(0,0,0,.36),
            0 0 0 4px rgba(255,255,255,.06)
            !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-photo-card img {
        display:block !important;
        width:100% !important;
        height:100% !important;
        object-fit:cover !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-hero-copy {
        visibility:visible !important;
        opacity:1 !important;
        padding:25px 28px !important;
        color:#fff !important;
        border:1px solid var(--gww327-line) !important;
        border-radius:10px !important;
        background:
            linear-gradient(
                135deg,
                rgba(2,12,24,.96),
                rgba(7,31,55,.91)
            ) !important;
        box-shadow:var(--gww327-shadow) !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-hero h1 {
        margin:0 0 8px !important;
        color:#fff !important;
        font-family:Georgia,"Times New Roman",serif !important;
        font-size:clamp(42px,5vw,64px) !important;
        line-height:1.02 !important;
        letter-spacing:-.035em !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-specialty {
        color:var(--gww327-gold-soft) !important;
        font-size:18px !important;
        font-weight:800 !important;
    }

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-location {
        color:#fff !important;
    }

    /* ---------- BUSINESS HERO ---------- */

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root {
        color:#fff !important;
        background:var(--gww327-deep) !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-hero {
        position:relative !important;
        isolation:isolate !important;
        overflow:hidden !important;
        color:#fff !important;
        background-color:var(--gww327-navy) !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-hero-grid {
        position:relative !important;
        z-index:4 !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-logo-card {
        visibility:visible !important;
        opacity:1 !important;
        overflow:hidden !important;
        border:2px solid var(--gww327-gold) !important;
        border-radius:12px !important;
        background:#fff !important;
        box-shadow:
            0 24px 52px rgba(0,0,0,.36),
            0 0 0 4px rgba(255,255,255,.06)
            !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-logo-card img {
        display:block !important;
        width:100% !important;
        height:100% !important;
        object-fit:cover !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-hero-copy {
        visibility:visible !important;
        opacity:1 !important;
        padding:25px 28px !important;
        color:#fff !important;
        border:1px solid var(--gww327-line) !important;
        border-radius:10px !important;
        background:
            linear-gradient(
                135deg,
                rgba(2,12,24,.96),
                rgba(7,31,55,.90)
            ) !important;
        box-shadow:var(--gww327-shadow) !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-hero h1 {
        margin:0 0 8px !important;
        color:#fff !important;
        font-family:Georgia,"Times New Roman",serif !important;
        font-size:clamp(42px,5vw,64px) !important;
        line-height:1.02 !important;
        letter-spacing:-.035em !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-hero-category {
        color:var(--gww327-gold-soft) !important;
        font-size:18px !important;
        font-weight:800 !important;
    }

    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-hero-location {
        color:#fff !important;
    }

    /* ---------- BUTTONS ---------- */

    body:has(#gww-advanced-profile-root)
    #gww-advanced-profile-root .gww-primary-btn,
    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-primary-btn,
    body:has(#gww-advanced-business-root)
    #gww-advanced-business-root .gww-business-hero-btn {
        color:#071525 !important;
        background:var(--gww327-gold) !important;
        border:1px solid var(--gww327-gold) !important;
        border-radius:6px !important;
    }

    /* ---------- FACT STRIPS: SIBLINGS OF ROOT ---------- */

    body:has(#gww-advanced-profile-root) .gww-fact-strip,
    body:has(#gww-advanced-business-root) .gww-business-authority-strip,
    body:has(#gww-advanced-business-root) .gww-business-info-strip {
        color:var(--gww327-copy) !important;
        background:#07182a !important;
        border:1px solid var(--gww327-line) !important;
        border-top:3px solid var(--gww327-gold) !important;
        border-radius:8px !important;
        box-shadow:var(--gww327-shadow) !important;
    }

    body:has(#gww-advanced-profile-root) .gww-fact-strip *,
    body:has(#gww-advanced-business-root) .gww-business-authority-strip *,
    body:has(#gww-advanced-business-root) .gww-business-info-strip * {
        color:var(--gww327-copy) !important;
    }

    /* ---------- PROFESSIONAL PAGE GRID ---------- */

    body:has(#gww-advanced-profile-root) .gww-page-grid {
        background:transparent !important;
        align-items:start !important;
    }

    body:has(#gww-advanced-profile-root) .gww-sidebar {
        align-self:start !important;
        position:sticky !important;
        top:18px !important;
    }

    body:has(#gww-advanced-profile-root) .gww-main {
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        grid-auto-flow:row !important;
        gap:18px !important;
        min-width:0 !important;
        background:transparent !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-main > .gww-adv212-about {
        order:10 !important;
        grid-column:1 / -1 !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-authority-grid {
        display:contents !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-adv212-press {
        order:20 !important;
        grid-column:1 / -1 !important;
        width:100% !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-adv212-accomplishments {
        order:30 !important;
        grid-column:1 !important;
        width:100% !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-main > .gww-adv212-career {
        order:30 !important;
        grid-column:2 !important;
        width:100% !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-professional-grid {
        order:40 !important;
        grid-column:1 / -1 !important;
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:18px !important;
        width:100% !important;
    }

    body:has(#gww-advanced-profile-root)
    [data-gww-field-source="professional-summary"] {
        order:90 !important;
        grid-column:1 / -1 !important;
        width:100% !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-main > .gww-contact-form {
        order:100 !important;
        grid-column:1 / -1 !important;
        width:100% !important;
    }

    /* ---------- BUSINESS PAGE GRID ---------- */

    body:has(#gww-advanced-business-root)
    .gww-business-main {
        background:transparent !important;
        align-items:start !important;
    }

    body:has(#gww-advanced-business-root)
    .gww-business-sidebar {
        align-self:start !important;
        position:sticky !important;
        top:18px !important;
    }

    body:has(#gww-advanced-business-root)
    .gww-business-content {
        gap:18px !important;
        background:transparent !important;
    }

    body:has(#gww-advanced-business-root)
    .gww-business-two-column,
    body:has(#gww-advanced-business-root)
    .gww-business-media-grid {
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:18px !important;
    }

    body:has(#gww-advanced-business-root)
    .gww-business-three-column {
        display:grid !important;
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:18px !important;
    }

    body:has(#gww-advanced-business-root)
    .gww-business-three-column > .gww-adv212-press {
        grid-column:1 / -1 !important;
    }

    /* ---------- DARK ADVANCED CARD SYSTEM ---------- */

    body:has(#gww-advanced-profile-root)
    :is(
        .gww-sidebar-card,
        .gww-editorial-section,
        .gww-adv-master-quicklinks
    ),
    body:has(#gww-advanced-business-root)
    :is(
        .gww-business-card,
        .gww-business-section-card,
        .gww-business-media-card,
        .gww-business-contact-card,
        .gww-business-bottom-contact,
        .gww-adv-master-quicklinks
    ) {
        color:var(--gww327-copy) !important;
        background:
            linear-gradient(
                145deg,
                rgba(9,27,46,.995),
                rgba(7,21,37,.995)
            ) !important;
        border:1px solid var(--gww327-line) !important;
        border-radius:9px !important;
        box-shadow:0 12px 28px rgba(0,0,0,.16) !important;
    }

    body:has(#gww-advanced-profile-root)
    :is(.gww-sidebar-card,.gww-editorial-section)
    :is(h1,h2,h3),
    body:has(#gww-advanced-business-root)
    :is(
        .gww-business-card,
        .gww-business-section-card,
        .gww-business-media-card,
        .gww-business-contact-card,
        .gww-business-bottom-contact
    )
    :is(h1,h2,h3) {
        color:var(--gww327-gold-soft) !important;
        font-family:Georgia,"Times New Roman",serif !important;
    }

    body:has(#gww-advanced-profile-root)
    :is(.gww-sidebar-card,.gww-editorial-section)
    :is(p,li,span,strong,address),
    body:has(#gww-advanced-business-root)
    :is(
        .gww-business-card,
        .gww-business-section-card,
        .gww-business-media-card,
        .gww-business-contact-card,
        .gww-business-bottom-contact
    )
    :is(p,li,span,strong,address) {
        color:var(--gww327-copy) !important;
        opacity:1 !important;
    }

    /* ---------- FEATURED PRESS CONTRAST ---------- */

    body:has(#gww-advanced-profile-root)
    .gww-editorial-section.gww-adv212-press,
    body:has(#gww-advanced-business-root)
    .gww-business-card.gww-adv212-press {
        color:#10243b !important;
        background:#f8fafc !important;
        border:1px solid #e3c47e !important;
        border-top:4px solid var(--gww327-gold) !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-editorial-section.gww-adv212-press
    :is(h1,h2,h3,p,li,span,strong,address),
    body:has(#gww-advanced-business-root)
    .gww-business-card.gww-adv212-press
    :is(h1,h2,h3,p,li,span,strong,address) {
        color:#10243b !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-adv212-press::before,
    body:has(#gww-advanced-business-root)
    .gww-adv212-press::before {
        content:"FEATURED PRESS" !important;
        display:block !important;
        margin:0 0 8px !important;
        color:#b47e17 !important;
        font-size:10px !important;
        font-weight:900 !important;
        letter-spacing:.11em !important;
    }

    /* ---------- WEBSITE LINKS ---------- */

    body:has(#gww-advanced-profile-root)
    .gww-sidebar-card
    a[href^="http"]:not([href*="facebook.com"]):not([href*="twitter.com"]):not([href*="instagram.com"]):not([href*="linkedin.com"]),
    body:has(#gww-advanced-business-root)
    .gww-business-contact-card
    a[href^="http"]:not([href*="facebook.com"]):not([href*="twitter.com"]):not([href*="instagram.com"]):not([href*="linkedin.com"]) {
        display:inline-flex !important;
        align-items:center !important;
        justify-content:center !important;
        width:100% !important;
        min-height:36px !important;
        padding:9px 12px !important;
        color:#071525 !important;
        background:var(--gww327-gold) !important;
        border:1px solid var(--gww327-gold) !important;
        border-radius:6px !important;
        text-decoration:none !important;
        font-size:0 !important;
        overflow:hidden !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-sidebar-card
    a[href^="http"]:not([href*="facebook.com"]):not([href*="twitter.com"]):not([href*="instagram.com"]):not([href*="linkedin.com"])::before,
    body:has(#gww-advanced-business-root)
    .gww-business-contact-card
    a[href^="http"]:not([href*="facebook.com"]):not([href*="twitter.com"]):not([href*="instagram.com"]):not([href*="linkedin.com"])::before {
        content:"View Website" !important;
        font-size:12px !important;
        font-weight:800 !important;
    }

    /* ---------- CONTACT FORM ---------- */

    body:has(#gww-advanced-profile-root)
    .gww-contact-form,
    body:has(#gww-advanced-business-root)
    .gww-business-bottom-contact {
        border-top:3px solid var(--gww327-gold) !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-contact-form label,
    body:has(#gww-advanced-business-root)
    .gww-business-bottom-contact label {
        color:var(--gww327-copy) !important;
    }

    body:has(#gww-advanced-profile-root)
    .gww-contact-form :is(input,textarea,select),
    body:has(#gww-advanced-business-root)
    .gww-business-bottom-contact :is(input,textarea,select) {
        color:#13243b !important;
        background:#fff !important;
        border:1px solid #ced8e4 !important;
    }

    /* ---------- MOBILE ---------- */

    @media(max-width:980px) {
        body:has(#gww-advanced-profile-root) .gww-sidebar,
        body:has(#gww-advanced-business-root) .gww-business-sidebar {
            position:static !important;
        }
    }

    @media(max-width:760px) {
        body:has(#gww-advanced-profile-root) .gww-main,
        body:has(#gww-advanced-profile-root) .gww-professional-grid,
        body:has(#gww-advanced-business-root) .gww-business-two-column,
        body:has(#gww-advanced-business-root) .gww-business-three-column,
        body:has(#gww-advanced-business-root) .gww-business-media-grid {
            grid-template-columns:1fr !important;
        }

        body:has(#gww-advanced-profile-root)
        .gww-adv212-accomplishments,
        body:has(#gww-advanced-profile-root)
        .gww-main > .gww-adv212-career,
        body:has(#gww-advanced-profile-root)
        .gww-adv212-press {
            grid-column:1 !important;
        }
    }
}
