/* ================================================================
   Reisetagebuch – Haupt-Stylesheet
   Design: Pixi-Buch-Stil · Hell/Dunkel-Modus · Modernes Layout
   ================================================================ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Fredoka:wght@400;500;600;700&family=Nunito:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
/* Naturnah / Bio-Bauernhof: Wiesengrün, Creme/Pergament, Erd- & Holztöne */
:root {
  /* Farben Hell */
  --bg:          #f6f2e7;   /* warmes Pergament */
  --bg-alt:      #efe9d9;
  --card:        #ffffff;
  --card-hover:  #f2efe2;
  --text:        #2c2a1f;   /* warmes Dunkelbraun */
  --text-muted:  #6f6a54;
  --border:      #e0d8c2;
  --accent:      #6a9a3a;   /* Wiesengrün (Leitfarbe, „Bio") */
  --accent2:     #557d2c;   /* tieferes Grün für Links */
  --accent3:     #c9772e;   /* Terrakotta/Holz als Akzent */
  --badge-bg:    #e7efd6;   /* Salbei */
  --badge-text:  #466321;
  --shadow:      rgba(60,55,25,.13);
  --nav-bg:      #36412a;   /* tiefes Oliv/Wald */
  --nav-text:    #f5f1e4;
  --story-bg:    #fbf9f1;

  /* Typografie */
  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body:    'Nunito', system-ui, sans-serif;

  /* Abstände */
  --radius-sm:  8px;
  --radius:     16px;
  --radius-lg:  28px;
  --max-w:      900px;
}

/* ── Dunkel-Modus ── */
[data-theme="dark"] {
  --bg:         #17150f;
  --bg-alt:     #1f1c14;
  --card:       #262219;
  --card-hover: #322d20;
  --text:       #efe9d8;
  --text-muted: #b1a888;
  --border:     #443e2c;
  --accent:     #8fbf5e;
  --accent2:    #a3cf72;
  --accent3:    #e0935a;
  --badge-bg:   #2d381d;
  --badge-text: #bcd98a;
  --shadow:     rgba(0,0,0,.5);
  --nav-bg:     #10130b;
  --nav-text:   #efe9d8;
  --story-bg:   #1f1c14;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .3s, color .3s;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Navigation ── */
.site-nav {
  background: var(--nav-bg);
  color: var(--nav-text);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -.5px;
  display: flex; align-items: center; gap: .4rem;
}
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: .25rem; margin-left: auto; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,.75);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  padding: .4rem .9rem;
  border-radius: 999px;
  transition: background .2s, color .2s;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--accent);
  color: #fff;
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: var(--nav-text);
  cursor: pointer;
  font-size: 1rem;
  padding: .35rem .7rem;
  transition: border-color .2s;
  line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); }

/* ── Hero ── */
.hero {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 1.75rem 1.5rem 2.25rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 40%, rgba(106,154,58,.16) 0%, transparent 70%),
              radial-gradient(ellipse at 20% 80%, rgba(201,119,46,.10) 0%, transparent 60%);
  pointer-events: none;
}
.hero-emoji { font-size: 3rem; line-height: 1; margin-bottom: .6rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: -1px;
  margin-bottom: .75rem;
}
.hero h1 span { color: var(--accent); }
.hero p {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: rgba(255,255,255,.7);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Haupt-Container ── */
.main-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Urlaub-Karten (Übersicht) ── */
.vacations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.vac-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex; flex-direction: column;
}
.vac-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow);
  text-decoration: none;
}
.vac-card-cover {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  position: relative;
  overflow: hidden;
}
.vac-card-cover img {
  width: 100%; height: 100%; object-fit: cover;
}
.vac-card-cover .cover-emoji {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.vac-card-days {
  position: absolute; top: .75rem; right: .75rem;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  padding: .25rem .6rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.vac-card-body { padding: 1.1rem 1.25rem 1.25rem; flex: 1; }
.vac-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: .25rem;
  color: var(--text);
}
.vac-card-dest {
  font-family: var(--font-display);
  font-size: .85rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: .5rem;
}
.vac-card-dates {
  font-size: .8rem;
  color: var(--text-muted);
  font-family: var(--font-display);
}

/* ── Urlaubsdetail / Pixi-Buch ── */
.vac-header {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 2.5rem;
}
.vac-header-cover {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  position: relative;
  overflow: hidden;
}
.vac-header-cover img { width: 100%; height: 100%; object-fit: cover; }
.vac-header-cover .cover-emoji-big {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 6rem;
}
.vac-header-info { padding: 1.5rem 2rem 2rem; }
.vac-header-info h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: .4rem;
}
.vac-meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-top: .75rem;
}
.badge {
  background: var(--badge-bg);
  color: var(--badge-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  padding: .25rem .75rem;
  border-radius: 999px;
}

/* ── Tages-Karten (Pixi-Seiten) ── */
.day-page {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
}
.day-page::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
}
.day-page-header {
  padding: 1.25rem 1.75rem .75rem 2rem;
  display: flex; align-items: baseline; gap: 1rem;
  border-bottom: 1.5px solid var(--border);
}
.day-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
  min-width: 2.5rem;
}
.day-title-area { flex: 1; }
.day-title-area h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: .15rem;
}
.day-date {
  font-family: var(--font-display);
  font-size: .82rem;
  color: var(--text-muted);
}
.day-content { padding: 1.5rem 1.75rem 1.75rem 2rem; }

/* ── Geschichte (Pixi-Text) ── */
.story-text {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
  background: var(--story-bg);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  margin-bottom: 1.25rem;
}
.story-text p + p { margin-top: .75rem; }

/* ── Pixi-Buch-Feinschliff (öffentliche Anzeige) ── */
.hero p { font-family: 'Caveat', var(--font-display); font-size: 1.5rem; color: rgba(255,255,255,.85); }
.day-page { background: var(--story-bg); box-shadow: 0 6px 26px var(--shadow); }
.day-page::before { width: 8px; }
.day-page-header h2 { font-family: 'Caveat', cursive; font-size: 1.9rem; font-weight: 700; }
.day-date { font-family: 'Caveat', cursive; font-size: 1.05rem; }
.story-text { box-shadow: inset 0 0 0 1.5px var(--border); }
.story-text > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 2.9rem; font-weight: 700; color: var(--accent);
  float: left; line-height: .85; margin: .12rem .5rem 0 0;
}
.pixi-divider { font-size: 1.4rem; letter-spacing: .6rem; color: var(--accent3); margin: 1rem 0; }
.vac-card { box-shadow: 0 4px 18px var(--shadow); }
.vac-card-title { font-size: 1.15rem; }
.vac-header-info h1 { font-family: 'Caveat', var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); }

/* ── Foto-Grid ── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .75rem;
  margin-top: 1.25rem;
}
.photo-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .2s;
}
.photo-item:hover { transform: scale(1.03); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff;
  font-size: .72rem;
  font-family: var(--font-display);
  font-weight: 600;
  padding: .5rem .5rem .35rem;
  transform: translateY(100%);
  transition: transform .2s;
}
.photo-item:hover .photo-caption { transform: translateY(0); }

/* ── Lightbox ── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 20px 80px rgba(0,0,0,.8);
}
.lightbox-close {
  position: fixed; top: 1rem; right: 1.25rem;
  color: #fff; font-size: 2rem; cursor: pointer;
  background: none; border: none; line-height: 1;
  opacity: .8; transition: opacity .2s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 3.2rem; height: 3.2rem; border-radius: 50%;
  background: rgba(0,0,0,.45); border: none; color: #fff;
  font-size: 2rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: .75; transition: opacity .2s, background .2s;
  z-index: 1000;
}
.lightbox-nav:hover { opacity: 1; background: rgba(0,0,0,.7); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
@media (max-width: 600px) {
  .lightbox-nav { width: 2.6rem; height: 2.6rem; font-size: 1.5rem; }
  .lightbox-prev { left: .4rem; }
  .lightbox-next { right: .4rem; }
}

/* ── Admin Gemeinsam ── */
.admin-layout {
  display: flex; min-height: 100vh;
}
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 1.5rem 0;
  display: flex; flex-direction: column;
}
.sidebar-logo {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--accent);
}
.sidebar-logo span { font-size: .75rem; opacity: .5; font-weight: 400; display: block; }
.sidebar a {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1.5rem;
  color: rgba(255,255,255,.65);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.sidebar a:hover, .sidebar a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar a .ico { font-size: 1.1rem; min-width: 1.25rem; }
.sidebar-bottom { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.1); }
.admin-main { flex: 1; padding: 2rem 2.5rem; overflow-y: auto; }
.admin-main h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* ── Admin Formular ── */
.form-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.form-card h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}
.field { margin-bottom: 1rem; }
label.lbl {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .35rem;
}
input[type=text], input[type=date], input[type=password],
input[type=email], input[type=file], input[type=number],
input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-size: .95rem;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent2); }
textarea { min-height: 120px; resize: vertical; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .7rem 1.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .85; }
.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: .65rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: background .2s;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover { background: var(--card-hover); }
.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1.5px solid #fca5a5;
  border-radius: 8px;
  padding: .5rem 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}
.btn-ai {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .65rem 1.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: opacity .2s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-ai:hover { opacity: .88; }

/* ── Tabellen ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--bg-alt);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  padding: .7rem 1rem;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
}
td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
  color: var(--text);
  vertical-align: middle;
}
tr:hover td { background: var(--bg-alt); }
/* Admin-Tabellen kompakt halten (kein erzwungener Horizontal-Scroll) */
.admin-main table th, .admin-main table td { padding: .6rem .7rem; }
.admin-main table select { max-width: 100%; }
/* Zweispaltiges Formular-Raster (mobil einspaltig, siehe Media-Query) */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Alerts ── */
.alert { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-family: var(--font-display); font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error   { background: #fee2e2; color: #b91c1c; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
  background: var(--nav-bg);
}
.login-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-card h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  margin-bottom: .25rem;
  color: var(--text);
}
.login-card p { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.75rem; font-family: var(--font-display); }

/* ── Generierungs-Spinner ── */
.spinner {
  display: inline-block;
  width: 1.1rem; height: 1.1rem;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ── */
.site-footer {
  background: var(--nav-bg);
  color: rgba(255,255,255,.4);
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-display);
  font-size: .82rem;
}
.site-footer a { color: rgba(255,255,255,.6); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-legal { margin-top: .45rem; }
.footer-legal .sep { opacity: .35; margin: 0 .15rem; }
.footer-copy { margin-top: .45rem; opacity: .7; }

/* Einfache Textseiten (Impressum, Kontakt) */
.text-page { max-width: 720px; margin: 0 auto; padding: 1rem 0 2rem; }
.text-page h1 { margin-bottom: 1.25rem; }
.text-page .text-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.text-page .muted { color: var(--text-muted); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero { padding: 1.75rem 1.25rem 2rem; }
  .hero-emoji { font-size: 2.4rem; }
  .hero p { font-size: 1rem; }

  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; padding: .6rem; gap: .15rem; }
  .sidebar-logo { display: none; }
  .sidebar a { padding: .5rem .7rem; font-size: .82rem; }
  .sidebar-bottom { margin-top: 0; width: 100%; border-top: none; padding-top: .25rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; }
  .sidebar-bottom > div { width: 100%; }

  .admin-main { padding: 1.1rem; }
  .admin-main h1 { font-size: 1.35rem; }
  .form-card { padding: 1.1rem; }
  .field-grid { grid-template-columns: 1fr; }

  .vacations-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .day-content { padding: 1rem 1.25rem 1.25rem 1.5rem; }
}
@media (max-width: 400px) {
  .vacations-grid { grid-template-columns: 1fr; }
}
