/* ==================================================================
   klettersteigeschweiz.ch — Stylesheet
   ================================================================== */

:root {
  --rot:        #D8232A;
  --rot-dunkel: #A81820;
  --tinte:      #101315;
  --grau-900:   #2A2E31;
  --grau-600:   #6E757A;
  --grau-400:   #A8AEB2;
  --linie:      #DFDEDB;
  --nebel:      #F5F4F2;
  --weiss:      #FFFFFF;

  --schrift: "Helvetica Neue", Helvetica, "Inter", "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", "Roboto Mono", Consolas, monospace;

  --rand: 1px solid var(--linie);
  --breit: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.55;
  color: var(--tinte);
  background: var(--weiss);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tinte); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--rot); }
:focus-visible { outline: 2px solid var(--rot); outline-offset: 2px; }

h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.1; }

.eyebrow {
  font-size: .6875rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--grau-600);
}

.container { max-width: var(--breit); margin: 0 auto; padding: 0 24px; }

/* ---------------- Kopfzeile ---------------- */

.kopf {
  position: sticky; top: 0; z-index: 900;
  background: var(--weiss);
  border-bottom: var(--rand);
}
.kopf-inner {
  max-width: var(--breit); margin: 0 auto; padding: 0 24px;
  height: 58px; display: flex; align-items: center; gap: 20px;
}
.marke { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.03em; font-size: 1.0625rem; }
.marke:hover { color: var(--tinte); }
.kreuz {
  width: 22px; height: 22px; background: var(--rot); position: relative; flex: none; border-radius: 2px;
}
.kreuz::before, .kreuz::after {
  content: ""; position: absolute; background: var(--weiss);
}
.kreuz::before { width: 12px; height: 3.6px; left: 5px; top: 9.2px; }
.kreuz::after  { height: 12px; width: 3.6px; top: 5px; left: 9.2px; }

.kopf-nav { margin-left: auto; display: flex; gap: 22px; font-size: .875rem; }
.kopf-nav a { text-decoration: none; color: var(--grau-600); }
.kopf-nav a:hover, .kopf-nav a[aria-current] { color: var(--tinte); }

/* ---------------- Hero ---------------- */

.hero { position: relative; background: var(--tinte); overflow: hidden; }
.hero img {
  display: block; width: 100%; height: clamp(340px, 62vh, 640px);
  object-fit: cover; object-position: center 45%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,12,14,.82) 0%, rgba(10,12,14,.28) 42%, rgba(10,12,14,0) 70%);
}
.hero-text {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  max-width: var(--breit); margin: 0 auto; padding: 0 24px 34px;
  color: var(--weiss);
}
.hero-text .eyebrow { color: rgba(255,255,255,.72); }
.hero-text h1 {
  font-size: clamp(2rem, 6.4vw, 4rem);
  letter-spacing: -.035em; margin: 10px 0 12px; max-width: 16ch;
}
.hero-text p { margin: 0; max-width: 46ch; font-size: 1.0625rem; color: rgba(255,255,255,.86); }
.hero-regel { width: 56px; height: 4px; background: var(--rot); margin-bottom: 16px; }

/* ---------------- Warnband ---------------- */

.warnband {
  background: var(--rot); color: var(--weiss);
  font-size: .8125rem; line-height: 1.45;
}
.warnband .container { padding-top: 11px; padding-bottom: 11px; display: flex; gap: 12px; align-items: baseline; }
.warnband strong { letter-spacing: .04em; text-transform: uppercase; font-size: .6875rem; white-space: nowrap; }
.warnband a { color: var(--weiss); }

/* ---------------- Werkzeugleiste ---------------- */

.werkzeug { border-bottom: var(--rand); background: var(--nebel); }
.werkzeug .container { padding-top: 18px; padding-bottom: 18px; }

.filterzeile { display: flex; flex-wrap: wrap; gap: 22px 30px; align-items: flex-end; }
.feld { display: flex; flex-direction: column; gap: 7px; }
.feld > label, .feld > .feld-titel { font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--grau-600); }

input[type="search"], select {
  font-family: inherit; font-size: .9375rem; color: var(--tinte);
  background: var(--weiss); border: var(--rand); border-radius: 3px;
  padding: 8px 11px; min-height: 38px;
}
input[type="search"] { width: 220px; }
input[type="range"] { width: 190px; accent-color: var(--rot); }

.wertzeile { font-size: .875rem; color: var(--grau-600); font-variant-numeric: tabular-nums; }
.wertzeile b { color: var(--tinte); font-weight: 700; }

/* --- Signaturelement: die Seil-Skala K1–K6 --- */
.seil { display: flex; align-items: center; gap: 0; position: relative; padding: 4px 0; }
.seil::before {
  content: ""; position: absolute; left: 6px; right: 6px; top: 50%;
  height: 2px; background: var(--grau-400); transform: translateY(-50%);
}
.sprosse {
  position: relative; z-index: 1;
  width: 40px; height: 34px;
  border: 1.5px solid var(--grau-400); border-right-width: 0;
  background: var(--weiss); color: var(--grau-600);
  font-size: .8125rem; font-weight: 700; letter-spacing: .02em;
  cursor: pointer; font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
}
.sprosse:first-child { border-radius: 3px 0 0 3px; }
.sprosse:last-child { border-right-width: 1.5px; border-radius: 0 3px 3px 0; }
.sprosse[aria-pressed="true"] { background: var(--rot); border-color: var(--rot); color: var(--weiss); }
.sprosse[aria-pressed="true"] + .sprosse { border-left-color: var(--rot); }
.sprosse:hover { border-color: var(--rot-dunkel); }

.schalter { display: flex; gap: 8px; }
.schalter button {
  font-family: inherit; font-size: .8125rem; padding: 8px 13px; min-height: 38px;
  border: var(--rand); background: var(--weiss); color: var(--grau-600);
  border-radius: 3px; cursor: pointer;
}
.schalter button[aria-pressed="true"] { border-color: var(--rot); color: var(--rot); font-weight: 700; }

.zuruecksetzen {
  margin-left: auto; align-self: flex-end;
  background: none; border: 0; font-family: inherit; font-size: .8125rem;
  color: var(--grau-600); cursor: pointer; text-decoration: underline;
  text-underline-offset: .2em; padding: 8px 0;
}
.zuruecksetzen:hover { color: var(--rot); }

/* ---------------- Arbeitsfläche ---------------- */

.flaeche {
  display: grid; grid-template-columns: 380px 1fr;
  height: calc(100vh - 58px); min-height: 520px;
}

.liste { border-right: var(--rand); overflow-y: auto; background: var(--weiss); }
.liste-kopf {
  position: sticky; top: 0; background: var(--weiss); border-bottom: var(--rand);
  padding: 13px 20px; display: flex; align-items: baseline; gap: 10px; z-index: 5;
}
.zaehler { font-size: .8125rem; color: var(--grau-600); font-variant-numeric: tabular-nums; }
.zaehler b { color: var(--tinte); }
.sortierung { margin-left: auto; font-size: .8125rem; }
.sortierung select { padding: 4px 6px; min-height: 0; font-size: .8125rem; }

.karte-eintrag {
  display: block; width: 100%; text-align: left; background: none;
  border: 0; border-bottom: var(--rand); padding: 15px 20px;
  font-family: inherit; cursor: pointer;
  border-left: 3px solid transparent;
}
.karte-eintrag:hover { background: var(--nebel); }
.karte-eintrag[aria-current="true"] { border-left-color: var(--rot); background: var(--nebel); }
.karte-eintrag h3 { font-size: 1rem; letter-spacing: -.015em; }
.karte-meta { font-size: .8125rem; color: var(--grau-600); margin-top: 3px; }
.karte-fuss { display: flex; align-items: center; gap: 12px; margin-top: 9px; }

/* Mini-Seil als Schwierigkeitsanzeige */
.miniseil { display: flex; gap: 2px; }
.miniseil span {
  width: 13px; height: 5px; background: var(--linie); border-radius: 1px;
}
.miniseil span.an.leicht { background: #E9908C; }
.miniseil span.an.mittel { background: var(--rot); }
.miniseil span.an.schwer { background: var(--tinte); }
.grad-text { font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--rot); }
.grad-text.leicht { color: #C25551; }
.grad-text.schwer { color: var(--tinte); }
.eyebrow.schwer { color: var(--tinte); }
.zeit-text { font-size: .75rem; color: var(--grau-600); font-variant-numeric: tabular-nums; }

.leer { padding: 40px 20px; color: var(--grau-600); font-size: .9375rem; }
.leer b { display: block; color: var(--tinte); margin-bottom: 6px; }

/* ---------------- Leaflet-Karte ---------------- */

#karte { height: 100%; width: 100%; background: var(--nebel); }
.leaflet-container { font-family: var(--schrift); }

/* Punkte: drei Stufen, gebaut nur aus Rot, Weiss und Tinte.
   leicht = offener Punkt, mittel = voll rot, schwer = dunkel mit rotem Ring. */
.punkt {
  width: 18px; height: 18px; border-radius: 50%;
  box-shadow: 0 1px 5px rgba(16,19,21,.45);
  transition: transform .14s ease;
}
.punkt.leicht { background: var(--weiss); border: 4px solid var(--rot); }
.punkt.mittel { background: var(--rot);   border: 3px solid var(--weiss); }
.punkt.schwer { background: var(--tinte); border: 3px solid var(--rot); }
.punkt.aktiv  { transform: scale(1.5); box-shadow: 0 0 0 6px rgba(216,35,42,.28), 0 2px 8px rgba(16,19,21,.5); }
.leaflet-marker-icon:hover .punkt { transform: scale(1.25); }

.punkt-hinweis.leaflet-tooltip {
  background: var(--tinte); color: var(--weiss); border: 0; border-radius: 3px;
  font-size: .75rem; line-height: 1.35; padding: 6px 9px; box-shadow: 0 3px 10px rgba(16,19,21,.35);
}
.punkt-hinweis.leaflet-tooltip::before { border-top-color: var(--tinte); }

/* Legende */
.legende {
  background: rgba(255,255,255,.94); border: var(--rand); border-radius: 3px;
  padding: 10px 12px 9px; box-shadow: 0 2px 10px rgba(16,19,21,.10);
  font-size: .75rem; line-height: 1.3; color: var(--grau-900);
  backdrop-filter: blur(3px);
}
.legende-titel {
  margin: 0 0 7px; font-size: .625rem; letter-spacing: .14em;
  text-transform: uppercase; font-weight: 700; color: var(--grau-600);
}
.legende-zeile { margin: 0 0 5px; display: flex; align-items: center; gap: 8px; }
.legende-zeile .punkt { width: 13px; height: 13px; border-width: 2.5px; box-shadow: none; flex: none; }
.legende-fuss { margin: 7px 0 0; padding-top: 7px; border-top: var(--rand); color: var(--grau-600); font-size: .6875rem; }

.kartenwahl {
  position: absolute; z-index: 500; right: 12px; top: 12px;
  display: flex; background: var(--weiss); border: var(--rand); border-radius: 3px;
  overflow: hidden; box-shadow: 0 2px 10px rgba(16,19,21,.10);
}
.kartenwahl button {
  font-family: inherit; font-size: .75rem; padding: 7px 12px; border: 0;
  background: var(--weiss); color: var(--grau-600); cursor: pointer;
}
.kartenwahl button + button { border-left: var(--rand); }
.kartenwahl button[aria-pressed="true"] { background: var(--rot); color: var(--weiss); font-weight: 700; }

.kartenraum { position: relative; }

/* Leaflet-Bedienelemente an die Seite angleichen */
.leaflet-control-zoom a {
  border-radius: 3px !important; color: var(--tinte) !important;
  border-color: var(--linie) !important; font-weight: 400;
}
.leaflet-control-zoom a:hover { color: var(--rot) !important; }
.leaflet-control-scale-line {
  border-color: var(--grau-400); color: var(--grau-900);
  background: rgba(255,255,255,.85); font-size: .6875rem;
}
.leaflet-control-attribution {
  font-size: .6875rem !important; background: rgba(255,255,255,.85) !important;
}

/* ---------------- Detailtafel ---------------- */

.tafel {
  position: fixed; z-index: 1000; top: 58px; right: 0; bottom: 0; width: 440px;
  background: var(--weiss); border-left: var(--rand);
  box-shadow: -8px 0 28px rgba(16,19,21,.10);
  overflow-y: auto; transform: translateX(102%);
  transition: transform .26s cubic-bezier(.4,0,.2,1);
}
.tafel[data-offen="true"] { transform: none; }

.tafel-kopf { padding: 22px 26px 18px; border-bottom: var(--rand); position: relative; }
.tafel-kopf h2 { font-size: 1.4375rem; letter-spacing: -.03em; padding-right: 40px; }
.tafel-ort { color: var(--grau-600); font-size: .875rem; margin-top: 5px; }
.schliessen {
  position: absolute; top: 18px; right: 20px; width: 32px; height: 32px;
  border: var(--rand); background: var(--weiss); border-radius: 3px;
  cursor: pointer; font-size: 1.125rem; line-height: 1; color: var(--grau-600);
}
.schliessen:hover { border-color: var(--rot); color: var(--rot); }

.tafel-inhalt { padding: 20px 26px 46px; }

.daten { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--linie); border: var(--rand); border-radius: 3px; overflow: hidden; margin-bottom: 22px; }
.daten div { background: var(--weiss); padding: 11px 13px; }
.daten dt { font-size: .625rem; letter-spacing: .13em; text-transform: uppercase; color: var(--grau-600); font-weight: 700; }
.daten dd { margin: 3px 0 0; font-size: .9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.tafel-inhalt h3 { font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; color: var(--grau-600); margin: 24px 0 9px; }
.tafel-inhalt p { margin: 0 0 12px; font-size: .9375rem; }

.sperrhinweis {
  border-left: 3px solid var(--rot); background: var(--nebel);
  padding: 11px 14px; font-size: .875rem; margin: 0 0 18px;
}
.sperrhinweis strong { display: block; font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rot); margin-bottom: 4px; }

.linkliste { list-style: none; margin: 0; padding: 0; }
.linkliste li { border-top: var(--rand); }
.linkliste li:last-child { border-bottom: var(--rand); }
.linkliste a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 2px; text-decoration: none; font-size: .9375rem; }
.linkliste a::after { content: "→"; color: var(--grau-400); }
.linkliste a:hover::after { color: var(--rot); }

.quellenzeile { font-size: .75rem; color: var(--grau-600); margin-top: 20px; line-height: 1.5; }

.tafel-warnung {
  margin-top: 24px; border: 1.5px solid var(--rot); border-radius: 3px;
  padding: 13px 15px; font-size: .8125rem; line-height: 1.5;
}
.tafel-warnung strong { display: block; color: var(--rot); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 5px; }

/* ---------------- Textseiten ---------------- */

.textseite { max-width: 720px; margin: 0 auto; padding: 52px 24px 80px; }
.textseite h1 { font-size: clamp(1.75rem, 4.4vw, 2.5rem); margin-bottom: 8px; }
.textseite h2 { font-size: 1.125rem; margin: 34px 0 10px; }
.textseite p, .textseite li { font-size: .9375rem; color: var(--grau-900); }
.textseite ul { padding-left: 20px; }
.textseite .stand { color: var(--grau-600); font-size: .8125rem; margin-top: 4px; }

/* ---------------- Fusszeile ---------------- */

.fuss { border-top: var(--rand); background: var(--nebel); padding: 30px 0; font-size: .8125rem; color: var(--grau-600); }
.fuss .container { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; }
.fuss nav { display: flex; gap: 20px; }
.fuss a { color: var(--grau-600); }
.fuss .rechts { margin-left: auto; }

/* ---------------- Mobil ---------------- */

.mobilwahl { display: none; }

@media (max-width: 1080px) {
  .tafel { width: 400px; }
}

@media (max-width: 860px) {
  .kopf-nav { display: none; }

  .werkzeug .container { padding-top: 14px; padding-bottom: 14px; }
  .filterzeile { gap: 16px 20px; }
  input[type="search"] { width: 100%; }
  .feld:has(input[type="search"]) { flex: 1 1 100%; }
  input[type="range"] { width: 100%; }
  .feld:has(input[type="range"]) { flex: 1 1 46%; }
  .sprosse { width: 100%; min-width: 0; }
  .seil { width: 100%; }
  .feld:has(.seil) { flex: 1 1 100%; }
  .zuruecksetzen { margin-left: 0; }

  /* Karte / Liste als Register */
  .mobilwahl {
    display: flex; border-bottom: var(--rand); background: var(--weiss);
    position: sticky; top: 58px; z-index: 600;
  }
  .mobilwahl button {
    flex: 1; font-family: inherit; font-size: .875rem; font-weight: 700;
    padding: 12px 0; border: 0; background: var(--weiss); color: var(--grau-600);
    cursor: pointer; border-bottom: 3px solid transparent;
  }
  .mobilwahl button[aria-pressed="true"] { color: var(--tinte); border-bottom-color: var(--rot); }

  .flaeche { grid-template-columns: 1fr; height: calc(100vh - 58px - 47px); }
  .liste { border-right: 0; }
  .flaeche[data-ansicht="karte"] .liste { display: none; }
  .flaeche[data-ansicht="liste"] .kartenraum { display: none; }

  .tafel { top: 0; width: 100%; border-left: 0; }
  .hero-text { padding-bottom: 26px; }
  .warnband .container { flex-direction: column; gap: 4px; }
  .daten { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .container, .kopf-inner { padding-left: 16px; padding-right: 16px; }
  .tafel-kopf, .tafel-inhalt { padding-left: 18px; padding-right: 18px; }
}
