/* Kürzungs-Tracker — Stylesheet */

:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --text: #1b1a18;
  --muted: #6b675f;
  --line: #e2ded4;
  --line-strong: #cfc9ba;
  --accent: #b3161f;
  --accent-ink: #ffffff;
  --accent-soft: #f7e6e5;
  --ok: #2f6349;
  --ok-soft: #e6f0ea;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --info: #2b5c8a;
  --info-soft: #e7eef6;
  --demo: #6f4aa8;
  --demo-soft: #efe9f8;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(24, 20, 12, 0.04), 0 6px 20px rgba(24, 20, 12, 0.05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* ---------------------------------------------------------------- Hero --- */

.hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  color: var(--text);
  padding: 46px 0 32px;
  border-bottom: 4px solid var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 760;
  color: var(--text);
}

.lede {
  margin: 12px 0 0;
  max-width: 52ch;
  font-size: clamp(1rem, 2vw, 1.18rem);
  color: var(--muted);
}

.stand {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* -------------------------------------------------------------- Notice --- */

.notice {
  background: var(--warn-soft);
  color: var(--warn);
  border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
  font-size: 0.92rem;
  padding: 12px 0;
}

.notice .wrap {
  padding-left: 18px;
  border-left: 4px solid var(--warn);
}

/* --------------------------------------------------------------- Stats --- */

main {
  padding: 32px 0 56px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 44px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.stat {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-value--small {
  font-size: 1.05rem;
}

.stat-of {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------- Filters --- */

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.filter--search {
  grid-column: 1 / -1;
}

.filter {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.filter label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter input,
.filter select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.filter select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.btn-reset {
  min-height: 40px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
}

.btn-reset:hover {
  background: var(--surface);
  border-color: var(--muted);
}

.result-line {
  margin: 14px 0 18px;
  font-size: 0.88rem;
  color: var(--muted);
}

.result-line strong {
  color: var(--text);
}

/* ------------------------------------------------------------- Entries --- */

.entries {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 20px 22px 16px;
  box-shadow: var(--shadow);
}

.entry--demo {
  border-left-color: var(--demo);
}

.entry[hidden] {
  display: none;
}

.entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.entry-title h2 {
  margin: 0;
  font-size: 1.14rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.programm {
  margin: 3px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.entry-amount {
  flex: none;
  text-align: right;
  line-height: 1.2;
}

.amount {
  display: block;
  font-size: 1.22rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.amount-typ {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.entry-auswirkung {
  margin: 12px 0 0;
  max-width: 78ch;
  font-size: 0.95rem;
}

.entry-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.fact dt {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.fact dd {
  margin: 2px 0 0;
  font-size: 0.92rem;
}

.entry-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

.status--angekündigt {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

.status--beschlossen {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

.status--in-kraft {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.status--abgewendet {
  background: transparent;
  color: var(--ok);
  border: 1px dashed var(--ok);
}

.status--unklar {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.badge--demo {
  background: var(--demo-soft);
  color: var(--demo);
  border-color: transparent;
}

.badge--warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

.entry-details {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  font-size: 0.9rem;
}

.entry-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  width: fit-content;
}

.entry-details summary:hover {
  color: var(--text);
}

.entry-details[open] summary {
  margin-bottom: 8px;
}

.entry-notiz {
  margin: 0 0 8px;
  max-width: 80ch;
  color: var(--muted);
}

.quellen {
  margin: 0;
  padding-left: 1.1em;
}

.quellen li {
  margin: 3px 0;
}

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* --------------------------------------------------- Konsolidierung --- */

.consolidation {
  margin: 0 0 32px;
  padding: 4px 0 26px;
  border-bottom: 1px solid var(--line);
}

.consolidation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.consolidation h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.consolidation-sub {
  margin: 5px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.consolidation-intro {
  max-width: 82ch;
  margin: 16px 0;
  font-size: 0.94rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.consolidation table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.consolidation th,
.consolidation td {
  padding: 9px 13px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.consolidation thead th {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
}

.consolidation thead th:first-child {
  text-align: left;
}

.consolidation tbody th {
  text-align: left;
  font-size: 0.9rem;
}

.consolidation tbody tr.is-summary th,
.consolidation tbody tr.is-summary td {
  background: var(--surface-2);
  border-top: 1px solid var(--line-strong);
}

.consolidation tbody tr:last-child th,
.consolidation tbody tr:last-child td {
  border-bottom: 0;
}

.consolidation-footnote {
  max-width: 92ch;
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.consolidation-footnote strong {
  color: var(--warn);
}

.consolidation-sources {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.consolidation-defs-wrap {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.consolidation-defs-wrap summary {
  width: fit-content;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text);
}

.consolidation-defs-wrap summary:hover {
  color: var(--accent);
}

.consolidation-defs-wrap[open] summary {
  margin-bottom: 12px;
}

.consolidation-defs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 28px;
  margin: 0;
}

.consolidation-defs dt {
  font-size: 0.8rem;
  font-weight: 650;
}

.consolidation-defs dd {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.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;
}

@media (max-width: 760px) {
  .consolidation-head {
    flex-direction: column;
  }

  .consolidation th,
  .consolidation td {
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .consolidation tbody th {
    white-space: normal;
  }
}

/* -------------------------------------------------------------- Footer --- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 44px;
  font-size: 0.86rem;
  color: var(--muted);
}

.site-footer p {
  max-width: 86ch;
}

.footer-meta {
  margin-top: 14px;
  font-size: 0.8rem;
}

.footer-kontakt {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ---------------------------------------------------------- Responsive --- */

@media (max-width: 980px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btn-reset {
    grid-column: 1 / -1;
    justify-self: start;
    padding-inline: 22px;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: calc(100% - 28px);
  }

  .hero {
    padding: 40px 0 32px;
  }

  .stats {
    gap: 10px 28px;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry {
    padding: 16px 16px 12px;
  }

  .entry-head {
    flex-direction: column;
    gap: 10px;
  }

  .entry-amount {
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .amount-typ {
    margin-top: 0;
  }

  .entry-facts {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 460px) {
  .filters {
    grid-template-columns: 1fr;
  }
}

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

@media print {
  .filters,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  .entry,
  .stat {
    box-shadow: none;
    break-inside: avoid;
  }
}
