/*
 * The test page, variant B (architect/tasks/02-test-page.md, mock-up
 * architect/design/mockups/test-r1/t-b.html + test.css).
 *
 * The first screen in two columns - the thread with the title on the left,
 * the cover in its own 1200x630 on the right; then the thread goes on through
 * the intro and the questions. Every question is on the page - the engine's
 * own mode: the active one bright with a shadow, the rest dimmed, the
 * answered ones half-way. The progress bar slides in at the top with the
 * first answer. Container 1200, the questions' column up to 820.
 *
 * Class names: .stillnormal-* are the theme's own; .quiz-engine-* are the
 * plugin's and are styled but never renamed, because its JS selects on them.
 */

.stillnormal-hero-test,
.stillnormal-tbody,
.stillnormal-after,
.stillnormal-pre-about,
.stillnormal-pre-related,
.single-quiz_test .quiz-engine-form {
    --wrap: 1200px;
}

/* ---------- the first screen ---------- */

.stillnormal-hero-test {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
    gap: 56px;
    align-items: center;
    padding-top: 24px;
    padding-bottom: 32px;
}

/* The first screen's thread fades out at its foot; the intro's picks it up. */
.stillnormal-hero-test .stillnormal-tthread::before {
    background: linear-gradient(180deg, var(--amber) 0%, var(--amber) 90%, rgba(179, 114, 31, 0) 100%);
}

.stillnormal-hero-test .stillnormal-tstep:last-child {
    margin-bottom: 0;
}

.stillnormal-title {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(38px, 4.4vw, 60px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.stillnormal-tlead {
    max-width: 28em;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(19px, 1.8vw, 24px);
    font-style: italic;
    font-weight: 300;
    line-height: 1.3;
    color: var(--amber-deep);
}

.stillnormal-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    margin: 0;
}

.stillnormal-chips span {
    max-width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    background: var(--paper);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: var(--ink-soft);
}

.stillnormal-tcover {
    margin: 0;
    overflow: hidden;
    border-radius: 26px;
    background: var(--sand-deep);
}

.stillnormal-tcover img {
    width: 100%;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

/* ---------- the intro ---------- */

.stillnormal-tbody .stillnormal-tthread::before {
    bottom: -1px;
}

.stillnormal-intro {
    max-width: 38em;
    margin-bottom: 0;
    padding-bottom: 28px;
    font-size: 17px;
    line-height: 1.65;
}

.stillnormal-intro p {
    margin: 0 0 .8em;
}

.stillnormal-note {
    margin: 14px 0 0;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* ---------- the form: the thread's continuation ---------- */

.stillnormal-quiz {
    margin: 0;
}

.single-quiz_test .quiz-engine-form {
    position: relative;
    width: 100%;
    max-width: calc(var(--wrap) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter) 8px calc(var(--gutter) + 64px);
    border: 0;
    background: transparent;
}

.single-quiz_test .quiz-engine-form::before {
    content: "";
    position: absolute;
    left: var(--gutter);
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--amber) 0%, var(--amber) 94%, rgba(179, 114, 31, 0) 100%);
}

/*
 * The progress bar - the engine's own element, moved nowhere: pinned to the
 * top of the screen and out of sight until the first answer, then sliding in
 * as a thin strip of 34px, the 4px bar and "N / K" (test-page.js).
 */
.single-quiz_test .quiz-engine-progress {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 34px;
    margin: 0;
    padding: 0 max(var(--gutter), calc((100% - var(--wrap)) / 2));
    border-bottom: 1px solid var(--rule);
    background: rgba(239, 226, 207, .96);
    transform: translateY(-100%);
    transition: transform .3s;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .single-quiz_test .quiz-engine-progress {
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
    }
}

.single-quiz_test .quiz-engine-form.stillnormal-started .quiz-engine-progress {
    transform: none;
}

.single-quiz_test .quiz-engine-progress-bar {
    flex: 1;
    height: 4px;
    border: 0;
    border-radius: 2px;
    background: var(--track);
    overflow: hidden;
}

.single-quiz_test .quiz-engine-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--amber);
    transition: width .35s;
}

/* The percentage says what the count beside it says. */
.single-quiz_test .quiz-engine-progress-percent {
    display: none;
}

.stillnormal-progress-count {
    flex: none;
    min-width: 52px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: right;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

/* ---------- the questions: paper cards ---------- */

.single-quiz_test .quiz-engine-question {
    position: relative;
    min-width: 0;
    max-width: 820px;
    margin: 0 0 16px;
    padding: 24px 26px 16px;
    border: 0;
    border-radius: var(--radius-card);
    background: var(--paper);
    opacity: .38;
    filter: grayscale(40%);
    transition: opacity .3s, filter .3s, box-shadow .3s;
}

/* Each card is sewn to the thread; the active one's stitch is full amber. */
.single-quiz_test .quiz-engine-question::before {
    content: "";
    position: absolute;
    left: -64px;
    top: 34px;
    width: 24px;
    height: 2px;
    background: rgba(179, 114, 31, .35);
}

.single-quiz_test .quiz-engine-question:has(input:checked) {
    opacity: .72;
    filter: none;
}

.single-quiz_test .quiz-engine-question.is-active {
    opacity: 1;
    filter: none;
    box-shadow: 0 12px 30px rgba(58, 42, 28, .10);
}

.single-quiz_test .quiz-engine-question.is-active::before {
    background: var(--amber);
}

/* Without a script nothing is dimmed: the plain form reads whole. */
html:not(.stillnormal-js) .single-quiz_test .quiz-engine-question {
    opacity: 1;
    filter: none;
}

.stillnormal-q-text,
.single-quiz_test .quiz-engine-question legend {
    margin: 0 0 12px;
    padding: 0;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.35;
}

/* The answers: a row each, a ring in front, the chosen one tinted. */
.single-quiz_test .quiz-engine-answer {
    position: relative;
    display: block;
    margin: 0 -14px;
    padding: 11px 14px 11px 46px;
    border-radius: 14px;
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--ink);
    cursor: pointer;
    transition: background-color .15s;
}

.stillnormal-js .quiz-engine-answer input[type="radio"] {
    position: absolute;
    left: 14px;
    top: 13px;
    width: 20px;
    height: 20px;
    margin: 0;
    opacity: 0;
}

.stillnormal-js .quiz-engine-answer::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 13px;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(58, 42, 28, .35);
    border-radius: 50%;
    box-sizing: border-box;
}

.quiz-engine-answer.is-picked,
.quiz-engine-answer:has(input:checked) {
    background: rgba(224, 169, 92, .18);
}

.quiz-engine-answer.is-picked::before,
.quiz-engine-answer:has(input:checked)::before {
    border-color: var(--amber);
    box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 10px var(--amber);
}

.quiz-engine-answer:has(input:focus-visible) {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* ---------- the button and what is left ---------- */

.stillnormal-submit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 18px;
    row-gap: 10px;
    max-width: 820px;
    margin: 24px 0 0;
}

.single-quiz_test .quiz-engine-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 14px 26px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--amber);
    font-family: var(--text);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

/* Not every question answered yet: the button waits (test-page.js). */
.single-quiz_test .quiz-engine-submit:disabled {
    opacity: .45;
    cursor: default;
}

.single-quiz_test .quiz-engine-submit:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

/* ---------- under the button: the author, and sending the test ---------- */

.stillnormal-after {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 40px;
    row-gap: 18px;
    padding-top: 28px;
    padding-bottom: 56px;
    padding-left: calc(var(--gutter) + 64px);
}

.stillnormal-sendtest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 14px;
    row-gap: 10px;
}

.stillnormal-sendtest-h {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--amber);
}

.stillnormal-share-icons.is-test {
    display: flex;
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 8px;
}

/* ---------- how this test works ---------- */

.stillnormal-credits {
    margin: 22px 0 0;
}

.stillnormal-credits-about {
    margin: 0 0 14px;
    font-size: 15px;
    color: var(--ink-soft);
}

.stillnormal-credits-line {
    margin: 0 0 6px;
    font-size: 15px;
}

/* The author stands under the button, and under the verdict on the result. */
.stillnormal-credits-line.is-author {
    display: none;
}

.stillnormal-credits-line b {
    margin-right: 6px;
    font-weight: 500;
    color: var(--ink-soft);
}

.stillnormal-credits-rate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 12px;
    row-gap: 6px;
    margin-top: 14px;
    font-size: 15px;
}

.stillnormal-credits-rate b {
    font-weight: 500;
    color: var(--ink-soft);
}

/* The accordion: lines, the heading in Literata, a plus in amber. */
.stillnormal-about {
    min-width: 0;
    margin: 0;
}

.stillnormal-acc {
    border-top: 1px solid var(--rule);
}

.stillnormal-acc-item {
    border-bottom: 1px solid var(--rule);
}

.stillnormal-acc-item > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    list-style: none;
    font-family: var(--display);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    cursor: pointer;
}

.stillnormal-acc-item > summary::-webkit-details-marker {
    display: none;
}

.stillnormal-acc-item > summary::after {
    content: "+";
    flex: none;
    font-family: var(--text);
    font-size: 26px;
    font-weight: 300;
    line-height: 1;
    color: var(--amber);
}

.stillnormal-acc-item[open] > summary::after {
    content: "\2013";
}

.stillnormal-acc-body {
    max-width: 40em;
    padding: 0 0 20px;
    font-size: 16px;
    color: var(--ink-soft);
}

.stillnormal-acc-body p {
    margin: 0 0 .7em;
}

.stillnormal-acc-body h3 {
    margin: 1em 0 .3em;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}

.stillnormal-acc-body a {
    color: var(--amber-deep);
}

/* ---------- related tests: paper cards with a round cover ---------- */

.stillnormal-pre-related .stillnormal-related {
    padding-top: 32px;
    padding-bottom: 20px;
}

.stillnormal-tcards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.stillnormal-tcard {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 20px 22px;
    border-radius: 20px;
    background: var(--paper);
    text-decoration: none;
}

.stillnormal-tcard-cover {
    flex: none;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--sand-deep);
}

.stillnormal-tcard-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stillnormal-tcard-text {
    min-width: 0;
}

.stillnormal-tcard-text b {
    display: block;
    font-family: var(--display);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.25;
}

.stillnormal-tcard-text small {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink-soft);
}

/* ---------- phone ---------- */

@media (max-width: 900px) {
    .stillnormal-hero-test {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
        padding-top: 8px;
    }

    /* The cover over the text, in the same proportion. */
    .stillnormal-tcover {
        order: -1;
        border-radius: 22px;
    }

    .single-quiz_test .quiz-engine-question::before {
        left: -38px;
        width: 16px;
    }

    .single-quiz_test .quiz-engine-form {
        padding-left: calc(var(--gutter) + 38px);
    }

    .stillnormal-title {
        font-size: 36px;
    }

    .single-quiz_test .quiz-engine-question {
        padding: 20px 18px 12px;
    }

    .stillnormal-q-text,
    .single-quiz_test .quiz-engine-question legend {
        font-size: 18px;
    }

    .stillnormal-after {
        padding-left: calc(var(--gutter) + 38px);
        padding-bottom: 40px;
    }

    .stillnormal-tcards {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}

/* ---------- hover, only on a real pointer ---------- */

@media (hover: hover) and (pointer: fine) {
    .single-quiz_test .quiz-engine-answer:hover:not(:active) {
        background: rgba(224, 169, 92, .14);
    }

    .single-quiz_test .quiz-engine-submit:not(:disabled):hover {
        background: var(--amber-deep);
    }

    .stillnormal-acc-item > summary:hover {
        color: var(--amber-deep);
    }

    .stillnormal-tcard:hover {
        background: #fff;
    }
}
