/*
 * ============================================================
 * DESIGN: „Reiseatlas" — warmes Papier, Tinte, Terracotta-Stempel
 * ============================================================
 * Die Idee: Das Tool soll sich anfühlen wie ein schöner alter Atlas
 * bzw. ein Reisetagebuch — nicht wie eine sterile Tech-Seite.
 * Alle Farben sind hier oben als "Variablen" definiert, damit man
 * das komplette Farbschema an EINER Stelle ändern kann.
 */

:root {
  --papier: #f5efe3;          /* warmer Papierton als Grundfläche */
  --papier-hell: #fbf7ee;     /* hellere Karten-Fläche */
  --tinte: #22302b;           /* dunkles Tannengrün statt hartem Schwarz */
  --tinte-sanft: #5c6a63;     /* abgeschwächte Textfarbe */
  --terracotta: #c0532b;      /* Akzent: Stempel, Slider, Highlights */
  --terracotta-tief: #9c3f1e;
  --salbei: #7d8f6f;          /* zweiter Akzent: positive Häkchen */
  --gold: #c89b3f;            /* „teils erfüllt"-Markierung */
  --linie: #d8cdb8;           /* Trennlinien im Papierton */
  --schatten: 0 2px 4px rgba(34, 48, 43, .07), 0 12px 28px rgba(34, 48, 43, .09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Karla", sans-serif;
  color: var(--tinte);
  background-color: var(--papier);
  /* Feine Topographie-Linien als Hintergrund-Muster — wie Höhenlinien einer Landkarte */
  background-image:
    radial-gradient(ellipse 90% 60% at 80% -10%, rgba(192, 83, 43, .07), transparent 60%),
    repeating-radial-gradient(circle at 12% 18%, transparent 0 34px, rgba(34, 48, 43, .035) 34px 35px),
    repeating-radial-gradient(circle at 88% 82%, transparent 0 46px, rgba(34, 48, 43, .03) 46px 47px);
  line-height: 1.55;
  min-height: 100vh;
}

/* ════════════════ KOPFBEREICH ════════════════ */

.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  border-bottom: 3px double var(--linie);
}

.hero-vorzeile {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 14px;
}

.hero h1 {
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  max-width: 14ch;
}

.hero-untertitel {
  margin-top: 18px;
  max-width: 56ch;
  font-size: 1.08rem;
  color: var(--tinte-sanft);
}
.hero-untertitel strong { color: var(--tinte); }

/* ════════════════ ZWEISPALTEN-LAYOUT ════════════════ */

.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 72px;
  display: grid;
  grid-template-columns: 320px 1fr;  /* links Filter, rechts Ergebnisse */
  gap: 40px;
  align-items: start;
}

/* Auf schmalen Bildschirmen (Handy) untereinander statt nebeneinander */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 28px; }
}

/* ════════════════ FILTER-SPALTE ════════════════ */

.filter-panel {
  background: var(--papier-hell);
  border: 1px solid var(--linie);
  border-radius: 14px;
  padding: 26px 22px;
  box-shadow: var(--schatten);
  position: sticky;   /* bleibt beim Scrollen sichtbar */
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
@media (max-width: 900px) { .filter-panel { position: static; max-height: none; } }

.filter-gruppe { padding: 18px 0; border-bottom: 1px dashed var(--linie); }
.filter-gruppe:first-child { padding-top: 0; }

/* "Woher kommst du?" — optisch abgesetzt, weil es kein Filter, sondern
   dein Ausgangspunkt ist (leicht getönter Kasten). */
.heimat-gruppe {
  background: rgba(192, 83, 43, .05);
  border: 1px solid rgba(192, 83, 43, .2);
  border-radius: 10px;
  padding: 14px 14px 12px;
  margin-bottom: 6px;
}
.heimat-anker {
  margin-top: 8px;
  font-size: .85rem;
  color: var(--tinte-sanft);
}
.heimat-anker strong { color: var(--terracotta-tief); }

.filter-gruppe h2 {
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

/* Die kleinen Kapitel-Nummern (01, 02, …) wie in einem Inhaltsverzeichnis */
.nr {
  font-family: "Karla", sans-serif;
  font-size: .7rem;
  font-weight: 700;
  color: var(--terracotta);
  letter-spacing: .1em;
}

.filter-hilfe { font-size: .85rem; color: var(--tinte-sanft); margin-bottom: 10px; }

/* ── Budget-Regler ── */

.budget-anzeige {
  font-family: "Fraunces", serif;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--terracotta-tief);
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 8px;
}
.budget-anzeige .euro { font-family: "Karla", sans-serif; font-size: .85rem; color: var(--tinte-sanft); }

input[type="range"] {
  width: 100%;
  accent-color: var(--terracotta);
  cursor: pointer;
  height: 28px;
}

.slider-skala {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  color: var(--tinte-sanft);
}

/* ── Auswahl-Chips (Landschaft, Klima) ── */

.chip-reihe { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; } /* Häkchen unsichtbar, der Chip selbst zeigt den Zustand */
.chip span {
  display: inline-block;
  padding: 7px 13px;
  border: 1.5px solid var(--linie);
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 500;
  background: var(--papier);
  transition: all .15s ease;
  user-select: none;
}
.chip:hover span { border-color: var(--terracotta); }
.chip input:checked + span {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--papier-hell);
  box-shadow: 0 3px 8px rgba(192, 83, 43, .3);
}
.chip input:focus-visible + span { outline: 2px solid var(--tinte); outline-offset: 2px; }

/* ── Radio-Listen ── */

.radio-liste { display: flex; flex-direction: column; gap: 7px; }
.radio-liste label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .92rem;
  cursor: pointer;
  padding: 3px 0;
}
.radio-liste input { accent-color: var(--terracotta); width: 16px; height: 16px; cursor: pointer; }

/* ── Zurücksetzen-Knopf ── */

.reset-knopf {
  margin-top: 18px;
  width: 100%;
  padding: 10px;
  font-family: "Karla", sans-serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--tinte-sanft);
  background: none;
  border: 1.5px dashed var(--linie);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s ease;
}
.reset-knopf:hover { color: var(--terracotta); border-color: var(--terracotta); }

/* ════════════════ ERGEBNIS-SPALTE ════════════════ */

.ergebnis-kopf { margin-bottom: 22px; }
.ergebnis-kopf h2 {
  font-family: "Fraunces", serif;
  font-size: 1.7rem;
  font-weight: 600;
}
#ergebnis-zusammenfassung { color: var(--tinte-sanft); margin-top: 4px; font-size: .98rem; }

.karten-raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── Die Länderkarte ── */

.karte {
  background: var(--papier-hell);
  border: 1px solid var(--linie);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--schatten);
  position: relative;
  overflow: hidden;
  /* Sanftes Erscheinen beim Neuberechnen */
  animation: auftauchen .35s ease both;
}
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* Die ersten Karten erscheinen leicht nacheinander — wirkt lebendiger */
.karte:nth-child(2) { animation-delay: .05s; }
.karte:nth-child(3) { animation-delay: .1s; }
.karte:nth-child(4) { animation-delay: .15s; }
.karte:nth-child(5) { animation-delay: .2s; }
.karte:nth-child(6) { animation-delay: .25s; }

.karte-kopf {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-right: 66px; /* Platz für den Stempel rechts oben */
}

.karte-flagge { font-size: 2rem; line-height: 1; }

.karte-kopf h3 {
  font-family: "Fraunces", serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.15;
}
.karte-region {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--tinte-sanft);
}

/* ── Der „Stempel" mit der Übereinstimmung in % ──
   Leicht gedreht und mit doppeltem Rand, wie ein Passstempel. */
.stempel {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 56px;
  height: 56px;
  border: 2px solid var(--terracotta);
  outline: 1.5px solid var(--terracotta);
  outline-offset: 2.5px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(7deg);
  color: var(--terracotta-tief);
  font-weight: 700;
  background: rgba(192, 83, 43, .05);
}
.stempel b { font-size: 1.05rem; line-height: 1; }
.stempel small { font-size: .5rem; letter-spacing: .08em; text-transform: uppercase; }

/* Stempel-Varianten je nach Güte des Treffers */
.stempel.gut { border-color: var(--salbei); outline-color: var(--salbei); color: #55663f; background: rgba(125, 143, 111, .1); }

/* Neutraler Stempel, wenn keine Kriterien gewählt sind ("im Budget") */
.stempel.neutral { border-color: var(--tinte-sanft); outline-color: var(--tinte-sanft); color: var(--tinte-sanft); background: rgba(92, 106, 99, .06); }
.stempel-text { font-size: .62rem; font-weight: 700; line-height: 1.05; text-transform: uppercase; letter-spacing: .04em; }

/* Aufklappbare Match-Erklärung über den Ergebnissen */
.match-erklaerung { margin-top: 10px; font-size: .9rem; }
.match-erklaerung > summary {
  cursor: pointer;
  color: var(--terracotta-tief);
  font-weight: 700;
  list-style: none;
  display: inline-block;
}
.match-erklaerung > summary::before { content: "ⓘ "; }
.match-erklaerung[open] > summary { margin-bottom: 8px; }
.match-erklaerung > summary::-webkit-details-marker { display: none; }
.match-erklaerung-text {
  background: var(--papier-hell);
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: 14px 16px;
  max-width: 62ch;
}
.match-erklaerung-text p { color: var(--tinte-sanft); margin-bottom: 8px; }
.match-erklaerung-text p:last-child { margin-bottom: 0; }
.match-erklaerung-text strong { color: var(--tinte); }
.match-erklaerung-text .legende { display: inline; }
.match-erklaerung-text .legende .ja   { color: #4c6136; font-weight: 700; }
.match-erklaerung-text .legende .halb { color: #8a6716; font-weight: 700; }
.match-erklaerung-text .legende .nein { color: #96442a; font-weight: 700; }

/* ── Budget-Zeile mit Vergleichsbalken ── */

.budget-zeile { margin: 10px 0 12px; }
.budget-zeile .zahlen {
  display: flex;
  justify-content: space-between;
  font-size: .86rem;
  margin-bottom: 5px;
}
.budget-zeile .zahlen b { font-size: .95rem; }
.budget-diff { color: var(--salbei); font-weight: 700; }
.budget-diff.knapp { color: var(--terracotta-tief); }

.balken {
  height: 7px;
  border-radius: 99px;
  background: var(--linie);
  overflow: hidden;
}
.balken > div {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--salbei), var(--gold) 85%, var(--terracotta));
}

/* Hinweis-Band „knapp über Budget" */
.knapp-band {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--terracotta-tief);
  background: rgba(192, 83, 43, .12);
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 8px;
}

/* ── „Warum passt es"-Häkchenliste ── */

.warum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.warum span {
  font-size: .78rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--papier);
  border: 1px solid var(--linie);
}
.warum .ja    { color: #4c6136; border-color: #b6c4a4; background: #eef2e6; }
.warum .halb  { color: #8a6716; border-color: #dcc68e; background: #f8f0dc; }
.warum .nein  { color: #96442a; border-color: #e0b6a4; background: #f8e8e0; text-decoration: line-through; opacity: .75; }

.karte-notiz { font-size: .9rem; color: var(--tinte-sanft); font-style: italic; }

/* ── Aufklappbare Details ── */

details { margin-top: 12px; border-top: 1px dashed var(--linie); padding-top: 10px; }
summary {
  cursor: pointer;
  font-size: .84rem;
  font-weight: 700;
  color: var(--terracotta-tief);
  letter-spacing: .03em;
  list-style: none;
}
summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
summary::-webkit-details-marker { display: none; }

.detail-tabelle { margin-top: 8px; font-size: .85rem; display: grid; gap: 6px; }
.detail-tabelle div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.detail-tabelle dt { font-weight: 700; color: var(--tinte-sanft); }
.detail-tabelle dd { margin: 0; }

/* ── Leerer Zustand: kein Land passt ── */

.leer {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  border: 2px dashed var(--linie);
  border-radius: 14px;
  color: var(--tinte-sanft);
}
.leer .gross { font-size: 2.4rem; margin-bottom: 10px; }
.leer h3 { font-family: "Fraunces", serif; color: var(--tinte); margin-bottom: 6px; }

/* ════════════════ FUSSBEREICH ════════════════ */

.fusszeile {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  border-top: 3px double var(--linie);
  font-size: .86rem;
  color: var(--tinte-sanft);
}
.fusszeile a { color: var(--terracotta-tief); }
.fusszeile-klein { margin-top: 10px; font-size: .78rem; opacity: .8; }
.fusszeile-links { margin-top: 14px; font-size: .84rem; letter-spacing: .02em; }

/* ════════════════ RECHTSSEITEN (Impressum & Datenschutz) ════════════════ */

.hero-klein { padding-bottom: 28px; }
.hero-klein h1 { font-size: clamp(2rem, 5vw, 3rem); }
.zurueck { color: var(--terracotta); text-decoration: none; letter-spacing: .06em; }
.zurueck:hover { text-decoration: underline; }

.rechtsseite {
  max-width: 720px;                 /* schmalere Textspalte liest sich besser */
  margin: 0 auto;
  padding: 36px 24px 56px;
}
.rechtsseite section { margin-bottom: 26px; }
.rechtsseite h2 {
  font-family: "Fraunces", serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.rechtsseite p, .rechtsseite li { color: var(--tinte-sanft); font-size: .96rem; }
.rechtsseite strong { color: var(--tinte); }
.rechtsseite ul { padding-left: 22px; display: grid; gap: 6px; }
.rechtsseite a { color: var(--terracotta-tief); }
.rechtsseite-stand { font-size: .8rem; opacity: .7; margin-top: 8px; }
