/*
  Zwei umschaltbare Designs für App und Web-App:
    - "natur"  (Standard): Waldgrün, Senf, Terrakotta auf warmem Creme – Landhaus-Charme
    - "modern":            Navy, Koralle, Sand – klar und zeitgemäß
  Das aktive Design steht als data-theme am <html>-Element (gesetzt von js/theme.js,
  bevor die Seite gezeichnet wird). Ohne Attribut gilt "natur".

  Die Datei wird NACH classical.css und app.css geladen: Oben stehen die Tokens je
  Design, darunter die Formen (gefüllte Pillen-Buttons, Karten, Kacheln), die für
  beide Designs gelten. Im Markup steht weiterhin kein Hex-Wert.

  Die frühere Fassung ("Classical") liegt im Git-Tag ui-backup-classical-2026-10-06.
*/

/* ── Design "natur" (Standard) ─────────────────────────────────────────── */

:root,
:root[data-theme="natur"] {
  --color-bg: #f6f1e7;
  --color-surface: #fffaf1;
  --color-text: #3a2e25;
  --color-accent: #5f7d45;
  --color-divider: color-mix(in srgb, #3a2e25 14%, transparent);

  --color-accent-100: #eef2e6;
  --color-accent-200: #dbe5cc;
  --color-accent-300: #bfcea3;
  --color-accent-400: #9db27c;
  --color-accent-500: #7c965c;
  --color-accent-600: #5f7d45;
  --color-accent-700: #4a6436;
  --color-accent-800: #36492a;
  --color-accent-900: #25321d;

  --color-neutral-100: #f9f5ed;
  --color-neutral-200: #f0e9dc;
  --color-neutral-300: #e3d9c7;
  --color-neutral-400: #ccbfa9;
  --color-neutral-500: #aa9e89;
  --color-neutral-600: #867a67;
  --color-neutral-700: #665c4c;
  --color-neutral-800: #483f34;
  --color-neutral-900: #2f2922;

  /* "Für dich" und Hervorhebungen: Senf */
  --color-gold: #c9973a;
  --color-gold-100: #fbf1dc;
  --color-gold-300: #ecc97c;
  --color-gold-700: #8a6418;
  --color-gold-800: #5f440f;

  /* Zweitakzent: Terrakotta */
  --color-secondary: #c4673f;
  --color-secondary-100: #f8e6dd;

  /* Rollen */
  --btn-primary-bg: #4a6436;
  --btn-primary-fg: #ffffff;
  --btn-accent-bg: #c9973a;
  --btn-accent-fg: #ffffff;
  --header-bg: linear-gradient(160deg, #36492a 0%, #5f7d45 55%, #8a6a3a 100%);
  --header-fg: #fffaf1;
  --tagline-font: "Caveat", "Segoe Script", cursive;
  --tagline-size: 30px;

  --font-heading: "Lora", Georgia, "Times New Roman", serif;
  --font-heading-weight: 600;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #3a2e25 12%, transparent);
  --shadow-md: 0 4px 14px color-mix(in srgb, #3a2e25 14%, transparent);
  --shadow-lg: 0 14px 34px color-mix(in srgb, #3a2e25 22%, transparent);
}

/* ── Design "modern" ───────────────────────────────────────────────────── */

:root[data-theme="modern"] {
  --color-bg: #faf6f0;
  --color-surface: #ffffff;
  --color-text: #1d2330;
  --color-accent: #1f3a5f;
  --color-divider: color-mix(in srgb, #1d2330 12%, transparent);

  --color-accent-100: #e8eef6;
  --color-accent-200: #cdd9ea;
  --color-accent-300: #a3b8d5;
  --color-accent-400: #7290bb;
  --color-accent-500: #46699c;
  --color-accent-600: #2d507f;
  --color-accent-700: #1f3a5f;
  --color-accent-800: #172c48;
  --color-accent-900: #101f33;

  --color-neutral-100: #f6f3ee;
  --color-neutral-200: #ede8e0;
  --color-neutral-300: #e0d9ce;
  --color-neutral-400: #c7bfb2;
  --color-neutral-500: #a39b8f;
  --color-neutral-600: #7f786e;
  --color-neutral-700: #5f5950;
  --color-neutral-800: #403c36;
  --color-neutral-900: #24221f;

  /* "Für dich": Pfirsich/Koralle */
  --color-gold: #ef7b5a;
  --color-gold-100: #fdeee7;
  --color-gold-300: #f6b9a1;
  --color-gold-700: #b4502f;
  --color-gold-800: #7d351d;

  --color-secondary: #ef7b5a;
  --color-secondary-100: #fde7de;

  --btn-primary-bg: #ef7b5a;
  --btn-primary-fg: #ffffff;
  --btn-accent-bg: #1f3a5f;
  --btn-accent-fg: #ffffff;
  --header-bg: linear-gradient(160deg, #101f33 0%, #1f3a5f 50%, #b4502f 120%);
  --header-fg: #ffffff;
  --tagline-font: "Poppins", "Segoe UI", system-ui, sans-serif;
  --tagline-size: 24px;

  --font-heading: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #1d2330 10%, transparent);
  --shadow-md: 0 6px 18px color-mix(in srgb, #1d2330 12%, transparent);
  --shadow-lg: 0 16px 36px color-mix(in srgb, #1d2330 20%, transparent);
}

/* ══ Formen – gelten für beide Designs ════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 { letter-spacing: -0.01em; }

/* — Buttons: gefüllte Pillen statt reiner Kontur — */
.btn {
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: 999px;
  padding: var(--space-2) calc(var(--space-3) * 1.4);
}

.btn-primary {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  box-shadow: var(--shadow-sm);
}
.btn-primary:active { background: color-mix(in srgb, var(--btn-primary-bg) 82%, #000); }

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-neutral-400);
  color: var(--color-text);
}

.btn-ghost { border-radius: 999px; }
.btn-icon { border-radius: 999px; padding: 0; }

/* — Chips (Zeitraum) — */
.chip {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--color-surface);
  border-color: var(--color-neutral-300);
}
.chip.is-active {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

.tag { border-radius: 999px; }
.input, .search-field { border-radius: 999px; }

/* — Kopfbereich mit Spruch — */
.app-header {
  background: var(--header-bg);
  color: var(--header-fg);
  border-bottom: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 2;
}

.app-header .kicker,
.app-header .place-radius { color: color-mix(in srgb, var(--header-fg) 75%, transparent); }

.app-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.app-tagline {
  font-family: var(--tagline-font);
  font-size: var(--tagline-size);
  font-weight: 700;
  line-height: 1.05;
  margin: 6px 0 12px;
}

/* Je Design ist nur der passende Spruch sichtbar. */
.app-tagline .tagline-modern { display: none; }
:root[data-theme="modern"] .app-tagline .tagline-natur { display: none; }
:root[data-theme="modern"] .app-tagline .tagline-modern { display: inline; }

.app-header .search-field {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.app-header .btn-secondary {
  background: color-mix(in srgb, var(--header-fg) 16%, transparent);
  border-color: color-mix(in srgb, var(--header-fg) 45%, transparent);
  color: var(--header-fg);
}

.app-header .chip {
  background: color-mix(in srgb, var(--header-fg) 14%, transparent);
  border-color: color-mix(in srgb, var(--header-fg) 40%, transparent);
  color: var(--header-fg);
}
.app-header .chip.is-active {
  background: var(--btn-accent-bg);
  border-color: var(--btn-accent-bg);
  color: var(--btn-accent-fg);
}

/* — Umschalter für das Design — */
.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--header-fg) 45%, transparent);
  background: color-mix(in srgb, var(--header-fg) 14%, transparent);
  color: var(--header-fg);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.theme-toggle-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: conic-gradient(var(--btn-accent-bg) 0 50%, var(--color-secondary) 50% 100%);
  border: 1.5px solid var(--header-fg);
}

/* — Kategorien als farbige Kacheln mit Symbol — */
.category-band { border-bottom: 0; padding-top: 16px; }

.category-tile {
  flex: none;
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
}

.category-tile-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: var(--shadow-sm);
  border: 3px solid transparent;
}

.category-tile.is-active .category-tile-icon {
  border-color: var(--btn-primary-bg);
  box-shadow: 0 0 0 2px var(--color-surface), var(--shadow-md);
}

.category-tile-label {
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  line-height: 1.15;
}

.category-tile.is-active .category-tile-label { color: var(--btn-primary-bg); }

/* — Abschnitte — */
.section { border-bottom: 0; }
.section-title { border-left-color: var(--color-secondary); border-left-width: 3px; }

/* — Karten — */
.nearby-card {
  background: var(--color-surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.nearby-thumb { position: relative; border-bottom: 0; }

.foryou-wrap { border-bottom: 0; }
.foryou { border-radius: var(--radius-lg); border-width: 0; box-shadow: var(--shadow-sm); }

.results { background: var(--color-bg); }
.results-head { background: var(--color-bg); border-bottom: 0; z-index: 3; }

.result-row {
  background: var(--color-surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.result-thumb {
  position: relative;
  border: 0;
  border-radius: var(--radius-md);
  width: 84px;
  height: 84px;
}

/* — Datums-Kästchen auf Vorschaubildern ("23 / Jun") — */
.date-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 34px;
  padding: 3px 5px 4px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}
.date-badge-day { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.date-badge-month { font-size: 9.5px; font-weight: 700; text-transform: uppercase; color: var(--color-secondary); margin-top: 2px; }

/* — Tab-Leiste — */
.tabbar { border-top: 0; box-shadow: 0 -4px 14px color-mix(in srgb, var(--color-text) 8%, transparent); }
.tab { border-right: 0; }
.tab.is-active { background: transparent; color: var(--btn-primary-bg); }
.tab.is-active .tab-rule { background: var(--btn-primary-bg); border-radius: 0 0 3px 3px; }
.tab-label { font-family: var(--font-body); font-weight: 700; letter-spacing: 0.01em; }

/* — Sheets, Segmente, Detailseite, Merkliste — */
.sheet-head { border-bottom: 0; }
.segment { border-radius: 999px; }
.segment-option.is-active { background: var(--btn-primary-bg); color: var(--btn-primary-fg); }
.segment-option { font-family: var(--font-body); font-weight: 700; }

.detail-back { border-radius: 999px; box-shadow: var(--shadow-sm); }
.detail-hero-placeholder, .detail-hero img { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.spec-grid, .map-placeholder { border-radius: var(--radius-md); background: var(--color-surface); }
.similar, .saved-header { border-color: transparent; }
.saved-header { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.similar-thumb { border: 0; border-radius: var(--radius-md); }
.detail-ai-stamp { color: var(--color-secondary); font-weight: 700; }

/* — Profil: Design-Auswahl — */
.theme-choice { margin-top: 10px; max-width: 320px; }

/* — Kachelfarben je Design (Reihenfolge = Kategorien-Band) — */
:root, :root[data-theme="natur"] {
  --tile-1: #5f7d45; --tile-2: #c9973a; --tile-3: #c4673f; --tile-4: #7a5c45;
  --tile-5: #8aa070; --tile-6: #b07d2a; --tile-7: #a5522f; --tile-8: #36492a;
}
:root[data-theme="modern"] {
  --tile-1: #ef7b5a; --tile-2: #1f3a5f; --tile-3: #f2a06e; --tile-4: #46699c;
  --tile-5: #d0613f; --tile-6: #2d507f; --tile-7: #e9b48c; --tile-8: #101f33;
}
.category-tile:nth-child(8n+1) .category-tile-icon { background: var(--tile-1); }
.category-tile:nth-child(8n+2) .category-tile-icon { background: var(--tile-2); }
.category-tile:nth-child(8n+3) .category-tile-icon { background: var(--tile-3); }
.category-tile:nth-child(8n+4) .category-tile-icon { background: var(--tile-4); }
.category-tile:nth-child(8n+5) .category-tile-icon { background: var(--tile-5); }
.category-tile:nth-child(8n+6) .category-tile-icon { background: var(--tile-6); }
.category-tile:nth-child(8n+7) .category-tile-icon { background: var(--tile-7); }
.category-tile:nth-child(8n+8) .category-tile-icon { background: var(--tile-8); }

/* — Symbolbilder (frei lizenziert, siehe img/motive/QUELLEN.md) — */
.motif-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nearby-thumb .motif-img,
.result-thumb .motif-img { position: absolute; inset: 0; }
.date-badge { z-index: 1; }
.similar-thumb { overflow: hidden; position: relative; }

.detail-hero-motif { position: relative; overflow: hidden; padding: 0; background: var(--color-surface); }
.detail-hero-motif img { width: 100%; height: 100%; object-fit: cover; }

.motif-label {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, #000 55%, transparent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* Kategorie-Kacheln: Linien-Symbol statt Emoji */
.category-tile-icon .icon { display: block; }

/* — Karten-Reiter (Leaflet) — */
.map-header { flex: none; }
.map-screen { flex: 1; position: relative; min-height: 0; display: flex; flex-direction: column; }
.event-map { flex: 1; min-height: 320px; margin: 12px 12px 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); z-index: 0; }
.event-map-radius { stroke: var(--btn-primary-bg); fill: var(--btn-primary-bg); }
.event-map-center { stroke: var(--color-surface); fill: var(--btn-accent-bg); }
.event-pin svg path { fill: var(--btn-primary-bg); stroke: var(--color-surface); stroke-width: 2; }
.event-pin svg circle { fill: var(--color-surface); }
.event-pin { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); }
.event-map-popup { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-body); font-size: 12.5px; min-width: 170px; }
.event-map-popup strong { font-family: var(--font-heading); font-size: 15px; line-height: 1.2; margin: 2px 0; }
.event-map-popup-cat { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-secondary); }
.event-map-popup a { margin-top: 6px; font-weight: 700; color: var(--btn-primary-bg); }
.leaflet-container { font-family: var(--font-body); }


/* — Karte: Button im Kopf rechts neben Ort/Umkreis, Zurück auf der Kartenseite — */
.place-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.place-row .place-button { min-width: 0; flex: 1; flex-wrap: wrap; text-align: left; }
.map-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--header-fg) 45%, transparent);
  background: color-mix(in srgb, var(--header-fg) 14%, transparent);
  color: var(--header-fg);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}
.map-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--btn-primary-bg);
  text-decoration: none;
}

/* — Einheitliche Karten: gleiche Bildhöhe, Titel max. 2 Zeilen, Infozeile 1 Zeile — */
.nearby-card {
  display: flex;
  flex-direction: column;
  height: 222px;
  padding: 0;
}
.nearby-thumb { display: block; flex: none; height: 118px; overflow: hidden; }
.nearby-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 10px 12px 12px;
}
.nearby-title,
.result-title,
.foryou-item-title,
.similar-title,
.saved-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.nearby-title { font-size: 16px; line-height: 1.25; }
.nearby-meta,
.result-when,
.result-where,
.similar-meta,
.saved-meta {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nearby-meta { margin-top: auto; padding-top: 6px; }
.result-title { font-size: 17px; line-height: 1.25; }
.result-body { display: flex; flex-direction: column; min-width: 0; }

/* — Kopf beim Scrollen verkleinern (js/discover-scroll.js setzt data-header-compact) — */
.header-collapse {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition: grid-template-rows 0.32s ease, opacity 0.24s ease;
}
.header-collapse-inner { min-height: 0; overflow: hidden; }
:root[data-header-compact] .header-collapse {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}
.app-header { transition: padding 0.32s ease; }
:root[data-header-compact] .app-header { padding-bottom: 12px; }
:root[data-header-compact] .place-row { margin-top: -4px; }

/* Die Liste ist Bezugspunkt für offsetTop (Sprung an den Anfang der Treffer). */
.app-scroll { position: relative; }

/* — Button "Zum Anfang der Eventliste" — */
.to-top {
  position: absolute;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 5;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  cursor: pointer;
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* — Detailseite: kleine Karte und Quellen-Link — */
.detail-map {
  height: 170px;
  margin-top: 6px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  z-index: 0;
}
.detail-map-caption { margin: 6px 0 0; font-size: 12px; color: var(--color-neutral-600); }
.detail-source a { color: var(--btn-primary-bg); font-weight: 700; text-underline-offset: 2px; word-break: break-word; }
.detail-facts .detail-source { margin: 0; font-size: inherit; color: inherit; }
/* KI-Stempel hinter der Quelle: dezentes Label, in beiden Designs über die Neutraltöne lesbar. */
.detail-ai-stamp {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--color-neutral-200);
  color: var(--color-neutral-700);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
/* Eigener Standort: blaue Nadel, unabhängig vom Design. */
.event-pin-user svg path { fill: #2563eb; }

/* — Griff zum Wiederaufklappen des kompakten Kopfes — */
.header-expand {
  position: absolute;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%) scale(0.8);
  width: 46px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-accent-bg);
  color: var(--btn-accent-fg);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  cursor: pointer;
}
:root[data-header-compact] .header-expand {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

/* Kopf (mit Griff) liegt über der Liste und ihrer mitlaufenden Überschrift. */
.app-header { z-index: 10; }
.sheet-backdrop { z-index: 20; }

/* — Route planen (Detailseite) — */
.route-btn { min-height: 46px; margin-top: 12px; gap: 8px; text-decoration: none; }
