/* ==========================================================================
   06 – DIREKTE DEMOKRATIE (§§ 31–34 NKomVG)
   Seitenspezifisch – benötigt NkomVG_Style.css als Basis
   ========================================================================== */

/* --- Seitenspezifische Variablen --- */
:root {
  --dd-stufe1: #95B0A4;   /* § 34 Anregung – ruhig, neutral */
  --dd-stufe2: var(--himmel);   /* § 31 Einwohnerantrag – blau */
  --dd-stufe3: var(--klee);     /* § 32 Bürgerbegehren – kraftvolles Grün */
  --dd-stufe4: var(--tanne);    /* § 33 Bürgerentscheid – höchste Hürde */
  --dd-rats:   #7B68AE;         /* Ratsreferendum – Lila */
  --dd-warn:   var(--red-signal);
  --dd-accent: var(--grashalm);
  --white: #FFFFFF;
  --shadow-sm: 0 2px 6px rgba(0, 85, 56, 0.08);
  --shadow:    0 4px 12px rgba(0, 85, 56, 0.12);
  --shadow-md: 0 6px 16px rgba(0, 85, 56, 0.15);
  --radius:    12px;
  --radius-sm: 6px;
  --text-dark: var(--text-main);
}

/* --- Body --- */
body { line-height: 1.6; }

/* --- Header-Deko --- */
header { text-align: center; }

header::before {
  content: '🗣️';
  position: absolute;
  right: -30px; top: -20px;
  font-size: 9rem;
  opacity: 0.06;
  pointer-events: none;
}

.hdr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(138,189,36,0.15);
  font-size: 1.6rem;
  margin-bottom: 0.6rem;
}

.nds-tag {
  display: inline-block;
  margin-top: 0.7rem;
  background: rgba(138,189,36,0.18);
  border: 1px solid rgba(138,189,36,0.4);
  color: var(--grashalm);
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Section --- */
.section {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: clamp(1.2rem, 3.5vw, 1.5rem);
  font-weight: 700;
  color: var(--tanne);
  margin: 0.5rem 0 0.4rem;
  line-height: 1.25;
}

.section-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
}

/* --- Section-Num als Skewed Textbalken --- */
.section-num {
  display: inline-block;
  background: var(--klee);
  color: var(--sand);
  padding: 0.3rem 0.85rem;
  border-radius: 4px;
  transform: skewX(-12deg);
  font-weight: 700;
  font-size: 0.85rem;
}
.section-num span {
  display: inline-block;
  transform: skewX(12deg);
}

/* --- Divider --- */
.divider {
  border: none;
  border-top: 2px solid var(--sand-dark);
  margin: 0;
  max-width: 720px;
  margin: 0 auto;
}

/* --- Callout Basis --- */
.callout {
  background: rgba(0, 137, 57, 0.06);
  border-left: 4px solid var(--klee);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1rem;
  margin: 0.75rem 0;
}
.callout p { font-size: 0.9rem; line-height: 1.65; }
.callout.blue   { background: rgba(11,161,221,0.06);  border-left-color: var(--himmel); }
.callout.green  { background: rgba(0,137,57,0.06);    border-left-color: var(--klee); }
.callout.red    { background: rgba(192,57,43,0.06);   border-left-color: var(--red-signal); }
.callout.purple { background: rgba(123,104,174,0.07); border-left-color: var(--dd-rats); }
.callout.tanne  { background: rgba(0,85,56,0.05);     border-left-color: var(--tanne); }

/* --- Law-Reference --- */
.law {
  display: inline-block;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.8rem;
  background: rgba(0,85,56,0.07);
  color: var(--tanne);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}

/* ==========================================================================
   STUFEN-TREPPE (Hero-Visualisierung der 4 Stufen)
   ========================================================================== */
.stairs {
  max-width: 720px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}

.stairs-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
}

.stairs-title {
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  color: var(--tanne);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.stairs-sub {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.stairs-stack {
  display: flex;
  flex-direction: column-reverse; /* Damit Stufe 1 unten, 4 oben */
  gap: 0;
}

.stair {
  display: flex;
  align-items: stretch;
  background: var(--white);
  border: 2px solid;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  margin-bottom: 4px;
  position: relative;
  cursor: default;
  transition: all 0.2s ease;
  text-align: left;
}

.stair-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--white);
  margin-right: 0.7rem;
  align-self: center;
}

.stair-body { flex: 1; min-width: 0; }

.stair-name {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.3;
  margin-bottom: 0.1rem;
}
.stair-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}
.stair-effect {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Stufen-Farben */
.stair.s1 { border-color: var(--dd-stufe1); }
.stair.s1 .stair-num { background: var(--dd-stufe1); }
.stair.s2 { border-color: var(--dd-stufe2); }
.stair.s2 .stair-num { background: var(--dd-stufe2); }
.stair.s3 { border-color: var(--dd-stufe3); }
.stair.s3 .stair-num { background: var(--dd-stufe3); }
.stair.s4 { border-color: var(--dd-stufe4); background: rgba(0,85,56,0.04); }
.stair.s4 .stair-num { background: var(--dd-stufe4); }

/* Hürde-Indikator */
.stair-hurdle {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.stair-hurdle.lo  { background: rgba(149,176,164,0.2); color: #5A7468; }
.stair-hurdle.md  { background: rgba(11,161,221,0.12); color: var(--himmel); }
.stair-hurdle.hi  { background: rgba(0,137,57,0.12);   color: var(--klee); }
.stair-hurdle.top { background: rgba(0,85,56,0.12);    color: var(--tanne); }

.stairs-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--klee);
  font-style: italic;
  margin-top: 0.6rem;
}

/* ==========================================================================
   TOPIC-CARDS (4 Karten für die §§ 31-34)
   ========================================================================== */
.topics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  max-width: 720px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.tc {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.95rem 0.7rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid var(--sand-dark);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tc:hover, .tc:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--klee);
}

.tc.active {
  border-color: var(--tanne) !important;
  box-shadow: 0 0 0 3px rgba(0,85,56,0.15), var(--shadow);
}

.tc-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tc-ico   { font-size: 1.5rem; margin-bottom: 0.3rem; }
.tc-lbl   { font-weight: 700; font-size: 0.85rem; line-height: 1.3; margin-bottom: 0.15rem; color: var(--tanne); }
.tc-par   { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); }

.tc-tag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
}
.tc-tag.alle    { background: rgba(149,176,164,0.2); color: #5A7468; }
.tc-tag.einw    { background: rgba(11,161,221,0.12); color: var(--himmel); }
.tc-tag.buerg   { background: rgba(0,137,57,0.12);   color: var(--klee); }
.tc-tag.entsch  { background: rgba(0,85,56,0.12);    color: var(--tanne); }

/* ==========================================================================
   INFO-AREA & PANELS
   ========================================================================== */
.info-area {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
}

.info-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
  overflow: hidden;
  margin-bottom: 1.2rem;
  animation: fadeUp 0.35s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.info-panel-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--sand-dark);
  background: linear-gradient(180deg, rgba(0,85,56,0.02) 0%, rgba(0,85,56,0) 100%);
}

.info-panel-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.info-panel-stufe {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.info-panel-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--tanne);
  line-height: 1.3;
  margin-top: 0.1rem;
}

.info-panel-body { padding: 1rem 1.1rem 1.2rem; }

.info-section { margin: 0.8rem 0; }
.info-section h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--tanne);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.info-section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-main);
}

/* Placeholder */
.placeholder {
  text-align: center;
  padding: 2rem 1rem;
}
.ph-ico { font-size: 2.5rem; margin-bottom: 0.5rem; }
.placeholder h3 {
  color: var(--tanne);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.placeholder p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
}

/* === WARN BOX === */
.warn {
  background: rgba(192,57,43,0.05);
  border: 1px solid rgba(192,57,43,0.12);
  border-left: 4px solid var(--red-signal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
}
.warn-title {
  font-weight: 700;
  color: var(--red-signal);
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.warn p { font-size: 0.9rem; line-height: 1.7; }

/* === TIPP BOX === */
.tip {
  background: rgba(0,137,57,0.05);
  border: 1px solid rgba(0,137,57,0.12);
  border-left: 4px solid var(--klee);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
}
.tip-title {
  font-weight: 700;
  color: var(--klee);
  font-size: 0.82rem;
  margin-bottom: 0.25rem;
}
.tip p { font-size: 0.9rem; line-height: 1.7; }

/* === Expert Toggle === */
.expert-toggle {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  border-top: 1px dashed var(--sand-dark);
  padding-top: 0.6rem;
}
.expert-toggle summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--klee);
  font-size: 0.82rem;
  padding: 0.2rem 0;
  list-style: none;
}
.expert-toggle summary::before {
  content: '▶ ';
  font-size: 0.7rem;
  display: inline-block;
  transition: transform 0.2s;
}
.expert-toggle[open] summary::before { transform: rotate(90deg); }
.expert-content {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-main);
  background: var(--sand);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
}

/* === Mini-Stats Row (Voraussetzung-Quorum-Wirkung) === */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.7rem 0;
}
.ms-item {
  background: var(--sand);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.4rem;
  text-align: center;
  border-top: 3px solid var(--klee);
}
.ms-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}
.ms-value {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.25;
  color: var(--tanne);
}

/* Stufenfarben für Mini-Stats */
.info-panel.s1 .ms-item { border-top-color: var(--dd-stufe1); }
.info-panel.s2 .ms-item { border-top-color: var(--dd-stufe2); }
.info-panel.s3 .ms-item { border-top-color: var(--dd-stufe3); }
.info-panel.s4 .ms-item { border-top-color: var(--dd-stufe4); }

/* ==========================================================================
   QUORUM-TABELLE für Einwohnerantrag
   ========================================================================== */
.quorum-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.6rem -0.3rem;
  padding: 0 0.3rem;
}

.quorum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  min-width: 320px;
}
.quorum-table th {
  text-align: left;
  background: var(--sand);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.6rem;
  border-bottom: 2px solid var(--sand-dark);
  color: var(--tanne);
}
.quorum-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--sand-dark);
  vertical-align: middle;
}
.quorum-table tr:last-child td { border-bottom: none; }
.quorum-table .pct {
  font-weight: 700;
  color: var(--himmel);
}
.quorum-table .cap {
  font-weight: 700;
  color: var(--tanne);
}

/* ==========================================================================
   VERGLEICHS-TABELLE (alle 4 Instrumente nebeneinander)
   ========================================================================== */
.compare-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0.9rem 0.7rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
  max-width: 880px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 560px;
}

.compare-table thead th {
  padding: 0.6rem 0.5rem;
  text-align: left;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-bottom: 3px solid var(--sand-dark);
  background: var(--white);
  color: var(--text-muted);
}
.compare-table thead th:first-child { width: 22%; }
.compare-table thead th.col-anregung { color: #5A7468; border-bottom-color: var(--dd-stufe1); }
.compare-table thead th.col-einwohner { color: var(--himmel);  border-bottom-color: var(--dd-stufe2); }
.compare-table thead th.col-buerger    { color: var(--klee);   border-bottom-color: var(--dd-stufe3); }
.compare-table thead th.col-entscheid  { color: var(--tanne);  border-bottom-color: var(--dd-stufe4); }

.compare-table tbody td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--sand-dark);
  vertical-align: top;
  line-height: 1.5;
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody td:first-child {
  font-weight: 700;
  color: var(--tanne);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ==========================================================================
   PRINCIPLE-Card (Abschluss)
   ========================================================================== */
.principle {
  background: var(--tanne);
  color: var(--sand);
  padding: 1.5rem 1.5rem 1.6rem;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.principle::before {
  content: '§';
  position: absolute;
  right: -10px; top: -20px;
  font-size: 7rem;
  font-weight: 900;
  opacity: 0.08;
  color: var(--grashalm);
}
.principle::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--grashalm), var(--sonne));
}
.principle h3 {
  font-family: 'PT Sans', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--sonne);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.principle p { font-size: 0.92rem; line-height: 1.6; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (min-width: 600px) {
  .topics {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
  }
  .tc { min-height: 150px; padding: 1.2rem 0.85rem; }
  .info-panel-header { padding: 1.3rem 1.4rem; }
  .info-panel-body   { padding: 1.2rem 1.4rem 1.4rem; }
  .stairs-card { padding: 1.5rem 1.5rem 1.2rem; }
  .stair { padding: 0.9rem 1.1rem; }
  .stair-num { width: 32px; height: 32px; font-size: 0.85rem; }
  .stair-name { font-size: 0.95rem; }
  .stair-meta { font-size: 0.78rem; }
  .stair-effect { font-size: 0.8rem; }
  .principle { padding: 1.8rem 2rem; }
  .section { padding: 2rem 1.5rem; }
  .section-header h2 { font-size: 1.5rem; }
}

@media (min-width: 900px) {
  .topics { gap: 1rem; }
  .info-area, .stairs, .section { max-width: 760px; }
  .compare-card { max-width: 920px; }
}

@media (max-width: 380px) {
  .topics { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .tc { min-height: 110px; padding: 0.7rem 0.45rem; }
  .tc-lbl { font-size: 0.78rem; }
  .info-panel-header { flex-direction: column; text-align: center; gap: 0.5rem; padding: 1rem 0.8rem; }
  .info-panel-icon { width: 42px; height: 42px; font-size: 1.3rem; }
  .mini-stats { grid-template-columns: 1fr; gap: 0.4rem; }
  .stair-num { width: 26px; height: 26px; font-size: 0.72rem; margin-right: 0.55rem; }
  .stair-hurdle { font-size: 0.6rem; padding: 0.1rem 0.35rem; }
}

@media (hover: none) {
  .tc:active { transform: scale(0.97); transition: transform 0.1s; }
}

@media print {
  .tc, .info-panel, .stair, .compare-card { break-inside: avoid; }
  .info-panel { display: block !important; }
}
