/* ==========================================================================
   01. GLOBAL PAGE STRUCTURE & CLEANUP
   ========================================================================== */

/* Prevent Horizontal Overflow & White Edges */
html,
body,
.wp-site-blocks,
main {
    overflow-x: clip !important;
}

/* Enable smooth scrolling for anchor links globally */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 120px;
}

/* Darken background on Pages AND CPT Spoke Pages */
body.page,
body.page .wp-site-blocks,
body.single-industry,
body.single-industry .wp-site-blocks,
body.single-location,
body.single-location .wp-site-blocks {
    background-color: #0B1724 !important;
}

/* Remove root spacing between top-level layout blocks */
.wp-site-blocks {
    gap: 0 !important;
    row-gap: 0 !important;
}

/* Close bottom of main content area */
main,
.wp-block-post-content,
.entry-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Keep final section flush against footer without stripping its internal padding */
.wp-block-post-content > *:last-child,
main > *:last-child {
    margin-bottom: 0 !important;
}

/* Ensure footer sits flush against content */
footer,
footer.wp-block-template-part,
div.wp-block-template-part,
.wp-site-blocks > [class*="wp-block-template-part"]:last-of-type {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Suppress ghost trailing containers */
.sharedaddy,
#jp-post-flair,
.jp-relatedposts,
#comments:empty {
    display: none !important;
}


/* ==========================================================================
   02. HEADER & NAVIGATION
   ========================================================================== */

/* Dissolve Template Part Wrapper for Native Sticky Behavior */
header.wp-block-template-part {
    display: contents !important;
}

/* Force Dark Blue Background Everywhere */
.sgp-sticky-nav,
.sgp-unified-header,
.wpcom-ai-hero-nav-bar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 99999 !important;
    background-color: #0c1f2b !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Offset for WordPress Admin Bar */
.admin-bar .sgp-sticky-nav,
.admin-bar .sgp-unified-header {
    top: 32px !important;
}


/* ==========================================================================
   03. BRANDING (LOGO & TITLE)
   ========================================================================== */

.sgp-brand-mark {
    flex-shrink: 0 !important;
    align-items: center !important;
}

.sgp-brand-mark .wp-block-site-logo img {
    min-width: 36px !important;
    width: 36px !important;
    max-width: 36px !important;
    height: auto !important;
    flex-shrink: 0 !important;
    display: block !important;
}


/* ==========================================================================
   04. COMPONENTS
   ========================================================================== */

/* --- FAQ Section (Desktop + Shared Base) --- */
.sgp-faq-container {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0 60px 0;
    align-items: flex-start;
}

.sgp-faq-sidebar {
    flex: 0 0 250px;
    position: sticky;
    top: calc(var(--sgp-sticky-offset, 80px) + 24px);
    z-index: 90;
}

.sgp-faq-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sgp-faq-nav li {
    margin: 0;
}

body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a,
.sgp-faq-nav a {
    display: block;
    padding: 12px 16px;
    color: #CBD5E1 !important;
    text-decoration: none !important;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
}

body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a:hover,
body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a:focus-visible,
.sgp-faq-nav a:hover,
.sgp-faq-nav a:focus-visible {
    color: #60A5FA !important;
    border-left-color: #2563EB;
    background-color: rgba(17, 34, 64, 0.7);
}

body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a.is-active,
.sgp-faq-nav a.is-active {
    color: #FFFFFF !important;
    border-left-color: #2563EB;
    background-color: #112240;
}

/* Hide mobile-only drawer controls on desktop */
.sgp-faq-all-btn,
.sgp-faq-drawer,
.sgp-faq-drawer-backdrop {
    display: none;
}

.sgp-faq-content {
    flex: 1;
    min-width: 0;
}

.sgp-faq-category-section {
    margin-bottom: 60px;
    scroll-margin-top: calc(var(--sgp-sticky-offset, 80px) + 28px);
}

.sgp-faq-category-section:last-child {
    margin-bottom: 0;
}

.sgp-faq-category-title {
    color: #F8FAFC;
    font-size: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #1E3A5F;
    padding-bottom: 12px;
}

/* Accordion Styling */
.sgp-accordion-item {
    background-color: #112240;
    border: 1px solid #1E3A5F;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.sgp-accordion-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: transparent;
    border: none;
    color: #F8FAFC;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sgp-accordion-trigger:hover {
    background-color: #0D1B2A;
}

.sgp-accordion-icon {
    color: #2563EB;
    font-size: 24px;
    font-weight: 400;
    transition: transform 0.3s ease;
}

.sgp-accordion-trigger[aria-expanded="true"] .sgp-accordion-icon {
    transform: rotate(45deg);
}

.sgp-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #0D1B2A;
}

.sgp-panel-inner {
    padding: 0 24px 24px 24px;
    color: #CBD5E1;
    line-height: 1.6;
}


/* ==========================================================================
   05. MOBILE & RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 781px) {
    .sgp-unified-header,
    .wpcom-ai-hero-nav-bar {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: 14px !important;
        padding-bottom: 14px !important;
    }

    .sgp-responsive-header-nav {
        gap: 8px !important;
    }

    .sgp-brand-mark .wp-block-site-title,
    .sgp-brand-mark .wp-block-site-title a {
        white-space: normal !important;
        max-width: 120px !important;
        font-size: 13px !important;
        letter-spacing: 0.02em !important;
        line-height: 1.2 !important;
        display: inline-block !important;
    }
}

/* --- Mobile Sticky Hybrid Pill Bar + All-Categories Drawer --- */
@media (max-width: 768px) {
    .sgp-faq-container {
        flex-direction: column;
        gap: 24px;
        padding: 8px 0 40px 0;
    }

    .sgp-faq-sidebar {
        position: -webkit-sticky;
        position: sticky;
        top: var(--sgp-sticky-offset, 64px);
        flex: none;
        display: flex;
        align-items: center;
        /* Full-bleed breakout past Gutenberg section horizontal padding */
        width: calc(100% + (var(--wp--preset--spacing--50, 20px) * 2));
        margin-left: calc(var(--wp--preset--spacing--50, 20px) * -1);
        margin-right: calc(var(--wp--preset--spacing--50, 20px) * -1);
        background-color: rgba(11, 23, 36, 0.94);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        border-top: 1px solid rgba(30, 58, 95, 0.65);
        border-bottom: 1px solid #1E3A5F;
        z-index: 9990; /* Docks cleanly beneath .sgp-unified-header (99999) */
        box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.55);
    }

    .sgp-faq-nav {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px 16px 10px var(--wp--preset--spacing--50, 20px);
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sgp-faq-nav::-webkit-scrollbar {
        display: none;
    }

    .sgp-faq-nav li {
        flex: 0 0 auto;
    }

    body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a,
    .sgp-faq-nav a {
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
        padding: 7px 14px;
        font-size: 13px;
        font-weight: 600;
        border-left: none;
        border: 1px solid #1E3A5F;
        border-radius: 999px;
        background-color: #112240;
        color: #CBD5E1 !important;
        min-height: 36px;
    }

    body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a:hover,
    body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a:focus-visible,
    .sgp-faq-nav a:hover,
    .sgp-faq-nav a:focus-visible {
        border-color: #3B82F6;
        color: #FFFFFF !important;
        background-color: #162C52;
    }

    body.page main .sgp-faq-container .sgp-faq-sidebar .sgp-faq-nav li a.is-active,
    .sgp-faq-nav a.is-active {
        background-color: #2563EB;
        border-color: #60A5FA;
        color: #FFFFFF !important;
        box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
    }

    /* Right-Pinned "All (7) ▾" Toggle Button */
    .sgp-faq-all-btn {
        position: relative;
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        margin-right: var(--wp--preset--spacing--50, 20px);
        padding: 7px 12px;
        min-height: 36px;
        background-color: #162C52;
        border: 1px solid #2B4C7E;
        border-radius: 999px;
        color: #F8FAFC;
        font-size: 12.5px;
        font-weight: 700;
        letter-spacing: 0.02em;
        cursor: pointer;
        white-space: nowrap;
        transition: background-color 0.2s ease, border-color 0.2s ease;
    }

    /* Soft gradient fade so scrolling pills glide cleanly beneath the button */
    .sgp-faq-all-btn::before {
        content: "";
        position: absolute;
        top: -10px;
        bottom: -10px;
        left: -24px;
        width: 23px;
        background: linear-gradient(to right, rgba(11, 23, 36, 0), rgba(11, 23, 36, 0.96));
        pointer-events: none;
    }

    .sgp-faq-all-btn:hover,
    .sgp-faq-all-btn[aria-expanded="true"] {
        background-color: #1E3A5F;
        border-color: #60A5FA;
    }

    .sgp-faq-all-chevron {
        display: inline-block;
        font-size: 11px;
        transition: transform 0.25s ease;
    }

    .sgp-faq-all-btn[aria-expanded="true"] .sgp-faq-all-chevron {
        transform: rotate(180deg);
    }

    /* Collapsible 7-Category Quick-Jump Sheet */
    .sgp-faq-drawer {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #0D1B2A;
        border-bottom: 1px solid #2B4C7E;
        box-shadow: 0 18px 36px rgba(0, 0, 0, 0.75);
        padding: 14px var(--wp--preset--spacing--50, 20px) 18px;
        z-index: 9992;
        max-height: 70dvh;
        overflow-y: auto;
    }

    .sgp-faq-drawer.is-open {
        display: block;
    }

    .sgp-faq-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        padding-bottom: 8px;
        border-bottom: 1px solid #1E3A5F;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #60A5FA;
    }

    .sgp-faq-drawer-list {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    @media (min-width: 500px) and (max-width: 768px) {
        .sgp-faq-drawer-list {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    body.page main .sgp-faq-container .sgp-faq-drawer li a.sgp-faq-drawer-link,
    .sgp-faq-drawer-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 11px 14px;
        border-radius: 8px;
        background-color: #112240;
        border: 1px solid #1E3A5F;
        color: #E2E8F0 !important;
        text-decoration: none !important;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.18s ease;
    }

    body.page main .sgp-faq-container .sgp-faq-drawer li a.sgp-faq-drawer-link:hover,
    body.page main .sgp-faq-container .sgp-faq-drawer li a.sgp-faq-drawer-link.is-active,
    .sgp-faq-drawer-link:hover,
    .sgp-faq-drawer-link.is-active {
        background-color: #162C52;
        border-color: #3B82F6;
        color: #FFFFFF !important;
    }

    body.page main .sgp-faq-container .sgp-faq-drawer li a.sgp-faq-drawer-link.is-active,
    .sgp-faq-drawer-link.is-active {
        box-shadow: inset 3px 0 0 #2563EB;
    }

    .sgp-faq-drawer-count {
        flex-shrink: 0;
        font-size: 11.5px;
        font-weight: 600;
        color: #94A3B8;
        background-color: #0B1724;
        padding: 2px 8px;
        border-radius: 999px;
        border: 1px solid #1E3A5F;
    }

    .sgp-faq-drawer-link.is-active .sgp-faq-drawer-count {
        color: #60A5FA;
        border-color: #2563EB;
    }

    /* Subtle Dimmed Backdrop When Drawer Is Open */
    .sgp-faq-drawer-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background-color: rgba(6, 13, 22, 0.6);
        z-index: 9985;
    }

    .sgp-faq-drawer-backdrop.is-open {
        display: block;
    }

    .sgp-faq-category-section {
        margin-bottom: 44px;
        scroll-margin-top: calc(var(--sgp-sticky-offset, 64px) + var(--sgp-faq-bar-height, 58px) + 18px);
    }

    .sgp-faq-category-title {
        font-size: 20px;
        margin-bottom: 18px;
    }
}


/* ==========================================================================
   06. COVER & CPT TEMPLATE STABILIZATION
   ========================================================================== */

/* Force Cover Image Cropping & Layering */
.wp-block-cover {
    position: relative !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Allow full-width covers to expand naturally */
.wp-block-cover.alignfull {
    width: auto !important;
}

.wp-block-cover .wp-block-cover__image-background {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    z-index: 0 !important;
}

.wp-block-cover .wp-block-cover__background {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
}

.wp-block-cover .wp-block-cover__inner-container {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Force .alignfull breakout on CPT Templates */
body.single-industry .alignfull,
body.single-location .alignfull {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

/* Ensure Multi-Column Containers Flex Evenly */
body.single-industry .wp-block-columns,
body.single-location .wp-block-columns,
body.single-industry .wp-block-column,
body.single-location .wp-block-column {
    box-sizing: border-box !important;
}


/* ==========================================================================
07. HYPERLINK ACCESSIBILITY
   ========================================================================== */

/* 1. Inherit surrounding text color and underline all body text links */
main :is(p, li) a:not(:where(.wp-block-button__link, .wp-element-button, .sgp-accordion-trigger, .sgp-share-btn, .wp-block-social-link-anchor)) {
    color: inherit !important;
    text-decoration: underline !important;
    text-decoration-color: currentColor !important;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

/* 2. Hover & keyboard focus state (dark sections default) */
main :is(p, li) a:not(:where(.wp-block-button__link, .wp-element-button, .sgp-accordion-trigger, .sgp-share-btn, .wp-block-social-link-anchor)):hover,
main :is(p, li) a:not(:where(.wp-block-button__link, .wp-element-button, .sgp-accordion-trigger, .sgp-share-btn, .wp-block-social-link-anchor)):focus-visible {
    color: #3B82F6 !important;
    text-decoration-color: #3B82F6 !important;
}

/* 3. Slightly deeper blue on hover/focus inside light sections & blog posts */
.has-white-background-color :is(p, li) a:not(:where(.wp-block-button__link, .wp-element-button, .sgp-accordion-trigger, .sgp-share-btn, .wp-block-social-link-anchor)):is(:hover, :focus-visible),
.has-background[style*="#ffffff" i] :is(p, li) a:not(:where(.wp-block-button__link, .wp-element-button, .sgp-accordion-trigger, .sgp-share-btn, .wp-block-social-link-anchor)):is(:hover, :focus-visible),
.has-background[style*="#f8fafc" i] :is(p, li) a:not(:where(.wp-block-button__link, .wp-element-button, .sgp-accordion-trigger, .sgp-share-btn, .wp-block-social-link-anchor)):is(:hover, :focus-visible),
body.single-post .sgp-content-col :is(p, li) a:not(:where(.wp-block-button__link, .wp-element-button)):is(:hover, :focus-visible) {
    color: #2563EB !important;
    text-decoration-color: #2563EB !important;
}

/* 4. Complete Failsafe: Prevent unwanted styles on icon buttons and SVGs */
.sgp-share-btn,
.sgp-share-btn svg,
.sgp-nav-home-icon,
.sgp-nav-home-icon svg,
.wp-block-social-link-anchor,
.wp-block-social-link-anchor svg {
    text-decoration: none !important;
}

.sgp-share-btn,
.sgp-share-btn svg {
    color: #FFFFFF !important;
    fill: #FFFFFF !important;
}

.sgp-share-btn:hover,
.sgp-share-btn:hover svg {
    color: #FFFFFF !important;
    fill: #FFFFFF !important;
}

/* ==========================================================================
   08. HERO VIEWPORT ALIGNMENT FIX
   ========================================================================== */

/* 1. Strip vertical Cover padding while keeping responsive horizontal gutters */
.wpcom-ai-full-screen-hero {
    padding: 0 clamp(20px, 5vw, 48px) !important;
    box-sizing: border-box !important;
}

/* 2. Offset the 32px WordPress Admin Bar while you are logged in/testing */
body.admin-bar .wpcom-ai-full-screen-hero .wp-block-cover__inner-container > .wp-block-group {
    min-height: calc(100dvh - 112px) !important; /* 80px header + 32px admin bar */
}

/* 3. Homepage Hero Inner Flex Layout */
.sgp-hero-inner {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - 80px);
    justify-content: space-between;
    padding-top: 4dvh;
    padding-bottom: 5dvh;
}

.sgp-hero-center {
    margin: auto 0;
    width: 100%;
}

.sgp-hero-bottom {
    margin-top: auto;
    width: 100%;
}


/* ==========================================================================
   09. ZOHO DESK SALES IQ COOKIE BANNER
   ========================================================================== */

/* Hide Zoho SalesIQ Cookie & Consent Banner */
#consent_container.gdbr-banner-cont,
#gdpr_banner.zoho-msgbanr,
#preference_container.zoho_prv_main {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   10. SCROLL REVEAL ANIMATIONS
   ========================================================================== */

.sgp-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.sgp-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Keep scroll-reveal sections visible inside the WordPress Block Editor */
.editor-styles-wrapper .sgp-reveal,
body.block-editor-iframe__body .sgp-reveal,
.wp-admin .sgp-reveal {
    opacity: 1;
    transform: none;
}