:root {
  --color-bg: #fbf7f1;
  --color-text: #3a3128;
  --color-accent: #b9723a;
  --color-accent-dark: #8f5527;
  --color-green: #4c8c5b;
  --color-danger: #b83b3b;
  --color-card: #ffffff;
  --color-border: #e6dcca;
  --shadow: 0 4px 16px rgba(60, 45, 20, 0.08);
  font-size: 16px;
}

* { box-sizing: border-box; }

img { max-width: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", Verdana, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; color: var(--color-accent-dark); }

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

.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.container.narrow { max-width: 720px; }

/* ---------- Header / Navigation ---------- */
.site-header {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand {
  font-family: Georgia, serif;
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--color-accent-dark);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand span { font-weight: normal; color: var(--color-text); }
.brand-logo { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--color-accent-dark);
}
.main-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.main-nav a { text-decoration: none; color: var(--color-text); font-weight: 500; }
.main-nav a:hover { color: var(--color-accent); }
.nav-admin { font-size: 0.85rem; color: var(--color-green); }
.nav-admin-link { color: var(--color-danger) !important; font-weight: 700; }
.nav-hidden-page { font-style: italic; opacity: 0.6; }
.nav-logout-form { margin: 0; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent-dark);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}
.link-button.danger { color: var(--color-danger); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.75rem;
    padding-top: 0.75rem;
  }
  .main-nav.open { display: flex; }
}

/* ---------- Hero Slider ---------- */
.hero-slider {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 320px;
  overflow: hidden;
  background: #111;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero-slide.active { opacity: 1; }
/* object-fit: contain statt cover - zeigt das ganze Bild unverzerrt/
   unbeschnitten an, mit Balken links/rechts (bzw. oben/unten) statt
   Bildausschnitten, wenn Bildformat und Slider-Format nicht zusammenpassen. */
.hero-slide img { width: 100%; height: 100%; object-fit: contain; background: #111; }
.hero-slide-img-clickable { cursor: pointer; }
.hero-empty { display: flex; align-items: center; justify-content: center; opacity: 1; background: var(--color-border); }
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}
.hero-prev { left: 1rem; }
.hero-next { right: 1rem; }
.hero-dots { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.5rem; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.6); cursor: pointer; }
.hero-dot.active { background: #fff; }

.hero-text { max-width: 760px; margin: 2.5rem auto; text-align: center; }
.hero-text h1 { font-size: 2.2rem; margin-bottom: 1rem; }

.home-section { max-width: 900px; margin: 2.5rem auto; }
.home-section.is-hidden { opacity: 0.6; }
.home-section-gallery img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; }

/* ---------- Tables / Forms ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.price-table { width: 100%; min-width: 480px; border-collapse: collapse; margin: 1.5rem 0; background: var(--color-card); box-shadow: var(--shadow); }
.price-table th, .price-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); text-align: left; }
.price-table th { background: var(--color-accent); color: #fff; }

.dungeon-price-list { list-style: none; padding: 0; }
.dungeon-price-list li { padding: 0.4rem 0; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }
.checkbox-label input { width: auto; }

.stacked-form { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; }
.stacked-form label { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; }
.stacked-form input, .stacked-form textarea, .stacked-form select {
  font: inherit;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
}
.inline-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0; }
.inline-form input { font: inherit; padding: 0.4rem 0.6rem; border: 1px solid var(--color-border); border-radius: 6px; }

.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { background: var(--color-accent-dark); }
.btn.small { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn.danger { background: var(--color-danger); }
.btn.secondary { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn.secondary:hover { background: var(--color-border); }

.flash { padding: 0.75rem 1rem; border-radius: 6px; margin: 1rem 0; }
.flash.success { background: #e4f3e6; color: #2c6437; }
.flash.error { background: #fbe6e6; color: var(--color-danger); }

.hint { font-size: 0.85rem; color: #6b5f4d; }

/* ---------- Booking calendar ---------- */
.apartment-calendar { margin-bottom: 2rem; }
.calendar-nav { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.calendar-nav button:disabled { opacity: 0.4; cursor: not-allowed; }
.calendar-months { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.calendar-month { background: var(--color-card); border: 1px solid var(--color-border); border-radius: 8px; padding: 0.75rem; box-shadow: var(--shadow); }
.calendar-month h4 { margin: 0 0 0.5rem; text-align: center; font-size: 1rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 28px); gap: 3px; }
.calendar-day { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; border-radius: 4px; background: #eef6ee; color: #2c6437; box-sizing: border-box; }
.calendar-day.booked { background: #f6dede; color: var(--color-danger); }
.calendar-day.clickable { cursor: pointer; }
.calendar-day.clickable:hover { outline: 2px solid var(--color-accent); }
.calendar-day.selected { background: #d9e8f5; color: #2a5a86; outline: 2px solid #2a5a86; }
.calendar-day.surcharge { border: 2px solid #e0b400; }
.calendar-day.conflict { background: #ffdca8 !important; color: #8a4b00 !important; outline: 2px solid #e07b00; }
.calendar-day.empty { background: transparent; }
.calendar-weekday { font-size: 0.7rem; text-align: center; color: #888; }

/* ---------- Preiszuschlag-Kalender je Wohnung ---------- */
.special-day-calendar { margin: 0.75rem 0 1.5rem; }
.sd-grid { display: grid; grid-template-columns: repeat(7, 62px); gap: 4px; }
.sd-day {
  width: 62px;
  height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
  border-radius: 4px;
  background: #eef6ee;
  color: #2c6437;
  box-sizing: border-box;
}
.sd-day-num { font-weight: 700; }
.sd-day-price { font-size: 0.65rem; opacity: 0.85; }
.sd-day.clickable { cursor: pointer; }
.sd-day.clickable:hover { outline: 2px solid var(--color-accent); }
.sd-day.surcharge { border: 2px solid #e0b400; }
.sd-day.selected { background: #fff3cf; outline: 3px solid var(--color-accent-dark); color: #6b4e00; }
.sd-day.empty { background: transparent; }
.sd-selection-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0.6rem 0.8rem;
  background: #fff3cf;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
}
.sd-selection-count { font-weight: 700; }
@media (max-width: 600px) {
  .sd-grid { grid-template-columns: repeat(7, 44px); gap: 2px; }
  .sd-day { width: 44px; height: 42px; font-size: 0.62rem; }
  .sd-day-price { font-size: 0.56rem; }
}
.calendar-booking-info {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff8ee;
  border: 1px solid var(--color-accent);
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ---------- Admin ---------- */
.admin-panel {
  margin-top: 3rem;
  padding: 1.5rem;
  background: #fff8ee;
  border: 2px dashed var(--color-accent);
  border-radius: 10px;
}
.admin-image-grid, .admin-image-card { }
.admin-image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-top: 1rem; }
.admin-image-card { background: #fff; border: 1px solid var(--color-border); border-radius: 8px; padding: 0.5rem; text-align: center; }
.admin-image-card.is-hidden { opacity: 0.5; }
.admin-image-card img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; }
.admin-image-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin-top: 0.5rem; }
.admin-apartment-card { background: #fff; border: 1px solid var(--color-border); border-radius: 8px; padding: 1rem; margin: 1.25rem 0; }
.booking-list { list-style: none; padding: 0; }
.booking-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--color-border); }
.booking-list-detailed li { flex-direction: column; align-items: stretch; gap: 0.35rem; padding: 0.6rem 0; }
.booking-list-main { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.booking-guest-details { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: #6b5f4d; }
.booking-note-form { margin: 0; }
.booking-note-form input { flex: 1; min-width: 160px; }

/* ---------- Ausflugsziele ---------- */
.highlight-card { margin: 2rem 0; padding-bottom: 1.5rem; border-bottom: 1px solid var(--color-border); }
.highlight-card.is-hidden { opacity: 0.6; }

/* ---------- Gallery / Lightbox ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery-thumb { padding: 0; border: none; background: none; cursor: pointer; border-radius: 8px; overflow: hidden; }
.gallery-thumb img { width: 100%; height: 160px; object-fit: cover; display: block; transition: transform 0.2s; }
.gallery-thumb:hover img { transform: scale(1.04); }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; border-radius: 6px; touch-action: pan-y; }
.lightbox-close { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2rem; background: none; border: none; color: #fff; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); color: #fff; border: none; font-size: 1.8rem; padding: 0.5rem 1rem; cursor: pointer; border-radius: 4px; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ---------- Impressum ---------- */
.impressum-text { white-space: pre-wrap; background: var(--color-card); padding: 1.5rem; border-radius: 8px; box-shadow: var(--shadow); }

/* Zeilenumbrueche aus <textarea>-Eingaben (Enter) an einfachen Textstellen
   erhalten - ohne pre-wrap wuerde normales HTML sie beim Anzeigen
   verschlucken, obwohl sie korrekt gespeichert wurden. */
.text-block { white-space: pre-wrap; }

/* ---------- Help button (Admin) ---------- */
.help-fab {
  position: fixed;
  top: 5.5rem;
  right: 1.25rem;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.help-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  align-items: center;
  justify-content: center;
}
.help-modal-backdrop.open { display: flex; }
.help-modal { background: #fff; max-width: 480px; padding: 1.5rem; border-radius: 10px; box-shadow: var(--shadow); }
.help-modal h3 { margin-top: 0; color: var(--color-danger); }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 1.5rem; color: #7a6a53; font-size: 0.85rem; }
.footer-social-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; margin: 0.75rem 0 0; }
.footer-social-link { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--color-accent-dark); }
.footer-social-link svg { fill: var(--color-accent-dark); }
.footer-social-link:hover { opacity: 0.8; }
.footer-admin-panel { text-align: left; margin-top: 2rem; }
.footer-admin-panel .booking-list li { align-items: center; flex-wrap: wrap; }
.footer-admin-panel svg { vertical-align: middle; fill: currentColor; }
.inline-form-tiny { display: inline; margin: 0; }

/* ---------- Cookie-Hinweis ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  background: #2a2016;
  color: #fdf8ee;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
}
.cookie-banner p { margin: 0; max-width: 640px; font-size: 0.9rem; }
.cookie-banner a { color: #ffd9a0; }
.cookie-banner-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.cookie-banner .btn.secondary { color: #fdf8ee; border-color: #6b6050; }
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ---------- Responsive: Tablet (<=900px) ---------- */
@media (max-width: 900px) {
  .container { padding: 1.5rem 1rem 3rem; }
  .brand { font-size: 1.3rem; }
  .hero-text h1 { font-size: 1.9rem; }
  .calendar-months { justify-content: center; }
}

/* ---------- Responsive: Handy (<=600px) ---------- */
@media (max-width: 600px) {
  html { font-size: 15px; }

  .nav-wrap { padding: 0.6rem 1rem; }
  .brand { font-size: 1.15rem; gap: 0.4rem; }
  .brand-logo { width: 32px; height: 32px; }

  .hero-slider { height: 42vh; min-height: 220px; }
  .hero-nav { font-size: 1.1rem; padding: 0.4rem 0.65rem; }
  .hero-text { margin: 1.75rem auto; }
  .hero-text h1 { font-size: 1.5rem; }

  .container { padding: 1.25rem 0.85rem 2.5rem; }
  .container.narrow { padding-left: 0.85rem; padding-right: 0.85rem; }

  .stacked-form, .booking-form { max-width: 100%; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form input, .inline-form select { width: 100%; }

  .price-table th, .price-table td { padding: 0.55rem 0.6rem; font-size: 0.9rem; }

  .admin-panel { padding: 1rem; margin-top: 2rem; }
  .admin-apartment-card { padding: 0.75rem; }

  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }
  .gallery-thumb img { height: 120px; }
  .admin-image-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  .lightbox-nav { font-size: 1.4rem; padding: 0.4rem 0.75rem; }
  .lightbox-close { top: 0.75rem; right: 0.75rem; font-size: 1.75rem; }

  .help-fab {
    top: auto;
    bottom: 1.25rem;
    right: 1.25rem;
  }

  .booking-list li { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
}
