/* ==========================================================================
   Schwarzwaldbauernhaus Bernau – eigenes, handbearbeitbares Stylesheet
   Ersetzt die frueheren UIkit/Astroid/jchoptimize-Bundles der Joomla-Seite.
   Aufbau: 1) Variablen  2) Grundlagen  3) Header/Navigation  4) Hero
           5) Inhalt  6) Tabs-Widget  7) Galerie + Lightbox  8) Buchung
           9) Footer  10) Cookie-Banner  11) Responsive (Mobile)
   ========================================================================== */

:root {
  --color-primary: #8a2f2f;      /* Hauptfarbe (Rotbraun, wie im Original) */
  --color-primary-dark: #6b2424;
  --color-text: #393939;         /* wie im Original: rgb(57,57,57), kein Schwarz */
  --color-text-light: #5a5a5a;
  --color-bg: #ffffff;
  --color-bg-alt: #f2f2f2;       /* neutrales Hellgrau statt Beige, fuer Karten/Filter-Hintergruende */
  --color-border: transparent;
  --color-header-bg: #ffffff;
  --color-footer-text: #393939;
  --color-page-backdrop: #ffffff;  /* Flaeche hinter der "geboxten" Seite, damit der Schatten sichtbar ist */
  --font-base: "Ubuntu", Arial, Helvetica, sans-serif;
  --max-width: 1140px;
  --header-height: 84px;
}

/* -------------------- 2) Grundlagen -------------------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-page-backdrop);
  line-height: 1.65;
}

/* Wie im Original: die gesamte Seite ist auf max-width begrenzt, zentriert
   und schwebt mit leichtem Schatten ueber dem Hintergrund - dadurch bleiben
   z.B. auch die Hero-Bilder auf den Unterseiten so schmal wie die Startseite. */
.site-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-bg);
  box-shadow: 0 0 15px rgba(0, 0, 0, .2);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; margin: 0 0 0.6em; }
h2 { font-size: 1.9rem; color: var(--color-primary); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

.btn {
  display: inline-block;
  padding: 0.55em 1.3em;
  background: var(--color-primary);
  color: #fff;
  border-radius: 3px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background-color .2s;
}
.btn:hover { background: var(--color-primary-dark); color: #fff; text-decoration: none; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 2000;
  background: #fff; padding: 10px 16px;
}
.skip-link:focus { left: 10px; top: 10px; }

/* -------------------- 3) Header / Navigation -------------------- */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-logo { display: flex; align-items: center; flex-shrink: 0; }
/* Quelldatei ist nur 289x38px - nicht groesser als das anzeigen, sonst wird
   das Logo beim Hochskalieren unscharf/pixelig. */
.site-logo img { height: 38px; width: auto; }

.main-nav { flex-grow: 1; }
.main-nav > ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: flex-end; gap: 4px;
}
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: block; padding: 12px 14px; color: var(--color-text);
  font-weight: 500; text-transform: uppercase; font-size: 0.82rem; letter-spacing: .03em;
  border-radius: 3px;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.open > a { color: var(--color-primary); text-decoration: none; background: var(--color-bg-alt); }

.main-nav .submenu {
  list-style: none; margin: 0; padding: 8px 0;
  position: absolute; left: 0; top: 100%;
  min-width: 240px; background: #fff;
  border: 1px solid var(--color-border); border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.main-nav li.has-children:hover > .submenu,
.main-nav li.has-children.open > .submenu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.main-nav .submenu a {
  display: block; padding: 9px 18px; color: var(--color-text); font-size: 0.9rem;
}
.main-nav .submenu a:hover { background: var(--color-bg-alt); color: var(--color-primary); text-decoration: none; }

.menu-toggle {
  display: none;
  flex-shrink: 0;                 /* sonst quetscht Flexbox den Button schmal, Balken werden unklar */
  background: none; border: none; border-radius: 50%; cursor: pointer;
  width: 44px; height: 44px; padding: 0;
  position: relative;
}
.menu-toggle:hover, .menu-toggle:focus-visible { background: var(--color-bg-alt); }
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  content: ""; position: absolute; left: 11px; right: 11px; height: 3px; border-radius: 2px;
  background: var(--color-text);
  transition: transform .2s, opacity .2s, background-color .2s;
}
.menu-toggle span { top: 21px; }
.menu-toggle span::before { top: -8px; }
.menu-toggle span::after { top: 8px; }
.menu-toggle[aria-expanded="true"] span { background: transparent; }
.menu-toggle[aria-expanded="true"] span::before { background: var(--color-primary); transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span::after { background: var(--color-primary); transform: translateY(-8px) rotate(-45deg); }

/* -------------------- 3b) Startseite-Bilderkarussell -------------------- */
.home-slideshow {
  position: relative;
  aspect-ratio: 14 / 5;
  overflow: hidden;
  background: #000;
}
.home-slideshow-slides { list-style: none; margin: 0; padding: 0; width: 100%; height: 100%; }
.home-slideshow-slides li {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
}
.home-slideshow-slides li.active { opacity: 1; z-index: 1; }
.home-slideshow-slides img { width: 100%; height: 100%; object-fit: cover; }
.home-slideshow-caption {
  position: absolute; left: 0; right: 0; bottom: 14%;
  text-align: center; color: #fff; padding: 0 20px;
}
.home-slideshow-caption h1 {
  color: #fff; margin: 0; font-size: 2.0rem; font-weight: 300; letter-spacing: .02em;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.home-slideshow-prev,
.home-slideshow-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  background: rgba(0,0,0,.25); color: #fff; border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer;
}
.home-slideshow-prev:hover, .home-slideshow-next:hover { background: rgba(0,0,0,.5); }
.home-slideshow-prev { left: 16px; }
.home-slideshow-next { right: 16px; }
/* Wie im Original: das grosse Karussell nur auf Desktop/Tablet, spart auf
   dem Handy Ladezeit/Platz. */
@media (max-width: 900px) {
  .home-slideshow { display: none; }
}

/* -------------------- 4) Hero -------------------- */
.hero {
  position: relative;
  height: 30vh; min-height: 200px; max-height: 360px;
  overflow: hidden;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .hero-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: #fff; padding: 40px 20px 20px;
  text-align: center;
}
.hero .hero-caption h1 { color: #fff; margin: 0; font-size: 1.8rem; }

/* -------------------- 5) Inhalt -------------------- */
.page-content { padding: 48px 0; }
article.page-body { max-width: 820px; margin: 0 auto; }
article.page-body ul { padding-left: 1.3em; }
article.page-body li { margin-bottom: .4em; }

.video-wrap {
  max-width: 820px; margin: 0 auto 24px;
}
.video-wrap video { width: 100%; border-radius: 4px; }

/* -------------------- 6) Tabs-Widget (z.B. Startseite, Preise) -------------------- */
.tabs-widget { padding: 8px 0; }
.tabs-widget .tab-list {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0 0 28px; padding: 0; justify-content: center;
  border-bottom: 1px solid var(--color-border);
}
.tabs-widget .tab-list button {
  background: none; border: none; cursor: pointer;
  padding: 12px 18px; font: inherit; font-size: 0.85rem; font-weight: 300;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-light); border-bottom: 3px solid transparent;
}
.tabs-widget .tab-list button[aria-selected="true"] {
  color: var(--color-primary); border-bottom-color: var(--color-primary);
}
.tabs-widget .tab-panel { display: none; }
.tabs-widget .tab-panel.active { display: block; }

.tab-card {
  display: flex; flex-wrap: wrap; align-items: stretch;
  background: var(--color-bg-alt); border-radius: 6px; overflow: hidden;
}
.tab-card .tab-card-media { flex: 1 1 320px; min-height: 240px; overflow: hidden; }
.tab-card .tab-card-media img { width: 100%; height: 100%; object-fit: cover; min-height: 240px; transition: transform .3s; }
.tab-card button.lightbox-trigger {
  border: none; padding: 0; margin: 0; width: 100%; height: 100%; cursor: zoom-in; display: block;
}
.tab-card button.lightbox-trigger:hover img { transform: scale(1.06); }
.tab-card .tab-card-body { flex: 1 1 360px; padding: 32px; }
.tab-card .tab-card-body h4 { color: var(--color-primary); }
.tab-card iframe { width: 100%; border: none; }

/* -------------------- 7) Galerie + Lightbox -------------------- */
.gallery-filters {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 24px; padding: 0; justify-content: center;
}
.gallery-filters button {
  background: var(--color-bg-alt); border: 1px solid var(--color-border);
  border-radius: 20px; padding: 6px 16px; font: inherit; font-size: 0.85rem;
  cursor: pointer; color: var(--color-text);
}
.gallery-filters button[aria-pressed="true"] {
  background: var(--color-primary); color: #fff; border-color: var(--color-primary);
}

.gallery-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(4, 1fr);
}
.gallery-grid figure {
  margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px;
  background: var(--color-bg-alt);
}
.gallery-grid figure.is-hidden { display: none; }
.gallery-grid button.lightbox-trigger {
  border: none; padding: 0; margin: 0; width: 100%; height: 100%; cursor: zoom-in; display: block;
}
.gallery-grid img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .3s;
}
.gallery-grid button.lightbox-trigger:hover img { transform: scale(1.06); }

.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.9);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lightbox button {
  position: absolute; background: none; border: none; color: #fff;
  font-size: 2.2rem; cursor: pointer; line-height: 1; padding: 10px;
}
.lightbox .lightbox-close { top: 10px; right: 16px; }
.lightbox .lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* -------------------- 8) Buchungskalender (iframe) -------------------- */
.booking-frame-wrap { max-width: 820px; margin: 0 auto; }
.booking-frame-wrap iframe { width: 100%; border: none; }

/* -------------------- 8b) Kontaktformular (mailto:, kein Server noetig) -------------------- */
.contact-form {
  max-width: 560px; margin: 32px auto 0; padding: 28px;
  background: var(--color-bg-alt); border-radius: 6px;
}
.contact-form h3 { margin-top: 0; }
.contact-form .form-row { margin-bottom: 16px; }
.contact-form label { display: block; margin-bottom: 6px; font-weight: 500; font-size: .92rem; }
.contact-form input,
.contact-form textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: .95rem;
  border: 1px solid var(--color-border); border-radius: 3px; background: #fff; color: var(--color-text);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.contact-form button[type="submit"] { border: none; font: inherit; font-size: 1rem; }
.contact-form .form-note { font-size: .82rem; color: var(--color-text-light); margin-top: 10px; }

/* -------------------- 8c) Kontakt-Box (auf jeder Seite ueber dem Footer) -------------------- */
.kontakt-box {
  background: rgba(170, 171, 170, .25);
  padding: 32px 0;
}
.kontakt-box h3 {
  display: inline-flex; align-items: center;
  border-bottom: 1px solid var(--color-primary);
  padding-bottom: 6px; margin-bottom: 16px;
}
.kontakt-box h3::before {
  content: ""; display: inline-block; width: 5px; align-self: stretch;
  background: var(--color-primary); margin-right: 10px;
}
.kontakt-box p { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.kontakt-box svg { flex-shrink: 0; width: 1.1em; height: 1.1em; margin-top: .2em; fill: var(--color-primary); }

/* -------------------- 9) Footer -------------------- */
/* Wie im Original: helle, einzeilige Fusszeile (Copyright | Links | Icons
   nebeneinander) statt eines dunklen Blocks. */
.site-footer {
  color: var(--color-footer-text);
  border-top: 1px solid var(--color-border);
  padding: 14px 0; font-size: 0.9rem;
}
.site-footer a { color: var(--color-footer-text); }
.site-footer a:hover { color: var(--color-primary); }
.site-footer .footer-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 24px;
}
.site-footer .footer-copyright { margin: 0; white-space: nowrap; }
.site-footer .footer-links {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0; padding: 0;
}
.site-footer .footer-social { display: flex; gap: 14px; flex-shrink: 0; }
.site-footer .footer-social a { display: inline-flex; }
.site-footer .footer-social svg { width: 20px; height: 20px; fill: currentColor; }

/* -------------------- 10) Cookie-Banner -------------------- */
#cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
  background: #adadad; color: #fff; padding: 14px 5%;
}
#cookie-banner .cookiehead { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
#cookie-banner .cookiecontent { display: inline-block; max-width: 720px; font-size: .88rem; }
#cookie-banner .cookiebuttons { float: right; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#cookie-banner a.btn { color: #fff; }
#cookie-banner a.more-link { color: #fff; text-decoration: underline; font-size: .85rem; }
#cookie-banner .clr { clear: both; }

/* -------------------- 11) Responsive / Mobile -------------------- */
@media (max-width: 900px) {
  .menu-toggle { display: block; }

  .main-nav {
    position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0;
    background: #fff; overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 400;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav > ul { flex-direction: column; padding: 10px 0; }
  .main-nav > ul > li > a { padding: 14px 20px; }
  .main-nav .submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; border-radius: 0;
    max-height: 0; overflow: hidden; padding: 0;
    background: var(--color-bg-alt);
    transition: max-height .2s ease;
  }
  .main-nav li.open > .submenu { max-height: 600px; padding: 6px 0; }
  .main-nav .submenu a { padding: 10px 34px; }

  .hero { height: 24vh; min-height: 160px; }
  .tab-card { flex-direction: column; }
  .tab-card .tab-card-media { min-height: 200px; }
  .tab-card .tab-card-media img { min-height: 200px; }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }

  #cookie-banner .cookiebuttons { float: none; margin-top: 10px; }
}

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(1, 1fr); }
  h2 { font-size: 1.5rem; }
}
