/* Quiz landing pages — extends styles.css ("Atlas Paper").
   Signature: cartographic mono labels + a faint lat/long graticule, now on the
   warm cream canvas with ink borders + hard sticker shadows. */

:root {
  --graticule: rgba(26, 23, 18, 0.05);   /* faint ink grid — a map's margin lines */
  --shape: #D8C08A;                        /* country silhouette fill — warm ochre */
  --shape-line: var(--ink);                /* coastlines / borders */
  --shadow-sm: 1px 2px 0 var(--ink);       /* dense-grid card sticker shadow */
}

/* The page sits on a faint graticule — like a map's margin grid. */
.quiz-page {
  background-image:
    linear-gradient(var(--graticule) 1px, transparent 1px),
    linear-gradient(90deg, var(--graticule) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
}

main.quiz { max-width: 960px; }

/* ---- Eyebrow: cartographic data label ---- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--coral-dark);
  font-weight: 700;
  margin-bottom: 0.9rem;
}

/* ---- Hero ---- */
.quiz-hero { text-align: center; padding: 3.5rem 0 2.5rem; }

.quiz-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.03;
  margin-bottom: 1rem;
  text-wrap: balance;
}

.quiz-hero .lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 0 auto 1.6rem;
}

/* Mono fact strip under the lede: "54 countries · Africa · Free" */
.quiz-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.quiz-meta b { color: var(--ink); font-weight: 700; }

/* ---- Primary play CTA (coral sticker button) ---- */
.play-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-btn);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.play-cta:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: 3px 4px 0 var(--ink); }
.play-cta:active { transform: translate(2px, 3px); box-shadow: 0 0 0 var(--ink); }
.play-cta:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.play-cta svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- Section heading ---- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 3.25rem 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--ink);
}
.section-head h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.section-head .count { font-family: var(--mono); font-size: 0.8rem; color: var(--ink-muted); white-space: nowrap; }

/* ---- Flag grid ---- */
.flag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}
.flag-card {
  background: var(--ivory);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.flag-card img {
  width: 44px;
  height: 30px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--paper-alt);
  box-shadow: 0 0 0 1.5px var(--ink);
}
.flag-card .fc-text { min-width: 0; }
.flag-card .fc-name { font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flag-card .fc-iso { font-family: var(--mono); font-size: 0.68rem; color: var(--ink-muted); letter-spacing: 0.05em; }

/* ---- Country → capital table ---- */
.cap-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.cap-table thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--ink);
}
.cap-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-lite); }
.cap-table tbody tr:hover { background: var(--paper-alt); }
.cap-table .ct-place { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; }
.cap-table .ct-place img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1.5px var(--ink); }
.cap-table .ct-cap { color: var(--ink-soft); }

/* ---- Country shape (silhouette) grid ---- */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}
.shape-card {
  background: var(--ivory);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 1rem 1rem 0.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.shape-card svg { width: 100%; height: 84px; display: block; margin-bottom: 0.6rem; }
.shape-card svg path { fill: var(--shape); stroke: var(--shape-line); stroke-width: 0.5; stroke-linejoin: round; }
.shape-card .sc-name { font-size: 0.9rem; font-weight: 700; }

/* ---- Continent / world map figure ---- */
.map-figure {
  background: var(--ivory);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  box-shadow: var(--shadow-card);
}
.map-figure svg { width: 100%; height: auto; display: block; }
.map-figure svg path { fill: var(--shape); stroke: var(--shape-line); stroke-width: 0.4; stroke-linejoin: round; }
.map-figure figcaption { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.75rem; text-align: center; min-height: 1.1em; }
.map-figure.interactive figcaption.is-named { color: var(--ink); font-weight: 700; letter-spacing: 0.02em; }

/* Interactive map: hover to explore, tap to name */
.map-figure.interactive svg path { transition: fill 0.12s ease; }
.map-figure.interactive svg path:hover { fill: var(--coral); cursor: pointer; }
.map-figure.interactive svg path.is-active { fill: var(--coral-dark); stroke: var(--ink); stroke-width: 0.7; }

.map-tip {
  position: absolute;
  transform: translate(-50%, -145%);
  background: var(--ink);
  border: 2px solid var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.32rem 0.62rem;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 2px 3px 0 rgba(26, 23, 18, 0.3);
}
.map-tip.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .map-figure.interactive svg path, .map-tip, .play-cta { transition: none; }
  .play-cta:hover, .play-cta:active { transform: none; }
}

/* List of places (map pages, topic pages) */
.place-list {
  columns: 3 160px;
  column-gap: 1.5rem;
  list-style: none;
  font-size: 0.93rem;
}
.place-list li { padding: 0.28rem 0; color: var(--ink); break-inside: avoid; }
.place-list li::before { content: "▸"; color: var(--coral); margin-right: 0.5rem; font-size: 0.8rem; }

/* ---- Facts ---- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.fact-card {
  background: var(--ivory);
  border: 2px solid var(--ink);
  border-left: 6px solid var(--coral);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.fact-card b { color: var(--ink); }

/* ---- FAQ ---- */
.faq details {
  border-bottom: 1.5px solid var(--ink);
  padding: 0.95rem 0;
}
.faq summary {
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--coral-dark); font-weight: 800; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-soft); font-size: 0.93rem; margin-top: 0.65rem; }

/* ---- Related quizzes ---- */
.related { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.related a {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  background: var(--ivory);
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.12s ease;
}
.related a:hover { text-decoration: none; background: var(--coral-soft); transform: translate(-1px, -1px); box-shadow: 2px 3px 0 var(--ink); }

/* ---- Mid-page replay CTA ---- */
.cta-band {
  text-align: center;
  margin: 3.5rem 0 1rem;
  padding: 2rem;
  background: var(--coral-soft);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.cta-band p { color: var(--ink-soft); margin-bottom: 1.1rem; font-weight: 600; }

/* ---- Hub ---- */
.hub-section { margin-top: 2.5rem; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.hub-card {
  display: block;
  background: var(--ivory);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.hub-card:hover { text-decoration: none; transform: translate(-1px, -2px); box-shadow: 3px 5px 0 var(--ink); }
.hub-card .hc-kicker { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--coral-dark); font-weight: 700; }
.hub-card h3 { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; margin: 0.45rem 0 0.4rem; color: var(--ink); }
.hub-card p { font-size: 0.88rem; color: var(--ink-soft); }

@media (max-width: 480px) {
  .place-list { columns: 2 120px; }
  .quiz-hero { padding: 2.5rem 0 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-card, .related a { transition: none; }
  .hub-card:hover, .related a:hover { transform: none; }
}
