/* QuizAura
   Direction: a contents page for ten short quizzes, not a card grid.
   The illustration and the Bodoni headline do the visual work.
   Bodoni Moda is used under the SIL Open Font License. See css/fonts/OFL.txt.
*/

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/bodoni-moda-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/bodoni-moda-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --paper: #f6edf1;
  --ink: #241820;
  --muted: #6d5662;
  --line: #e3d0d7;
  --lip: #8e1c44;
  --lip-deep: #711536;
  --surface: #fffafb;
  --font-display: "Bodoni Moda", "Iowan Old Style", "PMingLiU", "Songti TC", "Songti SC", "Noto Serif CJK TC", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Avenir Next", "Segoe UI", "PingFang TC", "PingFang SC", "Hiragino Sans", "Noto Sans CJK TC", "Microsoft JhengHei", "Malgun Gothic", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1317;
    --ink: #f7eef2;
    --muted: #cbb8c0;
    --line: #3d2c34;
    --lip: #f08aaa;
    --lip-deep: #ffd0de;
    --surface: #24181d;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
}

.container { width: min(960px, calc(100% - 2.5rem)); margin: 0 auto; }

a { color: var(--lip); }
a:hover { color: var(--lip-deep); }

:focus-visible {
  outline: 2px solid var(--lip);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 40;
  text-decoration: none;
}

.skip:focus { top: 0.5rem; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
}

:lang(zh) h1, :lang(zh) h2, :lang(zh) h3,
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3,
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3 {
  letter-spacing: 0;
  font-weight: 600;
}

/* ---------- Mast ---------- */
.mast-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0 0.4rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}

:lang(zh) .wordmark, :lang(ja) .wordmark, :lang(ko) .wordmark { letter-spacing: 0; }

.wordmark:hover { color: var(--lip); }

#site-tools { margin-left: auto; }

#i18n-btn-wrapper { position: relative; }

#i18n-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

#i18n-btn:hover { border-color: var(--lip); color: var(--lip); }

#i18n-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 12.5rem;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  z-index: 20;
}

#i18n-dropdown.show { display: block; }

.i18n-option {
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  color: var(--ink);
  border-radius: 2px;
}

.i18n-option:hover { background: var(--surface); }

.i18n-option.active { color: var(--lip); }

/* ---------- Hero ---------- */
.hero { padding: 1.6rem 0 2.2rem; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2.5rem;
  align-items: end;
}

.hero h1 {
  font-size: clamp(2.7rem, 7vw, 5.15rem);
  max-width: 11ch;
  margin: 0 0 1rem;
}

.hero .lead {
  max-width: 38ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
  margin: 0 0 1.4rem;
}

.hero-visual { margin: 0; }

.hero-frame {
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #fffafb;
  color-scheme: light;
}

@media (max-width: 760px) {
  .hero { padding: 1.2rem 0 1.6rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 1.4rem; align-items: start; }
  .hero-frame { max-width: 280px; margin-left: 0; }
  .hero h1 { max-width: 14ch; }
}

/* ---------- Buttons and text links ---------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.05rem;
  border-radius: 4px;
  background: var(--lip-deep);
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { background: var(--lip); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }

@media (prefers-color-scheme: dark) {
  .btn { background: var(--lip); color: #241820; }
  .btn:hover { background: var(--lip-deep); color: #241820; }
}

.text-link { font-weight: 650; }

/* ---------- Quiz index ---------- */
.section-heading {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 0.45rem;
}

.section-sub {
  color: var(--muted);
  margin: 0 0 0.4rem;
  max-width: 52ch;
}

.quiz-list { list-style: none; margin: 0.6rem 0 2.6rem; padding: 0; }

.quiz-list a {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.quiz-list li:last-child a { border-bottom: 1px solid var(--line); }

.quiz-list a:hover strong { color: var(--lip); }

.quiz-list img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  border: 1px solid var(--line);
  background: #fffafb;
  color-scheme: light;
  padding: 4px;
}

.quiz-kicker {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
}

.quiz-list strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

:lang(zh) .quiz-list strong,
:lang(ja) .quiz-list strong,
:lang(ko) .quiz-list strong { letter-spacing: 0; font-weight: 600; }

.quiz-list-copy span:last-child {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
  max-width: 62ch;
}

/* ---------- Reads ---------- */
.reads { padding-bottom: 1rem; }

.reads ol { margin: 0.8rem 0 0; padding: 0; list-style: none; counter-reset: none; }

.reads li { border-top: 1px solid var(--line); }

.reads li:last-child { border-bottom: 1px solid var(--line); }

.reads a {
  display: block;
  padding: 0.85rem 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: none;
}

:lang(zh) .reads a, :lang(ja) .reads a, :lang(ko) .reads a { letter-spacing: 0; }

/* ---------- Footer ---------- */
.footer {
  padding: 1.6rem 0 2.8rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }

.footer-nav a { text-decoration: none; font-size: 0.98rem; }

.footer p { color: var(--muted); font-size: 0.9rem; margin: 0.7rem 0 0; }

/* ---------- Prose pages ---------- */
.page { padding: 1.4rem 0 2rem; }

.prose { max-width: 66ch; }

.prose h1 {
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  max-width: 16ch;
  margin-bottom: 1rem;
}

.prose .dek {
  color: var(--muted);
  font-size: 1.12rem;
  margin: 0 0 1.4rem;
  max-width: 46ch;
}

.prose h2 {
  font-size: 1.7rem;
  margin: 1.8rem 0 0.55rem;
  max-width: 22ch;
}

.prose p { margin: 0 0 1rem; }

.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.2rem; }

.prose li { margin: 0.35rem 0; }

.prose .updated { color: var(--muted); font-size: 0.92rem; }

.prose .btn { margin-top: 0.4rem; }

.link-list { list-style: none; padding: 0; }

.link-list a { text-decoration: none; font-weight: 650; }

/* ---------- Quiz player ---------- */
.quiz-header { padding: 1.4rem 0 2.5rem; }

.quiz-box { max-width: 68ch; }

.quiz-box h1 {
  font-size: clamp(2.1rem, 5vw, 3.3rem);
  max-width: 18ch;
  margin: 0.2rem 0 0.8rem;
}

.quiz-box .lead { color: var(--muted); margin: 0 0 1rem; max-width: 52ch; }

.kicker { color: var(--muted); margin: 0; font-size: 0.95rem; }

.quiz-question {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.9rem;
  color: var(--ink);
}

:lang(zh) .quiz-question, :lang(ja) .quiz-question, :lang(ko) .quiz-question {
  letter-spacing: 0;
  font-weight: 600;
}

.options button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.45rem 0;
  padding: 0.85rem 0.95rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
}

.options button:hover { border-color: var(--lip); }

.options button.selected {
  background: var(--lip-deep);
  border-color: var(--lip-deep);
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .options button.selected { background: var(--lip); color: #241820; border-color: var(--lip); }
}

.result-box { display: none; }
.result-box h2 { font-size: 1.8rem; margin-bottom: 0.6rem; }

.progress-wrapper {
  width: 100%;
  height: 6px;
  background: var(--line);
  margin-top: 0.4rem;
}

.progress-bar { width: 0%; height: 100%; background: var(--lip); }
.progress-text { font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 0; }

.quiz-cover-frame {
  width: min(240px, 100%);
  aspect-ratio: 1 / 1;
  margin: 1.1rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fffafb;
  color-scheme: light;
}

.quiz-cover-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.quiz-cover-frame img:not([src]) { visibility: hidden; }

#quiz-progress-container { min-height: 2rem; }

.quiz-note { margin: 0 0 0.2rem; }

.share-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  padding: 0.45rem 0.7rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.share-btn:hover { color: #fff; }
.share-fb { background: #1877f2; }
.share-line { background: #06c755; }
.share-x { background: #15101a; }
.share-copy { background: #6d5662; }

.share-section {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.share-section .share-label { color: var(--muted); margin: 0 0 0.7rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-bar { transition: none; }
}
