/* ==========================================================================
   FILE 2: layout.css — Sticky Header, Navigation, Sidebar & Footer
   ==========================================================================
   HOW THIS FILE WORKS:
   - Controls the structural "shell" shared across all pages:
     1. Top Utility Bar & Expandable Service Area Drawer (.utility-bar, .service-area-drawer)
     2. Sticky Main Navbar & Category Dropdowns (.site-header, .main-nav, .dropdown-menu)
     3. Sticky Right Sidebar on Content Pages (.topic-sidebar, .sidebar-card)
     4. Site Footer & Mobile Sticky Call Bar (.site-footer, .mobile-call-bar)
   ========================================================================== */

/* ==========================================================================
   1. Sticky Header Shell & Top Utility Bar
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-header);
    border-bottom: 3px solid var(--brand-orange);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.utility-bar {
    background-color: var(--bg-utility);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-top-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-on-dark-muted);
    white-space: nowrap;
}

.header-top-line__left,
.header-top-line__right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

/* Clickable "📍 Service Area" Pill in Top Bar */
.utility-badge {
    background-color: rgba(29, 78, 216, 0.35);
    color: #93C5FD;
    border: 1px solid rgba(147, 197, 253, 0.35);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.16rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.utility-badge--btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.utility-badge--btn:hover,
.utility-badge--btn[aria-expanded="true"] {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange-bright);
    color: #FFFFFF;
}

.utility-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.utility-text strong {
    color: var(--text-on-dark);
}

.utility-divider {
    opacity: 0.35;
}

.utility-link {
    color: var(--text-on-dark-muted);
    font-weight: 500;
}

.utility-link:hover {
    color: var(--brand-orange-bright);
}

.utility-link--accent {
    color: #FDBA74;
    font-weight: 700;
}

.utility-link--accent:hover {
    color: #FFFFFF;
}

/* ==========================================================================
   2. Expandable Local Service Area Drawer (Below Top Bar)
   ========================================================================== */
.service-area-drawer {
    background-color: #10141C;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.15rem 0;
}

.service-area-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.service-area-drawer__eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #FDBA74;
    letter-spacing: 0.06em;
}

.service-area-drawer__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: #FAF8F5;
}

.service-area-drawer__close {
    background: rgba(255, 255, 255, 0.08);
    color: #FAF8F5;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.3rem 0.65rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
}

.service-area-drawer__close:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
}

.service-area-drawer__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.area-tag {
    font-size: 0.76rem;
    background: rgba(255, 255, 255, 0.05);
    color: #D1D5DB;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
}

.area-tag--interactive {
    background: rgba(29, 78, 216, 0.25) !important;
    border: 1px solid rgba(96, 165, 250, 0.35);
    color: #F7F5F0 !important;
}

/* ==========================================================================
   3. Main Navigation Bar (Wordmark + Category Dropdowns + Actions)
   ========================================================================== */
.header-bottom-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 64px;
}

.nav-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-wordmark__bolt {
    font-size: 1.25rem;
    line-height: 1;
}

.nav-wordmark__text {
    font-family: var(--font-display);
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #FAF8F5;
}

.nav-wordmark:hover .nav-wordmark__text {
    color: #FFFFFF;
}

.brand-accent {
    color: var(--brand-orange-bright);
}

.main-nav__list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.main-nav__item {
    position: relative;
}

.main-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 0.85rem;
    color: #E5E7EB;
    font-size: 0.92rem;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.main-nav__link:hover,
.main-nav__item:hover > .main-nav__link,
.main-nav__link.is-active,
.main-nav__item.is-active-group > .main-nav__link {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--brand-orange-bright);
}

.chevron-icon {
    transition: transform 0.2s ease;
}

.main-nav__item:hover .chevron-icon,
.main-nav__item.is-open .chevron-icon {
    transform: rotate(180deg);
}

/* Dropdown Category Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 380px;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-top: 3px solid var(--brand-blue);
    border-radius: 8px;
    box-shadow: var(--shadow-elevated);
    padding: 0.9rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    z-index: 1100;
}

.main-nav__item:hover .dropdown-menu,
.main-nav__item:focus-within .dropdown-menu,
.main-nav__item.is-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu__header {
    padding: 0.35rem 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 0.5rem;
}

.dropdown-menu__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-blue);
    background-color: var(--brand-blue-tint);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.35rem;
}

.dropdown-menu__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.dropdown-menu__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dropdown-menu__link {
    display: block;
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dropdown-menu__link:hover,
.dropdown-menu__link.is-active {
    background-color: var(--bg-surface-muted);
    border-left-color: var(--brand-orange);
}

.dropdown-menu__title {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.dropdown-menu__link:hover .dropdown-menu__title {
    color: var(--brand-orange);
}

.dropdown-menu__summary {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 2px;
}

/* Header Actions & Dark/Light Theme Button */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: #232834;
    color: #F7F5F0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.48rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle--top {
    padding: 0.18rem 0.55rem;
    font-size: 0.72rem;
    border-radius: 4px;
    gap: 0.32rem;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--brand-orange-bright);
    background-color: #2C3342;
}

[data-theme="light"] .theme-toggle__icon--sun {
    display: none;
}

[data-theme="dark"] .theme-toggle__icon--moon {
    display: none;
}

.theme-toggle__icon--sun {
    color: #FBBF24;
}

.theme-toggle__icon--moon {
    color: #93C5FD;
}

/* Hamburger Menu Button (Mobile Only) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: #232834;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
}

.hamburger-bar {
    width: 100%;
    height: 2px;
    background-color: #F7F5F0;
    transition: 0.2s ease;
}

/* ==========================================================================
   4. Right Sidebar on Informational Content Pages (.topic-sidebar)
   - Scrolls naturally with the page (`position: static`) so the user never gets
     stuck trying to scroll a tall sidebar.
   ========================================================================== */
.topic-sidebar {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.sidebar-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 1.35rem;
    box-shadow: var(--shadow-card);
}

.sidebar-card--toc {
    border-top: 4px solid var(--brand-blue);
}

.sidebar-card--cta {
    background-color: var(--bg-header);
    color: var(--text-on-dark);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 4px solid var(--brand-orange);
}

.sidebar-card--cta .btn--outline-sidebar {
    color: #FAF8F5 !important;
    border-color: rgba(255, 255, 255, 0.25);
}

.sidebar-card--cta .btn--outline-sidebar:hover {
    border-color: #60A5FA;
    color: #60A5FA !important;
}

/* Logo Showcase inside Sidebar CTA Box */
.sidebar-logo-showcase {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.25rem 0.5rem 0.9rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: radial-gradient(circle at 50% 50%, rgba(234, 88, 12, 0.15) 0%, transparent 70%);
}

.sidebar-logo-showcase__img {
    width: 100%;
    max-width: 225px;
    max-height: 105px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.sidebar-card__header {
    margin-bottom: 0.9rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-card__eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--brand-orange);
    text-transform: uppercase;
}

.sidebar-card__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Sidebar Table of Contents (Quick Jump) */
.toc-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.55rem;
    border-radius: 5px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.toc-link:hover {
    background-color: var(--bg-surface-muted);
    color: var(--brand-orange);
}

.toc-num {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--brand-blue);
}

.toc-link--code {
    margin-top: 0.35rem;
    background-color: var(--brand-orange-tint);
    border: 1px solid var(--brand-orange-border);
    color: var(--text-primary);
    font-weight: 600;
}

.toc-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    background-color: var(--brand-orange);
    color: #FFFFFF;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/* Sidebar CTA Text Elements */
.sidebar-cta__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #93C5FD;
    background: rgba(29, 78, 216, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-bottom: 0.5rem;
}

.sidebar-cta__heading {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: #FAF8F5;
    margin-bottom: 0.45rem;
}

.sidebar-cta__text {
    font-size: 0.86rem;
    color: var(--text-on-dark-muted);
    margin-bottom: 1rem;
}

/* Sidebar All Topics Directory */
.sidebar-nav-group {
    margin-bottom: 1.1rem;
}

.sidebar-nav-group:last-child {
    margin-bottom: 0;
}

.sidebar-nav-group__title {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-blue);
    margin-bottom: 0.45rem;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.65rem;
    border-radius: 5px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.sidebar-nav-link__indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--border-strong);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.sidebar-nav-link:hover {
    background-color: var(--bg-surface-muted);
    color: var(--text-primary);
}

.sidebar-nav-link:hover .sidebar-nav-link__indicator {
    background-color: var(--brand-orange);
}

.sidebar-nav-link.is-active {
    background-color: var(--brand-orange-tint);
    color: var(--brand-orange);
    font-weight: 700;
    border-left: 3px solid var(--brand-orange);
}

.sidebar-nav-link.is-active .sidebar-nav-link__indicator {
    background-color: var(--brand-orange);
    transform: scale(1.25);
}

/* ==========================================================================
   5. Site Footer & Mobile Sticky Click-to-Call Bar
   ========================================================================== */
.site-footer {
    background-color: var(--bg-footer);
    color: var(--text-on-dark-muted);
    border-top: 4px solid var(--brand-orange);
}

.footer-cta-band {
    background: linear-gradient(90deg, #161B24 0%, #1E2532 100%);
    padding: 2.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-cta-band__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-cta-band__eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--brand-orange-bright);
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.footer-cta-band__title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: #FAF8F5;
}

.footer-cta-band__sub {
    font-size: 0.95rem;
    color: var(--text-on-dark-muted);
}

.footer-cta-band__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.site-footer__grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
    gap: 2.25rem;
    padding: 3.5rem 1.5rem 2.5rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-on-dark);
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo__img {
    height: auto;
    width: 100%;
    max-width: 245px;
    object-fit: contain;
    display: block;
}

.brand-logo__img--footer {
    max-width: 240px;
}

.footer-about {
    font-size: 0.88rem;
    margin: 1rem 0;
    line-height: 1.6;
}

.footer-phone-link {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-orange-bright) !important;
    margin-bottom: 0.35rem;
}

.footer-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--text-on-dark-muted);
}

.footer-col__title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: #FAF8F5;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--brand-blue);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--text-on-dark-muted);
    font-size: 0.88rem;
}

.footer-links a:hover {
    color: var(--brand-orange-bright);
}

.footer-service-area {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-service-area__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
    margin-bottom: 0.25rem;
}

.footer-service-area__label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: #93C5FD;
}

.footer-service-area__hq {
    font-size: 0.88rem;
    color: #FAF8F5;
    font-weight: 600;
}

.footer-service-area__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.footer-bottom {
    padding: 1.35rem 0;
    font-size: 0.82rem;
}

.footer-bottom__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom__links {
    display: flex;
    gap: 1.25rem;
}

.footer-bottom__links a {
    color: var(--text-on-dark-muted);
}

/* Mobile Sticky Call Bar */
.mobile-call-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1200;
    background-color: var(--bg-header);
    padding: 0.55rem 1rem;
    border-top: 2px solid var(--brand-orange);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.mobile-call-bar__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    width: 100%;
    background-color: var(--brand-orange);
    color: #FFFFFF !important;
    padding: 0.7rem;
    border-radius: 6px;
    font-size: 0.98rem;
}

/* ==========================================================================
   6. Layout Responsive Breakpoints (Header, Sidebar, Footer)
   ========================================================================== */
@media (max-width: 1024px) {
    .topic-sidebar {
        position: static;
    }

    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 860px) {
    .header-top-line .utility-text,
    .header-top-line .utility-link,
    .header-top-line .utility-divider {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .btn--call-header span {
        display: none;
    }

    .main-nav {
        position: fixed;
        top: 98px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--bg-header);
        padding: 1.25rem;
        overflow-y: auto;
        display: none;
        z-index: 1050;
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .main-nav__link {
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 1rem;
        background: rgba(255, 255, 255, 0.04);
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        margin-top: 0.35rem;
        box-shadow: none;
    }

    .main-nav__item.is-open .dropdown-menu {
        display: block;
    }
}

@media (max-width: 640px) {
    .site-footer__grid {
        grid-template-columns: 1fr;
    }

    .mobile-call-bar {
        display: block;
    }
}
