/* ── Reset & Base ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:        #2e6b2e;
  --green-dark:   #1a4a1a;
  --green-light:  #e8f3e8;
  --blue:         #1a3a5c;
  --blue-light:   #e8f0f8;
  --stone:        #7a6a55;
  --bg:           #f9f6f1;
  --bg-card:      #ffffff;
  --text:         #222;
  --text-muted:   #666;
  --border:       #e0d9d0;
  --shadow:       0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
  --radius:       12px;
  --radius-sm:    6px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w:        1100px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Site Header ─────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.logo-icon { font-size: 1.8rem; }

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
  line-height: 1.2;
}

.site-title a { color: inherit; }

.site-subtitle {
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  letter-spacing: .05em;
}

.header-nav { display: flex; gap: 1rem; align-items: center; }

.nav-link {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  font-weight: 500;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,.10), transparent 70%),
    radial-gradient(ellipse 70% 50% at 85% 100%, rgba(26,58,92,.55), transparent 60%),
    linear-gradient(135deg, var(--green-dark) 0%, var(--green) 35%, #1f5470 70%, var(--blue) 100%);
  color: #fff;
  padding: 5rem 1.5rem;
  text-align: center;
  overflow: hidden;
}

/* Stilisierte Bergsilhouette am unteren Rand (reines CSS).
   clip-path statt gradient+mask -> zuverlässig in Safari (mit -webkit-Präfix). */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 56px;
  background: rgba(0,0,0,.2);
  -webkit-clip-path: polygon(
    0 100%, 0 60%, 12.5% 90%, 25% 50%, 37.5% 90%, 50% 45%,
    62.5% 90%, 75% 50%, 87.5% 90%, 100% 60%, 100% 100%);
          clip-path: polygon(
    0 100%, 0 60%, 12.5% 90%, 25% 50%, 37.5% 90%, 50% 45%,
    62.5% 90%, 75% 50%, 87.5% 90%, 100% 60%, 100% 100%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: .75rem;
  line-height: 1.15;
}

.hero-text {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .2rem;
}

.stat-sep {
  width: 1px;
  height: 2.5rem;
  background: rgba(255,255,255,.25);
}

/* ── Entry Cards ─────────────────────────────────── */
.entries-section { padding: 3rem 0 4rem; }

.entries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.entry-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}

.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--green-dark);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.entry-card:hover .card-image img { transform: scale(1.04); }

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-dark), var(--blue));
  font-size: 4rem;
  opacity: .6;
}

.card-day {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--green-dark);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .6rem;
  border-radius: 20px;
}

.card-body { padding: 1.1rem 1.25rem 1.25rem; }

.card-date {
  font-size: .8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: .3rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.3;
  margin-bottom: .4rem;
  color: var(--text);
}

.card-route {
  font-size: .85rem;
  color: var(--stone);
  margin-bottom: .6rem;
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .6rem;
}

.card-stat {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.card-stat svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Entry Page ──────────────────────────────────── */
.entry-hero {
  height: 55vh;
  min-height: 320px;
  max-height: 600px;
  background: linear-gradient(135deg, var(--green-dark), var(--blue));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.entry-hero-overlay {
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 100%);
  padding: 2.5rem 1.5rem;
}

.entry-hero--plain {
  background: linear-gradient(135deg, var(--green-dark), var(--blue));
  align-items: center;
  justify-content: center;
}

.entry-hero--plain .entry-hero-content { text-align: center; }

.entry-hero-content { max-width: var(--max-w); margin: 0 auto; color: #fff; }

.entry-day-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .25rem .7rem;
  border-radius: 20px;
  margin-bottom: .7rem;
}

.entry-hero-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
  margin-bottom: .4rem;
}

.entry-hero-content time {
  font-size: .9rem;
  opacity: .85;
}

.entry-container { padding-top: 2.5rem; padding-bottom: 4rem; }

.entry-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  align-items: center;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  color: var(--text-muted);
}

.meta-item svg {
  width: 16px;
  height: 16px;
  fill: var(--green);
  flex-shrink: 0;
}

.meta-route { color: var(--text); font-weight: 600; }

.diff-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.diff-easy      { background: #d4edda; color: #155724; }
.diff-medium    { background: #fff3cd; color: #856404; }
.diff-hard      { background: #ffe0cc; color: #7a3d00; }
.diff-very-hard { background: #f8d7da; color: #721c24; }

/* ── Teilen-Buttons (dezent, am Ende des Eintrags) ── */
.entry-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.entry-share-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: .1rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: inherit;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .35rem .75rem;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}

.share-btn:hover {
  color: var(--green-dark);
  border-color: var(--green);
  background: var(--green-light);
  text-decoration: none;
}

.share-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: .8;
}

/* WhatsApp: gleiche zurückhaltende Optik, Hover-Akzent in WhatsApp-Grün */
.share-btn--wa:hover {
  color: #1f7a43;
  border-color: #25d366;
  background: #e8f7ee;
}

.share-feedback {
  font-size: .76rem;
  font-weight: 600;
  color: var(--green);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
}

.share-feedback.is-visible { opacity: 1; transform: translateX(0); }

/* ── Etappen-Karte (Leaflet / OpenStreetMap) ─────── */
.entry-map-section { margin: 0 0 2rem; }

.entry-map {
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--green-light);
  z-index: 0; /* unter Sticky-Header bleiben */
}

.entry-map .leaflet-container { font-family: inherit; }

.map-attribution {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .4rem;
  text-align: right;
}

.map-attribution a { color: var(--text-muted); text-decoration: underline; }

.map-error {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

@media (max-width: 640px) {
  .entry-map { height: 280px; }
}

.entry-content { max-width: 720px; }

.entry-text {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 2rem;
}

.entry-text p { margin-bottom: 1rem; }

.entry-tips, .entry-accommodation {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.entry-tips h3, .entry-accommodation h3 {
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green-dark);
  margin-bottom: .5rem;
}

.tips-text { font-size: .95rem; }

/* ── Photo Gallery ───────────────────────────────── */
.foto-galerie { margin-top: 3rem; }

.galerie-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.galerie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.galerie-item { margin: 0; }

.galerie-item a {
  display: block;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #ddd;
}

.galerie-item a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.galerie-item a:hover img { transform: scale(1.05); }

.galerie-item figcaption {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .4rem;
  padding: 0 .25rem;
}

/* ── Entry Navigation ────────────────────────────── */
.entry-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.entry-nav-prev, .entry-nav-next {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
  max-width: 45%;
}

.entry-nav-prev:hover, .entry-nav-next:hover { color: var(--green); text-decoration: none; }

.entry-nav-prev svg, .entry-nav-next svg {
  width: 20px;
  height: 20px;
  fill: var(--green);
  flex-shrink: 0;
}

.entry-nav-prev small, .entry-nav-next small {
  display: block;
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.entry-nav-next { text-align: right; justify-content: flex-end; }

/* ── Lightbox ────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.94);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open { display: flex; }

.lb-content {
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}

.lb-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lb-caption {
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  text-align: center;
}

.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  font-size: 1.4rem;
  line-height: 1;
}

.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,.25);
}

.lb-close { top: 1rem; right: 1rem; width: 40px; height: 40px; }
.lb-prev  { left: 1rem; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.8rem; }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 1.8rem; }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.6);
  padding: 1.5rem;
  text-align: center;
  font-size: .85rem;
  margin-top: auto;
}

.footer-legal {
  margin-top: .5rem;
  font-size: .8rem;
}

.footer-legal a {
  color: rgba(255,255,255,.6);
  text-decoration: none;
}

.footer-legal a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-legal span {
  margin: 0 .45rem;
  color: rgba(255,255,255,.3);
}

/* ── Legal Pages (Impressum / Datenschutz) ───────── */
.legal-page {
  max-width: 760px;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.legal-page h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--green-dark);
  margin-bottom: 1.5rem;
}

.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 .6rem;
}

.legal-page p,
.legal-page li {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}

.legal-page ul {
  margin: .5rem 0 1rem 1.4rem;
}

.legal-page li { margin-bottom: .3rem; }

.legal-page address {
  font-style: normal;
  line-height: 1.7;
}

.legal-page a { color: var(--green); }

.legal-updated {
  margin-top: 2.5rem;
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Empty State ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

/* ── Intro Section ───────────────────────────────── */
.intro-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0;
}

.intro-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.intro-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1rem;
}

.intro-text p {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
}

.etappen-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

.etappen-heading {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--stone);
  margin-bottom: 1.1rem;
}

/* Etappen als Cards mit farbigem Tag-Badge links */
.etappen-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
/* Fallback für Safari < 14.1 (kein flex-gap): Abstand über margin */
.etappen-list > .etappe + .etappe { margin-top: .6rem; }
@supports (gap: 1rem) {
  .etappen-list { gap: .6rem; }
  .etappen-list > .etappe + .etappe { margin-top: 0; }
}

.etappe {
  display: flex;
  align-items: center;
  gap: .9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s, box-shadow .15s;
}

.etappe:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow);
}

.etappe-badge {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  min-height: 2.4rem;
  padding: .35rem .3rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  text-align: center;
  line-height: 1.1;
}

/* Farbverlauf der Badges in Alpentönen: Grün → Blau */
.etappe-badge--0 { background: #2e6b2e; }
.etappe-badge--1 { background: #357a3c; }
.etappe-badge--2 { background: #2f7a5e; }
.etappe-badge--3 { background: #2a7080; }
.etappe-badge--4 { background: #246486; }
.etappe-badge--5 { background: #1f527a; }
.etappe-badge--6 { background: #1a3a5c; }

.etappe-body {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.etappe-route { font-size: .9rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.etappe-info  { font-size: .78rem; color: var(--text-muted); }

.etappe--rueckreise { background: var(--bg); }
.etappe--rueckreise .etappe-badge { background: var(--stone); }
.etappe--rueckreise .etappe-route { font-weight: 500; font-style: italic; color: var(--text-muted); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 760px) {
  .intro-inner { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 640px) {
  .hero { padding: 2.5rem 1rem; }
  .stat-value { font-size: 1.5rem; }
  .entries-grid { grid-template-columns: 1fr; }
  .galerie-grid { grid-template-columns: repeat(2, 1fr); }
  .entry-meta-bar { padding: 1rem; gap: .5rem 1rem; }
  .entry-nav-prev, .entry-nav-next { max-width: 50%; font-size: .85rem; }
  .lb-prev { left: .25rem; }
  .lb-next { right: .25rem; }
  .header-logo .site-subtitle { display: none; }
}
