/*
 * Trivia CPT styles — ported from Q-v5 wireframe (Ben-locked round-5 §2.2).
 *
 * Scope: trivia single + archive only. Loaded via fizzics_enqueue_trivia_assets().
 *
 * Non-negotiables preserved from Phase 3:
 *   - B19 fix: `.quiz-q summary` uses border-radius: var(--r-md) — NOT --r-pill.
 *   - Softened question rollover: border darken + small shadow lift + 1px rise,
 *     NO giant green panel covering the tile (Sean-locked 2026-04-21, Ben round-5 §2.2).
 *   - Reveal-answer click state keeps the light-green panel Ben approved.
 *   - Quiz-start box = vertical stack: wording → Start → workshops CTA → segmentation.
 *
 * 3-green palette discipline: only --green, --green-050, --green-900 tokens from
 * Wave-1 theme.json / style.css. No new green tokens introduced here.
 */

/* ==========================================================================
 * Layout — article + right rail
 * ========================================================================== */

/* Column tracks, gap, stacking and the sticky rail come from rail-layout.css
 * (.fz-rail-layout, Ben 22 Oct 2026). */
.trivia-layout {
	margin: var(--s-5, 1.5rem) auto var(--s-7, 3rem);
}

.trivia-layout__main {
	min-width: 0;
}

.trivia-layout__rail {
	display: flex;
	flex-direction: column;
	gap: var(--s-4, 1rem);
}


.crumbs {
	margin-top: var(--s-5, 1.5rem);
	font-size: var(--step--1, 0.875rem);
}

.crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem var(--s-2, 0.5rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.crumbs li + li::before {
	content: "›";
	margin-right: var(--s-2, 0.5rem);
	color: var(--ink-soft, #666);
}

/* ==========================================================================
 * Tag row
 * ========================================================================== */

.tag-row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-2, 0.5rem);
	margin: var(--s-4, 1rem) 0;
}

/* ==========================================================================
 * AEO lede
 * ========================================================================== */

.aeo-lede {
	background: var(--surface-2, #f5f5f5);
	border-left: 4px solid var(--green, #529f3b);
	padding: var(--s-4, 1rem) var(--s-5, 1.5rem);
	margin: var(--s-4, 1rem) 0 var(--s-5, 1.5rem);
	border-radius: 0 var(--r-md, 0.5rem) var(--r-md, 0.5rem) 0;
}

.aeo-lede__tag {
	display: inline-block;
	font-size: var(--step--2, 0.75rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--green-900, #1c3a12);
	margin-bottom: var(--s-2, 0.5rem);
}

.aeo-lede p {
	margin: 0;
	font-size: var(--step-0, 1rem);
	line-height: 1.55;
}

/* ==========================================================================
 * Quiz-start box — round-4 §3.10 stacked layout (Ben round-5 §2.2 approved)
 *
 * Row order: wording → Start button → workshops CTA → segmentation.
 * Segmentation sits UNDER the workshops CTA because it segments the WORKSHOPS
 * offer, not the trivia content (round-4 §3.11).
 * ========================================================================== */

.quiz-start {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--s-4, 1rem);
	padding: var(--s-5, 1.5rem) var(--s-6, 2rem);
	background: linear-gradient(135deg, var(--green, #529f3b) 0%, var(--green-900, #1c3a12) 100%);
	color: var(--paper, #fff);
	border-radius: var(--r-lg, 0.75rem);
	margin: var(--s-5, 1.5rem) 0 var(--s-6, 2rem);
	position: relative;
	overflow: hidden;
	align-items: stretch;
}

.quiz-start::before {
	content: "";
	position: absolute;
	right: -40px;
	top: -40px;
	width: 180px;
	height: 180px;
	background: radial-gradient(circle, var(--orange, #eb7923) 0%, transparent 70%);
	opacity: 0.25;
	pointer-events: none;
}

.quiz-start__row {
	position: relative;
	margin: 0;
}

.quiz-start__row--wording {
	padding-right: 10%;
}

.quiz-start :is(h2, h3) {
	margin: 0 0 var(--s-2, 0.5rem);
	font-size: var(--step-2, 1.5rem);
	color: var(--paper, #fff);
}

.quiz-start p {
	margin: 0;
	color: #cedac5;
	font-size: var(--step--1, 0.875rem);
}

.quiz-start__row--start,
.quiz-start__row--workshops {
	display: flex;
	justify-content: flex-start;
}

.quiz-start__row--start .btn--primary {
	background: var(--orange, #eb7923);
	border-color: var(--orange, #eb7923);
	color: var(--paper, #fff);
}

.quiz-start__row--workshops .btn--ghost {
	border: 1.5px solid var(--paper, #fff);
	color: var(--paper, #fff);
	background: transparent;
	max-width: 100%;
	white-space: normal;
	text-align: left;
}

.quiz-start__row--workshops .btn--ghost:hover,
.quiz-start__row--workshops .btn--ghost:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	color: var(--paper, #fff);
}

/* Segmentation strip — sits UNDER the workshops CTA */
.audience-seg.quiz-start__row--segmentation {
	background: rgba(255, 255, 255, 0.08);
	padding: var(--s-3, 0.75rem);
	border-radius: var(--r-md, 0.5rem);
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--s-2, 0.5rem);
	border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.audience-seg__btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: var(--s-3, 0.75rem);
	background: transparent;
	border: 1.5px solid rgba(255, 255, 255, 0.55);
	color: var(--paper, #fff);
	text-align: center;
	text-decoration: none;
	border-radius: var(--r-sm, 0.25rem);
	font-weight: 700;
	line-height: 1.2;
	transition: background 150ms ease-out, border-color 150ms ease-out;
}

.audience-seg__btn small {
	display: block;
	margin-top: 2px;
	font-weight: 400;
	font-size: var(--step--2, 0.75rem);
	color: rgba(255, 255, 255, 0.75);
}

.audience-seg__btn:hover,
.audience-seg__btn:focus-visible {
	background: rgba(255, 255, 255, 0.12);
	border-color: var(--paper, #fff);
	outline: none;
}

.audience-seg__btn:focus-visible {
	box-shadow: 0 0 0 2px var(--orange, #eb7923);
}

@media (max-width: 620px) {
	.audience-seg.quiz-start__row--segmentation {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
 * Sticky progress bar
 * ========================================================================== */

.progress {
	display: flex;
	align-items: center;
	gap: var(--s-3, 0.75rem);
	font-size: var(--step--1, 0.875rem);
	color: var(--ink-soft, #666);
	margin-bottom: var(--s-5, 1.5rem);
	position: sticky;
	top: calc(var(--fz-header-h, 0px) + var(--s-4, 1rem));
	background: var(--paper, #fff);
	padding: var(--s-3, 0.75rem) var(--s-4, 1rem);
	z-index: 5;
	border: 1.5px solid var(--line, #e0e0e0);
	border-radius: var(--r-pill, 999px);
	box-shadow: var(--shadow-1, 0 1px 3px rgba(0, 0, 0, 0.08));
}

.progress__label {
	font-weight: 700;
	color: var(--navy, #1b1464);
	white-space: nowrap;
}

.progress__bar {
	flex: 1;
	height: 10px;
	border-radius: var(--r-pill, 999px);
	background: var(--surface-2, #f5f5f5);
	overflow: hidden;
}

.progress__fill {
	height: 100%;
	background: linear-gradient(90deg, var(--green, #529f3b) 0%, var(--green-900, #1c3a12) 100%);
	width: 0%;
	transition: width 400ms ease-out;
}

/* ==========================================================================
 * Questions — `<details class="quiz-q">`
 *
 * B19 fix preserved: summary border-radius is var(--r-md), NOT var(--r-pill).
 * Rollover softened: border darken + small shadow lift + 1px rise, NO green
 * background fill. Reveal-answer state (quiz-q[open]) DOES fill green — Ben
 * approved that at round-5 §2.2.
 * ========================================================================== */

.quiz-q-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.quiz-q-list__item {
	margin: 0;
}

/*
 * Start -> #q1 (Ben, 23 Oct 2026). scroll-padding-top already clears the
 * sticky header; this clears the sticky progress pill (about 48px, sat 1rem
 * below the header) so question 1 lands fully visible instead of under it.
 */
.quiz-q {
	scroll-margin-top: 4.5rem;
}

.quiz-q {
	border: 1.5px solid var(--line, #e0e0e0);
	border-radius: var(--r-md, 0.5rem);
	padding: var(--s-5, 1.5rem);
	margin-bottom: var(--s-4, 1rem);
	background: var(--paper, #fff);
	transition: border-color 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
}

/* Softened tile rollover — border darken + subtle shadow lift; NO background fill.
   Sean-locked 2026-04-21 (Q-v4 §4.8.4); Ben round-5 §2.2 approved. */
.quiz-q:hover {
	border-color: var(--green-900, #1c3a12);
	box-shadow: 0 2px 6px rgba(28, 58, 18, 0.18);
}

/* Reveal-answer state — Ben liked the light-green box (round-3 §8.6, round-5 §2.2) */
.quiz-q[open] {
	border-color: var(--green, #529f3b);
	background: var(--green-050, #eef6e9);
}

.quiz-q :is(h3, h4) {
	margin: 0 0 var(--s-3, 0.75rem);
	font-size: var(--step-1, 1.125rem);
	color: var(--navy, #1b1464);
	line-height: 1.4;
}

/*
 * Summary: B19 fix preserved.
 * - inline `style="display: block;"` stays in the markup (some UAs treat
 *   <summary> as inline-flex by default, which clips the reveal button).
 * - padding driven HERE by CSS (NOT inline `padding: 0`) so the "1." numeral
 *   can't overlap the button border.
 * - border-radius is var(--r-md), NOT var(--r-pill) — the pill curves arced
 *   over the numeral in round-3 §2.
 */
.quiz-q summary {
	cursor: pointer;
	padding: 8px var(--s-4, 1rem);
	border-radius: var(--r-md, 0.5rem);
	border: 2px solid var(--green, #529f3b);
	background: var(--paper, #fff);
	color: var(--green-900, #1c3a12);
	font-weight: 700;
	list-style: none;
	font-size: var(--step--1, 0.875rem);
	transition: background 150ms ease-out, color 150ms ease-out, transform 150ms ease-out, box-shadow 150ms ease-out;
}

.quiz-q summary::-webkit-details-marker {
	display: none;
}

/* Softened summary rollover — mirrors the tile: border darken + shadow lift + 1px rise */
.quiz-q summary:hover,
.quiz-q summary:focus-visible {
	border-color: var(--green-900, #1c3a12);
	box-shadow: 0 2px 6px rgba(28, 58, 18, 0.18);
	transform: translateY(-1px);
	outline: none;
}

.quiz-q summary:focus-visible {
	box-shadow: 0 0 0 2px var(--orange, #eb7923), 0 2px 6px rgba(28, 58, 18, 0.18);
}

/* Reveal-answer state — summary flips to filled green */
.quiz-q[open] summary {
	background: var(--green, #529f3b);
	color: var(--paper, #fff);
	border-color: var(--green, #529f3b);
}

.quiz-q__answer {
	margin-top: var(--s-3, 0.75rem);
	padding: var(--s-3, 0.75rem) var(--s-4, 1rem);
	background: var(--paper, #fff);
	border: 1px solid var(--green, #529f3b);
	border-radius: var(--r-sm, 0.25rem);
	font-size: var(--step--1, 0.875rem);
	line-height: 1.55;
	animation: triviaRevealIn 250ms ease-out;
}

.quiz-q[open] .quiz-q__answer {
	background: var(--green-050, #eef6e9);
	border-color: var(--green-900, #1c3a12);
}

.quiz-q[open] .quiz-q__answer strong {
	color: var(--green-900, #1c3a12);
}

@keyframes triviaRevealIn {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.quiz-q,
	.quiz-q summary,
	.quiz-q__answer,
	.audience-seg__btn,
	.progress__fill {
		transition: none;
		animation: none;
	}

	.quiz-q summary:hover,
	.quiz-q summary:focus-visible {
		transform: none;
	}
}

/* ==========================================================================
 * Teacher's note
 * ========================================================================== */

.teachers-note {
	background: var(--green-050, #eef6e9);
	border: 1.5px solid var(--green, #529f3b);
	border-left-width: 5px;
	border-radius: 0 var(--r-md, 0.5rem) var(--r-md, 0.5rem) 0;
	padding: var(--s-5, 1.5rem) var(--s-6, 2rem);
	margin: var(--s-5, 1.5rem) 0;
}

.teachers-note__head {
	display: flex;
	align-items: center;
	gap: var(--s-3, 0.75rem);
	margin-bottom: var(--s-3, 0.75rem);
}

.teachers-note__icon {
	color: var(--green, #529f3b);
	font-size: var(--step-1, 1.125rem);
	font-weight: 700;
}

.teachers-note__head :is(h3, h4) {
	margin: 0;
	color: var(--navy, #1b1464);
}

.teachers-note p {
	margin: 0;
	line-height: 1.55;
}

/* ==========================================================================
 * Grade-suppress note
 * ========================================================================== */

.grade-suppress-note {
	font-size: var(--step--1, 0.875rem);
	color: var(--ink-soft, #666);
	font-style: italic;
	margin-bottom: var(--s-4, 1rem);
}

/* ==========================================================================
 * Authorship + APA 7
 * ========================================================================== */

.authorship {
	border-top: 1px solid var(--line, #e0e0e0);
	padding-top: var(--s-5, 1.5rem);
	margin-top: var(--s-6, 2rem);
}

.authorship h4 {
	margin: 0 0 var(--s-3, 0.75rem);
}

.authorship__apa {
	padding: var(--s-3, 0.75rem) var(--s-4, 1rem);
	background: var(--surface-2, #f5f5f5);
	border-radius: var(--r-md, 0.5rem);
	font-family: var(--font-mono, Consolas, Menlo, monospace);
	font-size: var(--step--1, 0.875rem);
	margin: var(--s-3, 0.75rem) 0;
	overflow-wrap: anywhere;
}

.authorship__copy {
	display: inline-flex;
	align-items: center;
	gap: var(--s-2, 0.5rem);
	padding: var(--s-2, 0.5rem) var(--s-4, 1rem);
	background: transparent;
	border: 1.5px solid var(--navy, #1b1464);
	color: var(--navy, #1b1464);
	border-radius: var(--r-md, 0.5rem);
	font-weight: 700;
	cursor: pointer;
	transition: background 150ms ease-out, color 150ms ease-out;
}

.authorship__copy:hover,
.authorship__copy:focus-visible {
	background: var(--navy, #1b1464);
	color: var(--paper, #fff);
	outline: none;
}

/* ==========================================================================
 * Sticky booking rail — trivia topic-aligned box
 * ========================================================================== */

.booking-rail {
	display: flex;
	flex-direction: column;
	gap: var(--s-4, 1rem);
}

.booking-rail__box {
	background: var(--paper, #fff);
	border: 1px solid var(--line, #e0e0e0);
	border-radius: var(--r-md, 0.5rem);
	padding: var(--s-4, 1rem);
}

.booking-rail__box h3,
.booking-rail__box .intl-teaching-cta h2 {
	margin: 0 0 var(--s-2, 0.5rem);
	font-size: var(--step-0, 1rem);
	color: var(--navy, #1b1464);
}

.booking-rail__box p {
	margin: 0 0 var(--s-3, 0.75rem);
	font-size: var(--step--1, 0.875rem);
	line-height: 1.5;
}

.booking-rail__box .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.booking-rail__proof {
	margin-top: var(--s-3, 0.75rem);
	font-size: var(--step--2, 0.75rem);
	color: var(--ink-soft, #666);
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.35rem;
}

.booking-rail__cta-wrap {
	margin: 0 0 var(--s-2, 0.5rem);
}

/* Topic-aligned top border — derived from `linked_programme` → program_accent_colour.
   3-green palette discipline: these are non-green programme accents from Wave-1
   theme.json (--accent-*), not new green tokens. */
.booking-rail--human-body     .booking-rail__box { border-top: 4px solid var(--accent-human-body, #6b4794); }
.booking-rail--kitchen-chemistry .booking-rail__box { border-top: 4px solid var(--accent-kitchen-chemistry, #b3541e); }
.booking-rail--forensics      .booking-rail__box { border-top: 4px solid var(--accent-forensics, #3a3a3a); }
.booking-rail--space          .booking-rail__box { border-top: 4px solid var(--accent-space, #1a3c6e); }
.booking-rail--rockets        .booking-rail__box { border-top: 4px solid var(--accent-rockets, #a02020); }
.booking-rail--animal-biology .booking-rail__box { border-top: 4px solid var(--accent-animal-biology, #8a6d3b); }
.booking-rail--physics        .booking-rail__box { border-top: 4px solid var(--accent-physics, #2a6b7a); }
.booking-rail--earth-science  .booking-rail__box { border-top: 4px solid var(--accent-earth-science, #3d5a32); }
.booking-rail--chemistry      .booking-rail__box { border-top: 4px solid var(--accent-chemistry, #6e3a8a); }
.booking-rail--general        .booking-rail__box { border-top: 4px solid var(--navy, #1b1464); }

.trustpilot-slot {
	padding: var(--s-3, 0.75rem);
	min-height: 52px;
	background: var(--surface-2, #f5f5f5);
	border-radius: var(--r-sm, 0.25rem);
	font-size: var(--step--2, 0.75rem);
	color: var(--ink-soft, #666);
	text-align: center;
}

/* ==========================================================================
 * Archive grid — light touch
 * ========================================================================== */

.trivia-card {
	transition: border-color 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
}

.trivia-card:hover,
.trivia-card:focus-within {
	border-color: var(--green-900, #1c3a12);
	box-shadow: 0 2px 8px rgba(28, 58, 18, 0.14);
	transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
	.trivia-card:hover,
	.trivia-card:focus-within {
		transform: none;
	}
}

/* Empty-state */
.trivia-empty {
	padding: var(--s-5, 1.5rem);
	background: var(--surface-2, #f5f5f5);
	border-radius: var(--r-md, 0.5rem);
	color: var(--ink-soft, #666);
	text-align: center;
}
