/* =========================================================
   Ascot Graphics — Global CSS
   Design tokens, header/footer, buttons, shared components
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
    /* Brand colours - warm & established, three-colour palette */
    --brand:        #E31E24;   /* Ascot red */
    --brand-dark:   #A81419;   /* red hover / active */
    --brand-deep:   #7A0D11;   /* deepest red */

    /* Neutrals - deep chocolate + white */
    --charcoal:     #3D2B24;   /* deep chocolate - dark sections, headings */
    --charcoal-dark:#2A1D18;   /* darker chocolate - depth / gradients */
    --ink:          #2A1D18;   /* body text - dark chocolate */
    --muted:        #7A6963;   /* secondary text - warm brown-grey */
    --grey-line:    #E8E4E1;   /* very subtle warm hairline */
    --tint:         rgba(61, 43, 36, 0.05); /* whisper of chocolate for icon bg / subtle fills */
    --on-charcoal:  rgba(255, 255, 255, 0.88); /* off-white for text on chocolate sections */
    --footer-bg:    #1F2226;   /* true neutral cool charcoal - footer only */
    --white:        #ffffff;

    /* Typography */
    --font-head: 'DM Sans', system-ui, -apple-system, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

    /* Rhythm & layout */
    --maxw:       1180px;
    --nav-maxw:   1440px;
    --gutter:     clamp(1.25rem, 4vw, 3rem);
    --section-y:  clamp(3.5rem, 8vw, 6.5rem);
    --radius:     14px;
    --radius-lg:  22px;
    --radius-pill: 999px;

    /* Effects - warm chocolate-tinted shadows */
    --shadow-sm:  0 4px 18px rgba(61, 43, 36, 0.08);
    --shadow-md:  0 14px 40px rgba(61, 43, 36, 0.12);
    --shadow-nav: 0 10px 30px rgba(61, 43, 36, 0.10);
    --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--charcoal);
    line-height: 1.2;
    margin: 0 0 0.6em;
    font-weight: 500;
    letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* Skip link (a11y) */
.skip-link {
    position: absolute;
    top: 0; left: 0;
    transform: translateY(-100%);
    background: var(--charcoal); color: var(--white);
    padding: 8px 16px; z-index: 1000;
    text-decoration: none;
    transition: transform 0.15s var(--ease);
}
.skip-link:focus { transform: translateY(0); color: var(--white); }

/* ---------- Layout containers ---------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
    background: var(--white);
}
.section--grey {
    padding-block: var(--section-y);
    background: var(--white);
    position: relative;
}
.section--grey::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--tint);
    pointer-events: none;
    z-index: 0;
}
.section--grey > .container { position: relative; z-index: 1; }
.section--charcoal {
    padding-block: var(--section-y);
    background: var(--charcoal);
    color: var(--on-charcoal);
}
.section--charcoal h1,
.section--charcoal h2,
.section--charcoal h3 { color: var(--white); }
.section--charcoal a { color: var(--on-charcoal); }
.section--charcoal a:hover { color: var(--white); }

/* Section heading rhythm */
.section__eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand);
    font-weight: 500;
    margin-bottom: 0.75rem;
}
.section__title { margin-bottom: 1rem; }
.section__lead {
    max-width: 68ch;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    border: 0.5px solid transparent;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    white-space: nowrap;
}
.btn--primary {
    background: var(--brand);
    color: var(--white);
}
.btn--primary:hover {
    background: var(--brand-dark);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn--light {
    background: var(--white);
    color: var(--charcoal);
    border-color: var(--grey-line);
}
.btn--light:hover {
    background: var(--tint);
    color: var(--charcoal);
    border-color: var(--charcoal);
}
.btn--dark {
    background: var(--charcoal);
    color: var(--white);
}
.btn--dark:hover {
    background: var(--ink);
    color: var(--white);
}
.btn--lg {
    padding: 1.05rem 2rem;
    font-size: 1.05rem;
}
.btn--block {
    display: flex;
    width: 100%;
}

/* ---------- Header + floating pill nav ---------- */
.site-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem var(--gutter) 0;
    pointer-events: none;
    background: transparent;
}
.nav {
    pointer-events: auto;
    max-width: var(--nav-maxw);
    margin-inline: auto;
    background: var(--white);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-nav);
    padding: 1.05rem 1rem 1.05rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: nowrap;
    border: 0.5px solid var(--grey-line);
}
.nav__brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.nav__brand img {
    height: 54px;
    width: auto;
    display: block;
}
.nav__list {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.nav__link {
    display: inline-block;
    padding: 0.75rem 1.15rem;
    color: var(--charcoal);
    font-size: 0.98rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
    transition: all 0.2s var(--ease);
    white-space: nowrap;
    line-height: 1;
}
.nav__link:hover,
.nav__link:focus-visible {
    background: var(--tint);
    color: var(--charcoal);
}
.nav__link[aria-current="page"] {
    background: var(--charcoal);
    color: var(--white);
}

/* Contact strip inside pill - desktop/tablet only */
.nav__contact {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-inline: 0.75rem;
    border-left: 0.5px solid var(--grey-line);
    flex-shrink: 0;
}
.nav__contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--charcoal);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s var(--ease);
    white-space: nowrap;
}
.nav__contact a:hover { color: var(--brand); }
.nav__contact a i {
    color: var(--brand);
    font-size: 0.85rem;
}

.nav__cta {
    flex-shrink: 0;
}
.nav__cta .btn {
    padding: 0.95rem 1.75rem;
    font-size: 1rem;
}

/* Mobile toggle (hidden on desktop) */
.nav__toggle {
    display: none;
    background: transparent;
    border: 0.5px solid var(--grey-line);
    border-radius: var(--radius-pill);
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    color: var(--charcoal);
    font-size: 1.15rem;
    transition: background 0.2s var(--ease);
}
.nav__toggle:hover { background: var(--tint); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--on-charcoal);
    padding: 4rem var(--gutter) 2rem;
    margin-top: 4rem;
}
.site-footer__inner {
    max-width: var(--maxw);
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
}
.site-footer__brand {
    font-family: var(--font-head);
    font-size: 1.75rem;
    color: var(--white);
    margin-bottom: 0.75rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}
.site-footer__tagline {
    color: var(--on-charcoal);
    margin-bottom: 1.25rem;
    font-style: italic;
    opacity: 0.85;
}
.site-footer h4 {
    color: var(--white);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    font-weight: 500;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin-bottom: 0.6rem; }
.site-footer a {
    color: var(--on-charcoal);
    opacity: 0.85;
    transition: opacity 0.2s var(--ease), color 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.site-footer a:hover {
    color: var(--white);
    opacity: 1;
}
.site-footer a i { color: var(--brand); width: 16px; text-align: center; }
.site-footer__socials {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.site-footer__socials a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    opacity: 1;
    transition: background 0.2s var(--ease);
}
.site-footer__socials a:hover { background: var(--brand); }
.site-footer__bottom {
    max-width: var(--maxw);
    margin-inline: auto;
    padding-top: 2rem;
    border-top: 0.5px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    opacity: 0.75;
    flex-wrap: wrap;
}
.site-footer__bottom a { color: var(--on-charcoal); }
.site-footer__bottom a:hover { color: var(--white); }

/* ---------- Utility ---------- */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }

/* ---------- Responsive: tablet & mobile ---------- */

/* Tight tablet range - shrink contact strip so full nav fits */
@media (min-width: 901px) and (max-width: 1200px) {
    .nav {
        padding: 0.65rem 0.65rem 0.65rem 1.25rem;
        gap: 0.75rem;
    }
    .nav__brand img { height: 42px; }
    .nav__link {
        padding: 0.55rem 0.75rem;
        font-size: 0.9rem;
    }
    .nav__list { gap: 0.15rem; }
    .nav__contact {
        gap: 0.65rem;
        padding-inline: 0.65rem;
    }
    .nav__contact a { font-size: 0.82rem; }
    /* Hide email address text on tight tablet; keep phone */
    .nav__contact a[href^="mailto:"] { display: none; }
}

@media (max-width: 900px) {
    /* ===== Mobile standalone header: standard bar across ===== */
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        padding: 0;
        z-index: 100;
        background: transparent;
    }
    .nav {
        position: relative;
        max-width: 100%;
        border-radius: 0;
        padding: 0.9rem var(--gutter);
        background: var(--white);
        border: 0;
        border-bottom: 0.5px solid var(--grey-line);
        box-shadow: 0 2px 12px rgba(42, 29, 24, 0.06);
        gap: 0;
    }
    .nav__brand {
        /* Nudge the visual centre - logo has tagline pulling weight down */
        padding-top: 2px;
    }
    .nav__brand img { height: 40px; }
    .nav__list,
    .nav__contact,
    .nav__cta { display: none; }
    .nav__toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--brand);
        border: 0;
        color: var(--white);
    }
    .nav__toggle:hover,
    .nav__toggle:focus-visible {
        background: var(--brand);
        color: var(--white);
        opacity: 0.9;
    }

    /* ===== Overlay menu (open state) ===== */
    .nav.is-open {
        position: fixed;
        inset: 0;
        max-width: 100%;
        border-radius: 0;
        border: 0;
        box-shadow: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        overflow-y: auto;
        gap: 0;
        z-index: 200;
        background: var(--white);
    }
    /* White top strip carries over from closed bar */
    .nav.is-open .nav__brand {
        order: 1;
        position: sticky;
        top: 0;
        z-index: 5;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0.9rem var(--gutter);
        margin: 0;
        background: var(--white);
        border-bottom: 0.5px solid var(--grey-line);
        padding-top: calc(0.9rem + 2px);
    }
    /* Toggle (now X) sits top-right inside the strip via absolute positioning */
    .nav.is-open .nav__toggle {
        position: absolute;
        top: 0.9rem;
        right: var(--gutter);
        z-index: 210;
        color: var(--white);
        background: var(--brand);
        border: 0;
    }

    /* Nav links */
    .nav.is-open .nav__list,
    .nav.is-open .nav__contact,
    .nav.is-open .nav__cta {
        display: flex;
    }
    .nav.is-open .nav__list {
        order: 2;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
        margin: 1.75rem 0 0;
        padding: 0;
    }
    /* Zebra alternating tint for nav rows */
    .nav.is-open .nav__list li {
        background: var(--white);
    }
    .nav.is-open .nav__list li:nth-child(even) {
        background: var(--tint);
    }
    .nav.is-open .nav__link {
        display: block;
        padding: 0.95rem var(--gutter);
        font-size: 1.15rem;
        border-radius: 0;
        border: 0;
        background: transparent;
        color: var(--charcoal);
        font-weight: 500;
        position: relative;
        transition: color 0.2s var(--ease);
    }
    .nav.is-open .nav__link[aria-current="page"] {
        color: var(--brand);
        background: transparent;
        padding-left: calc(var(--gutter) + 0.85rem);
    }
    .nav.is-open .nav__link[aria-current="page"]::before {
        content: "";
        position: absolute;
        left: var(--gutter);
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 22px;
        background: var(--brand);
        border-radius: 2px;
    }
    .nav.is-open .nav__link:hover,
    .nav.is-open .nav__link:focus-visible {
        background: transparent;
        color: var(--brand);
    }

    /* Contact block with icon badges - separated from nav list by a top border */
    .nav.is-open .nav__contact {
        order: 3;
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding: 1.75rem var(--gutter);
        margin: 0;
        border: 0;
        border-top: 0.5px solid var(--grey-line);
    }
    .nav.is-open .nav__contact a {
        display: flex;
        align-items: center;
        gap: 0.85rem;
        color: var(--charcoal);
        font-size: 0.98rem;
        font-weight: 500;
        text-decoration: none;
    }
    .nav.is-open .nav__contact a:hover {
        color: var(--brand);
    }
    .nav.is-open .nav__contact a i {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: var(--brand);
        color: var(--white);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* CTA in natural flow, tight to contact block */
    .nav.is-open .nav__cta {
        order: 4;
        padding: 0 var(--gutter) 1.75rem;
    }
    .nav.is-open .nav__cta .btn { width: 100%; }
    body.nav-open { overflow: hidden; }

    /* Footer stack */
    .site-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
    .site-footer__bottom { justify-content: center; text-align: center; }
}

@media (max-width: 640px) {
    body { font-size: 16px; }
    .btn { padding: 0.75rem 1.25rem; font-size: 0.9rem; }
    .btn--lg { padding: 0.95rem 1.75rem; font-size: 1rem; }
}

@media (max-width: 420px) {
    .nav__brand img { height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}
