/* ============================================================
   Lokale Fonts (DSGVO-sauber) — via Google Web Fonts Helper
   ============================================================ */

/* Zilla Slab */
@font-face {
  font-family: 'Zilla Slab';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/zilla-slab-500.woff2') format('woff2');
}

@font-face {
  font-family: 'Zilla Slab';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/zilla-slab-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Zilla Slab';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/zilla-slab-700.woff2') format('woff2');
}

/* PT Sans */
@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/pt-sans-400.woff2') format('woff2');
}

@font-face {
  font-family: 'PT Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/pt-sans-700.woff2') format('woff2');
}

/* Material Symbols Outlined */
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url('/fonts/material-symbols-outlined.woff2') format('woff2');
}

/* Basis-Klasse fuer Icon-Rendering (kam frueher von Google, jetzt lokal) */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   cultours.css  —  Redesign-Stylesheet fuer cultours.app
   Geladen NACH dem Inline-<style> der index.html -> ueberschreibt.
   Statische Gestaltung hier; die dynamische KATEGORIEFARBE setzt
   renderCard() in der index.html per Inline-Style (pro POI).
   System-Funktionen nutzen --system (#001976), POIs ihre Kat.-Farbe.
   ============================================================ */

/* ---------- 1. Flaechen ---------- */
body { background: var(--bg); }
#map { background: var(--bg); }

/* ---------- 2. Header (System) ---------- */
.brand h1 {
  font-family: var(--font-display);
  color: var(--system);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0;
}
.brand .tag { font-family: var(--font-body); }

/* ---------- 3. Allgemeine Radien (5px) ---------- */
.search-box,
.ctrl-btn,
.chip,
.filter-panel,
.tour-panel,
.endpoint-row,
.ep-picker,
.search-results,
.status-pill,
.toast { border-radius: var(--radius); }

/* ---------- 4. Popup-Rahmen ---------- */
.leaflet-popup-content-wrapper { border-radius: var(--radius); background: var(--bg-surface); }
.leaflet-popup-content { width: 300px !important; font-family: var(--font-body); }

/* ---------- 5. POI-Card ---------- */
.poi-card { font-size: 14px; line-height: 1.5; background: var(--bg-surface); }
.poi-card .img-wrap { position: relative; height: 160px; }
.poi-card .body { padding: 16px; }
.poi-card .body.no-image { padding-top: 16px; }

.poi-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  margin: 0 0 12px;
}

.poi-card p {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

/* ---------- 6. Kategorie-Chip (Farbe per Inline-Style) ---------- */
.poi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.poi-chip .mi { font-size: 16px; }
/* Im Bild -> ueber das Foto gelegt. Ohne Bild -> normal im Body-Fluss. */
.poi-card .img-wrap .poi-chip { position: absolute; bottom: 10px; left: 10px; }
.poi-card .body > .poi-chip { margin: 0 0 12px; }

/* ---------- 7. Meta-Block ---------- */
.poi-card .meta {
  display: flex; flex-direction: column; gap: 10px;
  margin: 0 0 16px; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.poi-card .meta-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink-muted);
}
.poi-card .meta-row .mi { font-size: 18px; flex-shrink: 0; }
.poi-card .meta-row a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 8. Buttons ---------- */
.poi-card .actions { display: flex; gap: 8px; }
.poi-card .btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 700; letter-spacing: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.poi-card .btn .mi { font-size: 16px; }
.poi-card .btn.primary { color: #fff; }
.poi-card .btn:hover { filter: brightness(0.95); }

/* ---------- 9. System-Akzente (#001976) ---------- */
.ctrl-btn:hover { border-color: var(--system); color: var(--system); }
.chip.active { border-color: var(--system); }
.search-box:focus-within { border-color: var(--system); }

/* ---------- 10. Typografie-Feinschliff ---------- */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
.poi-card p { line-height: 1.6; }

/* ---------- 11. Control-Icons (Material Symbols) ---------- */
.mi { vertical-align: middle; line-height: 1; }
.search-box .mi { font-size: 20px; color: var(--ink-soft); }
.ctrl-btn .mi { font-size: 24px; }
.tour-head-actions .mi { font-size: 18px; }
.tour-mode .mi { font-size: 24px; }
/* Alle Material-Icons im Tour-Panel einheitlich 24px (id schlaegt die Klassen oben) */
#tour-panel .mi { font-size: 24px; }

/* ---------- 12. Kontrast: schwebende Flaechen vom Karten-Layer abheben ---------- */
header { box-shadow: var(--shadow-soft); }
.search-box,
.ctrl-btn {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.leaflet-popup-content-wrapper { box-shadow: var(--shadow); }

/* ---------- 13. Suche im Header ---------- */
.header-left { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.header-search { position: relative; width: 300px; max-width: 42vw; }
.header-search .search-inner { position: relative; width: 100%; }
.header-search .search-box { width: 100%; }
.header-search .search-results {
  position: absolute;   /* aus dem Header-Fluss loesen -> Header-Hoehe bleibt fix */
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin-top: 0;        /* ueberschreibt das inline margin-top:6px */
  z-index: 1200;        /* ueber overlay-controls (1000) und filter-panel (1001) */
}
.header-search .mi { font-size: 20px; }
/* Overlay enthaelt jetzt nur noch Tour/Filter -> rechts */
.overlay-controls { justify-content: flex-end; }

/* ---------- 14. Icon-Groessen ---------- */
.filter-chips .mi,
.filter-chips .cat-icon { font-size: 16px; }

/* ---------- 15. Zoom unten rechts + Location-FAB darueber ---------- */
/* Inline-Regel hob den Zoom nach oben-links; hier zurueck nach unten-rechts. */
.leaflet-control-zoom {
  margin: 0 10px 10px 0 !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  width: 44px !important;
  height: 44px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-soft) !important;
  color: var(--ink) !important;
  font-size: 0 !important;        /* versteckt das Standard +/- */
  border-bottom: none !important; /* Leaflet-Separator entfernen */
}

.leaflet-control-zoom-in::before,
.leaflet-control-zoom-out::before {
  font-family: 'Material Symbols Outlined';
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  font-weight: normal;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
}

.leaflet-control-zoom-in::before { content: "add"; }
.leaflet-control-zoom-out::before { content: "remove"; }

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
  color: var(--system) !important;
  border-color: var(--system) !important;
}

.leaflet-control-zoom-in:hover::before,
.leaflet-control-zoom-out:hover::before {
  color: var(--system);
}
.map-fab {
  position: absolute;
  right: 10px;
  bottom: 110px;           /* 44+4+44 Zoom + 10 Margin + 8 Gap */
  z-index: 1000;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  cursor: pointer;
}
.map-fab .material-symbols-outlined {
  font-size: 24px;
  font-weight: normal;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.map-fab:hover { color: var(--system); border-color: var(--system); }

/* ---------- 16. Popup-Close: Material-Icon, korrekt positioniert ---------- */
.leaflet-popup-close-button {
  top: 8px !important;
  right: 8px !important;
  width: 28px; height: 28px;
  padding: 0 !important;
  display: flex !important;
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  font-size: 0 !important;            /* verstecke das Text-x */
  color: var(--ink) !important;
}
.leaflet-popup-close-button::after {
  content: "close";
  font-family: 'Material Symbols Outlined';
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  font-size: 20px;
  line-height: 1;
}
.leaflet-popup-close-button:hover::after { color: var(--system); }

/* ============================================================
   Modal Overlay (Credits)
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.credits-modal {
  width: 100%;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  color: var(--system);
  font-family: var(--font-display);
  font-size: 24px;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--system);
  border-radius: 50%;
  transition: background 0.2s;
}

.modal-close:hover {
  background: rgba(0, 25, 118, 0.1);
}

.modal-body {
  overflow-y: auto;
  padding: 1.5rem;
  flex: 1;
}

.modal-body h3 {
  color: var(--system);
  font-family: var(--font-display);
  font-size: 18px;
  margin: 1.5rem 0 0.75rem 0;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.license-block {
  background: var(--bg);
  padding: 1rem;
  border-left: 3px solid var(--system);
  margin: 1rem 0;
  font-size: 0.9rem;
  border-radius: 3px;
}

.license-block a {
  color: var(--system);
  text-decoration: underline;
}

.license-block a:hover {
  color: var(--system-hover);
}

.modal-body p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #666;
}

/* Mobile */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.5rem;
  }
  
  .modal-content {
    max-height: 90vh;
  }
  
  .modal-header {
    padding: 1rem;
  }
  
  .modal-header h2 {
    font-size: 20px;
  }
  
  .modal-body {
    padding: 1rem;
  }
}
