/* =====================================================================
   KOLLERHAUS – Eigene Styles & Animationen
   ---------------------------------------------------------------------
   Das Grundlayout entsteht mit Tailwind-Klassen direkt im HTML.
   Diese Datei enthält:
     1. Farb-Variablen (Tailwind-Farbpalette)
     2. Basis-Einstellungen
     3. Header & Navigation
     4. Hero-Animationen (beim Laden der Seite)
     5. Scroll-Animationen (Reveal beim Scrollen)
     6. Überschriften
     7. Komponenten (Kennzahlen, Zimmer, Ausstattung, Region, Kontakt)
     8. Galerie & Lightbox
     9. Zitat-Band
    10. Footer
    11. Rechtstexte (Impressum & Datenschutz)
    12. Scroll-to-Top-Button
    13. Barrierefreiheit: reduzierte Bewegung
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. FARB-VARIABLEN
   Werte entsprechen exakt den Tailwind-Farben, damit eigene Klassen
   und Tailwind-Klassen zusammenpassen.
   --------------------------------------------------------------------- */
:root {
  --color-primary: #22c55e;        /* green-500  – Primärfarbe          */
  --color-primary-dark: #16a34a;   /* green-600  – Hover / Text-Akzent  */
  --color-secondary: #dc2626;      /* red-600    – Sekundärfarbe        */
  --color-bg: #d1fae5;             /* emerald-100 – Hintergrund         */
  --color-text: #042f2e;           /* teal-950   – Textfarbe            */
  --radius: 1rem;                  /* Einheitlicher Eckenradius         */
  --header-offset: 6rem;           /* Abstand für Anker unter dem Header */
}


/* ---------------------------------------------------------------------
   2. BASIS
   --------------------------------------------------------------------- */

/* Sanftes Scrollen bei Klick auf Anker-Links */
html {
  scroll-behavior: smooth;
}

/* Sections nicht unter dem fixierten Header verstecken */
section[id] {
  scroll-margin-top: var(--header-offset);
}

/* Verhindert horizontales Scrollen durch seitlich einfliegende Elemente
   (.reveal-left / .reveal-right sind vor dem Einblenden nach außen versetzt) */
main {
  overflow-x: hidden;
}

@supports (overflow: clip) {
  main {
    overflow-x: clip; /* wie hidden, erzeugt aber keinen eigenen Scroll-Container */
  }
}

/* Textmarkierung in der Primärfarbe */
::selection {
  background: var(--color-primary);
  color: #fff;
}

/* Body sperren, solange die Lightbox offen ist */
body.no-scroll {
  overflow: hidden;
}


/* ---------------------------------------------------------------------
   3. HEADER & NAVIGATION
   --------------------------------------------------------------------- */

/* Header schwebt mit etwas Abstand über dem Inhalt */
.site-header {
  padding-top: 1rem;
  transition: padding 0.3s ease;
}

/* Innere Leiste (Glas-Effekt kommt über Tailwind: bg-white/85 + backdrop-blur) */
.header-inner {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  box-shadow: 0 4px 20px rgba(4, 47, 46, 0.06);
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

/* Zustand nach dem Scrollen (wird per JS gesetzt): kompakter + stärkerer Schatten */
.site-header.header-scrolled {
  padding-top: 0.5rem;
}

.site-header.header-scrolled .header-inner {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  box-shadow: 0 10px 30px rgba(4, 47, 46, 0.15);
}

/* Desktop-Links */
.nav-link {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  background: var(--color-bg);
}

/* Aktiver Link = Section, die gerade sichtbar ist (per JS gesetzt) */
.nav-link.is-active {
  background: var(--color-bg);
  color: var(--color-primary-dark);
}

/* Mobiles Menü: zugeklappt über max-height 0, aufgeklappt per .is-open */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.mobile-menu.is-open {
  max-height: 30rem;
  opacity: 1;
}

.mobile-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-link:hover,
.mobile-link.is-active {
  background: var(--color-bg);
  color: var(--color-primary-dark);
}


/* ---------------------------------------------------------------------
   4. HERO-ANIMATIONEN (laufen einmal beim Laden der Seite)
   --------------------------------------------------------------------- */

/* Text fliegt von links ein (Haupttitel) */
@keyframes fly-in-left {
  from {
    opacity: 0;
    transform: translateX(-120px) skewX(-8deg);
  }
  to {
    opacity: 1;
    transform: translateX(0) skewX(0);
  }
}

/* Text fliegt von oben ein (Ortszeile) */
@keyframes fly-in-down {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Text gleitet von unten nach oben und wird sichtbar (Untertitel, Buttons) */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Trennlinie wächst von links nach rechts */
@keyframes grow-x {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Langsamer Zoom des Hero-Hintergrunds ("Ken-Burns-Effekt") */
@keyframes slow-zoom {
  from { transform: scale(1.15); }
  to   { transform: scale(1); }
}

/* Auf- und Abwippen des Scroll-Pfeils */
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(10px); }
}

/* Zuordnung der Animationen. "both" sorgt dafür, dass das Element
   schon während der Verzögerung im Startzustand (unsichtbar) ist. */
.anim-fly-left {
  animation: fly-in-left 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-fly-down {
  animation: fly-in-down 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-fade-up {
  animation: fade-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.anim-grow {
  transform-origin: left center;
  animation: grow-x 0.8s ease-out both;
}

/* Verzögerungen, damit die Elemente nacheinander erscheinen */
.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.45s; }
.delay-3 { animation-delay: 0.8s; }
.delay-4 { animation-delay: 1.1s; }

.hero-bg {
  animation: slow-zoom 14s ease-out both;
}

.scroll-hint i {
  display: inline-block;
  animation: bounce-down 2s ease-in-out infinite;
}


/* ---------------------------------------------------------------------
   5. SCROLL-ANIMATIONEN (Reveal)
   Elemente mit .reveal sind zunächst unsichtbar und leicht versetzt.
   Sobald sie in den sichtbaren Bereich scrollen, setzt script.js die
   Klasse .is-visible und sie blenden sanft ein.
   Nur aktiv, wenn JS läuft (Klasse .js auf <html>), sonst bleibt alles sichtbar.
   --------------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  /* Optionale Staffelung über style="--reveal-delay: 200ms" im HTML */
  transition-delay: var(--reveal-delay, 0ms);
}

/* Varianten: von links bzw. rechts einfliegen */
.js .reveal.reveal-left  { transform: translateX(-60px); }
.js .reveal.reveal-right { transform: translateX(60px); }

/* Endzustand: sichtbar an Originalposition */
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}


/* ---------------------------------------------------------------------
   6. ÜBERSCHRIFTEN
   --------------------------------------------------------------------- */

/* Kleine Dachzeile über der Überschrift (rote Linie + Großbuchstaben) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 2px;
  background: currentColor;
}

/* Section-Überschrift mit grüner Linie, die beim Einblenden "wächst" */
.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-title::after {
  content: "";
  display: block;
  width: 0;
  height: 4px;
  margin-top: 1.25rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

/* Linie wird sichtbar, sobald die Überschrift eingeblendet ist
   (bzw. sofort, wenn kein JavaScript läuft) */
.section-title.is-visible::after,
html:not(.js) .section-title::after {
  width: 4rem;
}

/* Zentrierte Variante: Linie mittig */
.section-title--center::after {
  margin-left: auto;
  margin-right: auto;
}


/* ---------------------------------------------------------------------
   7. KOMPONENTEN
   --------------------------------------------------------------------- */

/* --- Kennzahlen-Kacheln (Personen, Zimmer, Bäder, Sauna) --- */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem 0.75rem;
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
  box-shadow: 0 4px 14px rgba(4, 47, 46, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(4, 47, 46, 0.12);
}

.stat-card i {
  font-size: 1.4rem;
  color: var(--color-primary);
}

.stat-card strong {
  margin-top: 0.4rem;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}

.stat-card span {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  opacity: 0.7;
}

/* --- Zimmer-Cards --- */
.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.75rem;
  border: 2px solid var(--color-bg);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.room-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-primary);
  box-shadow: 0 18px 40px rgba(4, 47, 46, 0.12);
}

/* Icon-Kachel oben in der Zimmer-Card */
.room-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.room-card:hover .room-icon {
  transform: rotate(-8deg) scale(1.08);
}

.room-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.room-card p {
  font-size: 0.95rem;
  opacity: 0.75;
}

/* Etagen-Badge oben rechts */
.room-floor {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius);
  background: var(--color-secondary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- Ausstattungs-Liste --- */
.feature {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.feature i {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: #fff;
  color: var(--color-primary);
}

.feature span {
  padding-top: 0.45rem;
  line-height: 1.4;
}

/* Hinweis-Eintrag (z. B. "kein WLAN") in Sekundärfarbe */
.feature--muted i {
  color: var(--color-secondary);
}

/* --- Hausregeln --- */
.rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rule i {
  width: 1.25rem;
  text-align: center;
}

/* --- Region-Cards (Winter / Sommer / Einkehren) --- */
.region-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 6px 20px rgba(4, 47, 46, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.region-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(4, 47, 46, 0.15);
}

/* Bildbereich mit festem Seitenverhältnis */
.region-img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius);
}

.region-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* Leichter Zoom des Bildes beim Überfahren der Card */
.region-card:hover .region-img img {
  transform: scale(1.06);
}

/* Label auf dem Bild (z. B. "Winter") */
.region-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Liste mit grünen Punkten als Aufzählungszeichen */
.region-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem 1.75rem 1.75rem;
  font-size: 0.95rem;
}

.region-list li {
  position: relative;
  padding-left: 1.25rem;
  line-height: 1.45;
}

.region-list li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-primary);
}

/* --- Kontakt-Karten --- */
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 14px rgba(4, 47, 46, 0.06);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

/* Nur verlinkte Karten (Telefon, E-Mail) reagieren auf Hover */
a.contact-card:hover {
  transform: translateX(6px);
  border-color: var(--color-primary);
}

.contact-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-size: 1.1rem;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.contact-value {
  font-weight: 600;
  line-height: 1.4;
}


/* ---------------------------------------------------------------------
   8. GALERIE & LIGHTBOX
   --------------------------------------------------------------------- */

/* Einzelnes Galeriebild: einheitliches 4:3-Format, Bild wird zugeschnitten */
.gallery-item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: zoom-in;
  box-shadow: 0 4px 14px rgba(4, 47, 46, 0.1);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* Dunkles Overlay mit Lupen-Icon (Font Awesome per CSS) */
.gallery-item::after {
  content: "\f00e"; /* fa-magnifying-glass-plus */
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #fff;
  background: rgba(4, 47, 46, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.08);
}

.gallery-item:hover::after,
.gallery-item:focus-visible::after {
  opacity: 1;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

/* Lightbox: standardmäßig unsichtbar, per .is-open (JS) eingeblendet */
.lightbox {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

/* Bild wächst beim Öffnen leicht auf */
.lightbox-figure {
  transform: scale(0.94);
  transition: transform 0.35s ease;
}

.lightbox.is-open .lightbox-figure {
  transform: scale(1);
}

/* Steuer-Buttons (Schließen, Vor, Zurück).
   Kein transform hier, da die Position per Tailwind (translate) gesetzt wird. */
.lightbox-btn {
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.25rem;
  transition: background-color 0.2s ease;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  background: var(--color-primary);
}


/* ---------------------------------------------------------------------
   9. ZITAT-BAND
   --------------------------------------------------------------------- */
.quote-band {
  background-size: cover;
  background-position: center;
}

/* Parallax-Effekt nur auf großen Bildschirmen
   (mobile Browser unterstützen background-attachment: fixed schlecht) */
@media (min-width: 1024px) {
  .quote-band {
    background-attachment: fixed;
  }
}


/* ---------------------------------------------------------------------
   10. FOOTER
   --------------------------------------------------------------------- */

/* Links zu Impressum / Datenschutz */
.footer-legal {
  transition: color 0.2s ease;
}

/* Hover sowie die aktuell geöffnete Seite (aria-current) in Primärfarbe */
.footer-legal:hover,
.footer-legal[aria-current="page"] {
  color: var(--color-primary);
}


/* ---------------------------------------------------------------------
   11. RECHTSTEXTE (impressum.html & datenschutz.html)
   Die Texte werden unverändert als HTML eingefügt. Tailwind setzt
   Überschriften, Abstände und Listen standardmäßig zurück – hier
   bekommen sie wieder eine gut lesbare Formatierung.
   --------------------------------------------------------------------- */
.legal-content {
  overflow-wrap: break-word;   /* lange Wörter/URLs brechen auf dem Handy um */
  hyphens: auto;               /* deutsche Silbentrennung (lang="de") */
}

/* Seitentitel fliegt beim Laden von links ein (Keyframes aus Abschnitt 4) */
.legal-content h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  animation: fly-in-left 1s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both;
}

/* Grüne Linie unter dem Seitentitel – wie bei den Section-Überschriften */
.legal-content h1::after {
  content: "";
  display: block;
  width: 4rem;
  height: 4px;
  margin-top: 1.25rem;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  background: var(--color-primary);
}

/* Hauptabschnitte mit Trennlinie */
.legal-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 2rem;
  border-top: 2px solid var(--color-bg);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Erste Zwischenüberschrift direkt unter dem Titel: keine doppelte Linie */
.legal-content h1 + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.legal-content h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.legal-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: rgba(4, 47, 46, 0.85);
}

/* Aufzählungen wieder mit Punkten in der Primärfarbe */
.legal-content ul {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.legal-content li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.legal-content li::marker {
  color: var(--color-primary);
}

.legal-content a {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  transition: color 0.2s ease;
}

.legal-content a:hover {
  color: var(--color-secondary);
}


/* ---------------------------------------------------------------------
   12. SCROLL-TO-TOP-BUTTON
   Unsichtbar, bis script.js nach etwas Scrollen .is-visible setzt.
   --------------------------------------------------------------------- */
.scroll-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition: opacity 0.35s ease, visibility 0.35s ease,
              transform 0.35s ease, background-color 0.2s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top.is-visible:hover {
  transform: translateY(-4px);
}


/* ---------------------------------------------------------------------
   13. REDUZIERTE BEWEGUNG
   Nutzer, die im Betriebssystem "Bewegung reduzieren" aktiviert haben,
   sehen alle Inhalte sofort ohne Animationen.
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js .reveal,
  .js .reveal.reveal-left,
  .js .reveal.reveal-right {
    opacity: 1;
    transform: none;
  }

  .section-title::after {
    width: 4rem;
  }
}
