/* ==========================================================================
   chrome.css — site header + footer (§11.1, §11.9)
   ========================================================================== */

/* --------------------------------------------------------------------------
   §11.1 — Site header. Logo left, nav center/right, language toggle far right.
   Sticky with subtle background opacity transition on scroll. Hairline under.
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    display: flex;
    align-items: center;
    /* Solid midnight bar — strong, grounded (brand dark surface) */
    background: var(--midnight);
    transition: box-shadow var(--dur-mid) var(--ease-inout);
}
.site-header.is-scrolled {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12);
}
.site-header__inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--pad-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}
@media (max-width: 768px) {
    .site-header__inner { padding-inline: var(--pad-x-mobile); }
}

/* Logo — white variant on the midnight bar (brand-prescribed inversion when
   only the dark logo exists), at 2x the previous size. */
.brand-logo { display: flex; align-items: center; }
.brand-logo img {
    height: 52px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

/* Primary nav */
.nav { display: flex; align-items: center; gap: 30px; }
.nav__link {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
    transition: color var(--dur-fast) var(--ease-inout);
    position: relative;
    padding-block: 4px;
}
.nav__link:hover,
.nav__link[aria-current="page"] { color: var(--cerulean-light); }
.nav__link[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--cerulean-light);
}

.header-actions { display: flex; align-items: center; gap: 20px; }

/* Language toggle (EN / AR) — on dark bar */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    overflow: hidden;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.lang-toggle a {
    padding: 7px 11px;
    color: rgba(255, 255, 255, 0.6);
    transition: background var(--dur-fast) var(--ease-inout),
                color var(--dur-fast) var(--ease-inout);
}
.lang-toggle a[aria-current="true"] {
    background: var(--cerulean);
    color: var(--white);
}
.lang-toggle a:not([aria-current="true"]):hover { color: var(--white); }

/* Mobile nav toggle — on dark bar */
.nav-toggle {
    display: none;
    width: 40px; height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    cursor: pointer;
    color: var(--white);
}
.nav-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

@media (max-width: 900px) {
    .nav, .header-actions .desktop-cta { display: none; }
    .nav-toggle { display: inline-flex; }

    /* Mobile drawer */
    .nav.is-open {
        display: flex;
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--icefield);
        border-top: 1px solid var(--rule-cerulean);
        padding: 8px var(--pad-x-mobile) 24px;
        border-bottom: 1px solid var(--rule-cerulean);
    }
    .nav.is-open .nav__link {
        width: 100%;
        padding: 16px 0;
        border-bottom: 1px solid var(--border-soft);
        font-size: 0.95rem;
    }
}

/* --------------------------------------------------------------------------
   §11.9 — Footer. Midnight background. Brand block + nav + contact + lang.
   Echoes the print closing-panel language (corner triangle, grid overlay).
   -------------------------------------------------------------------------- */
.site-footer {
    /* Deeper than the closing section's midnight so the two dark blocks read
       as distinct, with a hairline at the seam for a clear break. */
    background: #06182F;
    color: rgba(255,255,255,0.7);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(127, 185, 225, 0.16);
}
/* Subtle grid overlay (echoes cnt-left::before) */
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}
.site-footer .container { position: relative; z-index: 1; }

.footer-top {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: 40px;
    padding-block: clamp(48px, 5vw, 80px);
}

.footer-brand__logo img {
    height: 30px;
    width: auto;
    /* §5 — white/inverted variant via the prescribed filter when only the
       dark logo is available. Crushes to pure-white silhouette on midnight. */
    filter: brightness(0) invert(1);
}
.footer-brand__tagline {
    margin-top: 18px;
    font-size: var(--fs-micro);
    font-weight: 700;
    letter-spacing: var(--tr-tag);
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    padding-top: 16px;
    border-top: 1px solid var(--border-on-dark);
    width: max-content;
    max-width: 100%;
}
.footer-brand__line {
    margin-top: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.62);
    max-width: 34ch;
}

.footer-col__head {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cerulean-light);
    margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a, .footer-col span {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.72);
    transition: color var(--dur-fast) var(--ease-inout);
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
    border-top: 1px solid var(--border-on-dark);
    padding-block: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.footer-legal {
    font-size: var(--fs-micro);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
}
.footer-bottom .lang-toggle { border-color: var(--border-on-dark); }
.footer-bottom .lang-toggle a:not([aria-current="true"]) { color: rgba(255,255,255,0.6); }

@media (max-width: 900px) {
    .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .footer-top { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}
