/* ============================================================
   machbar – Praxis für psychosoziale Ergotherapie
   Alle Maße stammen aus dem Figma-Design (Breite 1440 px) und
   werden über --s proportional zur Bildschirmbreite skaliert.
   ============================================================ */

/* Typografie: PF Marlet Display über Adobe Fonts (Kit kzs3jcj).
   Regel: Regular = braun, Black = blau. Ausnahme: Impressum. */

:root {
  --bg: #ffdedc;
  --blue: #2900f9;
  --brown: #684a41;
  --brown-dark: #432f2a;
  --font: "pf-marlet-display", Georgia, serif;

  /* 1 Design-Pixel */
  --s: clamp(0.62px, calc(100vw / 1440), 1px);

  --gutter: 16px;
  /* Einheitlicher Abstand zwischen allen Abschnitten */
  --gap: calc(300 * var(--s));

  --fs-body: calc(24 * var(--s));
  --fs-nav: calc(32 * var(--s));
  --fs-h: calc(38 * var(--s));    /* Titel etwas größer als das Menü */
  --fs-imp: calc(16 * var(--s));  /* Impressum-Text */

  --header-h: calc(112 * var(--s));
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--brown);
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: normal;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.blue { color: var(--blue); font-weight: 900; }

/* Sprachumschaltung */
html[data-lang="de"] body [lang="en"],
html[data-lang="en"] body [lang="de"] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Fixiertes Menü ---------- */
.nav-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: var(--bg);
}
.nav {
  width: calc(1440 * var(--s));
  max-width: 100%;
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  text-align: center;
  font-size: var(--fs-nav);
  line-height: 1;
}
.nav a, .nav button { font-weight: 400; color: var(--brown); white-space: nowrap; }
.nav a.active,
.nav button[aria-pressed="true"] { color: var(--blue); font-weight: 900; }
.nav .lang { display: flex; justify-content: center; gap: 1.1em; }

/* ---------- Layout ---------- */
main { padding-top: calc(305 * var(--s)); padding-bottom: calc(160 * var(--s)); }

.block { margin-top: var(--gap); }

.col {
  width: min(calc(var(--w, 884) * var(--s)), 100% - 2 * var(--gutter));
  margin-inline: auto;
  position: relative;
}

.text { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.text p { margin: 0; }
.text.intro { color: var(--brown-dark); }
.text .spacer { height: 1em; }

.h {
  font-weight: 900;
  color: var(--blue);
  font-size: var(--fs-h);
  line-height: normal;
  margin: 0;
}

ul { margin: 0; padding: 0; list-style: none; text-align: left; }
ul.rings li { position: relative; padding-left: 1.15em; }
ul.rings li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.36em;
  width: 0.58em;
  height: 0.58em;
  border: 0.13em solid var(--blue);
  border-radius: 50%;
}

/* ---------- Hero ---------- */
.hero { display: flex; justify-content: center; }
.hero img { width: calc(400 * var(--s)); }   /* etwas kleiner als im Figma (450) */
/* Mehr Luft zwischen Logo und "machbar"/Einleitung */
.text.intro.block { margin-top: calc(var(--gap) + 110 * var(--s)); }

/* ---------- Fotos ---------- */
.fig { position: relative; margin-inline: auto; }
.fig img.photo { position: relative; width: 100%; }
.w507 { width: calc(507 * var(--s)); }
.w492 { width: calc(492 * var(--s)); }
.w595 { width: calc(595 * var(--s)); }
.w676 { width: calc(676 * var(--s)); }

/* ---------- Dekorationen (Positionen exakt aus Figma) ---------- */
.deco { position: absolute; pointer-events: none; user-select: none; }
.deco-machbar-m, .deco-ergo-m { display: none; }

/* "machbar" links oben am Einleitungstext */
.deco-machbar {
  width: calc(179 * var(--s));
  top: calc(-157 * var(--s));
  left: max(calc(-145 * var(--s)), calc((100% - 100vw) / 2 + 8px));
}

/* Kleiner Bogen am Praxisfoto */
.bogen-wrap { margin-top: calc(var(--gap) + 138 * var(--s)); }
/* Mehr Luft zwischen "zusammen"-Text und Foto mit Polli */
.ergo-wrap { margin-top: calc(var(--gap) + 170 * var(--s)); }
.deco-bogen { width: 39.7%; left: -13.9%; top: -20.4%; }

/* "Ergotherapie" rechts über dem Foto von Barbara */
.deco-ergo { width: 37.9%; left: 126%; top: -45.8%; }

.side {
  position: absolute;
  margin: 0;
  font-weight: 900;
  color: var(--blue);
  font-size: var(--fs-h);
  line-height: 1;
  white-space: nowrap;
}
.side-barbara {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  right: calc(100% + 29 * var(--s));
  bottom: 0;
}
.side-kontakt {
  left: calc(100% + 51 * var(--s));
  bottom: -0.2em;
}

/* ---------- Kontakt-Logo ---------- */
.contact-logo { width: calc(438 * var(--s)); margin-inline: auto; position: relative; }
.contact-logo img { width: 100%; }
.contact-logo a { position: absolute; display: block; }
/* Feine Linie unter dem Text beim Darüberfahren */
.contact-logo a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;  /* volle Pixel, damit das Blau nicht durch Kantenglättung heller wirkt */
  background: var(--blue);
  transform: scaleX(0);
  transition: transform .35s ease;
}
.contact-logo a:hover::after,
.contact-logo a:focus-visible::after { transform: scaleX(1); }
.contact-logo a:focus-visible { outline: none; }
/* Adresse: beide Zeilen gemeinsam unterstreichen */
.contact-logo:has(.l-addr1:hover, .l-addr2:hover, .l-addr1:focus-visible) .l-addr1::after,
.contact-logo:has(.l-addr1:hover, .l-addr2:hover, .l-addr1:focus-visible) .l-addr2::after { transform: scaleX(1); }
.contact-logo .l-addr1 { left: 38.13%; width: 37.21%; top: 36.85%; height: 4.52%; }
.contact-logo .l-addr2 { left: 32.42%; width: 47.95%; top: 43.72%; height: 5.36%; }
.contact-logo .l-tel1 { left: 18.49%; width: 37.21%; top: 50.92%; height: 4.52%; }
.contact-logo .l-tel2 { left: 61.64%; width: 32.88%; top: 50.92%; height: 4.52%; }
.contact-logo .l-mail { left: 16.89%; width: 82.19%; top: 57.62%; height: 4.86%; }
.contact-logo .l-web { left: 17.81%; width: 77.17%; top: 64.49%; height: 4.86%; }

/* ---------- Fuß: Polli + Impressum ---------- */
.footer {
  width: calc(1440 * var(--s));
  max-width: 100%;
  margin-inline: auto;
}
.footer-top {
  position: relative;
  height: calc(433 * var(--s));
}
.footer .polli {
  position: absolute;
  left: calc(90 * var(--s));
  top: 0;
  width: calc(501 * var(--s));
}
.imp-toggle {
  position: absolute;
  left: calc(1180 * var(--s));
  top: calc(215 * var(--s));
  width: calc(66 * var(--s));
  height: calc(218 * var(--s));
  display: flex;
  align-items: center;
  justify-content: center;
}
.imp-toggle span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 900;
  color: var(--blue);
  font-size: var(--fs-nav);
  line-height: 1;
  white-space: nowrap;
}

/* Aufklappbarer Impressum-Text (eigene Typo-Regel: braun, Titel in Black) */
.imp-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.6s ease;
}
.imp-panel.open { grid-template-rows: 1fr; }
.imp-panel > div { overflow: hidden; }
.imp-text {
  margin-left: calc(673 * var(--s));
  width: calc(536 * var(--s));
  font-size: var(--fs-imp);
  color: var(--brown);
  padding-bottom: calc(40 * var(--s));
}
.imp-text p { margin: 0; }
.imp-text b { font-weight: 900; }
.imp-text .gap { height: 1.2em; }
.imp-text ul.rings li::before { border-width: 0.12em; }
.imp-text a { color: inherit; }

/* ============================================================
   Handy
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --s: clamp(0.4px, calc(100vw / 780), 0.62px);
    --fs-body: clamp(11.5px, 3.1vw, 13px);
    --fs-nav: clamp(11px, 3.4vw, 14px);
    --fs-h: clamp(15px, 4.6vw, 19px);
    --fs-imp: clamp(10.5px, 2.8vw, 12px);
    --header-h: 52px;
    --gap: calc(220 * var(--s));
    --gutter: 24px;
  }
  main { padding-top: calc(var(--header-h) + 48px); }

  .nav { display: flex; justify-content: space-between; padding: 0 12px; }
  .nav .lang { gap: 0.7em; }

  /* Handy-Varianten der Schriftbögen (gedreht wie im Handy-Figma) */
  .deco-machbar, .deco-ergo { display: none; }
  .deco-machbar-m, .deco-ergo-m { display: block; }
  .deco-machbar-m { width: 32vw; top: auto; bottom: calc(100% + 12px); right: -6px; }
  .text.intro.block { margin-top: calc(var(--gap) + 20vw + 12px); }
  .deco-ergo-m { width: 40vw; top: auto; left: auto; bottom: calc(100% + 30px); right: calc((100% - 100vw) / 2 + 14vw); }
  .ergo-wrap { margin-top: calc(var(--gap) + 22vw + 30px); }

  /* Alle Fotos gleich hoch und zentriert (Querformat wird seitlich leicht beschnitten) */
  .fig.w507, .fig.w492, .fig.w595, .fig.w676 { width: fit-content; }
  .fig img.photo {
    width: auto;
    height: 74vw;
    max-width: calc(100vw - 2 * var(--gutter));
    object-fit: cover;
  }
  .bogen-wrap { margin-top: calc(var(--gap) + 15vw); }
  .side-barbara { right: calc(100% + 10px); }
  .side-kontakt { left: calc(100% + 10px); }

  .footer { width: auto; padding-inline: var(--gutter); }
  .footer-top { display: flex; align-items: flex-end; justify-content: space-between; height: auto; }
  .footer .polli { position: static; width: calc(501 * var(--s)); }
  .imp-toggle { position: static; width: auto; height: auto; padding-bottom: 4px; }
  .imp-text { margin: 24px 0 0; width: 100%; }
}

/* ---------- Scroll-Animation: Blöcke erscheinen sanft ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(calc(60 * var(--s)));
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
