/* ==========================================================================
   02 – KOMMUNALE GEBIETSKÖRPERSCHAFTEN
   Seitenspezifisch – benötigt NkomVG_Style.css als Basis
   ========================================================================== */

/* --- Seitenspezifische Variablen --- */
:root {
  --purple-special: #5C3D6B;
  --purple-dark: #3A2345;
  --brown-region: #6B5A3D;
  --brown-dark: #4A3D28;
  --red-accent: #8B2500;
  --gold-warn: #C5A55A;
  --gold-dark: #8B7335;
  --klee-light: #00A347;
  --grashalm-light: #A8D94E;
  --ink: #1A2E24;
  --ink-light: #2D4438;
  --ink-lighter: #4A6B56;
}

/* --- Header-Anpassungen --- */
header {
  background: linear-gradient(160deg, var(--tanne) 0%, var(--tanne-dark) 60%, var(--klee) 100%);
  padding: 2rem 1rem 1.8rem;
}

.header-badge {
  display: inline-block;
  width: 52px; height: 52px;
  line-height: 48px;
  font-size: 1.5rem;
  margin-bottom: 0.7rem;
}

h1 {
  font-family: 'PT Sans Narrow', 'PT Sans', sans-serif;
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.subtitle {
  color: rgba(245,241,233,0.85);
}

.niedersachsen-tag {
  display: inline-block;
  margin-top: 0.8rem;
  background: rgba(138,189,36,0.2);
  border: 1px solid var(--grashalm);
  color: var(--grashalm-light);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* --- Body & Type --- */
body { line-height: 1.5; color: var(--ink); }

.section-header h2 {
  font-family: 'PT Sans Narrow', 'PT Sans', sans-serif;
}

.section-header .section-sub {
  color: var(--ink-lighter);
  max-width: 560px;
}

.section-num {
  display: inline-block;
  font-family: 'PT Sans Narrow', sans-serif;
  width: 32px; height: 32px;
  line-height: 32px;
  border-radius: 50%;
  font-size: 0.95rem;
  color: var(--sand);
}

/* === 1. LEGITIMATIONSKETTE === */
.chain-section {
  background: var(--white);
  border-radius: 12px;
  padding: 1.2rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
  max-width: 720px;
  margin: 0 auto 2rem;
}

.legal-chain {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 1rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

.chain-link {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 1rem 0.7rem;
  border-radius: 10px;
  color: white;
  position: relative;
}

.chain-link-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
  margin-bottom: 0.2rem;
}

.chain-link-title {
  font-family: 'PT Sans Narrow', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.chain-link-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  opacity: 0.85;
}

.chain-link-desc {
  font-size: 0.75rem;
  margin-top: 0.4rem;
  opacity: 0.88;
  line-height: 1.4;
}

.chain-arrow-container {
  display: flex;
  align-items: center;
  padding: 0 0.15rem;
  font-size: 1.2rem;
  color: var(--klee);
  font-weight: 700;
  flex-shrink: 0;
}

/* === 2. TRAPEZ-STRUKTUR === */
.structure-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.trapez-column {
  flex: 0 0 auto;
  width: 380px;
  max-width: 100%;
  position: sticky;
  top: 0.5rem;
}

.trapez-wrapper {
  background: var(--white);
  border-radius: 12px;
  padding: 1.2rem 0.8rem 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
}

.trapez-title {
  font-family: 'PT Sans Narrow', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.2rem;
  color: var(--tanne);
  text-transform: uppercase;
}

.trapez-title span {
  display: block;
  font-family: 'PT Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--ink-lighter);
  margin-top: 0.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trapez {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 1rem;
}

.trapez-level {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  position: relative;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  padding: 0.5rem 0.5rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  -webkit-tap-highlight-color: transparent;
  animation: fadeUp 0.4s ease backwards;
}

.trapez-level:hover { filter: brightness(1.1); z-index: 2; }
.trapez-level:active { transform: scale(0.97); }
.trapez-level.active {
  border-color: var(--sonne);
  filter: brightness(1.12);
  z-index: 3;
  box-shadow: 0 0 12px rgba(255,241,122,0.35);
}

.t-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.6rem;
  margin-right: 0.3rem;
  flex-shrink: 0;
  text-shadow: none;
}

/* Trapez-Formen */
.t-landkreis   { width: 58%; min-height: 48px; background: linear-gradient(180deg, var(--tanne) 0%, var(--tanne-dark) 100%); clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%); }
.t-split-row   { display: flex; width: 72%; gap: 3px; }
.t-samtgemeinde { flex: 1; min-height: 44px; background: linear-gradient(180deg, var(--klee) 0%, var(--tanne) 100%); clip-path: polygon(6% 0%, 100% 0%, 100% 100%, 0% 100%); font-size: 0.62rem; padding: 0.4rem 0.2rem; }
.t-gemeinde    { flex: 1; min-height: 44px; background: linear-gradient(180deg, var(--klee-light) 0%, var(--klee) 100%); clip-path: polygon(0% 0%, 94% 0%, 100% 100%, 0% 100%); font-size: 0.62rem; padding: 0.4rem 0.2rem; }
.t-mitglied    { width: 82%; min-height: 42px; background: linear-gradient(180deg, #5A7A2A 0%, #3D5A1A 100%); clip-path: polygon(4% 0%, 96% 0%, 100% 100%, 0% 100%); font-size: 0.65rem; }
.t-ortsraete   { width: 90%; min-height: 42px; background: linear-gradient(180deg, #7A9A55 0%, #566A38 100%); clip-path: polygon(3% 0%, 97% 0%, 100% 100%, 0% 100%); font-size: 0.65rem; }
.t-kreisfreie  { width: 46%; min-height: 42px; background: linear-gradient(180deg, var(--purple-special) 0%, var(--purple-dark) 100%); clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%); font-size: 0.6rem; }
.t-region      { width: 42%; min-height: 38px; background: linear-gradient(180deg, var(--brown-region) 0%, var(--brown-dark) 100%); clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%); font-size: 0.6rem; }

.t-samtgemeinde, .t-gemeinde { font-size: 0.62rem; }

/* Separator */
.t-separator { width: 80%; display: flex; align-items: center; gap: 0.4rem; margin: 0.3rem 0; }
.t-sep-line  { flex: 1; height: 1px; background: var(--klee); opacity: 0.3; }
.t-sep-label { font-size: 0.52rem; color: var(--klee); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.t-hint      { text-align: center; margin-top: 0.8rem; font-size: 0.72rem; color: var(--klee); font-style: italic; }

/* Legend */
.t-legend     { margin-top: 0.8rem; display: flex; flex-direction: column; gap: 0.25rem; }
.t-legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.68rem; color: var(--ink-lighter); }
.t-legend-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }

/* Info-Panel-Anpassungen */
.info-panel-title {
  font-family: 'PT Sans Narrow', sans-serif;
}

.info-panel-stufe {
  color: var(--ink-lighter);
}

.info-section p {
  color: var(--ink-light);
}

.law {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

/* Callout-Boxen Farbvariante */
.callout.purple {
  background: linear-gradient(135deg, rgba(92,61,107,0.06) 0%, rgba(92,61,107,0.02) 100%);
  border-left-color: var(--purple-special);
}

/* Placeholder */
.placeholder h3 {
  font-family: 'PT Sans Narrow', sans-serif;
  text-transform: uppercase;
}

/* === 3. KARRIERELEITER === */
.karriere-section { max-width: 720px; margin: 0 auto; }

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

.karriere-visual { display: flex; flex-direction: column; gap: 0; margin: 1rem 0; }

.karriere-step {
  display: flex;
  align-items: stretch;
  gap: 0.8rem;
  position: relative;
}

.karriere-bar {
  width: 3px;
  background: var(--sand-dark);
  position: relative;
  flex-shrink: 0;
  margin-left: 14px;
}

.karriere-bar::before {
  content: '';
  position: absolute;
  left: -7px; top: 1rem;
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--klee);
}

.karriere-step.step-active .karriere-bar        { background: var(--klee); }
.karriere-step.step-active .karriere-bar::before { background: var(--klee); }
.karriere-step.step-warn .karriere-bar           { background: var(--gold-warn); }
.karriere-step.step-warn .karriere-bar::before   { background: var(--gold-warn); box-shadow: 0 0 0 2px var(--gold-warn); }
.karriere-step.step-warn .karriere-threshold     { color: var(--gold-dark); }
.karriere-step.step-down .karriere-bar           { background: var(--red-accent); }
.karriere-step.step-down .karriere-bar::before   { background: var(--red-accent); box-shadow: 0 0 0 2px var(--red-accent); }
.karriere-step.step-down .karriere-threshold     { color: var(--red-accent); }

.karriere-content  { padding: 0.6rem 0 1.2rem; flex: 1; min-width: 0; }
.karriere-threshold { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; font-weight: 500; color: var(--klee); margin-bottom: 0.15rem; }
.karriere-name     { font-family: 'PT Sans Narrow', sans-serif; font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; color: var(--tanne); }
.karriere-desc     { font-size: 0.88rem; color: var(--ink-lighter); line-height: 1.55; }
.karriere-tag      { display: inline-block; font-size: 0.67rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 12px; margin-top: 0.3rem; }

.tag-prestige  { background: rgba(0,137,57,0.1); color: var(--klee); }
.tag-autonomie { background: rgba(11,161,221,0.1); color: var(--himmel); }
.tag-puffer    { background: rgba(197,165,90,0.15); color: var(--gold-dark); }
.tag-verlust   { background: rgba(139,37,0,0.08); color: var(--red-accent); }

/* Principle-Banner */
.principle-banner { max-width: 720px; margin: 0.5rem auto 1.5rem; }

.principle-card {
  background: linear-gradient(135deg, var(--tanne) 0%, var(--tanne-dark) 100%);
  color: var(--sand);
  padding: 1.5rem 1.2rem;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.principle-card::before {
  content: '§';
  position: absolute;
  right: -8px; top: -15px;
  font-size: 6rem;
  font-family: 'PT Sans Narrow', sans-serif;
  opacity: 0.06;
  font-weight: 700;
}

.principle-card h3 {
  font-family: 'PT Sans Narrow', sans-serif;
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
  color: var(--grashalm-light);
  text-transform: uppercase;
}

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

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

/* --- RESPONSIVE --- */
@media (max-width: 760px) {
  .structure-layout { flex-direction: column; align-items: stretch; }
  .trapez-column { position: static; width: 100%; }
}

@media (max-width: 600px) {
  .legal-chain { flex-direction: column; align-items: center; }
  .chain-link { width: 100%; }
  .chain-arrow-container { transform: rotate(90deg); padding: 0.2rem 0; font-size: 1rem; }
}

@media (max-width: 480px) {
  header { padding: 1.5rem 0.8rem 1.4rem; }
  .chain-section { padding: 1rem 0.75rem; }
  .chain-link { padding: 0.8rem 0.5rem; }
  .chain-link-desc { font-size: 0.7rem; }
  .info-panel-header { padding: 0.8rem; gap: 0.6rem; }
  .info-panel-body { padding: 0 0.8rem 1rem; }
  .info-panel-icon { width: 36px; height: 36px; font-size: 1rem; }
  .karriere-card { padding: 1rem 0.75rem; }
  .karriere-step { gap: 0.6rem; }
  .karriere-bar { margin-left: 10px; }
  .principle-card { padding: 1.2rem 1rem; }
}

@media (max-width: 380px) {
  .t-landkreis { width: 62%; }
  .t-split-row { width: 78%; }
  .t-samtgemeinde, .t-gemeinde { font-size: 0.56rem; min-height: 40px; padding: 0.35rem 0.15rem; }
  .t-num { width: 16px; height: 16px; font-size: 0.55rem; margin-right: 0.15rem; }
  .t-mitglied { width: 86%; }
  .t-ortsraete { width: 92%; }
}

@media (hover: none) {
  .trapez-level:active { transform: scale(0.96); filter: brightness(1.15); }
}
