/* ==========================================================================
   Crossen Law Firm — global shell (utility bar, navbar, footer, mobile CTA)
   Scoped stylesheet, enqueued sitewide from functions.php.
   Navbar collapses at XL (1200px) — see navbar-nav.php override note.
   ========================================================================== */

/* Shared shell width for utility bar, navbar inner, and footer */
.clf-shell-width {
    max-width: 1320px;
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Utility bar
   -------------------------------------------------------------------------- */

#clf-utility-bar {
    font-size: .875rem;
}

#clf-utility-bar .clf-utility-note {
    color: var(--clf-muted-dark);
    font-weight: 600;
}

#clf-utility-bar .clf-utility-phone {
    color: var(--clf-muted-dark);
}

#clf-utility-bar .clf-utility-phone a {
    color: #fff;
    font-family: var(--clf-font-header);
    font-weight: 700;
    text-decoration: none;
    margin-left: .5rem;
}

#clf-utility-bar .clf-utility-phone a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Navbar skin
   -------------------------------------------------------------------------- */

.clf-navbar {
    background-color: var(--clf-primary);
    box-shadow: 0 2px 12px rgba(6, 22, 54, .25);
}

.clf-navbar #navbar-brand-logo {
    padding: .5rem 0;
    margin-right: 1.5rem;
}

.clf-navbar #navbar-brand-logo img {
    height: 62px;
    width: auto;
    transition: height .2s ease;
}

/* Slight condense once the page is scrolled (parent toggles body.scrolled) */
body.scrolled .clf-navbar #navbar-brand-logo img {
    height: 50px;
}

/* Sticky header sits below the WP admin bar when logged in */
body.admin-bar #nav-header.sticky-top {
    top: var(--wp-admin--admin-bar--height, 32px);
}

.clf-navbar .navbar-nav .nav-link {
    color: #fff;
    font-family: var(--clf-font-header);
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
}

.clf-navbar .navbar-toggler {
    color: #fff;
}

.clf-navbar .navbar-toggler .navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

/* --------------------------------------------------------------------------
   Desktop navigation (≥1200px)
   -------------------------------------------------------------------------- */

@media (min-width: 1200px) {
    .clf-navbar .navbar-nav {
        align-items: center;
        gap: .125rem;
    }

    .clf-navbar .navbar-nav > li > .nav-link {
        position: relative;
        /* Fluid density: comfortable at 1920, compact at 1200 */
        font-size: clamp(.8125rem, .3vw + .58rem, .875rem);
        padding: 1.4rem clamp(.5rem, .55vw, .8rem);
    }

    /* Red underline indicator: hover, focus, and current page */
    .clf-navbar .navbar-nav > li > .nav-link::before {
        content: "";
        position: absolute;
        left: clamp(.5rem, .55vw, .8rem);
        right: clamp(.5rem, .55vw, .8rem);
        bottom: .9rem;
        height: 3px;
        border-radius: 2px;
        background: var(--clf-accent);
        transform: scaleX(0);
        transform-origin: left center;
        transition: transform .18s ease;
    }

    .clf-navbar .navbar-nav > li > .nav-link:hover::before,
    .clf-navbar .navbar-nav > li > .nav-link:focus-visible::before,
    .clf-navbar .navbar-nav > li.current-menu-item > .nav-link::before,
    .clf-navbar .navbar-nav > li.current-menu-ancestor > .nav-link::before {
        transform: scaleX(1);
    }

    /* Keyboard access: focusing into a parent opens its panel */
    .clf-navbar .dropdown:focus-within > .dropdown-menu {
        display: block;
    }
}

/* Caret on parent items (parent theme renders a Font Awesome angle-down) */
#nav-header .clf-navbar .dropdown-toggle::after {
    opacity: .6;
    padding-left: 5px;
}

/* --------------------------------------------------------------------------
   Dropdown panels (desktop)
   -------------------------------------------------------------------------- */

#nav-header .clf-navbar .dropdown-menu {
    top: 100%;
    border: 0;
    border-top: 3px solid var(--clf-accent);
    border-radius: 0 0 var(--clf-radius-sm) var(--clf-radius-sm);
    box-shadow: var(--clf-shadow-lift);
    padding: .625rem;
    margin-top: 0;
    min-width: 240px;
}

#nav-header .clf-navbar .dropdown-menu .nav-link {
    color: var(--clf-dark);
    font-family: var(--clf-font);
    font-weight: 500;
    font-size: .9rem;
    padding: .5rem .75rem;
    border-radius: 4px;
    display: block;
}

#nav-header .clf-navbar .dropdown-menu .nav-link:hover,
#nav-header .clf-navbar .dropdown-menu .nav-link:focus {
    color: var(--clf-primary);
    background: var(--clf-light);
}

.clf-navbar .dropdown-menu .current-menu-item > .nav-link {
    color: var(--clf-primary);
    font-weight: 600;
}

/* Large submenus flow into columns (CSS columns — safe with the parent's
   hover/display toggling). 9+ items: 2 columns. 15+ items: 3 columns. */
@media (min-width: 1200px) {
    #nav-header .clf-navbar .dropdown-menu:has(> li:nth-child(9)) {
        column-count: 2;
        column-gap: .5rem;
        min-width: 480px;
    }
    #nav-header .clf-navbar .dropdown-menu:has(> li:nth-child(15)) {
        column-count: 3;
        min-width: 700px;
    }
    .clf-navbar .dropdown-menu li {
        break-inside: avoid;
    }
    /* Keep wide panels on-screen when the parent sits right of center */
    .clf-navbar .navbar-nav > li:nth-last-child(-n+5) .dropdown-menu:has(> li:nth-child(9)) {
        left: auto;
        right: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .clf-navbar .dropdown-menu {
        animation: clf-dropdown-in .16s ease;
    }
    @keyframes clf-dropdown-in {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* --------------------------------------------------------------------------
   CTA appended to the menu (nav phone removed 2026-08-14 — utility bar and
   mobile call bar carry the number)
   -------------------------------------------------------------------------- */

@media (min-width: 1200px) {
    .clf-navbar .clf-nav-cta {
        display: flex;
        align-items: center;
        margin-left: .75rem;
    }
    .clf-navbar .clf-nav-cta .btn {
        padding: 10px 20px;
        font-size: .8125rem;
        white-space: nowrap;
    }
}

/* --------------------------------------------------------------------------
   Drawer navigation (<1200px)
   -------------------------------------------------------------------------- */

/* Injected submenu toggle buttons (js/nav.js) — hidden on desktop */
.clf-submenu-toggle {
    display: none;
}

@media (max-width: 1199.98px) {
    .clf-navbar .navbar-collapse {
        padding: .25rem 0 1rem;
        border-top: 1px solid var(--clf-line-dark);
        margin-top: .25rem;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }

    .clf-navbar .navbar-nav > li {
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .clf-navbar .navbar-nav > li:last-child {
        border-bottom: 0;
    }

    .clf-navbar .navbar-nav .nav-link {
        padding: .8rem .25rem;
        font-size: 1rem;
        white-space: normal;
    }

    /* Parent rows: link + explicit toggle button side by side */
    .clf-navbar .menu-item-has-children {
        position: relative;
    }

    #nav-header .clf-navbar .dropdown-toggle::after {
        display: none; /* replaced by the button chevron */
    }

    .clf-submenu-toggle {
        display: block;
        position: absolute;
        top: .35rem;
        right: 0;
        width: 42px;
        height: 42px;
        background: rgba(255, 255, 255, .08);
        border: 0;
        border-radius: 6px;
        cursor: pointer;
    }

    .clf-submenu-toggle::after {
        content: "";
        display: block;
        width: 9px;
        height: 9px;
        margin: 0 auto;
        border-right: 2px solid #fff;
        border-bottom: 2px solid #fff;
        transform: rotate(45deg) translateY(-2px);
        transition: transform .15s ease;
    }

    .clf-open > .clf-submenu-toggle::after {
        transform: rotate(225deg) translateY(-2px);
    }

    .clf-navbar .dropdown-menu {
        display: none;
        position: static;
        float: none;
        background: rgba(255, 255, 255, .06);
        border: 0;
        border-radius: 8px;
        box-shadow: none;
        padding: .25rem .75rem;
        margin: 0 0 .75rem;
        animation: none;
    }

    .clf-open > .dropdown-menu {
        display: block;
    }

    #nav-header .clf-navbar .dropdown-menu .nav-link {
        color: #fff;
        font-size: .9375rem;
        white-space: normal;
        padding: .55rem .5rem;
    }

    #nav-header .clf-navbar .dropdown-menu .nav-link:hover,
    #nav-header .clf-navbar .dropdown-menu .nav-link:focus {
        color: #fff;
        background: rgba(255, 255, 255, .1);
    }

    .clf-navbar .clf-nav-cta {
        margin: .75rem 0 0;
    }

    .clf-navbar .clf-nav-cta .btn {
        width: 100%;
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

#clf-footer .clf-footer-logo {
    max-width: 200px;
    height: auto;
}

#clf-footer .clf-footer-tagline {
    color: var(--clf-muted-dark);
    max-width: 34ch;
}

#clf-footer .clf-footer-phone {
    color: #fff;
    font-family: var(--clf-font-header);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

#clf-footer .clf-footer-phone:hover {
    text-decoration: underline;
}

#clf-footer .clf-footer-heading {
    color: #fff;
    font-family: var(--clf-font-header); /* UI label — not serif */
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

#clf-footer .clf-footer-office {
    color: var(--clf-muted-dark);
    font-style: normal;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

#clf-footer .clf-footer-office strong {
    color: #fff;
}

#clf-footer a:not(.btn) {
    color: var(--clf-muted-dark);
    text-decoration: none;
}

#clf-footer a:not(.btn):hover,
#clf-footer a:not(.btn):focus {
    color: #fff;
    text-decoration: underline;
}

#clf-footer .clf-footer-menu li {
    margin-bottom: .5rem;
}

#clf-footer .clf-footer-viewall {
    font-weight: 600;
    color: #fff !important;
}

/* Parent footer credit strip (holds [clf_footer_credit]) */
footer.clf-footer-bottom {
    border-top: 1px solid var(--clf-line-dark);
}

footer.clf-footer-bottom .clf-disclaimer {
    max-width: 920px;
    margin: 0 auto .75rem;
    font-size: .8125rem;
    line-height: 1.6;
    color: var(--clf-muted-dark);
}

footer.clf-footer-bottom .clf-copyright {
    font-size: .8125rem;
    color: var(--clf-muted-dark);
}

/* --------------------------------------------------------------------------
   Sticky mobile action bar (below the drawer breakpoint)
   -------------------------------------------------------------------------- */

#clf-mobile-cta {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    box-shadow: 0 -2px 12px rgba(6, 22, 54, .25);
}

#clf-mobile-cta a {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    font-family: var(--clf-font-header);
    font-size: .9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-decoration: none;
    color: #fff;
}

#clf-mobile-cta .clf-mobile-cta-call {
    background: var(--clf-primary);
}

#clf-mobile-cta .clf-mobile-cta-consult {
    background: var(--clf-accent);
}

/* Keep page content clear of the fixed bar */
@media (max-width: 1199.98px) {
    body {
        padding-bottom: 54px;
    }
}

@media print {
    #clf-mobile-cta {
        display: none !important;
    }
}

/* ==========================================================================
   Closing CTA band (template-parts/common/common-cta.php)
   Rendered by every template, so the composed treatment lives here rather
   than in home.css — previously interior pages fell back to flat blue.
   Promoted 2026-08-14; see project-manifest.md §10.
   ========================================================================== */
#clf-cta {
    background:
        radial-gradient(900px 500px at 78% 100%, rgba(10, 31, 68, .5), transparent 62%),
        radial-gradient(760px 460px at 8% 0%, rgba(255, 255, 255, .06), transparent 60%),
        var(--clf-primary);
}

#clf-cta .clf-cta-sub {
    color: var(--clf-muted-dark);
    max-width: 62ch;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 992px) {
    #clf-cta {
        padding-top: 4.75rem !important;   /* py-5 utility is !important */
        padding-bottom: 4.75rem !important;
    }

    #clf-cta h2 {
        font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem);
    }
}
