/* Layout shell: vars, reset, typography, container, header/nav, hero, footer.
 * Mobile-first: base styles are the small-screen styles; min-width queries
 * (640px, 768px nav, 1024px) layer larger screens on.
 * Component styles (buttons, forms, tables, cards) live in components.css. */

/* Legacy token names, re-pointed at the brand layer in brand.css.
 * Existing pages (dashboard, booking, auth) consume these names, so aliasing
 * rebrands them without touching their markup. Do not reintroduce raw hex
 * values here — add or adjust the underlying token in brand.css instead. */
:root {
    --granite-dark: var(--g-navy-900);
    --granite-mid: var(--g-blue-500);
    --accent: var(--g-action);
    --bg: var(--g-surface);
    --text: var(--g-ink);
    --card-bg: var(--g-surface-raised);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--g-font-body);
    font-size: var(--g-step-0);
    color: var(--text);
    background: var(--bg);
    line-height: var(--g-leading-body);
    -webkit-font-smoothing: antialiased;
}

/* Headings take the condensed display face across the whole site, so the
 * dashboard and booking screens read as the same brand as the landing page. */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--g-font-display);
    font-weight: var(--g-weight-heavy);
    line-height: var(--g-leading-snug);
    letter-spacing: var(--g-tracking-tight);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding-left: clamp(1rem, 4vw, 2rem);
    padding-right: clamp(1rem, 4vw, 2rem);
}

a {
    color: var(--accent);
}

/* Visible focus for every interactive element. The default UA outline is
 * nearly invisible against the navy header, so keyboard users lose their
 * place; the gold ring is the one accent that reads on both surfaces. */
:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--g-gold);
    outline-offset: 2px;
    border-radius: var(--g-radius-xs);
}

/* Header */

.site-header {
    background: var(--g-navy-950);
    /* Gold hairline lifted from the wrap's panel edging. */
    border-bottom: 2px solid var(--g-gold);
    box-shadow: var(--g-shadow-m);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    min-width: 0;
}

/* Vector wordmark: sized by height, width follows the 1000x380 viewBox.
 * No border-radius — the old rule was masking the corners of a photograph. */
.brand-logo {
    height: 38px;
    width: auto;
    flex-shrink: 0;
}

/* Division line. Hidden by default: below 768px the header has no spare room,
 * and the wordmark plus phone number are what matter on a phone. */
.brand-division {
    display: none;
}

.header-cta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Red pill, mirroring the wrap's URL badge. The phone number is the primary
 * conversion on a call-driven trade, so it gets button treatment rather than
 * sitting as one more link in the nav. */
.header-phone {
    color: #fff;
    font-family: var(--g-font-display);
    font-weight: var(--g-weight-bold);
    font-size: var(--g-step-1);
    letter-spacing: var(--g-tracking-tight);
    text-decoration: none;
    padding: 0.35rem 0.8rem;
    background: var(--g-action);
    border-radius: var(--g-radius-s);
    box-shadow: var(--g-shadow-inset-chrome);
    transition: background var(--g-duration) var(--g-ease-out);
    white-space: nowrap;
}

.header-phone:hover {
    background: var(--g-action-hover);
}

.nav-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
}

/* Mobile: nav is a full-width dropdown under the header row, JS-toggled. */
.site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
}

.site-nav.is-open {
    display: flex;
}

.site-nav a,
.site-nav .link-button {
    display: block;
    width: 100%;
    text-align: left;
    color: var(--g-ink-inverse);
    font-family: var(--g-font-display);
    font-weight: var(--g-weight-bold);
    font-size: var(--g-step-1);
    letter-spacing: var(--g-tracking-wide);
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.85rem 0.25rem;
    border-top: 1px solid var(--g-line-inverse);
    transition: color var(--g-duration) var(--g-ease-out);
}

.site-nav a:hover,
.site-nav .link-button:hover {
    color: var(--g-gold);
}

.site-nav .inline-form {
    display: block;
    width: 100%;
}

.link-button {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
}

/* The old .hero and .tagline rules lived here. The landing page now owns its
 * hero entirely (see the landing-*.css bundle), and no other template uses those classes,
 * so keeping them would only fight the new styles -- their text-align:center
 * was overriding the redesigned hero's alignment. */

/* Footer */

.site-footer {
    background: var(--g-navy-950);
    color: var(--g-ink-inverse);
    text-align: center;
    padding: var(--g-space-l) 0;
    margin-top: var(--g-space-l);
    border-top: 2px solid var(--g-gold);
}

.site-footer a {
    color: var(--g-ink-inverse);
    text-decoration-color: var(--g-gold);
    text-underline-offset: 3px;
}

.site-footer a:hover {
    color: var(--g-gold);
}

/* Larger phones / small tablets */

@media (min-width: 640px) {
    .brand-logo {
        height: 46px;
    }

    .header-phone {
        padding: 0.6rem 0.6rem;
    }
}

/* Tablet/desktop: hamburger disappears, single-row inline nav returns */

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }

    .header-inner {
        flex-wrap: nowrap;
        gap: 1rem;
    }

    /* Sits in the gap between the wordmark and the nav, separated by a gold
     * rule echoing the wrap's panel edging. */
    .brand-division {
        display: block;
        margin-right: auto;
        padding-left: 0.9rem;
        border-left: 2px solid var(--g-gold);
        color: var(--g-chrome-500);
        font-family: var(--g-font-display);
        font-weight: var(--g-weight-bold);
        font-size: var(--g-step-0);
        line-height: 1.15;
        text-transform: uppercase;
        letter-spacing: var(--g-tracking-wide);
        /* Breaks as "Mobile Maintenance / Division". Narrower values cannot:
         * "MAINTENANCE" alone is ~135px at this size and tracking, so anything
         * under that just forces a third line and pushes the header taller
         * than the wordmark. */
        max-width: 15rem;
    }

    .site-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
        width: auto;
        margin-left: 0;
    }

    .site-nav a,
    .site-nav .link-button {
        display: inline;
        width: auto;
        padding: 0.25rem 0;
        border-top: none;
    }

    .site-nav .inline-form {
        display: inline;
        width: auto;
    }

    .header-cta {
        order: 3;
    }
}

/* Wide desktop */

@media (min-width: 1024px) {
    .site-footer {
        margin-top: 3rem;
    }
}
