/* ============================================================
   Oak Island Quiz  Visual design module
   thecurseofoakisland.com
   Loaded only on /quiz and /quiz/{slug}
   ============================================================ */

/* Hero doubles as the start screen: full viewport, centred */
.c-article-hero--quiz {
    min-height: 100vh;
    min-height: 100svh;
    align-items: center;
    padding-bottom: calc(var(--space-lg) + 24px);
}
.c-article-hero--quiz .c-article-hero__content {
    text-align: center;
    margin: 0 auto;
    max-width: 820px;
}
.c-article-hero--quiz .c-article-hero__excerpt { margin-left: auto; margin-right: auto; }

/* Stage section stays collapsed until Start */
.quiz-page {
    position: relative;
    z-index: 1;
    background: var(--bg-dark);
    padding: 0 20px;
}
.quiz-page.is-active { padding: 3rem 20px 5rem; }

.quiz-wrap {
    max-width: 640px;
    margin: 0 auto;
}

/* ─── Shared bits ─────────────────────────────────────────── */

.quiz-eyebrow {
    font-family: var(--font-display);
    font-size: 0.66rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.75rem;
}
.quiz-eyebrow--muted { color: var(--text-muted); letter-spacing: 2px; }

.quiz-btn {
    cursor: pointer;
    width: 100%;
    text-align: center;
    padding: 16px 24px;
    font-size: 0.78rem;
    letter-spacing: 2px;
    min-height: 48px;
}
.quiz-btn--gold {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.quiz-btn--gold:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #000; }
.quiz-btn--outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.quiz-btn--outline:hover { background: var(--accent); color: #000; }

/* ─── Hero start (replaces the old intro block) ─────────── */

.quiz-hero__start { margin-top: 1.75rem; }
.quiz-hero__start .quiz-eyebrow { margin-bottom: 1rem; }
.quiz-hero__start .quiz-btn { width: auto; min-width: 260px; }
.quiz-hero__start[hidden] { display: none; }

.quiz-ladder {
    list-style: none;
    margin: 2rem auto 0;
    padding: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 0;
    max-width: 760px;
}
.quiz-ladder__tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0 18px;
    border-left: 1px solid rgba(255,255,255,0.14);
}
.quiz-ladder__tier:first-child { border-left: 0; }
.quiz-ladder__name {
    font-family: var(--font-display);
    font-size: 0.66rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-primary);
    white-space: nowrap;
}
.quiz-ladder__tier:last-child .quiz-ladder__name { color: var(--accent); }
.quiz-ladder__range { font-size: 0.7rem; color: var(--text-muted); }
@media (max-width: 768px) {
    .quiz-ladder { gap: 10px 0; }
    .quiz-ladder__tier { padding: 0 12px; }
    .quiz-ladder__name { font-size: 0.58rem; letter-spacing: 1.5px; }
}

/* ─── Stage ───────────────────────────────────────────────── */

.quiz-stage[hidden], .quiz-results[hidden], .quiz-intro[hidden], .quiz-misses[hidden], .quiz-btn[hidden] { display: none; }

/* scrollIntoView() targets: stop below the fixed nav (80px desktop, 56px mobile) plus breathing room */
.quiz-stage, .quiz-results { scroll-margin-top: 112px; }
@media (max-width: 768px) { .quiz-stage, .quiz-results { scroll-margin-top: 76px; } }

.quiz-progress {
    height: 2px;
    background: var(--border);
    margin: 0 0 1.75rem;
}
.quiz-progress__bar {
    height: 2px;
    width: 0;
    background: var(--accent);
    transition: width 0.3s ease;
}

.quiz-stage__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

/* Image plate: the linked page's image with the question set over its lower third */
.quiz-plate {
    position: relative;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}
.quiz-plate__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.quiz-plate.is-loaded .quiz-plate__img { opacity: 1; }
.quiz-plate__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10,10,10,0.05) 0%, rgba(10,10,10,0.35) 45%, rgba(10,10,10,0.88) 100%);
}
.quiz-question {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.1rem, 2.6vw, 1.45rem);
    line-height: 1.4;
    color: #fff;
    margin: 0;
    padding: 14px 16px 16px;
    text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}

.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.quiz-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.quiz-option:hover:not(:disabled) { border-color: var(--accent); background: rgba(201,169,98,0.06); }
.quiz-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-option__letter {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 14px;
    flex-shrink: 0;
}
.quiz-option__text { flex: 1; }
.quiz-option__mark { font-family: var(--font-display); font-size: 0.85rem; width: 16px; text-align: right; }

.quiz-option.is-locked { cursor: default; color: var(--text-muted); }
.quiz-option.is-correct {
    border-color: var(--accent);
    background: rgba(201,169,98,0.12);
    color: var(--text-primary);
}
.quiz-option.is-correct .quiz-option__mark::before { content: "\2713"; color: var(--accent); }
.quiz-option.is-wrong {
    border-color: rgba(231,76,60,0.6);
    color: var(--text-primary);
}
.quiz-option.is-wrong .quiz-option__mark::before { content: "\2715"; color: rgba(231,76,60,0.85); }

.quiz-after { margin-top: 1rem; }
.quiz-feedback {
    min-height: 1.4em;
    margin: 0;
    font-style: italic;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-muted);
}
.quiz-feedback--correct { color: var(--text-primary); }

.quiz-card { margin: 0.75rem 0 0; }
.quiz-card .artifact-inline,
.quiz-card .article-inline { margin: 0; }

.quiz-stage__actions { margin-top: 1.5rem; }

/* ─── Results ─────────────────────────────────────────────── */

.quiz-results { text-align: center; padding-top: 0.5rem; }

.quiz-score {
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 4.2rem);
    line-height: 1;
    color: #fff;
    margin: 0;
}
.quiz-score__total { font-size: 0.42em; color: var(--text-muted); margin-left: 2px; }

.quiz-tier {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: var(--accent);
    margin: 0.9rem 0 0.4rem;
}
.quiz-tier__line {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 auto 1.75rem;
    max-width: 420px;
}

.quiz-misses {
    text-align: left;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-bottom: 1.5rem;
}
.quiz-misses__list { display: flex; flex-direction: column; gap: 8px; }
.quiz-miss {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 12px;
}
.quiz-miss__n {
    font-family: var(--font-display);
    font-size: 0.68rem;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 28px;
}
.quiz-miss__body { flex: 1; min-width: 0; }
.quiz-miss__q { display: block; font-size: 0.8rem; line-height: 1.4; color: var(--text-primary); }
.quiz-miss__a { display: block; font-size: 0.72rem; color: var(--accent); margin-top: 2px; }
.quiz-miss__link {
    font-family: var(--font-display);
    font-size: 0.62rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    flex-shrink: 0;
    padding: 8px 0 8px 8px;
}
.quiz-miss__link:hover { color: var(--accent-hover); }

.quiz-results__actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0.75rem; }
.quiz-share-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-height: 1.2em;
    margin: 0 0 1.25rem;
    word-break: break-word;
}

.quiz-others {
    text-align: left;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-bottom: 1.5rem;
}
.quiz-others__list { list-style: none; margin: 0; padding: 0; }
.quiz-others__list li { margin: 0 0 6px; }
.quiz-others__list a { color: var(--text-primary); text-decoration: none; font-size: 0.9rem; }
.quiz-others__list a:hover { color: var(--accent); }

.quiz-subscribe {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    text-align: left;
}
.quiz-subscribe .c-subscribe--article { margin: 0; max-width: none; }
.quiz-subscribe .c-subscribe__inner { padding: 0; border-top: 0; }

/* ─── Desktop ─────────────────────────────────────────────── */

@media (min-width: 769px) {
    .quiz-page.is-active { padding: 3rem 40px 6rem; }
    .quiz-options { display: grid; grid-template-columns: 1fr 1fr; }
    .quiz-after { display: flex; gap: 14px; align-items: center; }
    .quiz-after .quiz-feedback { flex: 1; }
    .quiz-after .quiz-card { margin: 0; flex-shrink: 0; max-width: 300px; }
    .quiz-after .quiz-card:empty { display: none; }
    .quiz-results__actions { flex-direction: row; }
    .quiz-results__actions .quiz-btn { width: auto; flex: 1; }
}
