/* ==========================================================================
   Ferienhof Halde – Contao 5.7 Theme
   Einbinden: Layout > Stylesheets > "Externe Stylesheets" -> files/ferienhof/css/theme.css
   ========================================================================== */

/* ---------- Schriften (lokal, kein Google-Abruf -> kein Cookie-Banner nötig) */
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/roboto-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/roboto-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/lora-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 500; font-display: swap; src: url("../fonts/lora-latin-500-italic.woff2") format("woff2"); }

/* ---------- Farben & Maße (an die alte Seite angelehnt) */
:root {
  --gruen: #a1b133;          /* Olivgrün der alten Seite */
  --gruen-dunkel: #6c7a1d;   /* Navigation, Links – lesbar auf Weiß */
  --gruen-tief: #4d5714;
  --gruen-hell: #eef1dc;     /* Seitenhintergrund (alt: #e3e8c2, etwas heller) */
  --gruen-zart: #f6f7ec;
  --rot: #a8231c;            /* Schriftzug "Ferienhof Halde" */
  --text: #2f3224;
  --text-leise: #5d614c;
  --weiss: #fff;
  --linie: #d9ddbf;
  --radius: 6px;
  --breite: 1120px;
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* ---------- Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--gruen-hell);
  color: var(--text);
  font: 400 1.0625rem/1.65 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gruen-dunkel); text-underline-offset: .2em; }
a:hover { color: var(--rot); }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--gruen-tief); line-height: 1.25; margin: 1.4em 0 .5em; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); color: var(--rot); margin-top: 0; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.8rem); }
h3 { font-size: 1.25rem; }
strong { font-weight: 700; }
.invisible, .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Seitengerüst (Contao: #wrapper > #header / #container / #footer, jeweils .inside) */
#header .inside, #container, #footer .inside, .mod_breadcrumb {
  max-width: var(--breite);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Kopf */
#header { background: var(--weiss); border-bottom: 4px solid var(--gruen); }
#header .inside {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 84px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--rot); }
.logo img { width: 250px; }
.logo span { font: 500 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1 var(--serif); letter-spacing: .01em; }
.logo small { display: block; font: 400 .8rem/1.3 var(--sans); color: var(--text-leise); letter-spacing: .04em; margin-top: 4px; }

/* Navigation (mod_navigation) */
.mod_navigation ul { list-style: none; margin: 0; padding: 0; }
.mod_navigation .level_1 { display: flex; gap: 4px; }
.mod_navigation .level_1 > li { position: relative; }
.mod_navigation a, .mod_navigation strong {
  display: block; padding: 10px 14px; border-radius: var(--radius);
  font-weight: 500; font-size: .98rem; text-decoration: none; color: var(--text);
}
.mod_navigation a:hover, .mod_navigation a:focus-visible { background: var(--gruen-zart); color: var(--gruen-tief); }
.mod_navigation .active, .mod_navigation .trail { color: var(--gruen-tief); box-shadow: inset 0 -3px 0 var(--gruen); border-radius: 0; }
.mod_navigation .level_2 {
  position: absolute; left: 0; top: 100%; z-index: 20; min-width: 230px;
  background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(47,50,36,.12); padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: .15s;
}
.mod_navigation .level_1 > li:hover > .level_2,
.mod_navigation .level_1 > li:focus-within > .level_2 { opacity: 1; visibility: visible; transform: none; }
.mod_navigation .level_2 .active { box-shadow: none; background: var(--gruen-zart); }

.nav-toggle { display: none; }

/* Desktop: Navigation als olivgrüne Leiste unter dem Schriftzug – wie auf der alten Seite */
@media (min-width: 821px) {
  #header { border-bottom: 0; }
  #header .inside { flex-wrap: wrap; min-height: 0; padding-top: 0px; gap: 0; }
  #header .mod_navigation {
    flex-basis: 100%;
    background: var(--gruen-dunkel);
    box-shadow: 0 0 0 100vmax var(--gruen-dunkel);
    clip-path: inset(0 -100vmax);
    border-top: 0;
  }
  #header .mod_navigation .level_1 > li > a,
  #header .mod_navigation .level_1 > li > strong { color: var(--weiss); border-radius: 0; padding: 13px 16px; }
  #header .mod_navigation .level_1 > li > a:hover { background: rgba(255,255,255,.12); color: var(--weiss); }
  #header .mod_navigation .level_1 > li > .active,
  #header .mod_navigation .level_1 > li > .trail { box-shadow: inset 0 -4px 0 var(--gruen); background: rgba(0,0,0,.08); }
  #header .mod_navigation .level_1 > li:first-child > a,
  #header .mod_navigation .level_1 > li:first-child > strong { margin-left: -16px; }
  #header .mod_navigation .level_2 { border-radius: 0 0 var(--radius) var(--radius); border-top: 0; }
}

/* ---------- Titelbild (Startseite + Unterseiten) */
.hero { position: relative; overflow: hidden; background: var(--gruen-tief); }
.hero figure, .hero img { margin: 0; width: 100%; margin-bottom: 0 !important; }
.hero img { height: clamp(260px, 52vw, 560px); object-fit: cover; }
.hero .slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.hero .slide:first-child { position: relative; }
.hero .slide.is-active { opacity: 1; }
.hero figcaption { display: none;}
.hero-text {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 60px 20px 28px;
  background: linear-gradient(to top, rgba(30,33,18,.62), rgba(30,33,18,0));
  color: var(--weiss);
}
.hero-text .inside { max-width: var(--breite); margin: 0 auto; padding-inline: 20px; }
.hero-text p { font: italic 500 clamp(1.15rem, 1rem + .8vw, 1.6rem)/1.35 var(--serif); margin: 0; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.hero--klein img { height: clamp(180px, 28vw, 320px); }

/* ---------- Brotkrumen */
.mod_breadcrumb { padding-top: 14px; font-size: .9rem; color: var(--text-leise); }
.mod_breadcrumb ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.mod_breadcrumb li + li::before { content: "›"; margin: 0 .5em; color: var(--gruen); }
.mod_breadcrumb a { color: var(--text-leise); text-decoration: none; }

/* ---------- Inhalt */
#container { padding-block: 28px 56px; }
#main .inside { background: var(--weiss); border-radius: var(--radius); padding: clamp(22px, 4vw, 48px); box-shadow: 0 1px 2px rgba(47,50,36,.06); }
.mod_article + .mod_article { margin-top: 2.5em; }
#main .inside > .mod_article > *:last-child { margin-bottom: 0; }

/* Text mit Bild (Contao 5: .content-text.media.media--left/right > figure) */
.content-text { margin-bottom: 1.6em; }
.content-text::after { content: ""; display: table; clear: both; }
.content-text.media--left > figure, .content-text .media--left { float: left; margin: .3em 28px 12px 0; max-width: 45%; }
.content-text.media--right > figure, .content-text .media--right { float: right; margin: .3em 0 12px 28px; max-width: 45%; }
.content-text.media--above > figure, .content-text .media--above { margin-bottom: 1.2em; }
.content-text.media--left > h1, .content-text.media--left > h2, .content-text.media--left > h3 { margin-top: 0; }
.rte > *:last-child { margin-bottom: 0; }

/* Brotkrumen innerhalb der weißen Box; auf der Startseite ausgeblendet */
#main .mod_breadcrumb { max-width: none; padding: 0; margin: 0 0 1.2em; }
.startseite .mod_breadcrumb { display: none; }
figure { margin: 0; }
figure img { border-radius: var(--radius); }
figcaption, .caption { font-size: .9rem; color: var(--text-leise); margin-top: 8px; }

.content-image { margin-bottom: 1.6em; }

/* Hinweis-Box (z. B. Raumhöhe) */
.hinweis {
  background: #fbf3e8; border-left: 4px solid #c9822b; padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 1.4em;
}

/* Bildergalerie (content-gallery) */
.content-gallery ul { list-style: none; margin: 0 0 1.6em; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.content-gallery li { margin: 0; }
.content-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s ease, box-shadow .25s ease; }
.content-gallery a:hover img { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(47,50,36,.18); }

/* Teaser-Kacheln Startseite */
.teaser-reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 2em 0; }
.teaser {
  background: var(--gruen-zart); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 26px 22px 22px; text-align: center; display: flex; flex-direction: column; align-items: center;
}
.teaser img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid var(--weiss); box-shadow: 0 2px 8px rgba(47,50,36,.15); margin-bottom: 14px; }
.teaser h3 { margin: 0 0 .4em; }
.teaser p { color: var(--text-leise); margin-bottom: 1em; }
.teaser .mehr { margin-top: auto; }

.mehr, .button, button[type=submit], input[type=submit] {
  display: inline-block; background: var(--gruen-dunkel); color: var(--weiss); border: 0; border-radius: var(--radius);
  padding: 9px 20px; font: 500 .95rem/1.3 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s;
}
.mehr:hover, .button:hover, button[type=submit]:hover, input[type=submit]:hover { background: var(--gruen-tief); color: var(--weiss); }

/* Zwei Spalten (Allgäu-Teaser, Preise) */
.zwei-spalten .rte { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 1.5em 0; }
.allgaeu-teaser img { border-radius: var(--radius); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 14px; }
.allgaeu-teaser h2, .allgaeu-teaser h3 { margin-top: 0; font-size: 1.35rem; }
.allgaeu-teaser small { display: block; font: italic 500 1rem var(--serif); color: var(--text-leise); }

.gruss { font: italic 500 1.15rem var(--serif); color: var(--gruen-tief); }

/* Preistabelle */
.preise table, table.preise { width: 100%; border-collapse: collapse; margin: .5em 0 1.2em; }
.preise td, .preise th { padding: 10px 0; border-bottom: 1px solid var(--linie); text-align: left; }
.preise td:last-child { text-align: right; font-weight: 500; white-space: nowrap; }
.preise-box { background: var(--gruen-zart); border: 1px solid var(--linie); border-radius: var(--radius); padding: 22px 24px; }
.preise-box h3 { margin-top: 0; }
.preise-box ul { padding-left: 1.1em; margin: 0; }

/* Eckdaten-Liste */
.eckdaten { list-style: none; padding: 0; margin: 0 0 1.4em; display: flex; flex-wrap: wrap; gap: 8px; }
.eckdaten li { background: var(--gruen-zart); border: 1px solid var(--linie); border-radius: 999px; padding: 4px 14px; font-size: .95rem; }

/* Kontaktbox neben Formular (Artikel mit CSS-Klasse "kontakt-raster") */
.kontakt-box { background: var(--gruen-zart); border: 1px solid var(--linie); border-radius: var(--radius); padding: 22px 24px; }
.kontakt-box h3 { margin-top: 0; }
.kontakt-raster { display: grid; grid-template-columns: 2fr 1fr; gap: 0 36px; align-items: start; }
.kontakt-raster > .content-text:first-child { grid-column: 1 / -1; }
.kontakt-raster > script { display: none; }

/* Formular in Contao 5.7 (.ce_form) */
.ce_form .widget { margin-bottom: 16px; }
.ce_form .formbody { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.ce_form .widget-textarea, .ce_form .widget-checkbox, .ce_form .widget-submit, .ce_form .widget-explanation, .ce_form .widget-captcha, .ce_form .widget-altcha, .ce_form .widget-select { grid-column: 1 / -1; }
.ce_form label, .ce_form legend { display: block; font-weight: 500; font-size: .95rem; margin-bottom: 5px; padding: 0; }
.ce_form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ce_form span.mandatory { color: var(--rot); margin-left: 2px; }
.ce_form input[type=text], .ce_form input[type=email], .ce_form input[type=tel], .ce_form input[type=date], .ce_form input[type=number], .ce_form select, .ce_form textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--weiss);
  border: 1px solid #c8cca9; border-radius: var(--radius); padding: 10px 12px;
}
.ce_form select { max-width: 260px; }
.ce_form textarea { min-height: 150px; resize: vertical; }
.ce_form input:focus, .ce_form select:focus, .ce_form textarea:focus { outline: 2px solid var(--gruen); outline-offset: 1px; border-color: var(--gruen); }
.ce_form .checkbox_container > span { display: flex; gap: 10px; align-items: flex-start; }
.ce_form .checkbox_container input { margin-top: .35em; flex: none; width: 18px; height: 18px; accent-color: var(--gruen-dunkel); }
.ce_form .checkbox_container label { font-weight: 400; margin: 0; }
.ce_form .error { color: var(--rot); font-size: .9rem; margin: 0 0 4px; }
.ce_form button.submit { font-size: 1rem; padding: 11px 26px; }
.ce_form altcha-widget { --altcha-border-radius: 6px; --altcha-color-border: #c8cca9; --altcha-max-width: 320px; }

/* ---------- Fuß */
#footer { background: var(--gruen-tief); color: #e7ead2; font-size: .95rem; }
#footer .inside { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 28px; padding-block: 36px 24px; }
#footer h4, #footer strong.titel { font-family: var(--serif); font-weight: 500; color: var(--weiss); font-size: 1.1rem; margin: 0 0 .5em; display: block; }
#footer a { color: var(--weiss); }
#footer a:hover { color: #dfe7a5; }
#footer p { margin: 0 0 .4em; }
#footer .unterzeile { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; font-size: .85rem; color: #c3c8a6; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
#footer .unterzeile nav a { margin-left: 16px; }

/* ---------- Lightbox (theme.js) */
.lb { position: fixed; inset: 0; z-index: 1000; background: rgba(20,22,12,.92); display: flex; align-items: center; justify-content: center; padding: 56px 16px; }
.lb[hidden] { display: none; }
.lb figure { margin: 0; max-width: min(1200px, 100%); text-align: center; }
.lb img { max-height: calc(100vh - 140px); width: auto; margin: 0 auto; border-radius: 4px; }
.lb figcaption { color: #e7ead2; margin-top: 10px; }
.lb button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lb button:hover { background: rgba(255,255,255,.25); }
.lb .lb-zu { top: 14px; right: 14px; }
.lb .lb-zurueck { left: 14px; top: 50%; transform: translateY(-50%); }
.lb .lb-weiter { right: 14px; top: 50%; transform: translateY(-50%); }

/* ---------- Nach oben */
.nach-oben { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--gruen-dunkel); color: #fff; display: grid; place-items: center; text-decoration: none; opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.nach-oben.sichtbar { opacity: .9; pointer-events: auto; }
.nach-oben:hover { color: #fff; opacity: 1; }

/* ---------- Tablet / Handy */
@media (max-width: 900px) {
  .teaser-reihe { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .zwei-spalten .rte, .kontakt-raster { grid-template-columns: 1fr; }
  #footer .inside { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; background: var(--gruen-dunkel); color: #fff; border: 0; border-radius: var(--radius);
    padding: 9px 14px; font: 500 .95rem var(--sans); cursor: pointer;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
  #header .inside { flex-wrap: wrap; min-height: 70px; padding-block: 10px; }
  #header .mod_navigation { display: none; flex-basis: 100%; padding-bottom: 10px; }
  #header.nav-offen .mod_navigation { display: block; }
  .mod_navigation .level_1 { flex-direction: column; }
  .mod_navigation .level_2 { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; }
  .mod_navigation .active, .mod_navigation .trail { box-shadow: inset 3px 0 0 var(--gruen); }
  .content-text.media--left > figure, .content-text.media--right > figure, .content-text .media--left, .content-text .media--right { float: none; max-width: 100%; margin: 0 0 14px; }
  .ce_form .formbody { grid-template-columns: 1fr; }
  body { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  #header .mod_navigation, .nav-toggle, .nach-oben, .hero, #footer .unterzeile nav { display: none !important; }
  body { background: #fff; }
  #main .inside { box-shadow: none; padding: 0; }
}
