/* ==========================================================
   Mut im Gepaeck - gemeinsames Stylesheet (Startseite + Unterseiten)
   Aufbau: 1 Variablen · 2 Grundlagen · 3 Navigation/Footer
           4 Startseite (Szene, Himmel, Haus)
           5 Unterseiten · 6 Bewegung (nur wenn erlaubt)
   ========================================================== */

/* ---- 1. Variablen (Farbpalette Variante A: Apricot-Terrakotta) ---- */
:root {
  --roof: #E9A77B;
  --roof-light: #F6D9BF;
  --roof-dark: #C98358;
  --wall: #FBF3E2;
  --wood: #B07A4B;
  --wood-dark: #8A5A33;
  --shutter: #8DBFA3;
  --shutter-dark: #5F9479;
  --grass: #7DC25A;
  --footer: #8A5A3A;
  --footer-text: #F9F1E0;

  --ink: #3B2A1A;
  --ink-soft: #5C4632;
  --sky-ink: #12395C;
  --link: #2F6B4F;
  --focus: #0B4F9E;

  --font-text: ui-rounded, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

/* ---- 2. Grundlagen ---- */
* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: #FFFBF2;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
}

a { color: var(--link); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  border-radius: 8px;
  border: 2px solid var(--focus);
}
.skip-link:focus { top: 0.5rem; }

/* ---- 3. Navigation, Kopf und Footer ---- */
.top-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-nav a {
  display: inline-block;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.top-nav a:hover { background: #fff; border-color: var(--roof); }

.top-nav a[aria-current="page"] {
  background: var(--roof);
  border-color: var(--roof-dark);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.6rem 1rem;
  background: linear-gradient(180deg, #BFE4F8 0%, #E6F5FD 100%);
  border-bottom: 6px solid var(--grass);
}

.home-link { display: block; line-height: 0; }
.home-link img { display: block; }

.site-name {
  margin: 0;
  margin-right: auto;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sky-ink);
}

.site-footer {
  padding: 1.6rem 1rem 2rem;
  background: var(--footer);
  color: var(--footer-text);
  text-align: center;
  font-size: 0.95rem;
}

.site-footer ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin: 0 0 0.6rem;
  padding: 0;
  list-style: none;
}

.site-footer a { color: var(--footer-text); }
.site-footer a:focus-visible { outline-color: var(--footer-text); }
.site-footer p { margin: 0; }

/* ---- 4. Startseite: Szene mit Himmel, Wiese und Haus ---- */
.scene {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: linear-gradient(180deg, #5DB6EE 0%, #9BD3F5 45%, #DDF2FC 82%, #F3FAFE 100%);
}

.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sun {
  position: absolute;
  top: 3.5rem;
  right: 4%;
  width: clamp(72px, 13vw, 150px);
  height: auto;
}

.sun-rays { transform-origin: 50px 50px; }

.puff { transform-box: fill-box; transform-origin: center; }

.cloud {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--w);
  height: auto;
  filter: drop-shadow(0 6px 8px rgba(70, 130, 180, 0.2));
}

.hero {
  position: relative;
  z-index: 2;
  padding: 0.9rem 1rem 0;
  text-align: center;
}

.hero h1 {
  margin: 0.9rem 0 0;
  font-size: clamp(2rem, 6vw, 3.3rem);
  color: var(--sky-ink);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65);
}

.hero-sub {
  margin: 0.2rem auto 0.9rem;
  max-width: 34rem;
  color: var(--sky-ink);
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.house-wrap {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 28rem;
}

.house {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: visible; /* Wiese und Zaun laufen ueber den SVG-Rand hinaus bis zum Bildschirmrand */
}

/* Fenster und Haustuer als Links */
.window-link {
  cursor: pointer;
  outline: none;
}

.window-link .hit { fill: #fff; fill-opacity: 0; }

.window-link .ring {
  fill: none;
  stroke: transparent;
  stroke-width: 5;
  stroke-linejoin: round;
}

.window-link:focus-visible .ring { stroke: var(--focus); }

.frame { fill: #FFFDF7; stroke: var(--wood); stroke-width: 2; }
.pane { stroke: var(--wood-dark); stroke-width: 3; }
.pane-lit { opacity: 0; stroke: #FFE08A; stroke-width: 3; }
.shine { fill: #fff; opacity: 0.32; pointer-events: none; }
.mullion { fill: none; stroke: var(--wood-dark); stroke-width: 3; pointer-events: none; }

.window-link:hover .pane-lit,
.window-link:focus-visible .pane-lit { opacity: 1; }

/* Beschriftung: haengt wie ein Schild am Balkon bzw. liegt vor der Tuer */
.label {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.label rect { fill: #FFF8EC; stroke: var(--wood-dark); stroke-width: 2; }

.label text {
  font-family: var(--font-text);
  font-size: 18px;
  font-weight: 700;
  fill: #4A2F16;
  text-anchor: middle;
}

.window-link:hover .label,
.window-link:focus-visible .label {
  opacity: 1;
  transform: none;
}

/* Touch-Geraete haben kein Hover: Beschriftungen bleiben sichtbar */
@media (hover: none) {
  .label { opacity: 1; transform: none; }
}

/* Esc blendet die Beschriftungen aus (siehe js/main.js) */
.house.labels-off .label { opacity: 0; }

/* ---- 5. Unterseiten ---- */
.page-banner {
  padding: 2.2rem 1rem 2.4rem;
  background: var(--accent);
  color: var(--accent-ink);
}

.theme-nm { --accent: #8DBFA3; --accent-ink: #173A2A; }
.theme-as { --accent: #E9A77B; --accent-ink: #4A2410; }
.theme-plain { --accent: #F6D9BF; --accent-ink: #4A2410; }

.page-banner .inner,
.content {
  max-width: 44rem;
  margin: 0 auto;
}

.floor-tag {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.15rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  font-weight: 700;
  font-size: 0.9rem;
}

.page-banner h1 { margin: 0 0 0.6rem; font-size: clamp(1.9rem, 5vw, 2.8rem); }
.lead { margin: 0; font-size: 1.15rem; }

.content { padding: 2rem 1rem 3rem; }
.content h2 { margin: 2rem 0 0.5rem; font-size: 1.45rem; }
.content h3 { margin: 1.4rem 0 0.4rem; font-size: 1.2rem; }
.content h4 { margin: 1rem 0 0.3rem; font-size: 1.05rem; color: var(--ink-soft); }
.content p { margin: 0 0 1rem; }
.content ul { margin: 0 0 1rem; padding-left: 1.3rem; }
.content li { margin: 0 0 0.4rem; }

.placeholder {
  padding: 0.9rem 1.1rem;
  background: #FFF3DA;
  border-radius: 6px;
}

.placeholder-center {
  margin: 0;
  border-radius: 6px;
  text-align: center;
}
.back-link { display: inline-block; margin-top: 1.5rem; font-weight: 700; }

/* ---- 6. Bewegung: nur wenn der Browser sie nicht ausdruecklich abwaehlt ---- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .window-link .pane-lit,
  .label { transition: opacity 0.25s ease, transform 0.25s ease; }

  .top-nav a { transition: background-color 0.2s ease, filter 0.2s ease; }

  /* Wolken ziehen von links nach rechts durchs Bild */
  .cloud {
    left: 0;
    animation: drift var(--dur) linear infinite;
    animation-delay: calc(var(--dur) * var(--phase) * -1);
  }

  .sun-rays { animation: spin 120s linear infinite; }

  .puff { animation: rise 5s ease-in infinite; }
  .puff2 { animation-delay: 1.7s; }
  .puff3 { animation-delay: 3.4s; }
}

@keyframes drift {
  from { transform: translateX(-100%); }
  to { transform: translateX(100vw); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes rise {
  0%   { transform: translate(0, 0) scale(0.6); opacity: 0; }
  15%  { opacity: 0.85; }
  100% { transform: translate(14px, -60px) scale(1.7); opacity: 0; }
}
