/* app.css — CSS für alle öffentlichen Seiten ausser Landing (landing.html
   lädt zusätzlich landing.css, siehe {% block extra_css %}) und Admin-Portal
   (eigenständig in admin.css). Ersetzt das frühere Zwei-Datei-System
   style.css + desktop.css: kein .app-shell-Wrapper mehr, echtes Responsive
   über die volle Breite auf jeder Viewportgrösse — kein "Handy als Karte"-
   Look. Aufbau analog landing.css: Tokens, Reset, Navbar, Shared Components,
   seitenspezifische Stile, ein einziger @media (min-width: 900px)-Block am
   Ende für alle Desktop-Anpassungen. Siehe CLAUDE.md "CSS-Architektur". */

:root {
  --c-bg:        #F7F6F2;
  --c-surface:   #FFFFFF;
  --c-border:    #E2E0D8;
  --c-muted:     #A09E96;
  --c-text:      #1A1916;
  --c-sub:       #5A5854;
  --c-accent:    #2B6CB0;
  --c-accent-bg: #EBF2FA;
  --c-accent-t:  #1A4A80;
  --c-green:     #276749;
  --c-green-bg:  #EAF5EE;
  --c-green-t:   #1A4A30;
  --c-yellow:    #92600A;
  --c-yellow-bg: #FEF3DC;
  --c-red:       #9B1C1C;
  --c-red-bg:    #FDEAEA;
  --c-brand:     #1A1916;
  --c-purple:    #553C9A;
  --c-purple-bg: #F0EBFF;
  --radius-sm:   8px;
  --radius-md:   12px;
  --shadow:      0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.10);
}

/* ── Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: inherit; }

/* ── Navbar ──
   Eine einzige, immer sichtbare Navbar (ersetzt die frühere Trennung
   zwischen mobiler .topbar und .desktop-nav ab 900px). Auf Unterseiten
   ersetzt {% block nav_left %} das Logo durch einen Zurück-Pfeil
   (.nav-back) statt eine zweite, separate Bar zu rendern. */
.nav {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  /* Ohne flex-shrink:0 wird eine Navbar mit expliziter height in einer
     Column-Flexbox lautlos zusammengestaucht, sobald body's Gesamtinhalt
     über einen Viewport hinausgeht — siehe landing.css .l-nav-Gotcha
     (CLAUDE.md, v0.7.1). Gilt hier identisch. */
  flex-shrink: 0;
}
.nav-logo {
  font-size: 15px; font-weight: 600; color: var(--c-text);
  text-decoration: none; display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.nav-back {
  font-size: 22px; color: var(--c-accent); text-decoration: none;
  line-height: 1; flex-shrink: 0;
}
.nav-title { flex: 1; min-width: 0; }
.nav-title .page-title,
.nav-title .page-sub { margin: 0; }
.nav-links { display: none; }
.nav-cta {
  background: var(--c-brand); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 7px 14px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
}

/* ── Seitenüberschrift ──
   Ersetzt die frühere .topbar-title/.topbar-sub — sitzt jetzt als normale
   Überschrift im Seiteninhalt (innerhalb {% block body %}), nicht mehr in
   einer eigenen Bar über der Navbar. */
.page-title { font-size: 18px; font-weight: 700; color: var(--c-text); line-height: 1.25; }
.page-sub { font-size: 12px; color: var(--c-sub); margin-top: 2px; }

/* ── Content ── */
/* flex: 1 0 auto (nicht die gleich aussehende Kurzschreibweise "flex: 1",
   die flex-basis:0% bedeutet) — siehe CLAUDE.md-Gotcha zu .content. */
.content { flex: 1 0 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }

/* ── Cards ── */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow); }
.event-strip .meta-row { font-size: 13px; color: var(--c-sub); padding: 3px 0; }

.share-strip { background: var(--c-accent-bg); border: 1px solid #C3D9F0; border-radius: var(--radius-md); padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.share-strip span { font-size: 13px; color: var(--c-accent-t); flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-btn { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 20px; background: var(--c-accent); color: #fff; border: none; cursor: pointer; white-space: nowrap; }

.share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-actions .share-btn { flex: 1; min-width: 96px; padding: 9px 10px; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.share-actions .share-btn[hidden] { display: none; }
.share-btn-whatsapp { background: #25D366; }

.section-label { font-size: 11px; font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: 0.07em; padding: 4px 4px 2px; }

.fahrt-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow); }
.fahrt-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--c-accent-bg); color: var(--c-accent-t); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.avatar.g { background: var(--c-green-bg); color: var(--c-green-t); }
.avatar.y { background: var(--c-yellow-bg); color: var(--c-yellow); }
.avatar.p { background: var(--c-purple-bg); color: var(--c-purple); }
.fahrt-name { font-size: 14px; font-weight: 600; color: var(--c-text); }
.fahrt-meta { font-size: 12px; color: var(--c-sub); margin-top: 1px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge-green  { background: var(--c-green-bg);  color: var(--c-green); }
.badge-yellow { background: var(--c-yellow-bg); color: var(--c-yellow); }
.badge-red    { background: var(--c-red-bg);    color: var(--c-red); }
.badge-gray   { background: #F0EEE9; color: var(--c-sub); border: 1px solid var(--c-border); }

.seats-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.seat-chip { font-size: 12px; padding: 4px 11px; border-radius: 20px; background: #E8E6E0; color: var(--c-text); border: 1px solid var(--c-border); font-weight: 500; }
.seat-chip.empty { border-style: dashed; color: var(--c-muted); background: transparent; font-weight: 400; }

.btn { display: block; width: 100%; padding: 11px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; border: none; transition: opacity 0.15s; text-decoration: none; }
.btn:active { opacity: 0.8; }
.btn-primary   { background: var(--c-accent); color: #fff; }
.btn-secondary { background: transparent; color: var(--c-accent); border: 1.5px solid var(--c-accent); }
.btn-danger    { background: transparent; color: var(--c-red); border: 1.5px solid var(--c-red); }
.btn-brand     { background: var(--c-brand); color: #fff; }
.btn-disabled  { background: #E8E6E0; color: var(--c-muted); cursor: default; }
.btn-sm { padding: 7px 12px; font-size: 12px; width: auto; display: inline-block; }

.add-fahrt { background: transparent; border: 1.5px dashed var(--c-border); border-radius: var(--radius-md); padding: 14px 16px; display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--c-accent); font-size: 14px; font-weight: 500; text-decoration: none; }
.add-fahrt .plus { width: 32px; height: 32px; border-radius: 50%; background: var(--c-accent-bg); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--c-accent); flex-shrink: 0; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--c-text); }
.form-hint  { font-size: 12px; color: var(--c-muted); }
.form-input, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--c-text);
  background: var(--c-surface); outline: none; font-family: inherit; transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus { border-color: var(--c-accent); }
.form-textarea { resize: vertical; min-height: 72px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plaetze-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.plaetze-btn { width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1.5px solid var(--c-border); background: var(--c-surface); font-size: 16px; font-weight: 600; color: var(--c-sub); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.12s; }
.plaetze-btn.sel { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--c-surface); border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); cursor: pointer; }
.check-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--c-accent); cursor: pointer; flex-shrink: 0; }
.check-row label { font-size: 14px; color: var(--c-text); cursor: pointer; }
.field-error { font-size: 12px; color: var(--c-red); }

.magic-info { background: var(--c-accent-bg); border: 1px solid #C3D9F0; border-radius: var(--radius-md); padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.magic-info p { font-size: 13px; color: var(--c-accent-t); line-height: 1.5; }

.back-to-event { display: inline-block; font-size: 13px; color: var(--c-accent); text-decoration: none; margin-bottom: 16px; }
.back-to-event:hover { text-decoration: underline; }

/* Zentriert Inhalt im verbleibenden vertikalen Platz einer Flex-Column
   .content — für Seiten mit fixiertem Breadcrumb oben (.back-to-event),
   während der Rest weiterhin wie zuvor zentriert. */
.center-remaining { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.confirm-box { text-align: center; padding: 28px 16px; }
.confirm-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.confirm-icon svg { width: 30px; height: 30px; }
.confirm-icon-success { background: var(--c-green-bg); color: var(--c-green); }
.confirm-icon-warning { background: var(--c-yellow-bg); color: var(--c-yellow); }
.confirm-title { font-size: 20px; font-weight: 700; color: var(--c-text); margin-bottom: 8px; }
.confirm-sub { font-size: 14px; color: var(--c-sub); line-height: 1.6; margin-bottom: 20px; }

.info-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--c-border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--c-muted); font-weight: 500; flex-shrink: 0; }
.info-value { color: var(--c-text); font-weight: 500; text-align: right; }
.divider { height: 1px; background: var(--c-border); margin: 4px 0; }
.warn-box { background: var(--c-red-bg); border: 1px solid #F5C0C0; border-radius: var(--radius-md); padding: 14px 16px; font-size: 13px; color: var(--c-red); line-height: 1.5; }

/* Mobile-Rastzustand für Wrapper, die erst ab 900px zu einem Grid/einer
   Sidebar werden (siehe @media-Block unten). */
.desktop-only { display: none; }
.manage-grid { display: flex; flex-direction: column; gap: 14px; }
.event-main { display: flex; flex-direction: column; gap: 8px; }
.form-row-desktop { display: flex; flex-direction: column; gap: 14px; }

/* Footer / Coffee */
.coffee-strip { font-size: 12px; color: var(--c-muted); text-align: center; padding: 10px 16px; border-top: 1px solid var(--c-border); background: var(--c-surface); }
.coffee-strip a { color: var(--c-accent); text-decoration: none; }
.footer-links { display: flex; justify-content: center; gap: 12px; font-size: 11px; padding: 8px 16px; background: var(--c-surface); border-top: 1px solid var(--c-border); }
.footer-links a { color: var(--c-muted); text-decoration: none; }
.footer-version { font-size: 10px; color: #CCC; text-align: center; padding: 4px 16px 8px; background: var(--c-surface); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--c-surface); border-top: 1px solid var(--c-border); }
.footer-bottom .footer-links { border: none; padding: 0; background: none; gap: 10px; }
.footer-bottom .footer-version { padding: 0; background: none; white-space: nowrap; }

/* Static pages */
.static-content { padding: 16px; font-size: 13px; color: var(--c-sub); line-height: 1.7; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; flex: 1 0 auto; }
.static-content h2 { font-size: 15px; font-weight: 700; color: var(--c-text); margin-top: 4px; }
.static-content h3 { font-size: 13px; font-weight: 700; color: var(--c-text); margin-top: -4px; }
.static-content p { margin: 0; }
.static-content ul { margin: -4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.static-content li { margin: 0; }
.static-content a { color: var(--c-accent); }

.alert { border-radius: var(--radius-md); padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.alert-error { background: var(--c-red-bg); color: var(--c-red); border: 1px solid #F5C0C0; }
.alert-success { background: var(--c-green-bg); color: var(--c-green); border: 1px solid #B9DEC5; }

/* ── /warum Seite ── */
.warum-page-content h1 { font-size: 24px; font-weight: 800; color: var(--c-text); line-height: 1.2; margin-bottom: 4px; }
.warum-page-intro { font-size: 15px; color: var(--c-sub); line-height: 1.7; margin-bottom: 32px; }
.warum-point { display: flex; gap: 16px; padding: 24px 0; }
.warum-point + .warum-point { border-top: 1px solid var(--c-border); }
.warum-point-num { font-size: 12px; font-weight: 600; color: var(--c-muted); width: 24px; flex-shrink: 0; padding-top: 3px; }
.warum-point-body h2 { font-size: 17px; font-weight: 600; color: var(--c-text); margin-bottom: 8px; }
.warum-point-body p { font-size: 14px; color: var(--c-sub); line-height: 1.8; }
.warum-point-body strong { color: var(--c-text); font-weight: 500; }
.warum-final-cta { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-md); padding: 24px; text-align: center; margin-top: 32px; }
.warum-final-cta h3 { font-size: 18px; font-weight: 600; color: var(--c-text); margin-bottom: 8px; }
.warum-final-cta p { font-size: 14px; color: var(--c-sub); margin-bottom: 16px; }

/* ── Desktop ab 900px ──
   Alle Anpassungen für die einzelnen Seiten in einem Block, gescoped über
   body.page-{name} ({% block body_class %} in base.html). */
@media (min-width: 900px) {

  .nav { padding: 0 48px; height: 56px; }
  .nav-links { display: flex; gap: 20px; font-size: 13px; }
  .nav-links a { color: var(--c-sub); text-decoration: none; }

  .footer-bottom { width: 100%; max-width: 1100px; margin: 0 auto; }
  .coffee-strip { display: none; }

  /* ================= Event-Übersicht ================= */
  body.page-event .content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 48px;
    align-items: start;
  }
  .event-main { grid-column: 1; }
  /* Titel steht bereits als Sidebar-Titel in der Sidebar — auf Desktop
     nicht doppelt anzeigen (analog zum bereits bestehenden Ausblenden der
     mobilen event-strip/share-Duplikate weiter unten). */
  body.page-event .event-main > .page-title,
  body.page-event .event-main > .page-sub {
    display: none;
  }
  .event-sidebar {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .event-sidebar .sidebar-title { font-size: 15px; font-weight: 700; color: var(--c-text); margin-bottom: 8px; }
  .event-sidebar .share-row { display: flex; gap: 8px; margin-top: 10px; }
  .event-sidebar .share-row .share-btn { flex: 1; text-align: center; }
  /* Info/Share-Kopfzeile aus der Mobile-Ansicht zieht auf Desktop in die
     Sidebar um — Original bleibt im Markup (Mobile unverändert), wird hier
     nur ausgeblendet, damit die Info nicht doppelt erscheint. Scoped auf
     .event-main (nicht bare .event-strip): die Sidebar-Infocard trägt zur
     .meta-row-Typografie dieselbe .event-strip-Klasse und würde sonst von
     dieser Regel mitversteckt. */
  body.page-event .event-main .event-strip,
  body.page-event .event-main .share-strip,
  body.page-event .event-main .share-actions {
    display: none;
  }

  /* ================= Fahrt anbieten / Buchen / Event erstellen ================= */
  body.page-fahrt-form .content,
  body.page-buchen .content,
  body.page-event-new .content {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 48px;
  }
  /* Name/Telefon nebeneinander, E-Mail volle Breite darunter. Name hat
     keinen .form-hint, Telefon schon — würde man beide Felder nur simpel
     nebeneinanderstellen, rutscht das Telefon-Input tiefer als das
     Name-Input, weil die zusätzliche Hint-Zeile die Spalte streckt.
     Stattdessen bekommen Name und Telefon je eine eigene grid-area pro
     Label/Hint/Input-Zeile (via display:contents entpackt), sodass die
     Input-Zeile für beide exakt in derselben Grid-Zeile landet, unabhängig
     davon ob/wie lang der Hint ist. */
  .form-row-desktop {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "n-label p-label"
      "n-hint  p-hint"
      "n-input p-input"
      "email   email";
    row-gap: 6px;
    column-gap: 16px;
  }
  .form-row-desktop > *:nth-child(1) { display: contents; }
  .form-row-desktop > *:nth-child(1) > .form-label { grid-area: n-label; }
  .form-row-desktop > *:nth-child(1) > .form-hint  { grid-area: n-hint; }
  .form-row-desktop > *:nth-child(1) > .form-input { grid-area: n-input; }

  .form-row-desktop > *:nth-child(2) { grid-area: email; margin-top: 10px; }

  .form-row-desktop > *:nth-child(3) { display: contents; }
  .form-row-desktop > *:nth-child(3) > .form-label { grid-area: p-label; }
  .form-row-desktop > *:nth-child(3) > .form-hint  { grid-area: p-hint; }
  .form-row-desktop > *:nth-child(3) > .form-input { grid-area: p-input; }

  /* ================= Verwalten ================= */
  body.page-manage .content {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 48px;
  }
  body.page-manage .manage-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  body.page-manage-buchung .content {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 48px;
  }
  body.page-manage-event .content {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 48px;
  }

  /* ================= Bestätigung / Absage bestätigen ================= */
  body.page-confirm .content {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 48px;
  }

  /* ================= Impressum / Datenschutz / Kontakt ================= */
  body.page-impressum .static-content,
  body.page-datenschutz .static-content {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 48px;
  }
  body.page-kontakt .content {
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 48px;
  }
  body.page-kontakt .content form {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }

  /* ================= /warum ================= */
  body.page-warum .static-content {
    max-width: 780px;
    width: 100%;
    margin: 0 auto;
    padding: 56px 48px;
  }
  body.page-warum .warum-point { gap: 24px; padding: 32px 0; }
  body.page-warum .warum-point-body h2 { font-size: 20px; }
}
