/* ===================================================================
   Hütten-Verein Stylesheet
   Vibe: 175 Jahre Verein, Schwarzwald bei Hinterzarten, warmes Holz/
   Erdton-Retro-Gefühl, aber moderne, sehr gut lesbare Schrift und
   große, eindeutige Bedienelemente (auch für ältere Mitglieder).
   Mobile-first.
=================================================================== */

:root {
  /* Farbpalette: warmes Holz, Tanne, Sandstein, dazu ein Hauch Retro-Rot */
  --color-bg: #f6f1e7;          /* helles Sandstein/Papier */
  --color-bg-alt: #efe6d6;
  --color-surface: #ffffff;
  --color-text: #2c241b;         /* dunkles Holzbraun statt reinem Schwarz */
  --color-text-muted: #6b5f4f;
  --color-primary: #4a5d3a;      /* Tannengrün */
  --color-primary-dark: #37452b;
  --color-accent: #a63d2f;       /* gedecktes Retro-Rot, wie alte Hüttenschilder */
  --color-accent-dark: #82301f;
  --color-border: #ddd0b8;
  --color-success-bg: #e5efdc;
  --color-success-text: #35521f;
  --color-danger-bg: #f8e2df;
  --color-danger-text: #82301f;
  --color-warning-bg: #f8ecd4;
  --color-warning-text: #7a5b12;

  --radius: 10px;
  --shadow-soft: 0 2px 8px rgba(44, 36, 27, 0.08);
  --shadow-medium: 0 4px 16px rgba(44, 36, 27, 0.12);

  /* Falls Fraunces/Source Sans 3 lokal eingebunden werden (siehe README),
     werden sie hier automatisch verwendet; ansonsten hochwertiger
     System-Font-Fallback ohne externe Requests. */
  --font-base: 'Source Sans 3', 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
  --font-heading: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px; /* bewusst größer als Standard 16px -> für ältere Mitglieder besser lesbar */
}

body {
  margin: 0;
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-primary-dark);
  margin: 0 0 0.5em 0;
}

h2 { margin-top: 1.75rem; }
h3 { margin-top: 0; } /* h3 steht meist schon innerhalb einer .card, dort kein Extra-Abstand nötig */

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover, a:focus {
  text-decoration: underline;
}

p {
  margin: 0 0 1em 0;
}

/* ---------- Layout ---------- */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--color-primary);
  color: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar .brand {
  color: #fff;
}

.sidebar .brand {
  color: #fff;
}

.topbar .brand-sub {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.85;
  font-family: var(--font-base);
  display: block;
}

.main-content {
  flex: 1;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 6rem 1rem; /* unten Platz für Bottom-Nav auf Mobile */
}

/* ---------- Bottom Navigation (Mobile-first) ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  padding: 0.4rem 0.2rem calc(0.4rem + env(safe-area-inset-bottom, 0px)) 0.2rem;
  z-index: 20;
  box-shadow: 0 -2px 10px rgba(44,36,27,0.08);
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius);
  min-width: 3.5rem;
  text-decoration: none;
}

.bottom-nav a.active {
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-bg-alt);
}

.bottom-nav .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---------- Desktop-Anpassung ---------- */

.sidebar {
  display: none; /* Standard: mobile - Sidebar ist ausgeblendet, wird auf Desktop per Media-Query gezeigt */
}

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

  .app-shell {
    flex-direction: row;
  }

  .sidebar {
    display: flex;
    width: 235px;
    background: var(--color-primary);
    height: 100vh;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    flex-direction: column;
    gap: 0.25rem;
    position: sticky;
    top: 0;
  }

  .sidebar .brand {
    justify-content: center;
    margin-bottom: 1.5rem;
  }

  .sidebar a {
    color: rgba(255,255,255,0.85);
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.87rem;
    line-height: 1.3;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .sidebar a svg {
    margin-top: 0.1rem;
    flex-shrink: 0;
  }

  .sidebar a.active,
  .sidebar a:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
  }

  .topbar { display: none; }

  .main-content-wrapper {
    flex: 1;
  }

  .main-content {
    padding: 2rem 2rem 3rem 2rem;
    max-width: 960px;
  }
}

/* ---------- Karten / Boxen ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}

.card-title {
  margin-top: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-base);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px; /* Touch-Target-Größe */
  line-height: 1;
}

.btn:hover, .btn:focus {
  text-decoration: none;
  filter: brightness(1.05);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover { background: var(--color-primary-dark); }

.btn-accent {
  background: var(--color-accent);
  color: #fff;
}

.btn-accent:hover { background: var(--color-accent-dark); }

.btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border: 1px solid var(--color-accent);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  min-height: 38px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* ---------- Formulare ---------- */

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  font-family: var(--font-base);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-text);
  margin-bottom: 1rem;
  min-height: 48px;
}

textarea {
  min-height: 100px;
}

.form-group {
  margin-bottom: 1rem;
}

.form-hint {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: -0.6rem;
  margin-bottom: 1rem;
}

.radio-group, .checkbox-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.radio-group label, .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  min-height: 44px;
}

/* ---------- Meldungen ---------- */

.alert {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.alert-error {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border: 1px solid var(--color-accent);
}

.alert-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-primary);
}

.alert-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 1px solid #c9a13a;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-approved { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-rejected { background: var(--color-danger-bg); color: var(--color-danger-text); }

/* Aufeinanderfolgende Badges bekommen automatisch Abstand, egal wo sie verwendet werden */
.badge + .badge {
  margin-left: 0.35rem;
}

/* Card-Titel-Zeile mit mehreren Badges: sauberer Zeilenumbruch statt Berühren */
.card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ---------- Auth-Seiten (Login/Register) ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(180deg, var(--color-primary-dark) 0%, var(--color-primary) 45%, var(--color-bg) 45%);
}

.auth-box {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-medium);
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-box .brand-heading {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-box .brand-heading .brand-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-family: var(--font-base);
  margin-top: 0.2rem;
}

/* ---------- Utility ---------- */

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Einklappbare Bereiche (Galerie-Upload, Wanderroute-Felder im Blog-Editor):
   einheitliches Aussehen statt Browser-Standard-Dreieck-Marker */
details summary {
  list-style: none;
}
details summary::-webkit-details-marker {
  display: none;
}
details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}
details[open] summary::before {
  transform: rotate(90deg);
}
