/* Biemen Aktuelle
   Zeitungspapier, Druckschwarz, ein Druckblau für Links.
   Fraktur nur im Kopf, sonst Newsreader. */

@font-face {
  font-family: "UnifrakturMaguntia";
  src: url("/static/fonts/UnifrakturMaguntia-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/Newsreader-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/static/fonts/Newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #f3f4f1;       /* kühles Zeitungspapier */
  --sheet: #fafaf8;       /* Fensterfläche, eine Spur heller */
  --ink: #1d1f1e;         /* Druckschwarz */
  --ink-soft: #5b5f5c;    /* Datumszeilen, Hinweise */
  --rule: #c8cbc5;        /* feine Linien */
  --rule-strong: #9a9e98;
  --accent: #1e4a73;      /* Druckblau: Links, Fokus */
  --alert: #a3261c;       /* Fehler, Zähler */
  --alert-bg: #f6e9e6;
  --accent-bg: #e7edf2;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --fraktur: "UnifrakturMaguntia", "Old English Text MT", serif;

  /* Schriftgrade (Quarte, 1,25) */
  --s-1: 0.9rem;
  --s0: 1.125rem;
  --s1: 1.4rem;
  --s2: 1.75rem;
  --s3: 2.2rem;

  --gutter: 16px;
  --measure: 40rem;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--s0);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 600; }
p { margin: 0 0 0.9em; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -3rem;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

/* --- Kopf ------------------------------------------------------------- */

.masthead {
  text-align: center;
  padding: 1.75rem 0 0.9rem;
  border-bottom: 4px double var(--ink);
}
.masthead__title {
  font-family: var(--fraktur);
  font-weight: 400;
  font-size: clamp(2.6rem, 10.5vw, 6.5rem);
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.005em;
}

.dateline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--ink);
  font-size: var(--s-1);
}
.dateline__date { margin: 0; font-style: italic; color: var(--ink-soft); }

.menu { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1.4rem; }
.menu a { color: var(--ink); text-decoration: none; }
.menu a:hover { text-decoration: underline; }
.menu__logout { margin: 0; }
@media (max-width: 30rem) {
  .menu__home { display: none; }  /* der Zeitungskopf führt zur Startseite */
  .menu { gap: 0.3rem 1.1rem; }
}
.count {
  margin-left: 0.2em;
  color: var(--alert);
  font-weight: 700;
  font-size: 0.8em;
  vertical-align: super;
  line-height: 0;
  font-variant-numeric: lining-nums;
}

/* --- Knöpfe und Formulare --------------------------------------------- */

.button {
  display: inline-block;
  font: inherit;
  font-size: var(--s-1);
  font-weight: 600;
  line-height: 1.2;
  padding: 0.6em 1.15em;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #000; }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.button--quiet:hover { background: var(--sheet); border-color: var(--ink); }
.button--danger { background: transparent; color: var(--alert); border-color: var(--alert); }
.button--danger:hover { background: var(--alert-bg); }

.link-button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }
.link-button--danger { color: var(--alert); }

.form { margin: 0 0 1rem; }
.field { margin-bottom: 1.1rem; }
.field label, .choices legend { display: block; font-weight: 500; margin-bottom: 0.3rem; }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: var(--s0);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.5em 0.65em;
}
input[type="text"], input[type="email"], input[type="password"], select { height: 2.75rem; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); }
.input--code { max-width: 11rem; letter-spacing: 0.15em; font-variant-numeric: tabular-nums; }
.hint { font-size: var(--s-1); color: var(--ink-soft); margin: 0.35rem 0 0; }

.form--inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 1rem; }
.form--inline .field { flex: 1 1 12rem; }
.form--inline .button { margin-bottom: 1.1rem; height: 2.75rem; }

.choices { border: 0; padding: 0; margin: 0 0 1rem; }
.choices legend { padding: 0; }
.choice { display: inline-flex; align-items: center; gap: 0.4rem; margin-right: 1.25rem; font-weight: 400; }
.choice input { width: 1.05rem; height: 1.05rem; accent-color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.5rem; margin-top: 0.5rem; }
.actions form { margin: 0; }
.actions__delete { display: flex; align-items: center; gap: 0.75rem; }

.notice {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  padding: 0.65rem 0.9rem;
  margin: 0 0 1.25rem;
}
.notice > :last-child { margin-bottom: 0; }
.notice--error { border-left-color: var(--alert); background: var(--alert-bg); }

.secret {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  background: #fff;
  border: 1px dashed var(--rule-strong);
  padding: 0.6rem 0.75rem;
}

/* --- Startseite und Fenster ------------------------------------------- */

.front { margin-top: 2rem; }
.front__columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.window { background: var(--sheet); border: 1px solid var(--rule); }
.window__bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.window__rubric { font-size: var(--s0); font-weight: 500; font-style: italic; }
.window__rubric a { color: var(--ink); text-decoration: none; }
.window__rubric a:hover { text-decoration: underline; }
.window__all { font-size: var(--s-1); }
.window__body { padding: 1.4rem 1.25rem 1.5rem; }
.window__empty { color: var(--ink-soft); font-style: italic; margin: 0; }

.story__headline { font-size: var(--s2); line-height: 1.12; margin-bottom: 0.45rem; }
.story__headline a { color: var(--ink); text-decoration: none; }
.story__headline a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.story__meta { color: var(--ink-soft); font-size: var(--s-1); margin-bottom: 1rem; }
.story__lead { hyphens: auto; }
.story__lead p { margin-bottom: 0.6em; }
.story__more { margin: 0.75rem 0 0; font-weight: 600; }

.window--lead .window__body { padding: 1.9rem 1.5rem 1.75rem; }
.window--lead .story__headline {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.04;
  max-width: 24ch;
}
.window--lead .story__meta { font-size: var(--s0); font-style: italic; margin: 0.6rem 0 1.25rem; }
.window--lead .story__lead { font-size: 1.22rem; line-height: 1.58; }

@media (min-width: 56rem) {
  .story__lead--columns {
    columns: 2;
    column-gap: 2.75rem;
    column-rule: 1px solid var(--rule);
    text-align: justify;
  }
  .window--lead .window__body { padding: 2.25rem 2.25rem 2rem; }
  .window--lead .window__bar { padding: 0.65rem 2.25rem; }
}

.empty { max-width: var(--measure); margin: 3rem auto; }
.empty__title { font-size: var(--s2); margin-bottom: 0.75rem; }

/* --- Rubrik-Übersicht ------------------------------------------------- */

.section-page { margin-top: 2rem; }
.section-head { border-bottom: 1px solid var(--ink); padding-bottom: 1rem; margin-bottom: 0.5rem; }
.section-head__title { font-size: var(--s3); }
.section-head__intro { color: var(--ink-soft); font-style: italic; margin: 0.4rem 0 0; }

.archive { list-style: none; margin: 0; padding: 0; }
.archive__item {
  display: grid;
  gap: 0.25rem 2rem;
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.archive__meta { color: var(--ink-soft); font-size: var(--s-1); font-style: italic; margin: 0; }
.archive__headline { font-size: var(--s1); margin-bottom: 0.35rem; }
.archive__headline a { color: var(--ink); text-decoration: none; }
.archive__headline a:hover { text-decoration: underline; }
.archive__lead { margin: 0; max-width: 46rem; hyphens: auto; }

@media (min-width: 48rem) {
  .archive__item { grid-template-columns: 11rem 1fr; }
  .archive__meta { padding-top: 0.3rem; }
  .archive__meta span { display: block; }
}

/* --- Artikel ---------------------------------------------------------- */

.article { max-width: var(--measure); margin: 2.5rem auto 0; }
.article__rubric { font-style: italic; margin-bottom: 0.6rem; }
.article__rubric a { color: var(--ink-soft); }
.article__headline {
  font-size: clamp(2.2rem, 5.6vw, 3.4rem);
  letter-spacing: -0.012em;
  line-height: 1.05;
}
.article__meta { color: var(--ink-soft); font-style: italic; margin: 0.8rem 0 1.6rem; }
.article__standfirst {
  font-size: 1.3rem;
  line-height: 1.5;
  font-weight: 500;
  padding-bottom: 1.4rem;
  margin-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
}
.article__standfirst p:last-child { margin-bottom: 0; }
.article__back { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

.prose { hyphens: auto; }
.prose h2 { font-size: var(--s1); margin: 2.1rem 0 0.7rem; }
.prose h3 { font-size: var(--s0); margin: 1.6rem 0 0.5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--ink-soft); }
.prose strong { font-weight: 650; }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: var(--s-1); }
.prose th, .prose td { text-align: left; padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--rule); }

/* --- Formularseiten --------------------------------------------------- */

.form-page { max-width: 27rem; margin: 3rem auto 0; }
.form-page--wide { max-width: var(--measure); }
.form-page__title { font-size: var(--s3); margin-bottom: 1rem; }
.form-page__aside { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

.steps { padding-left: 1.4rem; margin: 1.5rem 0 0; }
.steps > li { margin-bottom: 1.75rem; padding-left: 0.3rem; }
.steps > li::marker { font-weight: 600; }
.qr { margin: 0.75rem 0; }
.qr svg { display: block; width: 12rem; height: auto; border: 1px solid var(--rule); }

.codes {
  list-style: none;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.5rem 1.5rem;
  background: #fff;
  border: 1px dashed var(--rule-strong);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1rem;
}

/* --- Profil, Postfach, Verwaltung ------------------------------------- */

.settings { max-width: 44rem; margin: 2.5rem auto 0; }
.settings__title { font-size: var(--s3); margin-bottom: 1.25rem; }
.settings__section { border-top: 1px solid var(--rule); padding: 1.6rem 0 0.75rem; }
.settings__section h2 { font-size: var(--s1); margin-bottom: 0.8rem; }

.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: var(--s-1); }
.table th {
  text-align: left; font-weight: 500; color: var(--ink-soft);
  padding: 0 1rem 0.4rem 0; border-bottom: 1px solid var(--rule-strong);
}
.table td { padding: 0.55rem 1rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table__action { text-align: right; white-space: nowrap; }
.table__action form { margin: 0; }

.message__date { color: var(--ink-soft); font-size: var(--s-1); font-style: italic; margin-bottom: 0.3rem; }
.message--unread .message__date { color: var(--alert); }
.message__from { margin-bottom: 0.75rem; }
.message__note {
  margin: 0 0 1.1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule-strong);
  font-style: italic;
}
.message__state { color: var(--ink-soft); }

.person__facts { color: var(--ink-soft); font-size: var(--s-1); }
.person__you { font-weight: 400; color: var(--ink-soft); }

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

@media print {
  .dateline .menu, .story__more, .article__back { display: none; }
  body { background: #fff; }
}
