/* Bookaholic – Mobile-First Styles, Palette & Schriften von buecherhausen.de */

/* ---- Selbst gehostete Schriften (DSGVO-freundlich, kein Google-Fonts-Call) -- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/IBMPlexSerif-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/IBMPlexSerif-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/IBMPlexSerif-Bold.woff2") format("woff2");
}

/* ---- Design-Tokens -------------------------------------------------------- */
:root {
  --accent: #ed002f;
  --accent-dark: #c2001f;
  --text: #27272a;
  --muted: #71717a;
  --border: #e4e4e7;
  --bg: #f9fefd;
  --surface: #ffffff;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(20, 20, 24, 0.08);
  --font-body: "Inter", system-ui, -apple-system, Arial, sans-serif;
  --font-head: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --maxw: 640px;
}

/* ---- Basis ---------------------------------------------------------------- */
* { box-sizing: border-box; }

/* hidden-Attribut muss display-Regeln (grid/flex/block) immer schlagen */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2 { font-family: var(--font-head); line-height: 1.15; }

a { color: var(--accent); }

.skip-link {
  position: absolute;
  left: -999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 8px;
}

/* ---- Header --------------------------------------------------------------- */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo { display: block; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
}
.brand-by { color: var(--muted); font-size: 0.85rem; }

/* ---- Layout --------------------------------------------------------------- */
.container {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
}

/* sanfte Einblendung beim Screenwechsel */
.screen { animation: fade 0.28s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ---- Startscreen ---------------------------------------------------------- */
.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
#start-title { font-size: 2rem; margin: 0 0 14px; }
.lead { font-size: 1.1rem; color: var(--text); margin: 0 0 24px; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 16px 0 0; }

/* Aufklappbarer Erklär-/SEO-Text unter der Start-Karte */
.about { margin: 18px 6px 0; }
.about summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 0;
}
.about summary::-webkit-details-marker { display: none; }
.about summary::before {
  content: "›";
  display: inline-block;
  font-weight: 700;
  transition: transform 0.2s ease;
}
.about[open] summary::before { transform: rotate(90deg); }
.about summary:hover { color: var(--accent); }
.about-body { color: var(--muted); font-size: 0.95rem; line-height: 1.6; padding: 4px 2px 0; }
.about-body p { margin: 0 0 12px; }
.about-body strong { color: var(--text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .about summary::before { transition: none; }
}

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  min-height: 52px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
  margin-top: 18px;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  width: auto;
  flex: 1 1 auto;
  min-height: 46px;
  padding: 11px 16px;
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
/* Programmatische Fokusziele (Screens, Frage, Ergebnis) sind nur Scroll-/
   Screenreader-Anker – kein sichtbarer Rahmen. Echte Controls behalten ihn. */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible { outline: none; }

/* ---- Quiz ----------------------------------------------------------------- */
.progress-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 28px;
}
.btn-back {
  grid-column: 1;
  justify-self: start;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  white-space: nowrap;
  cursor: pointer;
  padding: 4px 2px;
}
.btn-back:hover { color: var(--accent); }
.quiz-kicker {
  grid-column: 2;
  justify-self: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.progress-text { grid-column: 3; justify-self: end; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }

.progress {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 22px;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.35s ease;
}
@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}

.question { font-size: 1.35rem; margin: 0 0 22px; }

.answers { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.answer {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  min-height: 56px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.answer:hover { border-color: var(--accent); }
.answer:active { transform: scale(0.99); }
.answer[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
@media (prefers-reduced-motion: reduce) {
  .answer { transition: none; }
}

/* ---- Ergebnis ------------------------------------------------------------- */
.result-head { text-align: center; margin-bottom: 8px; }
.result-emoji { font-size: 3.4rem; line-height: 1; display: block; }
.result-percent {
  margin: 10px 0 2px;
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
}
.result-title { font-size: 1.9rem; margin: 0; }
.result-desc { font-size: 1.08rem; margin: 16px 0 24px; }

.cta-row { display: flex; gap: 10px; margin-bottom: 8px; }
.cta-row .btn { width: auto; margin-bottom: 0; }
#result-cta { flex: 1 1 auto; }
.btn-icon {
  flex: 0 0 52px;
  width: 52px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Teilen --------------------------------------------------------------- */
.share { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 20px; }
.share-label { font-weight: 600; margin: 0 0 12px; }
.share-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.share-primary { grid-column: 1 / -1; }
.share-hint { color: var(--muted); font-size: 0.85rem; margin: 12px 0 0; }
.share-card-preview {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 18px auto 0;
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ---- Statistik ------------------------------------------------------------ */
.stats {
  margin-top: 22px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
}
.stats p { margin: 0; }

/* ---- Nicht gestellte Fragen ----------------------------------------------- */
.unseen { margin-top: 22px; }
.unseen-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.unseen-toggle:hover { border-color: var(--accent); color: var(--accent); }
.unseen-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: var(--muted);
  display: grid;
  gap: 8px;
}

/* ---- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 20px 30px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.footer-follow { margin: 0 0 8px; }
.footer-feedback { margin: 0 0 8px; }
.footer-legal { margin: 0; }
.linklike {
  background: none;
  border: none;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.linklike:hover { color: var(--accent); }
.privacy {
  max-width: var(--maxw);
  margin: 14px auto 0;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text);
}
.privacy code { background: var(--border); padding: 1px 5px; border-radius: 4px; }

/* ---- Etwas größer ab Tablet ----------------------------------------------- */
@media (min-width: 600px) {
  #start-title { font-size: 2.4rem; }
  .question { font-size: 1.5rem; }
  .card { padding: 36px 34px; }
}

/* ---- Desktop: Inhalt vertikal zentrieren statt oben kleben ---------------- */
@media (min-width: 760px) {
  .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .screen { width: 100%; }
}
