/* Giro Fahrradferien: gemeinsames Stylesheet.
   Mobile-first, System-Fonts (keine Web-Font-Downloads = schneller + akkuschonend). */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #20171c;
  --muted: #6b5f65;
  --accent: #d6336c;      /* Maglia Rosa, das Pink des Giro d'Italia */
  --accent-dark: #a61e4d;
  --line: #ece4e6;
  /* Italienische Tricolore fuer Akzente */
  --it-green: #008c45;
  --it-red: #cd212a;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 6px 18px rgba(0, 0, 0, .05);
  --radius: 14px;
  --maxw: 920px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--accent-dark); }

img { max-width: 100%; height: auto; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* ---- Kopf / Navigation ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
  /* Tricolore-Streifen unter dem Header */
  border-bottom: 4px solid transparent;
  border-image: linear-gradient(to right,
    var(--it-green) 0 33.33%,
    #f4f5f0 33.33% 66.66%,
    var(--it-red) 66.66% 100%) 1;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .dot { font-size: 1.3rem; }

nav.main {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
nav.main a {
  color: #fff;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  opacity: .92;
}
nav.main a:hover { background: rgba(255, 255, 255, .15); opacity: 1; }
nav.main a.active { background: #fff; color: var(--accent-dark); opacity: 1; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #e75a92 0%, var(--accent) 45%, var(--accent-dark) 100%);
  color: #fff;
  padding: 44px 0 52px;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(1.7rem, 5vw, 2.6rem); }
.hero p { margin: 0; font-size: 1.1rem; opacity: .95; max-width: 36ch; }

/* ---- Layout-Bausteine ---- */
main { padding: 26px 0 60px; }
section { margin: 0 0 30px; }
h2 { font-size: 1.4rem; margin: 0 0 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

.info-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.info-card .label { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }

/* ---- Buttons / Formulare ---- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: #fff; color: var(--accent-dark); border: 1px solid var(--line); }

label { display: block; font-weight: 600; margin: 12px 0 5px; }
input[type=text], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
textarea { min-height: 110px; resize: vertical; }

/* ---- Karte (Touren) ---- */
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
#map {
  height: 60vh;
  min-height: 340px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #dfe7e3;
}
.map-placeholder {
  height: 60vh;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--accent);
  color: var(--muted);
  background: #fff;
  cursor: pointer;
}
.route-list { list-style: none; padding: 0; margin: 14px 0 0; }
.route-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
}
.route-list li:last-child { border-bottom: none; }
.route-list .swatch { width: 16px; height: 16px; border-radius: 4px; flex: 0 0 auto; }
.route-list .rname { font-weight: 600; flex: 1; }
.route-list .day-tag {
  font-size: .75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 9px;
  color: var(--muted);
}

/* ---- Packliste ---- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.checklist input[type=checkbox] { margin-top: 5px; width: 18px; height: 18px; flex: 0 0 auto; }
.checklist label { margin: 0; font-weight: 400; }
.checklist li.done label { text-decoration: line-through; color: var(--muted); }

/* ---- Gaestebuch ---- */
.entry { border-bottom: 1px solid var(--line); padding: 14px 0; }
.entry:last-child { border-bottom: none; }
.entry .meta { color: var(--muted); font-size: .85rem; margin-bottom: 3px; }
.entry .who { font-weight: 700; color: var(--ink); }
.toast { margin-top: 10px; font-weight: 600; }
.toast.ok { color: #1c7c4a; }
.toast.err { color: var(--accent-dark); }

/* ---- Fuss ---- */
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
  padding: 22px 0 40px;
  text-align: center;
}

.muted { color: var(--muted); }
.spinner { color: var(--muted); font-style: italic; }

/* ---- Bahnverbindung (SBB-Widget) ---- */
.conn { margin: 14px 0 6px; }
.conn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.conn-row:last-child { border-bottom: none; }
.conn-time { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.conn-meta { color: var(--muted); font-size: .9rem; }
.conn-prod {
  font-size: .82rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: auto;
}
.conn-foot { margin-top: 12px; font-size: .85rem; }

/* Hotel-Links in der Uebernachtungsliste */
.day-tag a { color: var(--accent-dark); text-decoration: none; }
.day-tag a:hover { text-decoration: underline; }

/* ---- Nutzerbereich im Header ---- */
.user-area { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  text-decoration: none;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9rem;
}
.user-chip:hover { background: rgba(255, 255, 255, .28); }
.user-chip svg { display: block; }
.logout-btn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}
.logout-btn:hover { background: rgba(255, 255, 255, .15); }

/* ---- Trikot-Picker ---- */
.jersey-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) { .jersey-grid { grid-template-columns: repeat(3, 1fr); } }
.jersey-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 8px 10px;
  cursor: pointer;
  font: inherit;
}
.jersey-opt:hover { border-color: var(--accent); }
.jersey-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214, 51, 108, .18); }
.jersey-opt.locked { opacity: .55; cursor: not-allowed; filter: grayscale(.5); }
.jersey-opt.locked:hover { border-color: var(--line); }
.jersey-opt.locked .jhint { color: var(--accent-dark); font-weight: 600; }
.jersey-opt svg { display: block; }
.jersey-opt .jname { font-weight: 700; font-size: .9rem; margin-top: 4px; }
.jersey-opt .jhint { color: var(--muted); font-size: .78rem; }

/* ---- Karten-Marker fuer geteilte Standorte ---- */
.loc-divicon { background: none; border: none; }
.loc-marker { display: flex; flex-direction: column; align-items: center; }
.loc-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.loc-badge svg { display: block; }
.loc-name {
  margin-top: 3px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

/* aktiver Standort-Teilen-Knopf */
.btn.active { background: var(--it-green); }
.btn.active:hover { background: #0b6e38; }
