/* ==========================================================================
   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-service_area,
body.single-service_area .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,
.wp-block-post-content > *:last-child,
main > *:last-child {
    margin-bottom: 0 !important;
    padding-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
   ========================================================================== */

/* --- Jetpack Contact Form --- */
#contact .wpcom-ai-prominent-contact-form button[type="submit"],
#contact .wpcom-ai-prominent-contact-form input[type="submit"],
#contact .wpcom-ai-prominent-contact-form .wp-block-button__link,
#contact form.contact-form .pushbutton-wide {    
    padding: 18px 24px !important;    
    min-height: 60px !important;    
    height: auto !important;    
    font-size: 18px !important;
    line-height: 1.5 !important;    
    box-sizing: border-box !important;
}

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

.sgp-faq-sidebar {
    flex: 0 0 250px;
    position: sticky;
    top: 120px;
}

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

.sgp-faq-nav a {
    display: block;
    padding: 12px 16px;
    color: #CBD5E1;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    font-weight: 600;
}

.sgp-faq-nav a:hover, 
.sgp-faq-nav a:focus {
    color: #2563EB;
    border-left-color: #2563EB;
    background-color: #112240;
}

.sgp-faq-content {
    flex: 1;
}

.sgp-faq-category-section {
    margin-bottom: 60px;
}

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

/* 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;
    }
}

@media (max-width: 768px) {
    .sgp-faq-container {
        flex-direction: column;
    }
    .sgp-faq-sidebar {
        position: relative;
        top: 0;
        width: 100%;
    }
}


/* ==========================================================================
   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-service_area .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-service_area .wp-block-columns,
body.single-industry .wp-block-column,
body.single-service_area .wp-block-column {
    box-sizing: border-box !important;
}


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

/* 1. Force white and underlined text links across all dark pages and sections */
body.page main p a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
body.page main li a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
body.single-industry main p a:not(.wp-block-button__link),
body.single-industry main li a:not(.wp-block-button__link),
body.single-service_area main p a:not(.wp-block-button__link),
body.single-service_area main li a:not(.wp-block-button__link),
.has-background[style*="#0D1B2A"] p a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#0D1B2A"] li a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#0B1724"] p a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#0B1724"] li a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#112240"] p a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#112240"] li a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#1E40AF"] p a:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#1E40AF"] li a:not(.wp-block-button__link):not(.sgp-accordion-trigger) {
    color: #FFFFFF !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

body.page main p a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
body.page main li a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
body.single-industry main p a:hover:not(.wp-block-button__link),
body.single-industry main li a:hover:not(.wp-block-button__link),
body.single-service_area main p a:hover:not(.wp-block-button__link),
body.single-service_area main li a:hover:not(.wp-block-button__link),
.has-background[style*="#0D1B2A"] p a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#0D1B2A"] li a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#0B1724"] p a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#0B1724"] li a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#112240"] p a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#112240"] li a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#1E40AF"] p a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger),
.has-background[style*="#1E40AF"] li a:hover:not(.wp-block-button__link):not(.sgp-accordion-trigger) {
    color: #3b82f6 !important;
    text-decoration-color: #3b82f6 !important;
}

/* 2. Text links on light sections */
.has-background[style*="#FFFFFF"] p a:not(.wp-block-button__link),
.has-background[style*="#FFFFFF"] li a:not(.wp-block-button__link),
.has-background[style*="#F8FAFC"] p a:not(.wp-block-button__link),
.has-background[style*="#F8FAFC"] li a:not(.wp-block-button__link) {
    color: #0D1B2A !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.has-background[style*="#FFFFFF"] p a:hover:not(.wp-block-button__link),
.has-background[style*="#FFFFFF"] li a:hover:not(.wp-block-button__link),
.has-background[style*="#F8FAFC"] p a:hover:not(.wp-block-button__link),
.has-background[style*="#F8FAFC"] li a:hover:not(.wp-block-button__link) {
    color: #2563EB !important;
    text-decoration-color: #2563EB !important;
}

/* 3. Text links inside single blog post content */
body.single-post .sgp-content-col p a:not(.wp-block-button__link),
body.single-post .sgp-content-col li a:not(.wp-block-button__link) {
    color: #0D1B2A !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
body.single-post .sgp-content-col p a:hover:not(.wp-block-button__link),
body.single-post .sgp-content-col li a:hover:not(.wp-block-button__link) {
    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;
}