/* ==========================================================================
   /store-audit: the dispensary audit page, written as a letter
   A signed note from Greg, read top to bottom. Each part is a short paragraph,
   a margin note on how it is measured, and a figure set wider than the text.
   Loads after homepage.css and uses its tokens; the figures' own styles are
   in film-figures.css.
   ========================================================================== */

:root {
    --field-border: rgba(26, 26, 46, 0.32);
}

/* The opening: the H1 and the note on the left, the desk spread on the
   right; on a phone the spread sits under the H1, full width. */

.audit-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    grid-template-areas:
        "h1 art"
        "body art";
    align-items: start;
    gap: 1.75rem clamp(2rem, 4vw, 4.5rem);
    padding-top: clamp(2.5rem, 5vw, 4.5rem);
    padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.audit-hero h1 {
    grid-area: h1;
    align-self: end;
    font-size: clamp(2.6rem, 4.3vw, 4.3rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1;
}

.audit-hero__body {
    grid-area: body;
}

.letter-from {
    margin: 0 0 1.25rem;
    color: var(--ink-soft);
    font-family: var(--display);
    font-size: 1.15rem;
    font-style: italic;
}

.audit-hero__intro {
    max-width: 32rem;
    margin-bottom: 1.75rem;
    color: var(--ink-soft);
    font-size: clamp(1.05rem, 1.25vw, 1.18rem);
    line-height: 1.65;
}

.audit-hero__art {
    grid-area: art;
    align-self: center;
    min-width: 0;
}

/* The body: margin note | text | figure set wide */

main > .letter {
    padding-top: 0;
}

main > .audit-hero + .letter {
    border-top: 0;
}

.letter-part {
    display: grid;
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
    grid-template-areas:
        "note text"
        ". fig";
    gap: 1.75rem clamp(2rem, 4vw, 4rem);
    padding: clamp(3rem, 6vw, 5rem) 0;
    border-top: 1px solid var(--rule);
}

.letter-part:first-child {
    border-top: 0;
    padding-top: clamp(1rem, 2vw, 2rem);
}

.letter-text {
    grid-area: text;
    max-width: 40rem;
}

.letter-text h2 {
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    line-height: 1.05;
}

.letter-text p {
    margin-top: 1rem;
    color: var(--ink-soft);
    font-size: 1.08rem;
    line-height: 1.7;
}

.letter-note {
    grid-area: note;
    align-self: start;
    padding-top: 0.9rem;
    border-top: 1px solid var(--emerald);
    color: var(--graphite);
    font-size: 0.9rem;
    line-height: 1.55;
}

.letter-fig {
    grid-area: fig;
    min-width: 0;
}

/* owner-2: a plain text link to the form after the first fix and the limits. */
.text-cta {
    margin-top: 1.5rem;
    font-weight: 600;
}


.letter-text .letter-sign {
    margin-top: 1.75rem;
    color: var(--graphite);
    font-size: 0.95rem;
}

.letter-sign span {
    display: block;
    color: var(--ink);
    font-family: var(--display);
    font-size: 1.5rem;
    font-style: italic;
}

@media (max-width: 1120px) {
    .audit-hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "h1"
            "body"
            "art";
    }

    .letter-part {
        grid-template-columns: 1fr;
    }

    .letter-part {
        grid-template-areas:
            "text"
            "fig"
            "note";
    }

    .letter-note {
        max-width: 40rem;
    }
}

@media (max-width: 760px) {
    .audit-hero h1 {
        font-size: clamp(2.3rem, 10vw, 3.1rem);
    }
}

/* Below 720px the hero shows only the "Do this first" card. */
@media (max-width: 720px) {
    .audit-hero .spread-answer,
    .audit-hero .logo-note {
        display: none;
    }
}

/* --- Request form ---------------------------------------------------------
   One self-contained block (data-slot="audit-start"). The instant audit
   replaces this block alone. */

.request-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.25rem;
}

/* display:grid would otherwise beat the hidden attribute and leave the form
   showing under the confirmation. */
.request-form[hidden] {
    display: none;
}

.field {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.field--wide {
    grid-column: 1 / -1;
}

.field label {
    font-size: 0.95rem;
    font-weight: 500;
}

.field .optional {
    color: var(--graphite);
    font-weight: 400;
}

.field input,
.field select {
    width: 100%;
    min-height: 3.1rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--field-border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
}

.field select {
    padding-right: 2.75rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%231a1a2e' stroke-width='1.6'/%3E%3C/svg%3E");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.field-help {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.field-error {
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 500;
}

.field [aria-invalid="true"] {
    border-color: #b42318;
}

/* owner-2: after a good send the form gives way to this. */
.request-done {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: 0.4rem 1rem;
    max-width: 36rem;
    padding: clamp(1.25rem, 3vw, 1.75rem);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-sm);
    background: var(--white);
}

.request-done[hidden] {
    display: none;
}

.request-done:focus {
    outline: none;
}

.request-done__mark {
    grid-row: 1 / span 3;
    width: 2.25rem;
    height: 2.25rem;
    fill: none;
    stroke: var(--green);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.request-done h3 {
    font-size: 1.5rem;
    line-height: 1.2;
}

.request-done p {
    color: var(--ink-soft);
    line-height: 1.6;
}

.field input::placeholder {
    color: #6b6e80;
}

.field input:focus-visible,
.field select:focus-visible {
    border-color: var(--green);
    outline: 2px solid var(--green);
    outline-offset: 1px;
}

.field input:user-invalid {
    border-color: #b42318;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin-top: 0.5rem;
}

.form-actions .button {
    cursor: pointer;
}

.form-note {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.form-status {
    grid-column: 1 / -1;
    color: var(--green);
    font-weight: 500;
}

.form-status:empty {
    display: none;
}

.form-status--error {
    color: #b42318;
}

.next-steps {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    border-top: 1px solid var(--rule-strong);
}

.next-steps li {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    counter-increment: step;
}

.next-steps li::before {
    color: var(--green);
    font-family: var(--display);
    font-size: 1.35rem;
    line-height: 1.2;
    content: counter(step);
}

.next-steps strong {
    display: block;
    font-weight: 600;
}

.next-steps span {
    color: var(--ink-soft);
}

/* --- Request section --------------------------------------- */

.request {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 3rem clamp(3rem, 6vw, 6rem);
    align-items: start;
}

main > .request {
    width: 100%;
    max-width: none;
    padding-right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
    padding-left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
    background: var(--paper);
}

.request-copy h2 {
    font-size: clamp(2.5rem, 4.4vw, 4rem);
    line-height: 1.02;
}

.request-copy > p {
    margin: 1rem 0 2rem;
    color: var(--ink-soft);
}

.request-next h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.request-depth {
    margin-top: 1.25rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

/* --- Responsive (request) ---------------------------------------------- */

@media (max-width: 1120px) {
    .request {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .request-copy h2 {
        font-size: clamp(2.15rem, 9.5vw, 2.75rem);
    }

    .request-form {
        grid-template-columns: 1fr;
    }
}

/* --- Questions owners ask (owner-4) --------------------------------------- */

/* design-12: the letter's close runs into the questions without a gulf. */
main > .letter {
    padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

main > .owner-questions {
    padding-top: clamp(2rem, 3vw, 2.5rem);
    padding-bottom: calc(var(--section-space) / 2);
}

main > .owner-questions + .request {
    padding-top: calc(var(--section-space) / 2);
}

.letter-part--close {
    padding-bottom: 1.5rem;
}

.owner-questions {
    display: grid;
    grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
    gap: 1.5rem clamp(2rem, 4vw, 4rem);
}

/* The divider sits inside the gutters, as every other one on the page does. */
main > section.owner-questions {
    border-top: 0;
}

.owner-questions::before {
    grid-column: 1 / -1;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    border-top: 1px solid var(--rule);
    content: "";
}

.owner-questions h2 {
    grid-column: 2;
    font-size: clamp(2rem, 3.2vw, 2.9rem);
    line-height: 1.05;
}

.owner-questions__list {
    display: grid;
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem clamp(2rem, 4vw, 3.5rem);
    margin: 0;
}

.owner-questions__list dt {
    font-weight: 600;
}

.owner-questions__list dd {
    margin: 0.4rem 0 0;
    color: var(--ink-soft);
    line-height: 1.6;
}

.owner-questions__list .text-link {
    display: inline;
    min-height: 0;
}

/* --- The phone's request bar (owner-2) ------------------------------------ */

.sticky-cta {
    display: none;
}

@media (max-width: 1120px) {
    .owner-questions {
        grid-template-columns: 1fr;
    }

    .owner-questions h2,
    .owner-questions__list {
        grid-column: 1;
    }
}

@media (max-width: 760px) {
    .owner-questions__list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .sticky-cta:not([hidden]) {
        position: fixed;
        right: 0;
        bottom: var(--banner-h, 0px);
        left: 0;
        z-index: 40;
        display: block;
        padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--rule);
        background: var(--white);
    }

    .sticky-cta .button {
        display: flex;
        justify-content: center;
        width: 100%;
        border-color: var(--ink);
        background: var(--ink);
        color: var(--white);
    }
}

@media (max-width: 720px) {
    .letter-part {
        grid-template-areas:
            "text"
            "note"
            "fig";
        row-gap: 1rem;
    }

    .letter-note {
        margin-top: -0.25rem;
        padding-top: 0;
        border-top: 0;
        color: var(--ink-soft);
        font-size: 1rem;
        line-height: 1.7;
    }
}

