/* ===========================================================================
   Public website — components that exist only on the marketing pages.

   This file is an EXTENSION of static/css/main.css, not a replacement and not a
   second design system. Two rules govern everything below:

   1. NO BRAND HEX. Every colour here is a var() reference to a token defined in
      main.css. That is what makes light mode, dark mode and the .on-dark scope
      work without a single media query in this file. If you find yourself
      typing a "#", the token you want already exists.

   2. Gold is never named. Components ask for --accent; .on-dark remaps it. Put
      navy behind a block by giving it .on-dark and the gold follows.

   It lives here rather than in main.css only because main.css belongs to the
   platform's shared design system and this app does not own it. Anything below
   that turns out to be genuinely shared belongs there instead.

   Mobile-first throughout: the base rules are the 375px layout and the media
   queries add width, never take it away.

   EVERYTHING IS INSIDE @layer marketing. That layer is declared last but one in
   main.css's order statement, after `portal`, so this file can override a
   shared component without a specificity war and `utilities` still wins over
   it. Nothing may be added outside the layer block: an unlayered declaration
   beats every layered one regardless of specificity, and a half-layered file
   is worse than no layers at all.

   The form set (.field, .field-radio, .field-check, .field-error, the
   honeypot), .notice and its modifiers have moved into main.css — they were
   defined here AND in two portal stylesheets, differently, and only never
   collided because no two of those files ever loaded together.
   =========================================================================== */

@layer marketing {

/* --- Header and navigation -----------------------------------------------
   main.css fixes the header at one row of --header-h. Six nav links plus a
   button do not fit that at 375px, so on narrow screens the header grows and
   the links wrap. site.js then upgrades it to a disclosure — but the wrapped
   layout is the fallback, so a visitor with no JavaScript still has every link.
   ------------------------------------------------------------------------ */

.public .site-header-inner {
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* The wordmark is 306px at its display size, which alone is wider than a 375px
   screen minus its gutters. Rather than wrap the header onto two rows and lose
   a third of a phone viewport to sticky chrome, the lockup steps down. The
   crest carries the identity at this size. */
@media (max-width: 559px) {
    .public .site-header .lockup-word {
        font-size: 0.75rem;
        letter-spacing: 0.06em;
    }
    .public .site-header .crest-sm { width: 22px; }
}

.site-nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem 1.1rem;
}

/* The collapse is done in CSS, at a media query, and NOT switched on by
   JavaScript. Doing it in JS after a deferred script runs means every mobile
   page load paints a four-row wrapped nav and then snaps to one row — a visible
   jump on the primary target. <noscript> in marketing/base.html restores the
   wrapped row for a visitor with no JavaScript, so the fallback survives without
   the shift. */
.nav-toggle {
    display: none;
    min-height: var(--tap);
    min-width: var(--tap);
    padding: 0 0.75rem;
    font: inherit;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-soft);
    background: none;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.nav-toggle:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 1023px) {
    .site-header .nav-toggle { display: inline-flex; }
    .site-header .site-nav-links {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem var(--gutter) 1rem;
        background: var(--bg);
        border-bottom: 1px solid var(--rule);
        text-align: left;
    }
    .site-header .site-nav-links a {
        display: flex;
        align-items: center;
        min-height: var(--tap);
        border-bottom: 1px solid var(--rule);
    }
    .site-header .site-nav-links a:last-child {
        border-bottom: 0;
        margin-top: 0.75rem;
    }
    .site-header[data-nav-open="true"] .site-nav-links { display: flex; }
}

/* main.css sets `.site-nav a { color: var(--ink-soft) }`, which is one class
   and one type — more specific than `.btn`, so an unqualified .btn inside the
   nav renders navy text on a navy ground. This is the fix, not a preference. */
.site-nav a.btn-nav,
.site-nav a.btn-nav:hover {
    color: var(--accent-contrast);
    text-decoration: none;
}
.btn-nav {
    padding: 0.55rem 1.1rem;
    font-size: 0.6875rem;
    letter-spacing: 0.14em;
}
.site-header[data-nav="collapsible"] .btn-nav { justify-content: center; }

/* --- Hero -----------------------------------------------------------------
   Full-bleed. The photograph is optional: with no image the navy ground shows
   through, which is the brand's own and reads as deliberate.
   ------------------------------------------------------------------------ */

.m-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 78vh;
    padding: 4rem 0;
    overflow: hidden;
}

.m-hero-media {
    position: absolute;
    inset: 0;
}
.m-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* A scrim, not a tint: the display serif has to stay legible over whatever
   photograph a director uploads, and we cannot know how bright it is. Built
   from the navy token so it darkens rather than greys. */
.m-hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--navy);
    opacity: 0.62;
}

.m-hero-body {
    position: relative;
    z-index: 1;
}
.m-hero-body .crest { margin-bottom: 1.25rem; }
.m-hero-body h1 { margin-bottom: 1rem; }
.m-hero-support {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--ink-soft);
    margin-bottom: 2rem;
}

/* --- Trust bar ------------------------------------------------------------
   The wireframe's "highest-value element on the page". One column at 375px,
   four across from tablet up. Never scrolls sideways.
   ------------------------------------------------------------------------ */

.trust-bar {
    padding: 2rem 0;
    border-bottom: 1px solid var(--rule);
    background: var(--bg-soft);
}
.trust-bar-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.trust-bar-list li { display: block; }
.trust-mark { margin: 0 auto 0.5rem; max-width: 3.5rem; }
.trust-label {
    display: block;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: var(--track-display);
    font-size: 0.9375rem;
    color: var(--ink);
}
.trust-detail {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}

/* --- Proof points and steps ---------------------------------------------- */

.proof-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 2.5rem;
}
.proof .ornament { max-width: 4rem; margin-top: 0; }
.proof h3 {
    text-transform: uppercase;
    letter-spacing: var(--track-display);
    font-size: 1rem;
}
.proof p { color: var(--ink-muted); font-size: 0.9375rem; }

.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 3rem;
    counter-reset: step;
}
.steps li { padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.step-number {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: var(--track-micro);
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.steps h2 { font-size: 1.35rem; }

/* --- Service area list --------------------------------------------------- */

.area-list {
    list-style: none;
    margin: 1.5rem 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
}
.area-list li { color: var(--ink-soft); font-size: 0.9375rem; }
.area-code {
    font-family: var(--font-sans);
    letter-spacing: var(--track-micro);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    margin-right: 0.4rem;
}

/* --- Anchored sections ---------------------------------------------------
   The header is sticky, so an anchor jump would otherwise land under it. */

.anchor { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* --- Forms ----------------------------------------------------------------
   The .public dialect centres everything, which is right for prose and wrong
   for a form: a centred label above a full-width input is hard to scan and
   harder to fill in one-handed. Forms opt out locally.
   ------------------------------------------------------------------------ */

.consultation-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: left;
}

.form-panel,
.side-panel { text-align: left; }
.public .form-panel p,
.public .side-panel p { margin-left: 0; margin-right: 0; }
.form-panel h2,
.side-panel h2 { font-size: 1.2rem; }
.form-panel .micro-label,
.side-panel .micro-label { text-align: left; }

.field { margin-bottom: 1.25rem; }
.field label,
.field legend {
    display: block;
    margin-bottom: 0.35rem;
    padding: 0;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: var(--track-micro);
    color: var(--ink-muted);
}
.field .req { color: var(--accent); }
.field-help,
.privacy-note,
.form-foot {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: var(--ink-muted);
}
.field-error {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: var(--danger);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--danger); }

/* Django 5 renders RadioSelect as nested <div>s — it stopped using <ul>/<li> in
   4.0 — so `.field-radio ul` and `.field-radio li` match nothing. Targeting the
   real markup: `.field-radio > div` is the widget's container and each child div
   is one option. Get this wrong and the option labels silently inherit the 11px
   uppercase micro-label style from `.field label` above, with no tap target, on
   the required radio group of the primary conversion form. */
.field-radio { border: 0; margin: 0 0 1.25rem; padding: 0; }
.field-radio > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}
.field-radio > div > div { flex: none; }
.field-radio label,
.field-check label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--tap);
    margin: 0;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9375rem;
    color: var(--ink-soft);
}
.field-radio input[type="radio"],
.field-check input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    min-height: 0;
    accent-color: var(--accent);
    flex: none;
}
.field-check label { align-items: flex-start; }
.field-check input[type="checkbox"] { margin-top: 0.85rem; }

.privacy-note { margin: 1rem 0; }
.form-foot { margin-top: 0.75rem; text-align: center; }

/* The honeypot. display:none, not off-screen. The off-screen version is
   sometimes recommended on the theory that bots skip hidden fields, but an
   off-screen input is still an input that browser autofill will populate — and a
   honeypot filled in by the visitor's own password manager refuses a real
   enquiry, repeatably. The field's name does the work of not looking fillable;
   see the docstring in apps/marketing/forms.py. */
.hp-wrap { display: none; }

/* --- Panels and notices -------------------------------------------------- */

.callback-panel {
    padding: 1.75rem;
    border: 1px solid var(--rule);
    background: var(--bg-raised);
}
.callback-number {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 6vw, 1.6rem);
    margin-bottom: 0.25rem;
}
.callback-lead {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.contact-block { padding-bottom: 1.75rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--rule); }
.contact-block:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.contact-block .area-list { justify-content: flex-start; margin: 0.5rem 0 0.75rem; }
/* hello@hawthornehouseholdcare.co.uk is a single 34-character token with no
   break opportunity in it, and at 1.5rem of display serif that is wider than a
   375px screen. It has to be allowed to break mid-word as well as to scale, or
   the contact page is the one page on the site that scrolls sideways. */
.contact-line {
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 5vw, 1.5rem);
    overflow-wrap: anywhere;
}

.notice {
    margin: 0 0 1.5rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--rule-strong);
    border-left-width: 3px;
    font-size: 0.9375rem;
    text-align: left;
}
.notice p { margin: 0 0 0.5rem; max-width: none; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { border-left-color: var(--ok); }
.notice-error { border-left-color: var(--danger); }
.notice-draft { border-left-color: var(--warn); }

.price-block {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--rule-strong);
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--ink);
}

.lead { font-size: 1.1rem; color: var(--ink); }

/* --- FAQ ------------------------------------------------------------------
   <details>/<summary>: opens with no JavaScript, keyboard-operable for free,
   and find-in-page opens the matching panel.
   ------------------------------------------------------------------------ */

.faq-list { text-align: left; margin-top: 1rem; }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--tap);
    padding: 1rem 0;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    flex: none;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--accent);
}
.faq-item[open] summary::after { content: "\2013"; }
.faq-answer { padding-bottom: 1.25rem; }
.faq-answer p { margin-left: 0; margin-right: 0; color: var(--ink-soft); font-size: 0.9375rem; }

/* --- Long-form legal copy ------------------------------------------------ */

.prose { text-align: left; }
.prose p { margin-left: 0; margin-right: 0; }
.prose h2 {
    margin-top: 2.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: var(--track-display);
}
.prose h2:first-of-type { margin-top: 1.5rem; }
.prose .data-table { margin: 1rem 0 1.5rem; }

/* --- Legal strip and cookie notice --------------------------------------- */

.legal-strip {
    padding: 1.5rem 0;
    border-top: 1px solid var(--rule);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: var(--track-micro);
}
.legal-strip .shell {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.5rem;
}
.legal-strip a { color: var(--ink-muted); }
.legal-strip a:hover { color: var(--accent); }

.cookie-notice {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule-strong);
    font-size: 0.8125rem;
}
.cookie-notice[hidden] { display: none; }
/* Set by site.js while the banner is up. It is fixed to the bottom, so without
   this it covers the footer and the legal links. */
[data-cookie-notice="visible"] body { padding-bottom: 9rem; }
@media (min-width: 560px) {
    [data-cookie-notice="visible"] body { padding-bottom: 5.5rem; }
}
.cookie-notice-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}
.cookie-notice p { margin: 0; max-width: 60ch; }
.cookie-notice .btn { flex: none; }

/* --- Wider viewports ------------------------------------------------------
   Everything above is the 375px layout. These only add.
   ------------------------------------------------------------------------ */

@media (min-width: 560px) {
    .trust-bar-list { grid-template-columns: repeat(2, 1fr); }
    .cookie-notice-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (min-width: 860px) {
    .trust-bar-list { grid-template-columns: repeat(4, 1fr); }
    .trust-bar-list li + li { border-left: 1px solid var(--rule); }
    .proof-grid { grid-template-columns: repeat(2, 1fr); }
    .steps { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 3rem; }
    .consultation-layout { grid-template-columns: 1.35fr 1fr; gap: 4rem; align-items: start; }
    .m-hero { min-height: 72vh; }
    .m-hero-support { font-size: 1.35rem; }
}
