/* ==========================================================================
   VeloKal – Stylesheet
   Halb-Dark-Theme · reduziertes Grunddesign · selbst gehostete Schriften
   Akzent: Rennrad-Rot #E63946
   ========================================================================== */

/* --- Schriften (selbst gehostet, kein externer CDN / DSGVO-freundlich) --- */
@font-face {
    font-family: "Inter";
    src: url("fonts/inter.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
    font-style: normal;
}
@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
    font-style: normal;
}

:root, :root[data-theme="dark"] {
    /* Halb-Dark-Palette (stärkerer Kontrast zwischen Hintergrund und Kacheln) */
    --bg: #090c17;
    --surface: #171c30;
    --surface-2: #20263f;
    --navbar-bg: rgba(9, 12, 23, 0.82);
    --line: #2a3152;
    --line-hell: #3c4570;

    --text: #eef0f8;
    --muted: #a3abc8;
    --muted-2: #757da0;

    --rot: #E63946;
    --rot-hell: #ff5d68;

    /* Schwierigkeitsgrade */
    --einsteiger: #4ade80;
    --mittel: #fbbf24;
    --schwer: #fb923c;
    --extrem: #ff5d68;
    --tint: 0.14;          /* Stärke der farbigen Badge-Flächen */
    --card-schatten: none;

    --radius: 14px;
    --radius-s: 9px;
    --max-breite: 1080px;

    --serif-display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ----- Light-Theme ----- */
:root[data-theme="light"] {
    --bg: #eef1f7;
    --surface: #ffffff;
    --surface-2: #f4f6fb;
    --navbar-bg: rgba(255, 255, 255, 0.85);
    --line: #e0e4ee;
    --line-hell: #c7cde0;

    --text: #161a2c;
    --muted: #555d77;
    --muted-2: #828aa3;

    --einsteiger: #15803d;
    --mittel: #b45309;
    --schwer: #c2410c;
    --extrem: #dc2626;
    --tint: 0.12;
    --card-schatten: 0 1px 3px rgba(20, 26, 44, 0.06);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
    font-family: var(--serif-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

::selection { background: var(--rot); color: #fff; }

/* ==========================================================================
   Navbar
   ========================================================================== */

.navbar {
    background: var(--navbar-bg);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: var(--max-breite);
    margin: 0 auto;
    padding: 0 18px;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    font-family: var(--serif-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

/* Steuerelemente rechts: Theme-Schalter, Sprachschalter, Hamburger */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 9px;
}

.icon-btn {
    width: 36px; height: 36px;
    border: 1px solid var(--line-hell);
    border-radius: var(--radius-s);
    background: var(--surface-2);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--rot); }
.icon-btn svg { width: 18px; height: 18px; }

/* Sonne/Mond je nach Theme zeigen */
.icon-sun { display: none; }
:root[data-theme="light"] .icon-sun { display: inline; }
:root[data-theme="light"] .icon-moon { display: none; }

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--line-hell);
    border-radius: var(--radius-s);
    overflow: hidden;
}
.lang-switch a {
    padding: 6px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--muted-2);
    background: var(--surface-2);
    transition: color 0.15s, background 0.15s;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.aktiv { background: var(--rot); color: #fff; }

.logo .punkt {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--rot);
    display: inline-block;
}

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-links a {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: var(--radius-s);
    transition: color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.aktiv { color: var(--text); }
.nav-links a.aktiv::after {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--rot);
    margin-left: 2px;
}

.merk-badge {
    background: var(--rot);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 19px;
    height: 19px;
    padding: 0 6px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px; height: 42px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 9px;
}
.hamburger span {
    display: block;
    height: 2px; width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.2s;
}
.hamburger.offen span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.offen span:nth-child(2) { opacity: 0; }
.hamburger.offen span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Layout
   ========================================================================== */

.inhalt {
    flex: 1;
    width: 100%;
    max-width: var(--max-breite);
    margin: 0 auto;
    padding: 28px 18px 56px;
}

.hero { margin-bottom: 26px; }
.hero h1 {
    font-size: 1.9rem;
    color: var(--text);
}
.hero p {
    color: var(--muted);
    margin-top: 8px;
    font-size: 1rem;
    max-width: 60ch;
}

.footer {
    border-top: 1px solid var(--line);
    color: var(--muted-2);
    padding: 26px 18px;
    font-size: 0.85rem;
}
.footer-inner {
    max-width: var(--max-breite);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    align-items: center;
    justify-content: space-between;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer .footer-links { display: flex; gap: 18px; }

/* ==========================================================================
   Filterleiste
   ========================================================================== */

.filter {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.filter-feld { display: flex; flex-direction: column; gap: 6px; }

.filter-feld label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted-2);
}

.filter-feld select {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    font-size: 0.92rem;
    padding: 10px 34px 10px 13px;
    border: 1px solid var(--line-hell);
    border-radius: var(--radius-s);
    background-color: var(--surface-2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa2c0' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    color: var(--text);
    cursor: pointer;
    width: 100%;
    transition: border-color 0.15s;
}
.filter-feld select:hover { border-color: var(--line-hell); }
.filter-feld select:focus {
    outline: none;
    border-color: var(--rot);
}

.filter-aktionen { display: flex; align-items: flex-end; gap: 10px; }

.btn-filter {
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    background: var(--rot);
    color: #fff;
    border: none;
    border-radius: var(--radius-s);
    padding: 10px 20px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-filter:hover { background: var(--rot-hell); }

.btn-reset {
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--muted);
    padding: 10px 14px;
    border-radius: var(--radius-s);
    border: 1px solid var(--line);
}
.btn-reset:hover { color: var(--text); border-color: var(--line-hell); }

/* ==========================================================================
   Ergebnis-Kopf
   ========================================================================== */

.ergebnis-kopf { margin-bottom: 16px; }
.anzahl {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.2px;
}
.anzahl strong { color: var(--text); font-weight: 700; }

/* ==========================================================================
   Event-Grid & Karten
   ========================================================================== */

.event-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--akzent, var(--line-hell));
    border-radius: var(--radius);
    box-shadow: var(--card-schatten);
    transition: border-color 0.18s, transform 0.18s, background 0.18s, box-shadow 0.18s;
}
.card:hover {
    border-color: var(--line-hell);
    border-left-color: var(--akzent, var(--line-hell));
    background: var(--surface-2);
    transform: translateY(-2px);
}

/* Farbiger Akzentstreifen je Schwierigkeit – hebt die Kacheln deutlicher ab */
.card.d-einsteiger { --akzent: var(--einsteiger); }
.card.d-mittel     { --akzent: var(--mittel); }
.card.d-schwer     { --akzent: var(--schwer); }
.card.d-extrem     { --akzent: var(--extrem); }

.card-overlay { position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }

.card-body { padding: 18px; position: relative; }

.badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }

.badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 7px;
    line-height: 1.3;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge.schwierigkeit::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.s-einsteiger { color: var(--einsteiger); background: rgba(74, 222, 128, 0.12); }
.s-mittel     { color: var(--mittel);     background: rgba(251, 191, 36, 0.12); }
.s-schwer     { color: var(--schwer);     background: rgba(251, 146, 60, 0.12); }
.s-extrem     { color: var(--extrem);     background: rgba(255, 93, 104, 0.14); }

.badge.kategorie {
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line-hell);
}

.card-title {
    font-size: 1.12rem;
    color: var(--text);
    margin-bottom: 5px;
    padding-right: 42px;
}

.card-datum {
    color: var(--rot-hell);
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 14px;
    letter-spacing: 0.1px;
}

.card-meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: var(--muted);
    font-size: 0.88rem;
}
.card-meta li { display: inline-flex; align-items: center; gap: 6px; }
.card-meta svg { width: 15px; height: 15px; stroke: var(--muted-2); flex-shrink: 0; }

.land-tag {
    color: var(--muted-2);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid var(--line);
    padding: 0 5px;
    border-radius: 4px;
    margin-left: 2px;
}

/* Herz-Button */
.merk-btn {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 2;
    width: 38px; height: 38px;
    border: 1px solid var(--line);
    background: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s, border-color 0.15s, background 0.15s;
}
.merk-btn:hover { transform: scale(1.08); border-color: var(--rot); }
.merk-btn .herz { font-size: 1.2rem; line-height: 1; color: var(--muted); }
.merk-btn.aktiv { background: var(--rot); border-color: var(--rot); }
.merk-btn.aktiv .herz { color: #fff; }

/* Entfernen-Button (Merkliste) */
.card-aktion { position: relative; z-index: 2; padding: 0 18px 18px; }
.btn-entfernen {
    font: inherit;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    padding: 8px 16px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.btn-entfernen:hover { color: var(--rot-hell); border-color: var(--rot); }

/* ==========================================================================
   Leerer Zustand
   ========================================================================== */

.leer {
    text-align: center;
    border: 1px dashed var(--line-hell);
    border-radius: var(--radius);
    padding: 56px 24px;
    color: var(--muted);
}
.leer h1 { color: var(--text); margin-bottom: 10px; }
.leer p { margin-bottom: 14px; }
.leer-emoji { font-size: 2.4rem; opacity: 0.85; }
.leer .btn-filter { display: inline-block; margin-top: 6px; }

/* ==========================================================================
   Detailseite
   ========================================================================== */

.zurueck {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 18px;
}
.zurueck:hover { color: var(--text); }

.detail { max-width: 760px; }

.detail-kopf h1 { font-size: 1.85rem; color: var(--text); margin: 12px 0 8px; }
.detail-datum {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.detail-datum strong { color: var(--rot-hell); font-weight: 600; }

/* Karte */
.karte {
    margin: 22px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.karte iframe {
    display: block;
    width: 100%;
    height: 280px;
    border: 0;
}
.karte-fuss {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--muted-2);
    border-top: 1px solid var(--line);
}
.karte-fuss a { color: var(--muted); }
.karte-fuss a:hover { color: var(--text); }

.karte-platzhalter {
    margin: 22px 0;
    height: 180px;
    border-radius: var(--radius);
    border: 1px dashed var(--line-hell);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-2);
    font-size: 0.9rem;
    text-align: center;
    padding: 0 16px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 22px 0;
}
.fakt {
    border: 1px solid var(--line);
    border-radius: var(--radius-s);
    padding: 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fakt-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    color: var(--muted-2);
}
.fakt-wert { font-size: 1.05rem; font-weight: 600; color: var(--text); font-family: var(--serif-display); }

.frist {
    border-radius: var(--radius-s);
    padding: 13px 15px;
    font-size: 0.92rem;
    font-weight: 500;
    margin: 4px 0 22px;
    border: 1px solid var(--line);
    color: var(--muted);
}
.frist-warnung {
    background: rgba(230, 57, 70, 0.1);
    border-color: rgba(230, 57, 70, 0.55);
    color: var(--rot-hell);
    font-weight: 600;
}
.frist-vorbei { color: var(--muted-2); }

.beschreibung { margin: 22px 0; }
.beschreibung h2 { font-size: 1.15rem; color: var(--text); margin-bottom: 8px; }
.beschreibung p { color: var(--muted); max-width: 65ch; }

.detail-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}
.btn-primary, .btn-secondary {
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-s);
    padding: 13px 22px;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--rot); color: #fff; flex: 1 1 auto; }
.btn-primary:hover { background: var(--rot-hell); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--line-hell); }
.btn-secondary:hover { border-color: var(--text); }

.btn-merken {
    position: static;
    width: auto; height: auto;
    border-radius: var(--radius-s);
    gap: 8px;
    padding: 13px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    border: 1px solid var(--line-hell);
    background: transparent;
}
.btn-merken:hover { transform: none; border-color: var(--text); }
.btn-merken.aktiv { background: var(--rot); border-color: var(--rot); }
.btn-merken.aktiv .herz, .btn-merken.aktiv .merk-text { color: #fff; }

/* ==========================================================================
   Rechtstexte (Impressum / Datenschutz)
   ========================================================================== */

.rechtstext { max-width: 720px; }
.rechtstext h1 { font-size: 1.7rem; margin-bottom: 18px; }
.rechtstext h2 { font-size: 1.15rem; color: var(--text); margin: 26px 0 8px; }
.rechtstext p, .rechtstext li { color: var(--muted); margin-bottom: 8px; }
.rechtstext ul { padding-left: 20px; }
.rechtstext a { color: var(--rot-hell); }
.rechtstext .platzhalter {
    color: var(--mittel);
    background: rgba(251, 191, 36, 0.1);
    border-radius: 5px;
    padding: 0 5px;
    font-size: 0.9em;
}
.rechtstext .hinweis {
    border: 1px solid var(--line);
    border-left: 3px solid var(--mittel);
    border-radius: var(--radius-s);
    padding: 13px 15px;
    margin: 18px 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 640px) {
    .filter { grid-template-columns: repeat(2, 1fr); align-items: end; }
    .filter-aktionen { grid-column: 1 / -1; }
    .event-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.2rem; }
}

@media (min-width: 980px) {
    .filter { grid-template-columns: repeat(5, 1fr) auto; }
    .filter-aktionen { grid-column: auto; }
    .event-grid { grid-template-columns: repeat(3, 1fr); }
    .detail-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
    .hamburger { display: flex; }
    .nav-links {
        position: absolute;
        top: 62px; left: 0; right: 0;
        background: var(--bg);
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px 14px 16px;
        border-bottom: 1px solid var(--line);
        display: none;
    }
    .nav-links.offen { display: flex; }
    .nav-links a { padding: 13px 14px; justify-content: space-between; }
    .nav-links a.aktiv::after { margin-left: auto; }
}
