/* =========================================================
   EDIT: colours and font
   ========================================================= */
:root {
  --color-header: #7a5e68;        /* header background, dropdown and slide-in menu */
  --color-header-text: #ebe8e7;   /* text and links in header and slide-in menu (warm near-white) */
  --color-footer: #b7aca9;        /* footer background (warm light grey) */
  --color-footer-text: #3a3533;   /* text and links in the footer (warm dark grey) */
  --color-flieder: #cbb7c1;       /* line under headings (soft brownish violet / mauve) */
  --color-flieder-light: #ece3e7; /* boxes, back of the cards */
  --color-primary: #6b4f61;       /* links, buttons (deep brownish violet / plum) */
  --color-primary-dark: #553d4c;  /* buttons when the mouse is over them */
  --color-heading: #4c3944;       /* headings */
  --color-text: #302a2d;          /* normal text (warm dark grey) */
  --color-background: #faf7f2;    /* page background (very light beige) */

  /* Fonts that are already installed on the computer – nothing is loaded from the internet */
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;

  --radius: 0.75rem;              /* rounded corners of boxes, cards, pictures */
}

/* =========================================================
   Base (mobile first: phones first, larger screens below)
   ========================================================= */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-background);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; text-align: center; }
main img { display: block; margin-inline: auto; }

img { max-width: 100%; height: auto; }

/* Headings: classic serif font, calm deep violet */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-heading);
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.75rem); line-height: 1.2; }

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--color-primary-dark); }

/* Clearly visible focus for keyboard users */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--color-flieder-light); }

.container {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background: var(--color-header);
  color: var(--color-header-text);
  box-shadow: 0 1px 0 rgb(76 57 68 / 0.08);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

/* The logo sets the height of the top row, so logo and "Menü" button
   stay in place when the menu opens below them. */
.logo {
  display: flex;
  align-items: center;
  height: 4.5rem;
  line-height: 0;
}
.logo img { height: 2.5rem; width: auto; }

/* Page title in the middle of the header, between logo and menu */
.header-title {
  flex: 1;
  min-width: 0;
  margin: 0 0.75rem;
  text-align: center;
  font-size: clamp(1rem, 0.75rem + 1.2vw, 1.6rem);
  line-height: 1.2;
  color: inherit;
  hyphens: auto;              /* long German words break with a hyphen on phones */
  overflow-wrap: break-word;
}

/* Burger button (three bars); turns into an X while the menu is open */
.menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.burger,
.burger::before,
.burger::after {
  display: block;
  width: 26px;
  height: 3px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s, background-color 0.2s;
}
.burger { position: relative; }
.burger::before,
.burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -8px; }
.burger::after { top: 8px; }

.menu-button[aria-expanded="true"] .burger { background: transparent; }
.menu-button[aria-expanded="true"] .burger::before { transform: translateY(8px) rotate(45deg); }
.menu-button[aria-expanded="true"] .burger::after { transform: translateY(-8px) rotate(-45deg); }

/* Text only for screen readers (e.g. "Menü" on the burger button) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Menu: phones & tablets ---------- */
/* A panel that slides in from the right over the page when the burger button is
   pressed; sub pages are shown indented. */
.menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(20rem, 85vw);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding: 5rem 1.5rem 1.5rem;   /* space at the top for the X button */
  background: var(--color-header);
  box-shadow: -0.5rem 0 1.5rem rgb(58 40 50 / 0.18);
  transform: translateX(100%);
  visibility: hidden;            /* links can't be reached while closed */
  transition: transform 0.3s ease, visibility 0s 0.3s;
}
.menu.open {
  transform: none;
  visibility: visible;
  transition: transform 0.3s ease;
}

/* Burger / X button stays above the panel, so it can close it */
.menu-button { position: relative; z-index: 110; }

/* Dimmed page behind the open menu; the page does not scroll meanwhile */
body.menu-open { overflow: hidden; }
body.menu-open::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgb(58 40 50 / 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .menu, .menu.open { transition: none; }
}

.menu ul { list-style: none; margin: 0; padding: 0; }

.menu a {
  display: block;
  padding: 0.75rem 0;
  color: var(--color-header-text);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.menu a:hover { color: var(--color-header-text); text-decoration: underline; }
.menu a[aria-current="page"] {
  font-weight: 600;
  color: var(--color-header-text);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.dropdown { padding-left: 1.25rem !important; }

/* Focus outline in header and footer in the text colour, so it shows on the background */
.site-header :focus-visible { outline-color: var(--color-header-text); }
.site-footer :focus-visible { outline-color: var(--color-footer-text); }
.dropdown a { padding-block: 0.5rem; }

/* =========================================================
   Page content
   ========================================================= */

/* Image with quote on top (variant 2) – kept low to save space */
.image-banner {
  position: relative;
  min-height: clamp(9rem, 22vw, 15rem);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.image-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
/* Soft dark violet layer over the picture so the white text is readable */
.image-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(rgb(58 40 50 / 0.5), rgb(58 40 50 / 0.62));
}
/* Text on the picture: a quote (blockquote) or a welcome text (div) */
.banner-text {
  position: relative;
  z-index: 2;
  max-width: 42rem;
  margin: 0;
  padding: 1.25rem 1rem;
  color: #fff;
  font-family: var(--font-heading);
  text-shadow: 0 1px 3px rgb(40 26 34 / 0.6), 0 0 12px rgb(40 26 34 / 0.45);
}
.banner-text p {
  margin: 0 0 0.5rem;
  font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.6rem);
  line-height: 1.4;
}
.banner-text p:last-child { margin-bottom: 0; }
blockquote.banner-text p { font-style: italic; }

/* Big first line, e.g. "Herzlich willkommen" */
.banner-text .banner-title {
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.image-banner cite {
  font-family: var(--font);
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

/* Headings and text blocks */
.content {
  max-width: 48rem;              /* readable line length */
  padding-block: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.content h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem);
  line-height: 1.3;
}
/* Short Flieder line below section headings – gives the page a clear structure */
.content h2::after,
.spectrum h2::after,
.steps h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 0.6rem auto 0;
  background: var(--color-flieder);
  border-radius: 1px;
}
/* Sub heading below an <h2>, e.g. the cost types on "Ablauf & Kosten" */
.content h3 {
  margin: 1.75rem 0 0.35rem;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--color-primary);
}
.content > :first-child { margin-top: 0; }

/* Bullet lists: the list is centred as a block, the text inside stays left-aligned
   so the bullet points line up */
.content ul {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding-left: 1.25rem;
  text-align: left;
}
.content li + li { margin-top: 0.35rem; }

/* Über mich: photo left (1/3), name and text right (2/3).
   Phones: stacked, photo first. */
.profile {
  display: grid;
  gap: 1.5rem 2.5rem;
  align-items: center;
  padding-top: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.profile-photo img {
  width: 100%;
  max-width: 16rem;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgb(58 40 50 / 0.12);
}
.profile h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  line-height: 1.25;
}
.profile-text p { margin: 0 0 0.75rem; }
.profile-text p:last-child { margin-bottom: 0; }

/* Start page: intro row – text left (2/3), logo right (1/3).
   Phones: stacked, text first. */
.intro {
  display: grid;
  gap: 1.5rem 2.5rem;
  align-items: center;
  padding-top: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.intro h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  line-height: 1.25;
}
.intro-tagline {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}
.intro-logo img { width: 100%; max-width: 16rem; }

/* Psychotherapie: "Behandlungsspektrum" – grid of cards that flip when clicked.
   Phones: 2 per row. Tablet and desktop: 4 per row. */
.spectrum {
  max-width: 60rem;
  padding-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.spectrum h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem);
  line-height: 1.3;
}
.spectrum-hint { margin: 0 0 1.5rem; font-size: 0.9rem; color: var(--color-primary); }

.flip-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* minmax: long words may not widen the columns */
  grid-auto-rows: 1fr;         /* all rows as high as the highest one -> all cards the same size */
  gap: 0.75rem;
}
.flip-grid > li { display: grid; }   /* the card fills its grid cell */

.flip-card {
  display: grid;
  width: 100%;
  min-height: 10rem;
  align-self: stretch;         /* as high as the highest card, so all cards have the same size */
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  perspective: 1000px;
  transition: transform 0.2s;
}
.flip-card:hover { transform: translateY(-3px); }
.flip-card-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* long words may not widen the card */
  transition: transform 0.6s;
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-card-inner { transform: rotateY(180deg); }

/* Front and back lie on top of each other in the same grid cell */
.flip-card-front,
.flip-card-back {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-card-front {
  background: #fff;
  border: 1px solid var(--color-flieder-light);
  box-shadow: 0 2px 8px rgb(58 40 50 / 0.06);
  transition: box-shadow 0.2s;
}
.flip-card:hover .flip-card-front { box-shadow: 0 8px 20px rgb(58 40 50 / 0.12); }
.flip-card-back {
  background: var(--color-flieder-light);
  transform: rotateY(180deg);
}

/* Line drawing: fills the card width, keeps its proportions */
.flip-card-front img { width: 100%; height: 5.5rem; margin: 0; object-fit: contain; }
.flip-card-title {
  font-weight: 600;
  color: var(--color-heading);
  line-height: 1.25;
  hyphens: auto;
  overflow-wrap: break-word;
}
.flip-card-text { font-size: 0.85rem; line-height: 1.35; hyphens: auto; overflow-wrap: break-word; }

@media (prefers-reduced-motion: reduce) {
  .flip-card, .flip-card-inner { transition: none; }
  .flip-card:hover { transform: none; }
}

/* Kognitive Verhaltenstherapie: "In der Therapie widmen wir uns" –
   round pictures with a line of text below.
   Phones: 2 per row. Tablet and desktop: 4 per row. */
.steps {
  max-width: 60rem;
  padding-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.steps h2 {
  margin: 0 0 1.75rem;
  font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem);
  line-height: 1.3;
}
.steps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 1rem;
}
.steps-grid img {
  width: 7rem;
  height: 7rem;
  border-radius: 50%;         /* photos are cut to a circle too */
  object-fit: cover;
  box-shadow: 0 4px 14px rgb(58 40 50 / 0.1);
}
.steps-grid p { margin: 0.75rem 0 0; line-height: 1.35; }

/* Kontakt: address, phone, fax and e-mail in a light box */
.contact {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 2.5rem;
  padding: 1.25rem 1.25rem;
  font-style: normal;          /* browsers show <address> in italics by default */
  line-height: 1.8;
  background: var(--color-flieder-light);
  border-radius: var(--radius);
}
.contact strong { font-family: var(--font-heading); font-weight: 600; color: var(--color-heading); }
.contact a { overflow-wrap: anywhere; }   /* long e-mail address may wrap on phones */
.contact p { margin: 0; }
.contact p + p { margin-top: 1rem; }

/* Button, e.g. "Kontakt" */
.button {
  display: inline-block;
  min-height: 44px;
  padding: 0.75rem 2.25rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-radius: 999px;        /* pill shape */
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.button:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(107 79 97 / 0.3);
}
@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
  .button:hover { transform: none; }
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--color-footer);
  color: var(--color-footer-text);
  font-size: 0.95rem;
  padding-block: 1.75rem;
}

/* Phones: two lines
   1st line: Kontakt · Datenschutz · Impressum
   2nd line: copyright left, logo right */
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "links links"
    "copy  logo";
  align-items: center;
  gap: 1rem;
}

.footer-copy { grid-area: copy; margin: 0; }

.footer-logo { grid-area: logo; display: block; line-height: 0; }
.footer-logo img { height: 2.5rem; width: auto; }

.footer-links {
  grid-area: links;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}
.footer-links a { color: var(--color-footer-text); text-decoration: none; }
.footer-links a:hover,
.footer-links a[aria-current="page"] { color: var(--color-footer-text); text-decoration: underline; }

/* =========================================================
   Tablet (768px and wider)
   ========================================================= */
@media (min-width: 48em) {
  .container { padding-inline: 2rem; }
  .logo img { height: 3rem; }
  .contact { padding: 1.5rem 2rem; }
  .intro { grid-template-columns: 2fr 1fr; }
  .profile { grid-template-columns: 1fr 2fr; }
  .flip-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
  .flip-card-front img { height: 7rem; }
  .steps-grid { grid-template-columns: repeat(4, 1fr); }
  .steps-grid img { width: 8rem; height: 8rem; }

  /* Footer: copyright left – logo middle – links right */
  .footer-inner {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "copy logo links";
  }
  .footer-links { justify-self: end; }
}

/* =========================================================
   Desktop (1024px and wider): menu next to the logo
   ========================================================= */
@media (min-width: 64em) {
  .menu-button { display: none; }

  /* Normal menu in the header – undo the slide-in panel */
  .menu {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    padding: 0;
    background: none;
    box-shadow: none;
    transform: none;
    visibility: visible;
    transition: none;
  }
  body.menu-open { overflow: visible; }
  body.menu-open::after { display: none; }
  .menu > ul { display: flex; gap: 1.75rem; }

  /* Dropdown under "Psychotherapie" */
  .has-dropdown { position: relative; }
  .has-dropdown > a::after { content: " ▾"; font-size: 0.8em; }

  .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: -1rem;
    z-index: 10;
    min-width: 16rem;
    padding: 0.5rem 0 !important;
    background: var(--color-header);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 0.5rem 1.25rem rgb(58 40 50 / 0.15);
  }
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown { display: block; }

  .dropdown a { padding: 0.5rem 1rem; }
  .dropdown a:hover { text-decoration: underline; }
}
