/* ==========================================================================
   OnProm: base.css
   Grundlagen, Typografie-Regeln, Fokus, Barrierefreiheits-Hilfen
   ========================================================================== */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-var.woff2") format("woff2-variations"),
       url("/assets/fonts/manrope-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  font-named-instance: "Regular";
  ascent-override: 100%;
  descent-override: 27%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-var.woff2") format("woff2-variations"),
       url("/assets/fonts/newsreader-latin-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  ascent-override: 92%;
  descent-override: 26%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-italic-var.woff2") format("woff2-variations"),
       url("/assets/fonts/newsreader-latin-italic-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
  ascent-override: 92%;
  descent-override: 26%;
  line-gap-override: 0%;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 8rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  font-weight: 450;
  line-height: var(--leading-relaxed);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* Deutsche Trennung, aber keine Trennstriche in kurzen Zeilen */
main,
article {
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 7 3 3;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-read);
  font-weight: 450;
  font-variation-settings: "opsz" 32;
  line-height: var(--leading-snug);
  margin: 0;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: var(--step-7);
  line-height: var(--leading-tight);
}

h2 {
  font-size: var(--step-5);
}

h3 {
  font-size: var(--step-3);
}

h4 {
  font-family: var(--font-ui);
  font-size: var(--step-0);
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: var(--leading-normal);
}

p {
  margin: 0 0 1.15em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease);
}

a:hover {
  text-decoration-color: currentColor;
}

strong,
b {
  font-weight: 680;
}

em,
i {
  font-style: italic;
}

small {
  font-size: var(--step--1);
}

ul,
ol {
  margin: 0 0 1.15em;
  padding-left: 1.25em;
}

li + li {
  margin-top: 0.4em;
}

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

img {
  height: auto;
}

figure {
  margin: 0;
}

figcaption {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: var(--space-3);
  max-width: var(--measure);
}

blockquote {
  margin: var(--space-6) 0;
  padding-left: var(--space-5);
  border-left: 2px solid var(--rule-strong);
  font-family: var(--font-read);
  font-size: var(--step-2);
  font-style: italic;
  line-height: var(--leading-normal);
}

blockquote cite {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-style: normal;
  color: var(--ink-muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-7) 0;
}

code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.5;
}

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-muted);
  padding-bottom: var(--space-3);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rule);
}

thead th {
  border-bottom: 1px solid var(--rule-strong);
  font-weight: 650;
}

tbody th {
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
  color: inherit;
}

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

/* Fokus nie unter einer klebenden Kopfzeile verstecken */
:target {
  scroll-margin-top: 9rem;
}

::selection {
  background: var(--wheat-pencil);
  color: var(--ink);
}

/* --- Hilfsklassen ------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--shell-gutter);
}

.shell--wide {
  max-width: 1480px;
}

.measure {
  max-width: var(--measure);
}

.measure-narrow {
  max-width: var(--measure-narrow);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-3) var(--space-5);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-hairline);
  transition: top var(--duration-base) var(--ease);
}

.skip-link:focus {
  top: var(--space-4);
}

.label {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--ink-muted);
}

.label--brick { color: var(--brick); }
.label--sage { color: var(--sage); }
.label--blue { color: var(--blue); }
.label--wheat { color: var(--wheat-strong); }

.meta {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-muted);
}

.meta__sep {
  display: inline-block;
  padding-inline: 0.4em;
  color: var(--rule-strong);
}

.standfirst {
  font-family: var(--font-ui);
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 620;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: var(--radius-hairline);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid:hover {
  background: var(--brick-strong);
  border-color: var(--brick-strong);
  color: var(--paper);
}

.btn--quiet {
  border-color: var(--rule-strong);
  color: var(--ink-muted);
}

.btn--quiet:hover {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.btn--link {
  border-color: transparent;
  padding-inline: 0;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.2em;
}

.btn--link:hover {
  background: transparent;
  color: var(--brick);
  text-decoration-color: currentColor;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --- Formulare ---------------------------------------------------------- */

.field {
  display: block;
  margin-bottom: var(--space-5);
}

.field__label {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 620;
  margin-bottom: var(--space-2);
}

.field__hint {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--step--1);
  color: var(--ink-muted);
  margin-bottom: var(--space-2);
}

.field__input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-hairline);
  transition: border-color var(--duration-fast) var(--ease);
}

.field__input:hover {
  border-color: var(--ink-muted);
}

.field__input:focus-visible {
  border-color: var(--focus);
}

.field__input[aria-invalid="true"] {
  border-color: var(--danger);
  border-width: 2px;
}

.field__error {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 550;
  color: var(--danger);
}

.field__error::before {
  content: "Fehler: ";
  font-weight: 700;
}

/* --- Statusmeldungen ---------------------------------------------------- */

.status {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  line-height: 1.5;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--rule-strong);
  border-left-width: 3px;
  border-radius: var(--radius-hairline);
  background: var(--paper-raised);
}

.status--success {
  border-left-color: var(--success);
}

.status--error {
  border-left-color: var(--danger);
}

.status--info {
  border-left-color: var(--blue);
}

.status__title {
  font-weight: 680;
  margin-bottom: var(--space-1);
}

/* --- Druck -------------------------------------------------------------- */

@media print {
  :root {
    --paper: #ffffff;
    --ink: #000000;
    --paper-raised: #ffffff;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-header,
  .site-footer,
  .skip-link,
  .newsletter-invite,
  .share-bar,
  .toc-compact,
  .consent-banner,
  .consent-dialog,
  .article-aside,
  .related,
  .breadcrumbs__home,
  .menu-panel {
    display: none !important;
  }

  .article-body {
    max-width: none;
  }

  .article-body a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    word-break: break-all;
  }

  .article-body a[href^="/"]::after,
  .article-body a[href^="#"]::after {
    content: "";
  }

  img {
    max-width: 100% !important;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  figure,
  table,
  .callout {
    break-inside: avoid;
  }

  .sources {
    break-inside: avoid;
  }
}
