/* ==========================================================================
   F* hat jemand einen Flaschenöffner?
   Archival, text-first beer-blog aesthetic. Tokens per the approved mockups.
   ========================================================================== */

:root {
  --paper: #f6f1e3;
  --ink: #191510;
  --muted: #6f6353;
  --gold: #c8891c;
  --border: #d8cdb8;
  --card: #fffdf5;
  --danger: #a53220;

  --low-bg: #e2ead3;
  --low-fg: #2c5e2e;
  --low-bd: #b9cc9a;
  --caution-bg: #f7e4b5;
  --caution-fg: #6b4300;
  --caution-bd: #e0c070;
  --danger-bg: #f6dcd5;
  --danger-fg: #8f2a1a;
  --danger-bd: #d99a8b;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --pad: 20px;
  --container: 1120px;
  --radius: 2px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

button { font: inherit; color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------------ kicker */
.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ------------------------------------------------------------- beer-cap motif */
.cap { width: 28px; height: 28px; flex: none; }
.cap--cream .cap-disc { fill: var(--card); }
.cap--cream .cap-ring { stroke: var(--ink); }
.cap--lg { width: 48px; height: 48px; }
.cap--sm { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ header */
.topbar {
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand .kicker { color: var(--muted); }
.topbar__right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  white-space: nowrap;
}
.lang__btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.lang__btn:hover { color: var(--ink); }
.lang__btn.is-active {
  background: var(--low-bg);
  border-color: var(--low-bd);
  color: var(--low-fg);
}
.lang__sep { opacity: 0.5; }

/* The switch only hides things once a single language is chosen. With no
   data-lang (or "both") every span stays visible, so no-JS keeps bilingual. */
html[data-lang="de"] .lang-en,
html[data-lang="en"] .lang-de,
html[data-lang="de"] .lang-sep,
html[data-lang="en"] .lang-sep {
  display: none !important;
}
.topbar__fav {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding: 4px 2px;
}
.topbar__fav:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* -------------------------------------------------------------------- hero */
.hero { margin-bottom: 24px; }
.hero__kicker { margin-bottom: 10px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  text-wrap: balance;
}
.hero__sub {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 18px;
  color: var(--muted);
  margin: 0;
  max-width: 34ch;
}
.hero__cta { display: none; margin-top: 20px; }
.cta-mobile { display: block; }

/* ---------------------------------------------------------------- controls */
.block { margin-bottom: 24px; }

.field { display: block; }
.field__label {
  display: block;
  margin-bottom: 8px;
}
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  appearance: none;
}
.field__input::placeholder { color: var(--muted); }
.field__input:focus { border-color: var(--ink); outline-offset: 0; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  border: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  cursor: pointer;
}
.pill:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.pill--safe { color: var(--low-fg); border-color: var(--low-bd); }
.pill--safe[aria-pressed="true"] {
  background: var(--low-fg);
  color: var(--card);
  border-color: var(--low-fg);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
}
.btn--primary {
  width: 100%;
  min-height: 56px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  border: 1px solid var(--ink);
}
.btn--primary:hover { background: #d2951f; }
.btn--secondary {
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--ink);
}
.btn--secondary:hover { background: #fbf7ea; }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; font-size: 14px; }

.btn-row {
  display: grid;
  gap: 10px;
}
.btn-row--two { grid-template-columns: 1fr 1fr; }

/* ---------------------------------------------------------------- index */
.index-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.index-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  margin: 0;
}
.rule {
  height: 2px;
  background: var(--ink);
  border: 0;
  margin: 10px 0 0;
}

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

.row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 18px;
  align-items: center;
  column-gap: 12px;
  min-height: 68px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
}
.row:hover { background: #fbf7ea; }
.row__num {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.row__titles { min-width: 0; }
.row__de {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}
.row__en {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.3;
}
.row__meta {
  display: none;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.3;
}
.row__arrow { font-size: 18px; color: var(--muted); text-align: right; }

.index-empty {
  padding: 28px 2px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.index-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}
.index-foot .btn { order: 1; }
.index-foot .count-line { order: 2; }
.count-line {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid;
  border-radius: var(--radius);
  white-space: normal;
}
.badge__en { font-weight: 500; }
.badge--low { background: var(--low-bg); color: var(--low-fg); border-color: var(--low-bd); }
.badge--caution { background: var(--caution-bg); color: var(--caution-fg); border-color: var(--caution-bd); }
.badge--danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-bd); }
.badge--single { flex-direction: row; gap: 6px; font-size: 11px; padding: 5px 9px; }
.badge__why {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: -10px -8px -10px 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}
.badge__why::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  background: var(--ink);
  color: var(--card);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.badge__why:hover::after,
.badge__why:focus-visible::after { opacity: 1; visibility: visible; }

/* --------------------------------------------------------------- sidebar */
.sidebar { display: none; }
.filter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.filter-card h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 14px;
}
.filter-group { margin-bottom: 18px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group__label { margin-bottom: 8px; }
.filter-list { display: flex; flex-direction: column; gap: 6px; }
.filter-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14px;
  cursor: pointer;
}
.filter-opt input { width: 18px; height: 18px; accent-color: var(--ink); }
.filter-opt--safe { color: var(--low-fg); }

/* ---------------------------------------------------------------- detail */
.detail { padding-bottom: 24px; }
.backlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.backlink:hover { color: var(--ink); }
.detail__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 12px;
}
.detail h1 {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 600;
  line-height: 1.04;
  margin: 0 0 4px;
  text-wrap: balance;
}
.detail__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  color: var(--muted);
  margin: 0 0 16px;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}
.teaser {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.teaser__kicker { margin-bottom: 10px; }
.teaser__de {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.4;
  margin: 0;
}
.teaser hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.teaser__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}
.source-line {
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 0;
}
.source-line a { color: var(--muted); }

.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 32px 0 6px;
}

/* --------------------------------------------------------------- surprise */
.surprise { padding-bottom: 24px; }
.surprise__cap { margin-bottom: 14px; }
.surprise h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.06;
  margin: 0 0 4px;
}
.surprise__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--muted);
  margin: 0 0 20px;
}
.result-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.result-card__kicker { margin-bottom: 8px; }
.result-card__title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}
.result-card__en {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--muted);
  margin: 0 0 12px;
}
.result-card__de { font-size: 16px; margin: 0 0 8px; }
.result-card__ensum { font-size: 15px; color: var(--muted); margin: 0; }
.result-card hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 14px;
  color: var(--muted);
}

/* ------------------------------------------------------------ recent list */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { border-bottom: 1px solid var(--border); }
.recent a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 52px;
  padding: 12px 2px;
  text-decoration: none;
  color: var(--ink);
}
.recent .num {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.recent .de { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.recent .en { font-size: 13px; color: var(--muted); }

/* --------------------------------------------------------------- notices */
.safety {
  background: var(--card);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.safety strong { color: var(--danger); font-weight: 700; }
.safety--inline { margin-top: 16px; }

.footer {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 20px 0 40px;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--muted); }

.noscript {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 14px;
}

/* --------------------------------------------------------------- layout */
.layout { display: block; }
.main { min-width: 0; }

/* ------------------------------------------------------------ responsive */
@media (min-width: 768px) {
  :root { --pad: 40px; }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: end;
    gap: 32px;
  }
  .hero h1 { font-size: 52px; }
  .hero__cta { display: block; margin-top: 0; }
  .hero__cta .btn--primary { width: 100%; }
  .cta-mobile { display: none; }

  .field__input { min-height: 54px; }

  .row {
    grid-template-columns: 56px minmax(0, 1fr) 150px auto 20px;
  }
  .row__meta { display: block; }

  .index-foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .index-foot .count-line { order: 1; }
  .index-foot .btn { order: 2; width: auto; }
}

@media (min-width: 900px) {
  .layout {
    display: flex;
    align-items: flex-start;
    gap: 40px;
  }
  .main { flex: 1 1 auto; }
  .sidebar {
    display: block;
    flex: 0 0 280px;
    width: 280px;
  }
  .sidebar .safety { margin-top: 16px; }
  .pills--home { display: none; } /* settings/difficulty live in the sidebar */
  .hero { grid-template-columns: minmax(0, 1fr) 320px; }
  .hero h1 { font-size: 68px; }
  .hero__sub { font-size: 24px; }
  .hero__cta { text-align: right; }
  .hero__cta .btn--primary { min-height: 64px; width: 100%; }
  .hero__count { margin-top: 8px; }
}

.desktop-only { display: none; }
.mobile-only { display: block; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media (min-width: 900px) {
  .desktop-only { display: inline; }
  .mobile-only { display: none; }
}
