/* =========================================================================
   "Hofheim spart mit" – CI angelehnt an hofheim.de
   Primär: Hofheim-Blau, Akzent: Limettengrün + Cyan (Wellen-Swoosh)
   ========================================================================= */
:root {
  --hof-blue:        #004f80;
  --hof-blue-dark:   #003a5d;
  --hof-blue-700:    #0a5b8c;
  --hof-cyan:        #009ee0;
  --hof-green:       #93c01f;   /* nur als Flaeche/Verlauf, nie als Textfarbe */
  --hof-green-dark:  #5c7c12;   /* war #6f9416 — 3.55:1 auf Weiss, zu wenig */
  --hof-green-hover: #46600e;
  --hof-green-hell:  #b6e02f;   /* Gruen fuer Text auf dunklem Blau (5.6:1) */

  --ink:    #1d2a35;
  --muted:  #5d6b78;
  --line:   #e4eaf0;            /* dekorative Kanten */
  --line-ui:#7d8b98;            /* Bedienelemente: 3.5:1, WCAG 1.4.11 */
  --focus:  #005a94;
  --bg:     #f3f7fa;
  --card:   #ffffff;
  --shadow: 0 1px 2px rgba(16,42,67,.06), 0 6px 22px rgba(16,42,67,.07);

  --ok-fg:#2f7d20; --ok-bg:#eaf5e1;
  --warn-fg:#8a5c00; --warn-bg:#fdf3df;   /* war #9a6700 — 4.42:1, knapp darunter */
  --bad-fg:#b23a2e; --bad-bg:#fbe9e6;
  --info-fg:#0a5b8c; --info-bg:#e4f1fb;

  --radius: 14px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ---- Barrierefreiheit: Grundlagen -------------------------------------- */

/* Sichtbarer Tastaturfokus auf JEDEM bedienbaren Element. Doppelring, weil ein
   einfarbiger Ring entweder auf Weiss oder auf dem dunkelblauen Hero verschwindet:
   die dunkle Linie traegt auf hellem Grund, der weisse Halo auf dunklem. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255,255,255,.92);
  border-radius: 6px;
}

/* Sprunglink: fuer Sehende unsichtbar, bis er den Fokus bekommt. Erspart
   Tastatur- und Screenreader-Nutzenden das Durchtabben der Navigation. */
.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 100;
  background: #fff; color: var(--hof-blue-dark); font-weight: 700;
  padding: 12px 18px; border-radius: 0 0 10px 10px; box-shadow: var(--shadow);
  transition: top .12s;
}
.skip-link:focus { top: 0; }

/* Nur fuer Screenreader — z. B. Tabellen, die eine Grafik in Worte fassen. */
.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;
}

/* Wer im Betriebssystem weniger Bewegung eingestellt hat, bekommt sie auch hier
   nicht — betrifft das weiche Scrollen und die Button-Animation. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--hof-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { color: var(--hof-blue-dark); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---- Topbar / Header --------------------------------------------------- */
.topbar { height: 5px; background: linear-gradient(90deg, var(--hof-green) 0%, var(--hof-cyan) 55%, var(--hof-blue) 100%); }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { height: 46px; width: auto; display: block; }
.brand .brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand .brand-txt b { color: var(--hof-blue-dark); font-size: 1.06rem; letter-spacing: -.01em; }
.brand .brand-txt span { color: var(--hof-green-dark); font-size: .82rem; font-weight: 600; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { color: var(--ink); font-weight: 600; font-size: .96rem; padding: 9px 14px; border-radius: 9px; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--hof-blue); background: var(--info-bg); }
.nav a.admin-link { color: var(--muted); font-weight: 500; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-ui); border-radius: 9px;
  width: 44px; height: 42px; font-size: 1.3rem; cursor: pointer; color: var(--hof-blue-dark); }

/* ---- Buttons ----------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; padding: 12px 20px; border-radius: 10px;
  background: var(--hof-blue); color: #fff; transition: transform .04s, background .15s; }
.btn:hover { background: var(--hof-blue-dark); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.green { background: var(--hof-green-dark); }
.btn.green:hover { background: var(--hof-green-hover); }
.btn.ghost { background: #fff; color: var(--hof-blue); border: 1.5px solid var(--hof-blue); }
.btn.ghost:hover { background: var(--info-bg); }
.btn.small { padding: 8px 13px; font-size: .85rem; border-radius: 8px; }
.btn.danger { background: var(--bad-fg); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- Hero -------------------------------------------------------------- */
.hero { background: linear-gradient(135deg, var(--hof-blue-dark) 0%, var(--hof-blue) 55%, var(--hof-blue-700) 100%);
  color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 420px; height: 420px;
  background: radial-gradient(circle at center, rgba(147,192,31,.34), transparent 62%); }
.hero .wrap { padding: 56px 20px 60px; position: relative; z-index: 1; max-width: 880px; }
.hero h1 { color: #fff; }
.hero p.lead { font-size: 1.18rem; color: #dceaf4; max-width: 640px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero .btn.ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.16); }
.kicker { display:inline-block; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  font-size:.74rem; color: var(--hof-green-hell); background: rgba(147,192,31,.18);
  border:1px solid rgba(147,192,31,.4); padding:5px 11px; border-radius:999px; margin-bottom:16px; }

/* ---- Sections / Cards -------------------------------------------------- */
section { padding: 40px 0; }
.section-head { margin-bottom: 22px; }
.section-head p { max-width: 680px; }
.grid { display: grid; gap: 18px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; }
.card h3 { font-size: 1.05rem; margin-bottom: 4px; }

/* KPI */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--muted); font-weight: 600; font-size: .9rem; }
.kpi .value { font-size: 1.9rem; font-weight: 800; color: var(--hof-blue-dark); letter-spacing: -.02em; }
.kpi .value.neg { color: var(--bad-fg); }
.kpi .value.pos { color: var(--ok-fg); }
.kpi .sub { font-size: .82rem; color: var(--muted); }
.kpi .accent { height: 4px; width: 46px; border-radius: 99px; background: var(--hof-green); margin-bottom: 8px; }

/* Chart container */
.chart-card { padding: 22px; }
.chart-wrap { position: relative; height: 320px; }
.chart-wrap.short { height: 240px; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .78rem;
  padding: 4px 10px; border-radius: 999px; }
.badge::before { content:""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.in_pruefung { color: var(--warn-fg); background: var(--warn-bg); }
.badge.umgesetzt  { color: var(--ok-fg);  background: var(--ok-bg); }
.badge.abgelehnt  { color: var(--bad-fg); background: var(--bad-bg); }
.badge.beschlossen{ color: var(--info-fg);background: var(--info-bg); }
.badge.in_umsetzung{color: #4f6b10; background: var(--ok-bg); }

/* Progress */
.progress { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > span { display:block; height: 100%; background: linear-gradient(90deg, var(--hof-green), var(--hof-cyan)); }

/* Measures list */
.measure { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--line); }
.measure:last-child { border-bottom: 0; }
.measure .m-title { font-weight: 600; }
.measure .m-meta { color: var(--muted); font-size: .82rem; }
.measure .m-vol { font-weight: 800; color: var(--hof-blue-dark); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Proposal cards */
.proposal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.proposal .p-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.proposal h3 { margin: 0; font-size: 1.12rem; }
.proposal .p-meta { color: var(--muted); font-size: .82rem; }
.proposal .p-cat { display:inline-block; font-size:.74rem; font-weight:700; color: var(--hof-blue);
  background: var(--info-bg); padding: 3px 9px; border-radius: 999px; }
.proposal .p-response { background: var(--bg); border-left: 3px solid var(--hof-green);
  padding: 10px 14px; border-radius: 8px; font-size: .92rem; }
.proposal .p-response b { color: #4f6b10; }  /* auf --bg reicht green-dark nicht (4.49:1) */
.proposal .p-savings { display:flex; gap: 16px; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.proposal .p-savings b { color: var(--ink); }

/* Filter chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-ui); background: #fff; border-radius: 999px; padding: 7px 14px;
  font-weight: 600; font-size: .86rem; cursor: pointer; color: var(--muted); }
.chip.active { background: var(--hof-blue); color: #fff; border-color: var(--hof-blue); }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; color: var(--hof-blue-dark); }
.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line-ui); border-radius: 10px;
  font: inherit; color: var(--ink); background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
textarea { min-height: 120px; resize: vertical; }
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }

/* Alerts */
.alert { border-radius: 10px; padding: 13px 16px; font-size: .92rem; margin-bottom: 14px; }
.alert.ok { background: var(--ok-bg); color: var(--ok-fg); }
.alert.err { background: var(--bad-bg); color: var(--bad-fg); }
.alert.info { background: var(--info-bg); color: var(--info-fg); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* Preisschild */
.preisschild { background: linear-gradient(135deg,#fff, #f0f7ff); border:1px solid var(--line); }
.preisschild .ps-out { display:flex; gap: 26px; flex-wrap: wrap; margin-top: 14px; }
.preisschild .ps-big { font-size: 2rem; font-weight: 800; color: var(--hof-blue-dark); letter-spacing:-.02em; }
.preisschild .ps-lbl { font-size:.8rem; color: var(--muted); font-weight:600; }

/* Footer */
.site-footer { background: var(--hof-blue-dark); color: #cfe0ec; margin-top: 30px; }
.site-footer .wrap { padding: 34px 20px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 22px; }
.site-footer a { color: #fff; }
.site-footer h4 { color: #fff; margin: 0 0 10px; font-size: .95rem; }
.site-footer .demo-note { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 16px; font-size: .8rem; color: #9fb8ca; }

/* Einreichungsfenster ------------------------------------------------------ */
.fenster { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 22px; border: 1px solid var(--line); }
.fenster.offen { background: var(--ok-bg); border-color: #b9d9a4; }
.fenster.zu    { background: var(--info-bg); border-color: #bcd9ef; }
.fenster .f-txt { flex: 1; }
.fenster b { display: block; color: var(--hof-blue-dark); margin-bottom: 2px; }
.fenster .f-zeit { font-weight: 700; white-space: nowrap; }

/* Demo-Vorschlaege. Bewusst NICHT ueber die Deckkraft ausgegraut — das wuerde
   den Text unter die Kontrastgrenze druecken. Stattdessen: gedaempfte Flaeche,
   gestrichelte Kante, entfaerbte Akzente und ein deutliches Kennzeichen.
   Die Schrift selbst behaelt ihren vollen Kontrast. */
.proposal.demo { background: #f7f8f9; border-style: dashed; border-color: var(--line-ui);
  box-shadow: none; }
.proposal.demo .p-cat, .proposal.demo .badge { filter: grayscale(1); }
.proposal.demo .p-response { border-left-color: var(--line-ui); background: #f1f2f4; }
.demo-flag { display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
  color: #4a5560; background: #e6e9ec; border: 1px solid var(--line-ui);
  padding: 3px 9px; border-radius: 999px; }

/* Zahlentabelle unter einem Diagramm */
.chart-tabelle { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.chart-tabelle summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--hof-blue);
  padding: 6px 2px; }
.chart-tabelle summary:hover { text-decoration: underline; }
.chart-tabelle table { margin-top: 10px; }
.chart-tabelle > table { display: block; overflow-x: auto; }

/* Offene Stellen in Impressum/Datenschutz. Bewusst auffaellig: eine Luecke in
   einer Pflichtangabe soll niemandem durchrutschen. Vor dem Live-Gang muessen
   alle .todo-Stellen ersetzt sein — scripts/todo-check.sh zaehlt sie. */
.todo {
  background: #fff3cd; color: #6b4e00; border: 1px dashed #8a5c00;
  border-radius: 6px; padding: 1px 7px; font-weight: 600; font-size: .93em;
}

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(16,42,67,.5); display: none;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 60; overflow:auto; }
.modal-back.open { display: flex; }
.modal { background: #fff; border-radius: 16px; max-width: 620px; width: 100%; padding: 26px; box-shadow: var(--shadow); }
.modal .close { float: right; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--muted); }

/* Admin */
.admin-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.admin-tabs button { background: none; border: 0; padding: 12px 16px; font: inherit; font-weight: 700;
  color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.admin-tabs button.active { color: var(--hof-blue); border-bottom-color: var(--hof-green); }
.queue-row { border:1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; background:#fff; }
.queue-row.pending { border-left: 4px solid var(--warn-fg); }
.row-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top: 10px; }
.inline-grid { display:grid; grid-template-columns: repeat(4,1fr); gap: 12px; }

/* Responsive */
@media (max-width: 860px) {
  .cols-3 { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .inline-grid { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .nav { position: absolute; top: 83px; right: 0; left: 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; }
  .nav-toggle { display: inline-flex; align-items:center; justify-content:center; }
}

/* Zugang zum Redaktionsbereich. Bewusst zurueckgenommen: die Seite richtet sich
   an Buergerinnen und Buerger, nicht an die Verwaltung. Der Link bleibt
   auffindbar und tastaturbedienbar — nur eben nicht in der Hauptnavigation.
   Er ist KEINE Sicherheitsmassnahme; die liegt in Passwort, Zweitfaktor,
   Rollen und Rate-Limit. Ein versteckter Link schuetzt nichts. */
.site-footer .dienst-link { float: right; opacity: .55; }
.site-footer .dienst-link a { font-size: .78rem; }
.site-footer .dienst-link:hover, .site-footer .dienst-link:focus-within { opacity: 1; }
@media (max-width: 860px) {
  .site-footer .dienst-link { float: none; display: block; margin-top: 10px; }
}
