/* ==========================================================================
   Kindertagespflege Die Nesthopser – Stylesheet
   --------------------------------------------------------------------------
   Eigenständiges CSS ohne Framework und ohne externe Abhängigkeiten.
   Nachbau des ursprünglichen Layouts: fixe AppBar, responsiver Drawer
   (links, ab 960px dauerhaft sichtbar) und zentrierte Text-Sektionen.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design-Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Farben */
  --color-primary: #d98e84;                 /* rgb(217,142,132) */
  --color-primary-darken: #d07367;
  --color-primary-lighten: #e2a9a1;
  --color-secondary: #e6a690;
  --color-text: #424242;                    /* rgb(66,66,66) */
  --color-text-secondary: rgba(0, 0, 0, 0.54);
  --color-surface: #ffffff;
  --color-background: #ffffff;
  --color-appbar: #fdb8a0;                  /* Logo-Rand, gleiche Fläche wie Drawer und Startbild */
  --color-appbar-text: #4a2c22;
  --color-divider: #e0e0e0;
  --color-action-hover: rgba(0, 0, 0, 0.06);
  /* Drawer in Logo-Farben: Rand #fdb8a0, Mitte #fcc4ae, Text dunkelbraun */
  --color-drawer-top: #fdb8a0;
  --color-drawer-bottom: #fcc4ae;
  --color-drawer-text: #4a2c22;
  --color-drawer-hover: rgba(255, 255, 255, 0.35);
  --color-drawer-active: rgba(255, 255, 255, 0.5);
  --color-drawer-divider: rgba(74, 44, 34, 0.25);
  --color-overlay: rgba(33, 33, 33, 0.5);
  --color-whatsapp: #25d366;
  --color-scrollbar: #c4c4c4;
  --color-scrollbar-hover: #a6a6a6;

  /* Typografie */
  --font-family: Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 0.875rem;               /* 14px – Navigation, Buttons */
  --font-size-body: 1.2rem;                 /* 19.2px – Fließtext */
  --font-size-lead: 1.5rem;                 /* 24px – Hervorhebungen, Kontakt */
  --font-size-h1: 2rem;                     /* 32px – Sektionstitel */

  /* Maße */
  --toolbar-height: 56px;                   /* wird per Media Query angepasst */
  --drawer-width: 240px;
  --content-max-width: 960px;
  --gutter: 32px;
  --media-gap: 48px;              /* Abstand zwischen Text und Bildern */
  --block-gap: 32px;              /* Abstand zwischen Text und Button/Kontaktblock */
  --radius: 4px;

  /* Effekte */
  --shadow-1: 0 2px 1px -1px rgba(0, 0, 0, 0.2),
              0 1px 1px 0 rgba(0, 0, 0, 0.14),
              0 1px 3px 0 rgba(0, 0, 0, 0.12);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);
  --duration-drawer: 225ms;

  /* Stapelreihenfolge */
  --z-drawer: 1100;
  --z-appbar: 1300;
  --z-overlay: 1301;
  --z-drawer-mobile: 1302;
}

@media (orientation: landscape) {
  :root { --toolbar-height: 48px; }
}

@media (min-width: 600px) {
  :root { --toolbar-height: 64px; }
}

/* --------------------------------------------------------------------------
   2. Reset & Basis
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: var(--color-scrollbar) transparent;
  scrollbar-width: thin;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: 1.43;
  letter-spacing: 0.01071em;
  color: var(--color-text);
  background-color: var(--color-background);
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Scrollbalken wie im Original */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-scrollbar);
  border-radius: 1px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-scrollbar-hover);
}

/* --------------------------------------------------------------------------
   3. Ripple-Effekt (Klick-Feedback auf Buttons und Links)
   -------------------------------------------------------------------------- */
.ripple {
  position: relative;
  overflow: hidden;
  --ripple-color: var(--color-text);
}

.ripple::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--ripple-color) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(20);
  opacity: 0;
  transition: transform 0.6s, opacity 1s;
}

.ripple--icon::after {
  transform: scale(14);
}

.ripple:active::after {
  transform: scale(0);
  opacity: 0.1;
  transition: 0s;
}

/* --------------------------------------------------------------------------
   4. Layout-Rahmen
   -------------------------------------------------------------------------- */
.layout {
  position: relative;
  width: 100%;
  min-height: 100%;
}

/* AppBar ------------------------------------------------------------------ */
.appbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: var(--z-appbar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
  color: var(--color-appbar-text);
  background-color: var(--color-appbar);
  transition: margin var(--duration-drawer) var(--ease-decelerate),
              width var(--duration-drawer) var(--ease-decelerate);
}

.toolbar {
  position: relative;
  display: flex;
  align-items: center;
  height: var(--toolbar-height);
  padding: 0 16px;
}

.toolbar__spacer {
  flex-grow: 1;
}

@media (min-width: 600px) {
  .toolbar {
    padding: 0 24px;
  }
}

/* Icon-Button (Hamburger) */
.icon-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 12px;
  font-size: 1.5rem;
  color: inherit;
  border-radius: 50%;
  transition: background-color 150ms var(--ease-standard);
  --ripple-color: currentColor;
}

.toolbar .icon-button {
  margin-left: -12px;
}

.icon-button svg {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.icon-button:focus-visible,
.icon-button:active {
  background-color: var(--color-action-hover);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .icon-button:hover {
    background-color: var(--color-action-hover);
  }
}

/* Drawer ------------------------------------------------------------------ */
.drawer {
  position: fixed;
  top: 0;
  left: calc(-1 * var(--drawer-width));
  z-index: var(--z-drawer);
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  width: var(--drawer-width);
  height: 100%;
  overflow-y: auto;
  color: var(--color-drawer-text);
  background-color: var(--color-drawer-top);
  background-image: linear-gradient(180deg, var(--color-drawer-top) 0 200px, var(--color-drawer-bottom) 100%);
  box-shadow: none;
  outline: 0;
  transition: left var(--duration-drawer) var(--ease-decelerate),
              box-shadow var(--duration-drawer) var(--ease-decelerate);
}

.drawer__inner {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
}

.drawer__header {
  display: flex;
  min-height: var(--toolbar-height);
  padding: 12px 24px;
}

.drawer__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background-color 250ms var(--ease-standard);
}

.drawer__logo img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.drawer__logo:focus-visible,
.drawer__logo:active {
  background-color: var(--color-drawer-hover);
}

@media (hover: hover) and (pointer: fine) {
  .drawer__logo:hover {
    background-color: var(--color-drawer-hover);
  }
}

/* Navigation */
.nav {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.nav__link {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  padding: 8px 16px;
  font-size: var(--font-size-base);
  font-weight: 400;
  line-height: 1.75;
  color: inherit;
  background-color: transparent;
  transition: background-color 250ms var(--ease-standard);
}

.nav__link span {
  width: 100%;
  margin-left: 12px;
  letter-spacing: 0;
  text-align: start;
}

.nav__link:focus-visible {
  background-color: var(--color-drawer-hover);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .nav__link:hover {
    background-color: var(--color-drawer-hover);
  }
}

.nav__link.is-active {
  font-weight: 500;
  background-color: var(--color-drawer-active);
}

.nav__divider {
  flex-shrink: 0;
  width: 100%;
  height: 0;
  margin: 0;
  border-top: 1px solid var(--color-drawer-divider);
}

/* Overlay (nur Mobil, hinter dem geöffneten Drawer) */
.overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-overlay);
  display: none;
  background-color: var(--color-overlay);
}

.overlay.is-visible {
  display: block;
  animation: overlay-fade-in 150ms ease;
}

@keyframes overlay-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Hauptinhalt */
.main {
  flex: 1 1 auto;
  margin: 0;
  padding-top: var(--toolbar-height);
  transition: margin var(--duration-drawer) var(--ease-decelerate);
}

/* Einfache Seiten ohne Drawer (z. B. 404): Leiste mit Textmarke */
.toolbar__brand {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: inherit;
}

.text-link {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Zustände --------------------------------------------------------------- */
/* Mobil (< 960px): Drawer standardmäßig zu, per Menü-Button einblendbar */
@media (max-width: 959px) {
  .drawer {
    z-index: var(--z-drawer-mobile);
  }

  .layout.drawer-open .drawer {
    left: 0;
    box-shadow: var(--shadow-1);
  }
}

/* Desktop (>= 960px): Drawer standardmäßig offen, Inhalt rückt nach rechts */
@media (min-width: 960px) {
  .overlay {
    display: none !important;
  }

  .layout:not(.drawer-closed) .drawer {
    left: 0;
    box-shadow: var(--shadow-1);
  }

  .layout:not(.drawer-closed) .appbar {
    width: calc(100% - var(--drawer-width));
    margin-left: var(--drawer-width);
  }

  .layout:not(.drawer-closed) .main {
    margin-left: var(--drawer-width);
  }
}

/* --------------------------------------------------------------------------
   5. Sektionen & Inhalt
   -------------------------------------------------------------------------- */
.section {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 24px;
  color: var(--color-text);
  background-color: var(--color-surface);
  border-radius: var(--radius);
  scroll-margin-top: var(--toolbar-height);
}

.section:last-of-type {
  margin-bottom: 0;
}

.section__header {
  display: flex;
  align-items: center;
  margin: 0 var(--gutter);
  padding: 16px;
}

.section__title {
  flex: 1 1 auto;
  font-size: var(--font-size-h1);
  font-weight: 500;
  line-height: 1.167;
  letter-spacing: -0.01562em;
  text-align: center;
  color: var(--color-primary);
}

.section__body {
  flex-grow: 1;
}

.container {
  display: block;
  width: 100%;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 960px) {
  .container {
    max-width: var(--content-max-width);
  }
}

/* Fließtext */
.text {
  padding: 0 var(--gutter);
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.00938em;
  text-align: left;
  color: var(--color-text);
  background-color: var(--color-surface);
}

.text--center {
  text-align: center;
}

.text--lead {
  font-size: var(--font-size-lead);
  text-align: center;
  color: var(--color-primary);
}

/* Bilder. Abstand zu Text ober- und unterhalb; angrenzende Margins fallen
   zusammen, benachbarte Textabsaende bleiben daher bei diesem Wert. */
.media,
.media-pair {
  margin-top: var(--media-gap);
  margin-bottom: var(--media-gap);
}

.media:first-child,
.media-pair:first-child {
  margin-top: 0;
}

.media:last-child,
.media-pair:last-child {
  margin-bottom: 0;
}

.media-pair > .media {
  margin: 0;
}

.media {
  display: flex;
  justify-content: center;
}

.media img {
  display: block;
  width: 100%;              /* mit width/height-Attributen: Platz wird vor dem Laden reserviert */
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

/* Zwei Bilder nebeneinander (ab 600px), auf kleinen Bildschirmen untereinander */
.media-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 var(--gutter);
}

.media-pair img {
  max-height: none;
}

@media (min-width: 600px) {
  .media-pair {
    grid-template-columns: 1fr 1fr;
  }
}

/* Startbild: volle Breite, Logo-Farbe als Fläche, nahtlos zur Leiste.
   Das Logo wird kreisförmig weich ausgeblendet (keine harten Bildkanten),
   unten läuft die Fläche ins Weiß des Inhalts aus. */
.media--hero {
  position: relative;
  align-items: center;
  height: 60vh;
  margin: 0;
  background-color: var(--color-drawer-top);
}

.media--hero img {
  width: min(100%, 60vh);
  height: auto;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 60%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(circle closest-side, #000 60%, rgba(0, 0, 0, 0) 100%);
}

.media--hero::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--color-surface) 100%);
  pointer-events: none;
}

/* Button-Link (z. B. Konzeption als PDF) --------------------------------- */
/* Aktionsblock (Button) und Kontaktblock: etwas enger als Bilder, weil die
   Blöcke selbst deutlich kleiner sind */
.actions,
.contact {
  margin-top: var(--block-gap);
}

.actions {
  display: flex;
  justify-content: center;
  padding: 0 var(--gutter);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.02857em;
  text-align: center;
  text-transform: uppercase;
  color: var(--color-drawer-text);
  background-color: var(--color-drawer-top);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: background-color 250ms var(--ease-standard), box-shadow 250ms var(--ease-standard);
  --ripple-color: var(--color-drawer-text);
}

.button:focus-visible,
.button:active {
  background-color: var(--color-drawer-bottom);
}

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    background-color: var(--color-drawer-bottom);
  }
}

/* Kontakt ----------------------------------------------------------------- */
.contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter);
}

.contact__button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px var(--gutter);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: 0.02857em;
  text-transform: uppercase;
  color: var(--color-text);
  border-radius: var(--radius);
  transition: background-color 250ms var(--ease-standard);
}

.contact__icon {
  flex-shrink: 0;
  width: 2.25rem;               /* 36px */
  height: 2.25rem;
  fill: var(--color-primary);
}

.contact__phone {
  font-size: var(--font-size-lead);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.00938em;
  text-transform: none;
}

.contact__mail {
  font-size: var(--font-size-lead);
  font-weight: 350;
  line-height: 1.2;
  letter-spacing: -0.00833em;
  text-transform: none;
}

.contact__whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background-color 250ms var(--ease-standard);
}

.contact__whatsapp-icon {
  display: block;
  width: 48px;
  height: 48px;
  margin: auto auto 6px;
}

.contact__whatsapp-icon svg {
  width: 48px;
  height: auto;
}

.contact__button:focus-visible,
.contact__button:active,
.contact__whatsapp:focus-visible,
.contact__whatsapp:active {
  background-color: var(--color-action-hover);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .contact__button:hover,
  .contact__whatsapp:hover {
    background-color: var(--color-action-hover);
  }
}

/* Fußzeile mit den rechtlichen Links ------------------------------------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px var(--gutter);
  background-color: var(--color-drawer-top);
  background-image: linear-gradient(180deg, var(--color-drawer-bottom) 0%, var(--color-drawer-top) 100%);
  color: var(--color-drawer-text);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
}

.footer__link {
  padding: 8px 12px;
  font-size: 1rem;
  line-height: 1.5;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  border-radius: var(--radius);
  transition: background-color 250ms var(--ease-standard);
  --ripple-color: var(--color-drawer-text);
}

.footer__link:focus-visible,
.footer__link:active {
  background-color: var(--color-drawer-hover);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .footer__link:hover {
    background-color: var(--color-drawer-hover);
  }
}

.footer__note {
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0.85;
}

/* --------------------------------------------------------------------------
   6. Barrierefreiheit: reduzierte Bewegung
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
