/* ==========================================================================
   ZENTRALE CSS: KOMMUNALPOLITIK NIEDERSACHSEN – NKomVG-Projekt
   Gemeinsame Styles für alle Seiten (Module 01–06+)
   ========================================================================== */
/* ==========================================================================
   LOKALE SCHRIFTEN (PT Sans, OFL, selbst gehostet)
   ========================================================================== */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/pt-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/pt-sans-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/pt-sans-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'PT Sans';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/pt-sans-latin-700-italic.woff2') format('woff2');
}
/* === 1. RESET & CUSTOM PROPERTIES === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* --- Basis-Farbpalette (Grüne CI) --- */
  --tanne: #005538;
  --tanne-dark: #003D28;
  --klee: #008939;
  --grashalm: #8ABD24;
  --sand: #F5F1E9;
  --sand-dark: #E8E0D0;
  --himmel: #0BA1DD;
  --sonne: #FFF17A;
  --white: #FFFFFF;
  --red-signal: #C0392B;

  /* --- Text --- */
  --text-dark: #1A2E24;
  --text-muted: #4A6B56;

  /* --- Schatten --- */
  --shadow-sm: 0 2px 8px rgba(0,85,56,0.08);
  --shadow: 0 4px 20px rgba(0,85,56,0.10);
  --shadow-lg: 0 8px 32px rgba(0,85,56,0.15);

  /* --- Radien --- */
  --radius: 12px;
  --radius-sm: 8px;
}

/* === 2. GLOBALE TYPOGRAFIE === */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'PT Sans', sans-serif;
  background: var(--sand);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* === 3. HEADER === */
header {
  background: var(--tanne);
  color: var(--sand);
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--grashalm), var(--sonne), var(--grashalm));
}

h1 {
  font-family: 'PT Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-weight: 400;
  font-size: clamp(0.88rem, 2.5vw, 1.05rem);
  color: var(--sand);
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Header-Badge (Runder Kreis mit Modul-Icon) */
.hdr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border: 2px solid var(--grashalm);
  border-radius: 50%;
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
}

/* Header-Inner (Zentrierter Container) */
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header-Tag (Skewed oder Pill Badge) */
.header-tag {
  display: inline-block;
  background: var(--klee);
  color: var(--sand);
  padding: 0.25rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border-radius: 20px;
}

/* Niedersachsen-Tag */
.nds-tag {
  display: inline-block;
  margin-top: 0.8rem;
  background: rgba(138,189,36,0.15);
  border: 1px solid rgba(138,189,36,0.4);
  color: var(--grashalm);
  padding: 0.25rem 0.85rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* === 4. FOOTER === */
footer {
  background: var(--tanne-dark);
  color: var(--sand);
  text-align: center;
  padding: 1.5rem 1.25rem;
  font-size: 0.75rem;
  opacity: 0.85;
  line-height: 1.6;
  margin-top: 1rem;
}

/* === 5. SECTION-SYSTEM === */
.section {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.section-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-family: 'PT Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
  color: var(--tanne);
}

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tanne);
  color: var(--sonne);
  font-weight: 700;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.section-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.55;
}
/* Impressum / Rechtshinweis im Footer */
.footer-legal {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(245, 241, 233, 0.15);
    font-size: 0.72rem;
}
.footer-legal a {
    color: var(--sonne);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.footer-legal a:hover,
.footer-legal a:focus {
    color: var(--grashalm);
    text-decoration-thickness: 2px;
}
/* === 6. TEXTBALKEN (Skewed Headline Bar) === */
.textbalken {
  display: inline-block;
  transform: skewX(-12deg);
  padding: 0.4rem 1.2rem;
  margin: 0.2rem 0;
}

.textbalken > * {
  transform: skewX(12deg);
  display: block;
}

.textbalken h2,
.textbalken h3 {
  font-family: 'PT Sans', sans-serif;
  font-weight: 700;
  color: var(--sand);
  text-transform: uppercase;
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

/* Textbalken Farbvarianten */
.textbalken-tanne  { background: var(--tanne); color: var(--sand); }
.textbalken-klee   { background: var(--klee);  color: var(--sand); }
.textbalken-green  { background: var(--grashalm); color: var(--tanne); }
.textbalken-himmel { background: var(--himmel); color: var(--sand); }


/* === 7. INFO-PANELS === */
.info-panel {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
  overflow: hidden;
  animation: fadeUp 0.35s ease;
}

.info-panel-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--sand-dark);
}

.info-panel-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  color: white;
}

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

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

.info-panel-body {
  padding: 0 1.25rem 1.25rem;
}

/* Info-Sections innerhalb der Panels */
.info-section {
  margin-bottom: 1rem;
}

.info-section:last-child {
  margin-bottom: 0;
}

.info-section h4 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--tanne);
}

.info-section p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-dark);
}

/* Placeholder (wenn kein Panel ausgewählt) */
.placeholder {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
}

.placeholder .ph-ico {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
  opacity: 0.4;
}

.placeholder h3 {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--tanne);
}

.placeholder p {
  font-size: 0.9rem;
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.5;
}

/* === 8. CALLOUT-BOXEN === */
.callout {
  background: rgba(0,137,57,0.06);
  border-left: 4px solid var(--klee);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
}

.callout p {
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Farbvarianten */
.callout.green  { background: rgba(0,137,57,0.06);   border-left-color: var(--klee); }
.callout.blue   { background: rgba(11,161,221,0.06);  border-left-color: var(--himmel); }
.callout.red    { background: rgba(192,57,43,0.06);   border-left-color: var(--red-signal); }
.callout.orange { background: rgba(211,84,0,0.06);    border-left-color: #D35400; }
.callout.purple { background: rgba(108,52,131,0.06);  border-left-color: #6C3483; }
.callout.teal   { background: rgba(0,85,56,0.06);     border-left-color: var(--tanne); }

/* === 9. PARAGRAPHEN-REFERENZEN === */
.law {
  font-family: 'PT Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--sand);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--sand-dark);
  white-space: nowrap;
  color: var(--tanne);
}

/* === 10. EXPERT-TOGGLE (Details/Summary) === */
.expert-toggle {
  margin-top: 0.8rem;
  border-top: 1px dashed var(--sand-dark);
  padding-top: 0.7rem;
}

.expert-toggle summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--klee);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  -webkit-tap-highlight-color: transparent;
}

.expert-toggle summary::-webkit-details-marker {
  display: none;
}

.expert-toggle summary::before {
  content: '▸';
  transition: transform 0.2s;
}

.expert-toggle[open] summary::before {
  transform: rotate(90deg);
}

.expert-content {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0,85,56,0.04);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* === 11. PRINCIPLE-BANNER (§-Box) === */
.principle {
  background: var(--tanne);
  color: var(--sand);
  padding: 1.75rem 1.25rem;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  max-width: 720px;
  margin: 1rem auto;
}

.principle::before {
  content: '§';
  position: absolute;
  right: -8px; top: -16px;
  font-size: 7rem;
  font-weight: 900;
  opacity: 0.06;
  color: var(--grashalm);
}

.principle h3 {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: var(--sonne);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.principle p {
  font-size: 0.92rem;
  line-height: 1.65;
  opacity: 0.9;
}

/* === 12. LEGEND === */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  justify-content: center;
  padding: 0.8rem 1rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
  margin-bottom: 1.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.legend-sw {
  width: 14px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* === 13. ORGANIGRAMM & NODES === */
.org-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
  overflow-x: auto;
}

.org-title {
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  text-transform: uppercase;
  color: var(--tanne);
  letter-spacing: 0.03em;
}

.org-title span {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0.15rem;
}

.org-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 1.25rem;
  min-width: 280px;
}

.node {
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  border: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
}

.node:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.node:active {
  transform: scale(0.97);
}

.node.active {
  border-color: var(--sonne) !important;
  box-shadow: 0 0 0 3px rgba(255,241,122,0.35);
  transform: scale(1.02);
  z-index: 3;
}

.node-lbl {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.node-ttl {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.25;
}

.node-sub {
  font-size: 0.68rem;
  opacity: 0.8;
  margin-top: 0.1rem;
}

.node-ico {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

/* Arrow-Label (zwischen Nodes) */
.arrow-lbl {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tanne);
  padding: 0.1rem 0.4rem;
  background: var(--sand);
  border: 1px solid var(--sand-dark);
  border-radius: 5px;
  white-space: nowrap;
}

.row-dual {
  display: flex;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.hint {
  text-align: center;
  margin-top: 0.8rem;
  font-size: 0.72rem;
  color: var(--klee);
  font-weight: 700;
}

/* === 14. LAYOUT (Dual-Column mit Sticky) === */
.main-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.organi-col {
  width: 100%;
}

.info-column {
  width: 100%;
  flex: 1;
  min-width: 0;
}

/* === 15. INTRO === */
.intro {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1rem;
}

.intro p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.intro strong {
  color: var(--tanne);
}

/* === 16. DIVIDER === */
hr.divider {
  border: none;
  border-top: 2px solid var(--sand-dark);
  max-width: 700px;
  margin: 0 auto;
}

/* === 17. ANIMATION === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === 18. RESPONSIVE: MOBILE === */
@media (max-width: 600px) {
  header {
    padding: 2rem 1rem 1.5rem;
  }

  h1 {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .hdr-badge {
    width: 48px; height: 48px;
    font-size: 1.3rem;
  }

  .section {
    padding: 1.2rem 0.85rem;
  }

  .info-panel-header {
    padding: 1rem;
    gap: 0.7rem;
  }

  .info-panel-icon {
    width: 38px; height: 38px;
    font-size: 1rem;
  }

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

  .info-section h4 {
    font-size: 0.72rem;
  }

  .callout {
    padding: 0.7rem 0.85rem;
    margin: 0.6rem 0;
  }

  .expert-toggle summary {
    font-size: 0.78rem;
  }

  .expert-content {
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
  }

  .principle {
    padding: 1.25rem 1rem;
  }

  .legend {
    padding: 0.7rem 0.8rem;
    gap: 0.5rem 0.8rem;
  }

  footer {
    padding: 1.25rem 1rem;
    font-size: 0.7rem;
  }
}

/* Tablet+ Layout für Dual-Column Seiten */
@media (min-width: 768px) {
  .main-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .organi-col {
    position: sticky;
    top: 1rem;
  }

  .info-column {
    flex: 1;
    min-width: 0;
  }
}

/* Touch-optimiert */
@media (hover: none) {
  .node:hover {
    transform: none;
    box-shadow: none;
  }

  .node:active {
    transform: scale(0.97);
    box-shadow: var(--shadow);
  }
}

/* Print */
@media print {
  header {
    background: var(--tanne) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .info-panel,
  .principle {
    break-inside: avoid;
  }
}
