/*
 * Dr. Thomas Equit – statische Website
 * Design: Maximilian Holl (ursprüngliches WordPress-Theme „Equit Custom Theme“),
 * statische Umsetzung ohne WordPress/PHP.
 * Breakpoints wie im Original: 600px, 860px, 999px, 1200px.
 */

/* ---------- Schriften (lokal, keine externen Anfragen) ---------- */
@font-face {
  font-family: "Source Sans Pro";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/source-sans-pro-400.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans Pro";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("../fonts/source-sans-pro-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans Pro";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/source-sans-pro-700.woff2") format("woff2");
}

/* ---------- Variablen ---------- */
:root {
  --navy: #0d0b60;
  --accent: #5d5bec;
  --accent-light: #9da5f7;
  --gray-bg: #efefef;
  --muted: #646464;
  --white: #fff;
  --layout: 1180px;
  --gutter: 4vw;
  --header-h: 65px;
  --font: "Source Sans Pro", Helvetica, Verdana, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  color: var(--navy);
  background: var(--white);
  line-height: 1.15;
  overflow-x: clip;
}
body.menu-open { overflow: hidden; }

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

h1, h2, h3, h4 { font-weight: 700; color: var(--navy); }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { line-height: 1.5em; }
a { color: var(--navy); }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.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: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 12px 18px;
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
}
.skip-link:focus { top: 10px; color: var(--white); }

.layout {
  max-width: var(--layout);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Kopfzeile ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--header-h);
  background: var(--white);
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--layout);
  margin-inline: auto;
  padding-left: var(--gutter);
}
.logo {
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
}

.nav-desktop { display: none; }
.nav-desktop ul,
.mobile-menu ul,
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-desktop ul { display: flex; }
.nav-desktop li { margin-right: 5vw; }
.nav-desktop a,
.footer-nav a {
  display: inline-block;
  text-decoration: none;
}
.nav-desktop a::after,
.footer-nav a::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  margin-top: 3px;
  background: var(--accent);
  transition: width 300ms;
}
.nav-desktop a:hover::after,
.nav-desktop a:focus-visible::after,
.nav-desktop a[aria-current="page"]::after { width: 100%; }

/* Burger-Button (mobil) */
.nav-toggle {
  position: relative;
  z-index: 12;
  width: 55px;
  height: 55px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  position: absolute;
  left: 16px;
  width: 23px;
  height: 3px;
  background: var(--navy);
  transition: all 0.4s ease;
}
.nav-toggle__bars { top: 26px; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; left: 0; }
.nav-toggle__bars::before { top: -8px; }
.nav-toggle__bars::after { top: 8px; }
.menu-open .nav-toggle__bars { transform: rotate(135deg); background: var(--white); }
.menu-open .nav-toggle__bars::before,
.menu-open .nav-toggle__bars::after { top: 0; transform: rotate(90deg); background: var(--white); }

/* Vollbild-Menü mit kreisförmiger Einblendung (wie im Original) */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear 0.4s;
}
.mobile-menu::before {
  content: "";
  position: absolute;
  width: 260vmax;
  height: 260vmax;
  border-radius: 50%;
  background: var(--navy);
  transform: scale(0);
  transition: transform 0.4s ease;
}
.mobile-menu ul {
  position: relative;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.mobile-menu li { padding: 1.2rem; }
.mobile-menu a {
  color: var(--white);
  font-size: 1.8rem;
  text-decoration: none;
}
.mobile-menu a:hover,
.mobile-menu a[aria-current="page"] { color: var(--accent-light); }
.menu-open .mobile-menu { visibility: visible; transition: none; }
.menu-open .mobile-menu::before { transform: scale(1); transition-duration: 0.8s; }
.menu-open .mobile-menu ul { opacity: 1; transition: opacity 0.1s ease 0.4s; }

.site-content { margin-top: var(--header-h); }

/* ---------- Startseite: Hero ---------- */
.hero {
  position: relative;
  z-index: 3;
  overflow: hidden;
  background: var(--white);
}
.hero__img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
}
.hero__inner { position: relative; }
.hero__text {
  max-width: 550px;
  padding-bottom: 20px;
}
/* Mobil: Überschrift sitzt unten auf dem Foto (Block so hoch wie das Foto,
   Seitenverhältnis 1920:1428), der Fließtext folgt darunter auf Weiß */
.hero__headline {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: calc(100vw * 1428 / 1920);
  padding-bottom: 16px;
}
.hero__text h1,
.hero__subtitle { margin: 0; }
.hero__subtitle {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
}
.hero__text p:not(.hero__subtitle) { margin-top: 30px; }

/* „Beratung anfragen“ – Post-it */
.post-it {
  display: block;
  width: 220px;
  margin: 30px var(--gutter) 50px;
  padding: 16px 10px;
  background: var(--navy);
  color: var(--white);
  font-size: 1.15em;
  text-align: center;
  text-decoration: none;
}
.post-it:hover,
.post-it:focus-visible { background: var(--accent); color: var(--white); }

/* Fokus-Abschnitte */
.focus { padding-block: 20px 50px; }
.focus--gray { background: var(--gray-bg); }
.focus__text { max-width: 680px; }
.focus h2 { margin-block: 1em; }

/* Kacheln (Verbindungen zu Unterseiten) */
.tiles {
  position: relative;
  z-index: 3;
  margin-top: 30px;
  padding-block: 30px 0;
  background: var(--gray-bg);
}
.tiles__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  margin: 0;
  padding: 0 var(--gutter);
  list-style: none;
}
.tile {
  position: relative;
  display: block;
  width: 300px;
  height: 300px;
  margin-bottom: 40px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.5s ease;
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tile__title {
  position: absolute;
  top: 35%;
  width: 100%;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--white);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.tile__popup {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
  background: var(--white);
  transition: height 0.35s ease-in-out;
}
.tile__popup p {
  width: 72%;
  margin: 13% auto 0;
  text-align: center;
  opacity: 0;
  transition: opacity 0.35s ease-in-out;
}
.tile:hover,
.tile:focus-visible { transform: scale(1.05); }
.tile:hover .tile__popup,
.tile:focus-visible .tile__popup { height: 120px; }
.tile:hover .tile__popup p,
.tile:focus-visible .tile__popup p { opacity: 1; }

/* Variante auf Unterseiten: grauer Streifen hinter den Kacheln */
.tiles--sub {
  margin-top: 0;
  padding-block: 30px 80px;
  background: linear-gradient(to bottom, var(--white) 110px, var(--gray-bg) 110px);
}

/* Kontakt */
.contact {
  position: relative;
  z-index: 3;
  padding-block: 60px 80px;
  background: var(--white);
}
.contact__text {
  max-width: 600px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  text-align: center;
}
.contact__mail {
  font-size: 30px;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.contact__mail a { text-decoration: none; }
.contact__mail a:hover { text-decoration: underline; color: var(--accent); }

/* Kontaktformular */
.contact-form-section {
  position: relative;
  z-index: 3;
  padding-block: 30px 50px;
  background: var(--gray-bg);
}
.contact-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.form-field label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b9b9b9;
  border-radius: 6px;
  background: var(--white);
  color: #000;
  font: inherit;
  font-size: 16px;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: #7aa4ff;
  outline: 2px solid #7aa4ff;
  outline-offset: 0;
}
.form-field textarea { min-height: 8em; resize: vertical; }
.form-field--full,
.form-actions,
.form-status { grid-column: 1 / -1; }
.form-field .required { color: #b02000; }
.form-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 15px;
}
.form-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.button {
  display: inline-block;
  padding: 12px 22px;
  border: 0;
  border-radius: 4px;
  background: var(--navy);
  color: var(--white);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.button:hover,
.button:focus-visible { background: var(--accent); }
.button[disabled] { opacity: 0.6; cursor: progress; }
.form-status {
  margin: 0;
  padding: 0;
  font-size: 16px;
}
.form-status:empty { display: none; }
.form-status[data-state] { padding: 12px 16px; border-radius: 4px; }
.form-status[data-state="success"] { background: #ebf9f0; color: #11702f; }
.form-status[data-state="error"] { background: #ffeeea; color: #a62000; }
.field-error { margin: 6px 0 0; color: #a62000; font-size: 15px; }

/* ---------- Unterseiten ---------- */
.page-header {
  position: relative;
  min-height: 200px;
  overflow: hidden;
}
.page-header img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.page-header__inner {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 200px;
}
.page-header h1 {
  margin: 0 0 0.6em;
  color: var(--white);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.quote {
  max-width: 450px;
  margin: 50px 0 0;
  padding: 0;
  min-height: 100px;
}
.quote p {
  font-size: 20px;
  font-style: italic;
  color: var(--muted);
}

.text-image {
  position: relative;
  margin-block: 20px 60px;
  padding-block: 30px;
  background: var(--gray-bg);
}
.text-image__inner {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
}
.text-image__text { max-width: 500px; }
.text-image__img {
  width: 100%;
  max-width: 400px;
  margin-top: -40px;
}

.facts { margin: 0; }
.facts__row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.facts dt {
  width: 200px;
  margin: 1.33em 20px 0 0;
  font-size: 18px;
  font-weight: 700;
}
.facts dd {
  max-width: 550px;
  margin: 0;
}
.spacer { height: 75px; }
.spacer--sm { height: 50px; }

.text-block { margin-block: 40px 80px; }
.text-block h2 { margin: 0; }
.text-block__inner {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.text-block__main {
  max-width: 650px;
  margin-right: var(--gutter);
}
.text-block__aside {
  max-width: 300px;
  margin: 0;
  font-size: 20px;
  font-style: italic;
  line-height: 1.25em;
}

.legal p { overflow-wrap: anywhere; }

/* Fehlerseite */
.error-page { padding-block: 60px 100px; }
.error-page__code {
  margin: 0;
  font-size: 80px;
  font-weight: 700;
  line-height: 1;
  color: var(--gray-bg);
  -webkit-text-stroke: 1px var(--navy);
}
.error-page ul { padding-left: 1.2em; line-height: 1.8; }

/* ---------- Fußzeile ---------- */
.site-footer {
  position: relative;
  z-index: 3;
  min-height: 130px;
  padding-block: 30px;
  background: var(--navy);
  color: var(--white);
}
.site-footer__inner {
  max-width: var(--layout);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.site-footer .logo {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--white);
  font-size: 18px;
}
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 6vw;
}
.footer-nav a { color: var(--white); }
.footer-nav a:hover,
.footer-nav a[aria-current="page"] { color: var(--accent-light); }
.site-footer .logo:hover { color: var(--accent-light); }

/* ---------- ab 600px ---------- */
@media (min-width: 600px) {
  :root { --header-h: 80px; }
  p { font-size: 1.15em; }
  h1 { font-size: 42px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
  .hero__subtitle { font-size: 40px; }
  .contact__mail { font-size: 40px; }

  .nav-desktop { display: block; }
  .nav-toggle,
  .mobile-menu { display: none; }

  .hero { min-height: 550px; }
  .hero__img img { height: 100%; object-fit: cover; object-position: center top; }
  .hero__text { padding-top: 120px; }
  .hero__headline { display: block; min-height: 0; padding-bottom: 0; }

  .post-it { margin-top: -25px; margin-bottom: 20px; position: relative; z-index: 4; }

  .tiles { padding-block: 60px; }
  .tile { width: 150px; height: 150px; }
  .tile__title { top: 30%; font-size: 22px; }
  .tile__popup p { width: 95%; margin-top: 19px; font-size: 16px; }
  .tiles--sub { background: linear-gradient(to bottom, var(--white) 110px, var(--gray-bg) 110px); }

  .contact-form { grid-template-columns: 1fr 1fr; }

  .page-header,
  .page-header__inner { min-height: 280px; }

  /* Bild und Text stehen hier noch untereinander: kein Versatz nach oben,
     sonst überdeckt das Bild das Zitat darüber */
  .text-image__img { margin-top: 0; margin-bottom: 30px; }
  .text-block__aside { margin-top: 20px; }

  .site-footer__inner { display: flex; align-items: baseline; flex-wrap: wrap; gap: 20px 4vw; }
  .site-footer .logo { margin-bottom: 0; font-size: 20px; }
}

/* ---------- ab 860px ---------- */
@media (min-width: 860px) {
  .tiles__list { justify-content: center; }
  .tile { width: 200px; height: 200px; margin-inline: 40px; }
  .tile__title { font-size: 24px; }
  .tile__popup p { margin-top: 15%; }
  .footer-nav ul { gap: 10px 5vw; }
}

/* ---------- ab 960px: Profiltext und Bild nebeneinander ----------
   Erst ab hier passen Text (500px) und Bild (350px) sicher in eine Zeile.
   Nur dann darf das Bild nach oben in den weißen Bereich ragen. */
@media (min-width: 960px) {
  .text-image__inner { flex-wrap: nowrap; }
  .text-image__img { flex: 0 0 370px; margin: -80px 0 0 4vw; }
}

/* ---------- ab 999px ---------- */
@media (min-width: 999px) {
  /* Post-it bleibt beim Scrollen sichtbar und verschwindet hinter Kacheln, Kontakt und Fußzeile */
  .post-it {
    position: fixed;
    z-index: 1;
    top: 150px;
    right: 20px;
    margin: 0;
  }
  .tile { width: 250px; height: 250px; }
  .tile__title { font-size: 28px; }
  .tile__popup p { width: 90%; margin-top: 12%; font-size: 18px; }
}

/* ---------- ab 1200px ---------- */
@media (min-width: 1200px) {
  .tile { width: 300px; height: 300px; }
  .tile__popup p { width: 72%; }
}
