:root {
  --color-primary: #1f3075;
  --color-primary-light: #2d46a1;
  --color-accent: #eef3ff;
  --color-text: #192048;
  --color-muted: #4c5275;
  --color-border: #ccd2e8;
  --color-footer-bg: #24326b;
  --color-surface: #ffffff;
  --shadow-soft: 0 14px 40px rgba(31, 48, 117, 0.12);
  --shadow-hover: 0 18px 32px rgba(31, 48, 117, 0.15);
  --max-width: 1180px;
  --font-body: "Nunito", sans-serif;
  /* noch ein Stück transparenter */
  --hero-overlay: linear-gradient(180deg, rgba(255,255,255,0.46) 0%, rgba(243,246,255,0.12) 100%);
  --hero-border: none;
  /* Seitenhintergrund – Standardbild */
  --page-bg-image: image-set(
    url("images/variants/sg-hero1_1600.avif") type("image/avif") 1x,
    url("images/variants/sg-hero1_1600.webp") type("image/webp") 1x,
    url("images/sg-hero1.webp") type("image/webp") 1x
  );
}

html { color-scheme: light; }

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

html,
body {
  margin: 0;
  padding: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 10px 16px;
  background: var(--color-primary);
  color: #ffffff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
  z-index: 1000;
}

.skip-link:focus {
  top: 16px;
}
/* Hintergrund auch auf <html> legen, um Bounce/Überlauf ohne Weiß zu zeigen */
html {
  background:
    linear-gradient(180deg, rgba(249,251,255,1) 0%, rgba(243,246,255,0.96) 28%, rgba(255,255,255,0) 75%),
    var(--page-bg-image) center bottom / cover no-repeat,
    var(--color-footer-bg);
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--color-text);
  /* Verlauf oben, unten transparenter Bereich + Hintergrundbild am Seitenende */
  background:
    linear-gradient(180deg, rgba(249,251,255,1) 0%, rgba(243,246,255,0.96) 28%, rgba(255,255,255,0) 75%),
    var(--page-bg-image) center bottom / cover no-repeat,
    var(--color-footer-bg);
  background-color: var(--color-footer-bg);
  min-height: 100vh;
  position: relative; /* für Overscroll-Hintergrund */
}

/* Seiten-spezifische Hintergründe */
.bg-hero6 { --page-bg-image: image-set(url("images/variants/sg-hero6_1600.avif") type("image/avif") 1x, url("images/variants/sg-hero6_1600.webp") type("image/webp") 1x, url("images/sg-hero6.webp") type("image/webp") 1x); }
.bg-hero5 { --page-bg-image: image-set(url("images/variants/sg-hero5_1600.avif") type("image/avif") 1x, url("images/variants/sg-hero5_1600.webp") type("image/webp") 1x, url("images/sg-hero5.webp") type("image/webp") 1x); }
.bg-hero8 { --page-bg-image: image-set(url("images/variants/sg-hero8_1600.avif") type("image/avif") 1x, url("images/variants/sg-hero8_1600.webp") type("image/webp") 1x, url("images/sg-hero8.webp") type("image/webp") 1x); }

/* Overscroll: fixiertes Hintergrundbild auf der Viewport-Ebene,
   damit bei Rubber-Banding (iOS/Android) kein weißer Bereich erscheint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--color-footer-bg); /* Overscroll: dunkelblau statt Bild */
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e6f3;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Menü weiter nach links */
  gap: 32px;
}

/* Menü etwas näher an das Logo rücken */
.nav { margin-left: clamp(20px, 4vw, 48px); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-primary);
}

.brand__mark {
  width: 64px;
  height: 64px;
  background: url("images/sg-logo.webp") center/contain no-repeat;
  display: inline-block;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-weight: 700;
  font-size: 20px;
}

.brand__subtitle {
  font-weight: 400;
  font-size: 15px;
  color: var(--color-muted);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-weight: 600;
  color: var(--color-primary);
}

.nav__list li a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.nav__list li a:hover,
.nav__list li a:focus {
  color: var(--color-primary-light);
}

/* Modern hover effect: slide-in underline + soft highlight */
/* Scope to top-level items, exclude language switch */
.nav__list > li:not(.nav__item--lang) > a {
  --nav-underline-h: 3px; /* thicker for more contrast */
  --nav-underline-bg: linear-gradient(90deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
}
.nav__list > li:not(.nav__item--lang) > a::before {
  content: "";
  position: absolute;
  inset: -6px -10px; /* soft pill behind text */
  border-radius: 12px;
  background: rgba(31, 48, 117, 0.12); /* a bit stronger */
  box-shadow: 0 6px 18px rgba(31, 48, 117, 0.00);
  opacity: 0;
  transform: translateY(2px) scale(0.98);
  transition: opacity 0.28s cubic-bezier(.22,.7,.25,1), transform 0.28s cubic-bezier(.22,.7,.25,1), box-shadow 0.28s ease;
  pointer-events: none;
}
.nav__list > li:not(.nav__item--lang) > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: var(--nav-underline-h);
  background: var(--nav-underline-bg);
  border-radius: 4px;
  transform: scaleX(0);
  transform-origin: 10% 50%;
  background-size: 200% 100%;
  background-position: 0 0;
  transition: transform 0.34s cubic-bezier(.22,.7,.25,1), background-position 0.6s cubic-bezier(.22,.7,.25,1);
}
.nav__list > li:not(.nav__item--lang) > a:hover::before,
.nav__list > li:not(.nav__item--lang) > a:focus-visible::before {
  opacity: 1;
  transform: translateY(0) scale(1);
  box-shadow: 0 8px 20px rgba(31, 48, 117, 0.14);
}
.nav__list > li:not(.nav__item--lang) > a:hover::after,
.nav__list > li:not(.nav__item--lang) > a:focus-visible::after {
  transform: scaleX(1);
  background-position: 100% 0; /* animated sweep */
  box-shadow: 0 8px 14px rgba(31, 48, 117, 0.18);
}

/* Keep hover styling while dropdown submenu is open */
.nav__item--dropdown:hover > a::before,
.nav__item--dropdown:focus-within > a::before {
  opacity: 1;
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(31, 48, 117, 0.10);
}
.nav__item--dropdown:hover > a::after,
.nav__item--dropdown:focus-within > a::after {
  transform: scaleX(1);
  background-position: 100% 0;
  box-shadow: 0 8px 14px rgba(31, 48, 117, 0.18);
}
.nav__item--dropdown:hover > a,
.nav__item--dropdown:focus-within > a {
  color: var(--color-primary-light);
}

/* Active page: keep underline visible and emphasize */
.nav__list > li:not(.nav__item--lang) > a[aria-current="page"] {
  color: var(--color-primary-light);
  font-weight: 700;
}
.nav__list > li:not(.nav__item--lang) > a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav__item--dropdown {
  position: relative;
  padding-right: 18px;
}

/* Language switch */
.nav__item--lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.nav__item--lang a {
  padding: 4px 0;
}
.nav__item--lang .is-active {
  color: var(--color-primary-light);
}
.nav__item--lang .lang-sep {
  opacity: 0.5;
}

/* Sprache: auf allen Geräten Flagge der Gegensprache anzeigen */
.nav__item--lang .is-active,
.nav__item--lang .lang-sep { display: none; }
.nav__item--lang a {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(31,48,117,0.18);
  background: #fff;
  font-size: 0; /* nur Flagge anzeigen */
}
html[lang="de"] .nav__item--lang a::before { content: "\1F1EC\1F1E7"; /* 🇬🇧 */ font-size: 18px; }
html[lang="en"] .nav__item--lang a::before { content: "\1F1E9\1F1EA"; /* 🇩🇪 */ font-size: 18px; }

/* Desktop/iPad: Flaggen statt DE/EN-Text anzeigen und kompaktere Nav */
@media (min-width: 768px) {
  .brand__mark { width: 58px; height: 58px; }
  /* Zeige Rechtsanwälte neben ScharlemannGross in der Topbar */
  .topbar .brand__text { flex-direction: row; align-items: baseline; gap: 8px; }
  .topbar .brand__subtitle { display: inline; font-weight: 600; font-size: 18px; color: var(--color-primary); }
  .nav { margin-left: clamp(10px, 3vw, 28px); }
  .nav__list { gap: 16px; }

  .nav__item--lang .is-active,
  .nav__item--lang .lang-sep { display: none; }

  .nav__item--lang a {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(31,48,117,0.18);
    background: #fff;
    font-size: 0; /* Text ausblenden, nur Flagge zeigen */
  }
  .nav__item--lang a:hover,
  .nav__item--lang a:focus { box-shadow: 0 2px 6px rgba(31,48,117,.18); }

  /* Flaggen je aktuelle Sprache: zeige jeweils die Gegen‑Sprache */
  html[lang="de"] .nav__item--lang a::before { content: "🇬🇧"; font-size: 18px; }
  html[lang="en"] .nav__item--lang a::before { content: "🇩🇪"; font-size: 18px; }
}

/* Zusätzliche Komprimierung zwischen 1024–1200px */
@media (min-width: 1024px) and (max-width: 1200px) {
  .nav__list { gap: 12px; }
  .nav__list li a { font-size: 15px; }
}

.nav__submenu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px; /* keine Hover-Lücke zwischen Button und Menü */
  background-color: #ffffff;
  border-radius: 14px;
  border: 1px solid #dbe1f5;
  box-shadow: 0 22px 45px rgba(31, 48, 117, 0.16);
  padding: 12px 0;
  min-width: 240px;
  list-style: none;
  margin: 0;
  display: none;
  z-index: 20;
}

.nav__submenu li a {
  display: block;
  padding: 10px 22px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 500;
}

/* Nested submenu (2. Ebene) */
.nav__submenu li { position: relative; }
.nav__submenu li > .nav__submenu {
  top: 0;
  left: calc(100% + 8px);
}
.nav__submenu li:hover > .nav__submenu,
.nav__submenu li:focus-within > .nav__submenu { display: block; }

.nav__submenu li a:hover,
.nav__submenu li a:focus {
  background-color: #f2f5ff;
  color: var(--color-primary);
}

.nav__item--dropdown:hover > .nav__submenu,
.nav__item--dropdown:focus-within > .nav__submenu {
  display: block;
}

.nav__caret {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-40%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--color-primary);
}

.nav__toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Chevron toggle is injected via JS; hidden on desktop by default */
.nav__chevron-btn { display: none; }

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center; /* zentriert die Striche horizontal */
  gap: 5px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: rgba(31, 48, 117, 0.08);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.nav__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center; /* saubereres Kreuz */
}

.nav__burger:hover {
  background-color: rgba(31, 48, 117, 0.15);
}

.nav__toggle:checked + .nav__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__toggle:checked + .nav__burger span:nth-child(2) {
  opacity: 0;
}

.nav__toggle:checked + .nav__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__toggle:checked ~ .nav {
  max-height: 80vh; /* genug Platz für Scroll */
  opacity: 1;
  pointer-events: all;
  overflow-y: auto; /* mobil scrollen */
  -webkit-overflow-scrolling: touch;
}

.hero {
  background-color: transparent;
  padding: 0;
}

.hero__image {
  width: 100%;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  position: relative; /* allow overlay button positioning */
  aspect-ratio: 16 / 9;
  max-height: clamp(520px, 70vw, 820px);
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Small white box at bottom-left of the hero image */
.hero-callout {
  position: absolute;
  right: 0;
  bottom: 40px; /* etwas höher gesetzt */
  background: #fff;
  border: 1px solid #e0e5f5;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(31, 48, 117, 0.18);
  width: min(720px, 92vw);
  min-height: 160px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto; /* Button | Text | Bild */
  grid-template-rows: auto auto;
  grid-template-areas:
    "button subtitle image"
    "button desc image";
  column-gap: 16px;
  row-gap: 10px;
  align-items: center;
}
@media (max-width: 640px) {
  .hero__image {
    height: auto;
    overflow: visible;
  }
  .hero__image img {
    height: auto;
  }
  .hero-callout {
    display: none;
  }
  .intro > .ibr-callout-mobile {
    display: grid;
    grid-area: ibr;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    grid-template-areas:
      "button"
      "subtitle"
      "desc"
      "image";
    justify-items: center;
    text-align: center;
    gap: 14px;
    margin-top: 12px;
  }
  .ibr-callout-mobile .btn--book {
    justify-self: center;
    align-self: center;
    width: min(100%, 240px);
  }
  .ibr-callout-mobile .hero-callout__subtitle {
    text-align: center;
    font-size: 22px;
    line-height: 1.3;
  }
  .ibr-callout-mobile .hero-callout__desc {
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
    text-align: center;
  }
  .ibr-callout-mobile > img {
    justify-self: center;
    width: 150px;
    height: 100px;
  }
}

/* Button-Stil in der Hero-Box (IBR) */
.hero-callout .btn--book,
.ibr-callout-mobile .btn--book {
  background-color: #d93025;
  border-color: #d93025;
  color: #fff;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1;
  padding: 10px 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 26px rgba(31,48,117,.18), 0 0 0 0 rgba(217,48,37,0.4);
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
  animation: bookBlink 1.5s ease-in-out 0.4s 3 both;
  justify-self: start; /* nach links verschoben im linken Bereich */
  grid-area: button;
}
.hero-callout .btn--book {
  align-self: center;
}
.hero-callout .btn--book:hover,
.hero-callout .btn--book:focus,
.ibr-callout-mobile .btn--book:hover,
.ibr-callout-mobile .btn--book:focus {
  background-color: #b71c1c;
  border-color: #b71c1c;
  color: #fff;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 30px rgba(31,48,117,.20), 0 0 0 6px rgba(217,48,37,0.14);
}

/* kleines Bild rechts in der Box */
.hero-callout > img,
.ibr-callout-mobile > img {
  width: 150px;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  border-radius: 8px;
  justify-self: end;
  grid-area: image;
}

/* Beschreibung in der Mitte (dunkelblau) */
.hero-callout__desc {
  grid-area: desc;
  color: var(--color-primary);
  font-size: 22px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
}

/* Untertitel unter dem Button in hellblauer Schrift */
.hero-callout__subtitle {
  grid-area: subtitle;
  color: var(--color-primary);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-align: center;
}

.ibr-callout-mobile {
  display: none;
}

/* Mittiges Textfeld mit dunkelblauer Schrift */
/* (unused) seminar-band styles removed */

.legal-main {
  padding-top: 60px;
  padding-bottom: 120px;
}

.legal-hero {
  background: var(--hero-overlay);
  border-bottom: var(--hero-border);
}

.legal-hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) 32px;
}

.legal-hero__inner h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 4.2vw, 48px);
  color: var(--color-primary);
}

.legal-hero__inner p {
  margin: 0;
  font-size: 20px;
  color: var(--color-muted);
}

.legal-content {
  background-color: #f8faff;
  padding: clamp(40px, 8vw, 80px) 0;
}

.legal-content__inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  gap: 28px;
  font-size: 18px;
  color: var(--color-text);
}

.legal-content__inner h2 {
  margin: 24px 0 0;
  font-size: 24px;
  color: var(--color-primary);
}

.legal-content__inner ul {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 10px;
}

.legal-content__inner a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(31, 48, 117, 0.4);
}

.legal-address {
  font-style: normal;
  line-height: 1.7;
}

.legal-address a {
  text-decoration: underline;
}

.core-hero__image {
  width: 100%;
  height: clamp(480px, 62vw, 720px);
  background: image-set(
      url("images/variants/sg-hero2_1600.avif") type("image/avif") 1x,
      url("images/variants/sg-hero2_1600.webp") type("image/webp") 1x,
      url("images/sg-hero2.webp") type("image/webp") 1x
    )
    center/cover no-repeat;
}

.core-content {
  padding: clamp(60px, 8vw, 100px) 32px 120px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 48px);
}

.core-block {
  background-color: #ffffff;
  border: 1px solid #dbe1f5;
  border-radius: 18px;
  padding: clamp(28px, 4vw, 36px);
  display: grid;
  gap: 18px;
  text-align: center;
  box-shadow: 0 18px 35px rgba(31, 48, 117, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.core-block h2 {
  margin: 0;
  font-size: 24px;
  color: var(--color-primary);
}

.core-block p {
  margin: 0;
  font-size: 17px;
  color: var(--color-text);
}

.core-block:hover,
.core-block:focus-within {
  transform: translateY(-6px);
  border-color: var(--color-primary-light);
  box-shadow: 0 26px 45px rgba(31, 48, 117, 0.16);
}

.ref-hero {
  /* Überschriftbereich dezent, integriert sich in den Hintergrund */
  background: var(--hero-overlay);
  border-bottom: var(--hero-border);
}

.ref-hero--compact {
  padding: clamp(72px, 12vw, 110px) 0 clamp(16px, 4vw, 28px);
}

.ref-hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  text-align: center;
}

.ref-hero__inner h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 54px);
  color: var(--color-primary);
}

.ref-hero__inner p {
  margin: 12px auto 0;
  max-width: 640px;
  font-size: 18px;
  color: var(--color-muted);
}

/* Referenzen: Bildbanner */
.ref-hero__image {
  width: 100%;
  height: clamp(420px, 60vw, 700px);
  background: image-set(
      url("images/variants/sg-hero3_1600.avif") type("image/avif") 1x,
      url("images/variants/sg-hero3_1600.webp") type("image/webp") 1x,
      url("images/sg-hero3.webp") type("image/webp") 1x
    )
    center/cover no-repeat;
}


.ref-overview {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(60px, 8vw, 110px) 32px clamp(60px, 9vw, 120px);
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 48px);
}

.ref-card {
  background-color: #ffffff;
  border: 1px solid #d9def0;
  border-radius: 18px;
  padding: clamp(28px, 4vw, 36px);
  display: grid;
  gap: 18px;
  text-align: center;
  box-shadow: 0 18px 35px rgba(31, 48, 117, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.ref-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(65, 90, 169, 0.1), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.ref-card:hover,
.ref-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 26px 45px rgba(31, 48, 117, 0.16);
  border-color: var(--color-primary-light);
}

.ref-card:hover::after,
.ref-card:focus-within::after {
  opacity: 1;
}

.ref-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--color-primary);
}

.ref-card p {
  margin: 0;
  font-size: 17px;
  color: var(--color-text);
}

.ref-card .btn {
  align-self: flex-start;
  position: relative;
  padding-right: 46px;
}

.ref-card .btn::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: inherit;
  transition: transform 0.25s ease;
}

.ref-card:hover .btn::after,
.ref-card:focus-within .btn::after {
  transform: translate(4px, -50%);
}

.ref-detail {
  background-color: transparent; /* gleichen Hintergrund wie Seite durchscheinen lassen */
}

.ref-detail__hero {
  background: var(--hero-overlay);
  border-bottom: var(--hero-border);
  padding: clamp(72px, 12vw, 110px) 0 clamp(16px, 4vw, 28px);
}

.ref-detail__hero .ref-hero__inner {
  text-align: left;
}

.ref-detail__hero p {
  margin-top: 10px;
  color: var(--color-muted);
}

.ref-detail__content {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 60px) 32px clamp(60px, 8vw, 110px);
  display: grid;
  gap: 28px;
}

.ref-detail__section {
  background-color: #ffffff;
  border-radius: 18px;
  border: 1px solid #e0e5f5;
  box-shadow: 0 18px 40px rgba(31, 48, 117, 0.1);
  padding: clamp(28px, 4vw, 40px);
  display: grid;
  gap: 18px;
}

.ref-detail__section--center {
  text-align: center;
}

.ref-detail__section h2 {
  margin: 0;
  font-size: 26px;
  color: var(--color-primary);
}

.ref-detail__section h3 {
  margin: 12px 0 0;
  font-size: 20px;
  color: var(--color-primary-light);
}

.ref-detail__section h4 {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 700;
}

.ref-detail__section ul {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 8px;
  font-size: 16px;
  color: var(--color-text);
}

/* Person card layout for Mitarbeiter page */
.person-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
}
.person-card__photo {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(31, 48, 117, 0.12);
}
.person-card__content h3 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--color-primary);
}
.person-card__content p { margin: 0; }

@media (max-width: 700px) {
  .person-card { grid-template-columns: 1fr; }
  .person-card__photo { width: 100%; height: auto; }
}

/* News article layout */
.news-article {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title date"
    "body body"
    "actions actions";
  gap: 10px 18px;
}
.news-article h2 {
  margin: 0;
  grid-area: title;
}
.news-article .news-date {
  grid-area: date;
  align-self: start;
  justify-self: end;
  font-size: 14px;
  color: var(--color-muted);
  font-weight: 700;
}
.news-article .news-body { grid-area: body; }
.news-article .news-actions { grid-area: actions; }
.news-article .news__meta { margin: 10px 0; gap: 6px; }

.news-article--split {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  grid-template-areas:
    "title date"
    "body image"
    "actions image";
  align-items: end;
}
.news-article--split .news-body { grid-area: body; }
.news-article--split .news-image-link { grid-area: image; justify-self: end; align-self: end; }
.news-article--split img {
  width: 100%;
  max-width: 220px; /* kleineres Bild */
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(31, 48, 117, 0.12);
}
.news-image-link img { cursor: zoom-in; }
.news-image-link { outline: none; }
.news-image-link:focus-visible img { box-shadow: 0 0 0 3px rgba(31,48,117,.35); }

/* Einfaches Lightbox-Overlay (CSS-only, schließt per Klick) */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.86);
  padding: 16px;
  z-index: 1000;
  cursor: zoom-out;
}
.lightbox:target { display: flex; }
.lightbox img {
  /* Skaliert stets proportional (keine Verzerrung) */
  width: auto;
  height: auto;
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.news-image-link { display: inline-block; }
.news-image-link:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 12px; }

@media (max-width: 720px) {
  .news-article { grid-template-columns: 1fr auto; }
  .news-article--split { grid-template-columns: 1fr; grid-template-areas: "title date" "body body" "image image" "actions actions"; }
  .news-article--split .news-image-link { justify-self: center; }
  .news-article--split img { max-width: min(90%, 360px); }
}

.ref-detail__list--columns {
  columns: 2;
  column-gap: 28px;
}

.ref-detail__list--columns li {
  break-inside: avoid;
}

.intro {
  max-width: var(--max-width);
  margin: clamp(40px, 6vw, 80px) auto clamp(80px, 8vw, 120px);
  padding: clamp(24px, 4vw, 40px) 32px clamp(40px, 6vw, 60px);
  display: grid;
  grid-template-columns: 1.75fr 1fr;
  gap: 18px 24px; /* row-gap | column-gap: News etwas höher */
  align-items: start;
  position: relative; /* for floating seminar card */
}

/* Intro-Grid: Links = Willkommen + News, Rechts = Kernkompetenzen + Freies Feld */
.intro > .news { grid-column: 2; grid-row: 1; align-self: start; margin-top: 0; }
.intro > .more-card { grid-column: 2; grid-row: 2; align-self: start; }
.intro > .summary-card { grid-column: 2; grid-row: 2; }
.intro > .more-card { grid-column: 2; grid-row: 1; }



/* Inline-Variante der Seminar-Card im Intro: etwas größer, statisch */
@media (min-width: 1021px) {
  .intro .seminar-float {
    position: static;
    margin: 0;
    width: 100%;
    padding: 18px 20px;
    grid-template-columns: 1fr 130px;
    grid-template-areas:
      "title slot"
      "button slot";
    row-gap: 12px;
    column-gap: 16px;
    min-height: 0;
    box-shadow: 0 18px 36px rgba(31, 48, 117, 0.12);
    z-index: auto; /* unter Menüleiste bleiben */
  }
  .intro .seminar-float__title {
    font-size: clamp(18px, 2.1vw, 24px);
    text-align: left;
  }
}

.card {
  background-color: var(--color-surface);
  border-radius: 22px;
  padding: clamp(28px, 4vw, 40px);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

/* Feld: Cards auf Hover hervorheben */
.intro .card {
  border: 1px solid rgba(219, 225, 245, 0.6);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.summary-card,
.seminar-float,
.intro .news__card {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.intro .card:hover,
.intro .card:focus-within,
.summary-card:hover,
.summary-card:focus-within,
.seminar-float:hover,
.seminar-float:focus-within,
.intro .news__card:hover,
.intro .news__card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 26px 45px rgba(31, 48, 117, 0.16);
  border-color: var(--color-primary-light);
}

/* Vierter Kasten: Zusammenfassung Kernkompetenzen + Partner */
.summary-card {
  background-color: var(--color-surface);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 28px);
  box-shadow: var(--shadow-soft);
  border: 1px solid #dbe1f5;
}
.summary-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: var(--color-primary);
}
.summary-card p { margin: 0 0 14px; color: var(--color-text); }
.summary-links {
  list-style: disc;
  padding-left: 22px;
  margin: 0;
  display: block;
}
.summary-links li { display: list-item; margin: 8px 0; }
.summary-links a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}
.summary-links a:hover,
.summary-links a:focus-visible {
  text-decoration-thickness: 2px;
}

/* IBR card: static white box with 3 columns (button | text | image) */
.ibr-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto; /* Button | Text | Bild */
  row-gap: 8px;
  align-items: start;
  position: relative;
  padding: 10px 12px; /* kompakter */
  max-width: 300px; /* sehr klein */
  width: min(280px, 100%);
  justify-self: start;
  min-height: 0; /* nicht künstlich hoch */
}
.ibr-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-top-left-radius: 22px;
  border-bottom-left-radius: 22px;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
  opacity: 0.9;
}

.ibr-card__text {
  color: var(--color-primary);
  font-size: 14px; /* kleiner Text */
  line-height: 1.4;
  text-align: left;
  align-self: start;
}
.ibr-card__text strong { font-size: 16px; }

.ibr-card__image { justify-self: stretch; }

.ibr-card__image img {
  width: 100%;
  height: 60px; /* kleines Bild */
  border-radius: 10px;
  object-fit: cover;
}

.ibr-card .btn--book {
  background-color: #d93025;
  border-color: #d93025;
  color: #fff;
  white-space: nowrap;
  font-size: 14px; /* kleiner Button */
  line-height: 1;
  padding: 8px 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 26px rgba(31,48,117,.18), 0 0 0 0 rgba(217,48,37,0.4);
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
  animation: bookBlink 1.5s ease-in-out 0.4s 4 both;
  justify-self: stretch; /* Button über ganze Kartenbreite oben */
  text-align: center;
}

.ibr-card .btn--book:hover,
.ibr-card .btn--book:focus {
  background-color: #b71c1c;
  border-color: #b71c1c;
  color: #fff;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 30px rgba(31,48,117,.20), 0 0 0 6px rgba(217,48,37,0.14);
}

/* Short, accessible blink to draw attention */
@keyframes bookBlink {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.5; }
  60% { opacity: 1; }
}

@media (max-width: 820px) {
  .ibr-card {
    grid-template-columns: auto 1fr;
    row-gap: 10px;
  }
  .ibr-card .ibr-card__image {
    display: none;
  }
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(65, 90, 169, 0.15), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover::before,
.card:focus-within::before {
  opacity: 1;
}

.intro__content h1,
.intro__content h2 {
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 18px;
  color: var(--color-primary);
}

.intro p {
  font-size: 18px;
  color: #24325f;
  margin-bottom: 16px;
}

.profile h3 {
  font-size: 22px;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--color-primary);
}

.profile p {
  font-size: 17px;
  color: var(--color-text);
}

.news {
  display: flex;
  flex-direction: column;
  gap: 14px; /* kompakter: geringere Höhe */
  position: static; /* nicht sticky: soll nicht floaten */
  top: auto;
}

.news h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.22em;
  color: var(--color-muted);
  text-transform: uppercase;
}

.news__card {
  background-color: rgba(255, 255, 255, 0.92);
  padding: 18px 20px; /* kompakter: geringere Höhe */
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

/* Home: two news cards side-by-side */
.news__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .news__row { grid-template-columns: 1fr; } }

/* Seminar card subtle slide-in from right */
@keyframes seminarIn {
  from {
    opacity: 0;
    transform: translateX(120%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.news__card--seminar { animation: seminarIn 600ms cubic-bezier(.22,.7,.25,1) both; }

/* Floating seminar card over the News box (home) */
/* Floating seminar card over the News box (home) */
.seminar-float {
  /* Place within the right column of the intro grid */
  grid-column: 2;
  align-self: start;
  justify-self: end;
  position: sticky;
  top: clamp(12px, 4vw, 28px); /* sticks a bit above News top line */
  margin-right: -32px; /* extend to the outer right edge beyond padding */
  z-index: 40;
  background: #fff;
  border: 1px solid #e0e5f5;
  box-shadow: 0 22px 45px rgba(31, 48, 117, 0.16);
  border-radius: 20px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: auto 1fr 120px;
  grid-template-areas: "button title slot";
  align-items: center; /* center all children vertically */
  min-height: 92px; /* give vertical room so the button feels centered */
  column-gap: 18px;
  width: min(540px, 92vw);
  transform-origin: 100% 50%;
  animation: seminarIn 1.4s cubic-bezier(.19,.7,.28,1) both;
  will-change: transform;
}

/* (unused) seminar-band overrides removed */
.seminar-float__title {
  grid-area: title;
  margin: 0;
  font-size: 18px;
  text-align: center;
  color: var(--color-primary);
  align-self: center;
}
.seminar-float .btn--book {
  grid-area: button;
  justify-self: start;
  align-self: center;
  background-color: #d93025;
  border-color: #d93025;
  color: #fff;
  white-space: nowrap;
  font-size: 19px;
  line-height: 1;
  padding: 14px 22px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 26px rgba(31,48,117,.18), 0 0 0 0 rgba(217,48,37,0.4);
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
  animation: bookPulse 2.6s ease-in-out 0.6s 3 both;
}
.seminar-float .btn--book:hover,
.seminar-float .btn--book:focus {
  background-color: #b71c1c;
  border-color: #b71c1c;
  color: #fff;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 30px rgba(31,48,117,.20), 0 0 0 6px rgba(217,48,37,0.14);
}
.seminar-float__slot {
  grid-area: slot;
  min-height: 1px;
}
.seminar-float__slot picture,
.seminar-float__slot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}

/* Attention pulse for the booking button */
@keyframes bookPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 12px 26px rgba(31,48,117,.18), 0 0 0 0 rgba(217,48,37,0.0);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 16px 32px rgba(31,48,117,.22), 0 0 0 10px rgba(217,48,37,0.10);
  }
}
.seminar-float__slot picture,
.seminar-float__slot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}

/* Position the floating card relative to the News aside on narrow layouts */
@media (max-width: 1024px) {
  .seminar-float {
    margin-right: -20px;
    top: clamp(10px, 5vw, 24px);
  }
}
@media (max-width: 820px) {
  .seminar-float {
    position: static;
    width: 100%;
    margin-top: 12px;
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "button title"
      "slot slot";
    z-index: auto;
    right: auto;
    bottom: auto;
  }
  .seminar-float__slot { display: none; }
}


.news__card .btn + .btn {
  margin-left: 10px;
}

.news__card h4 {
  margin: 0;
  font-size: 22px;
  color: var(--color-primary);
}

.news__card p {
  margin: 0;
  color: var(--color-text);
}

.news__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(31, 48, 117, 0.08);
  pointer-events: none;
}

/* override when IBR card is shown on the hero */
.seminar-float--hero {
  position: absolute;
  right: 24px; /* weiter ins Bild hinein */
  bottom: 24px; /* weiter ins Bild hinein */
  margin-right: 0;
  width: min(360px, 94vw); /* kompakter */
  z-index: 5;
  transition: opacity .25s ease;
  /* eigenständiges, kompaktes Grid für die Hero-Variante */
  padding: 12px 14px;
  grid-template-columns: auto 1fr 84px; /* kleiner Bildslot */
  grid-template-areas: "button title slot";
  column-gap: 12px;
  row-gap: 8px;
}
.seminar-float--hero .seminar-float__title { font-size: 16px; text-align: left; }
.seminar-float--hero .btn--book { font-size: 15px; padding: 10px 14px; border-radius: 12px; }
.seminar-float--hero .seminar-float__slot picture,
.seminar-float--hero .seminar-float__slot img { width: 100%; height: auto; border-radius: 8px; object-fit: cover; }
.seminar-float--hero.is-hidden {
  opacity: 0;
  visibility: hidden; /* keep size for stable measurements, but hide visually */
  pointer-events: none;
}
/* Fixed state while scrolling within sticky window */
.seminar-float--hero.is-fixed {
  position: fixed;
  right: 0;
}
@media (max-width: 1024px) {
  .seminar-float--hero { right: 18px; bottom: 18px; width: min(340px, 96vw); }
}
@media (max-width: 640px) {
  .seminar-float--hero { right: 14px; bottom: 14px; width: min(320px, 96vw); }
}

/* Run-away state when nearing the sticky menu */
/* optional escape style removed in favor of controlled top movement */

.news__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--color-muted);
  font-size: 15px;
}

.btn {
  align-self: flex-start;
  padding: 12px 32px;
  border-radius: 24px;
  border: 2px solid var(--color-primary);
  background-color: transparent;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 16px;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.btn:hover,
.btn:focus {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 48, 117, 0.25);
}

.btn--light {
  background-color: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  box-shadow: none;
}

.btn--light:hover,
.btn--light:focus {
  background-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.btn--outline {
  border-color: rgba(31, 48, 117, 0.32);
  color: var(--color-primary);
  padding-inline: 26px;
}

.btn--outline:hover,
.btn--outline:focus {
  border-color: var(--color-primary);
  box-shadow: 0 10px 24px rgba(31, 48, 117, 0.18);
}

.footer {
  background-color: var(--color-footer-bg);
  color: #ffffff;
  padding: 60px 32px 40px;
}

.footer__inner {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  display: flex;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
}

/* Footer: remove left brand block next to contact details */
.footer .brand--footer { display: none; }

.brand--footer .brand__text .brand__subtitle {
  color: rgba(255, 255, 255, 0.75);
}

.footer__locations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 30px;
  flex: 1;
}

.footer__location h3 {
  margin: 0 0 16px;
  font-size: 20px;
}

.footer__location p {
  margin: 0 0 14px;
  line-height: 1.5;
}

/* Center the contact section in the footer */
.footer__inner { justify-content: center; }
.footer__locations {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  justify-content: center; /* center grid tracks */
}
.footer__location { text-align: center; }

.footer__location a {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.footer__legal {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 28px;
}

.footer__legal a {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}

.footer__legal a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,255,255,0.6));
  border-radius: 4px;
  transform: scaleX(0);
  transform-origin: 10% 50%;
  transition: transform 0.28s ease;
}
.footer__legal a:hover,
.footer__legal a:focus-visible { color: #ffffff; }
.footer__legal a:hover::after,
.footer__legal a:focus-visible::after { transform: scaleX(1); }

.footer__legal a[aria-current="page"] {
  color: #ffffff;
}

/* Mobile: stack Leipzig and Berlin vertically in footer */
@media (max-width: 768px) {
  .footer__locations {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1020px) {
  .topbar__inner {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 18px;
  }

  .nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.25s ease;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 6px 0;
    border-top: 1px solid rgba(31, 48, 117, 0.12);
  }

  .nav__item--dropdown {
    padding-right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; /* allows submenu to wrap to next row */
    width: 100%;
  }

  .nav__caret {
    display: none;
  }

  .nav__burger {
    display: inline-flex;
  }

  /* Mobile submenu: collapsible with animation */
  .nav__submenu {
    position: static;
    display: block; /* become block inside flex container */
    flex: 0 0 100%;
    border: none;
    box-shadow: none;
    padding: 0 0 0 16px; /* top padding when open */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(.22,.7,.25,1), padding-top 0.28s cubic-bezier(.22,.7,.25,1);
  }

  .nav__item--dropdown.is-open > .nav__submenu {
    max-height: 480px; /* sufficient for a few items */
    padding-top: 4px;
  }

  .nav__submenu li a {
    padding: 6px 0;
  }

  /* Chevron toggle button */
  .nav__chevron-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(31,48,117,0.18);
    background: #fff;
    color: var(--color-primary);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
  }
  .nav__chevron-btn:hover,
  .nav__chevron-btn:focus-visible {
    box-shadow: 0 2px 6px rgba(31,48,117,.18);
    outline: none;
  }
  .nav__chevron-btn span { transition: transform 0.25s ease; }
  .nav__item--dropdown.is-open > .nav__chevron-btn span { transform: rotate(180deg); }

  .intro {
    padding: 0 24px;
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .hero__image {
    height: clamp(280px, 60vw, 420px);
  }

  .news {
    position: static;
    order: -1;
  }

  /* Mobile: Reihenfolge welcome → ibr → news → summary */
  .intro {
    grid-template-columns: 1fr;
    grid-template-areas:
      "welcome"
      "news"
      "ibr"
      "summary";
  }
  .intro > .intro__content { grid-area: welcome; }
  .intro > .news { grid-area: news; }
  .intro > .summary-card { grid-area: summary; }
  .intro > .more-card,
  .intro > .ibr-callout-mobile { grid-area: ibr; }

  .footer__inner {
    gap: 34px;
  }

  .core-content {
    padding: 60px 24px 90px;
  }

  .core-grid,
  .ref-grid {
    grid-template-columns: 1fr;
  }

  .ref-overview {
    padding: 60px 24px 90px;
  }

  .ref-detail__content {
    padding: 50px 24px 90px;
  }

  .ref-detail__list--columns {
    columns: 1;
  }
}

@media (max-width: 640px) {
  .topbar__inner {
    padding: 16px 18px;
  }

  .brand__mark {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .brand__name {
    font-size: 18px;
  }

  .intro__content h1,
  .intro__content h2 {
    font-size: 24px;
  }

  .profile h3 {
    font-size: 20px;
  }

  .news__card {
    padding: 28px 24px;
  }

  .footer {
    padding: 50px 20px 32px;
  }

  .footer__legal {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .legal-hero__inner,
  .legal-content__inner {
    padding: 0 20px;
  }

  .core-content {
    padding: 50px 20px 80px;
  }

  .core-grid {
    grid-template-columns: 1fr;
  }

  .ref-overview {
    padding: 50px 20px 80px;
  }

  .ref-detail__content {
    padding: 40px 20px 80px;
  }
}
.kanzlei-hero__image {
  width: 100%;
  height: clamp(420px, 60vw, 700px);
  background: image-set(
      url("images/variants/sg-hero4_1600.avif") type("image/avif") 1x,
      url("images/variants/sg-hero4_1600.webp") type("image/webp") 1x,
      url("images/sg-hero4.webp") type("image/webp") 1x
    )
    center/cover no-repeat;
}

.kanzlei-actions {
  padding: clamp(40px, 6vw, 80px) 32px;
}

.kanzlei-actions__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap; /* prevent overflow on narrow screens */
}

.kanzlei-actions .btn {
  padding: 16px 44px;
  font-size: 18px;
  border-width: 2px;
}

.kanzlei-actions {
  text-align: center;
}
.contact-hero__image {
  width: 100%;
  height: clamp(420px, 60vw, 700px);
  background: image-set(
      url("images/variants/sg-hero6_1600.avif") type("image/avif") 1x,
      url("images/variants/sg-hero6_1600.webp") type("image/webp") 1x,
      url("images/sg-hero6.webp") type("image/webp") 1x
    )
    center/cover no-repeat;
}
.partner-hero__image {
  width: 100%;
  height: clamp(420px, 60vw, 700px);
  background: image-set(
      url("images/variants/sg-hero1_1600.avif") type("image/avif") 1x,
      url("images/variants/sg-hero1_1600.webp") type("image/webp") 1x,
      url("images/sg-hero1.webp") type("image/webp") 1x
    )
    center/cover no-repeat;
}

.news-hero__image {
  width: 100%;
  height: clamp(420px, 60vw, 700px);
  background: image-set(
      url("images/variants/sg-hero1_1600.avif") type("image/avif") 1x,
      url("images/variants/sg-hero1_1600.webp") type("image/webp") 1x,
      url("images/sg-hero1.webp") type("image/webp") 1x
    )
    center/cover no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .nav__list > li:not(.nav__item--lang) > a::before,
  .nav__list > li:not(.nav__item--lang) > a::after,
  .nav__item--dropdown:hover > a::before,
  .nav__item--dropdown:hover > a::after {
    transition: none !important;
  }
}

/* Make Kanzlei buttons wrap nicely on small screens */
@media (max-width: 640px) {
  .kanzlei-actions__inner { gap: 12px; }
  .kanzlei-actions .btn {
    flex: 1 1 100%;
    width: 100%;
    text-align: center;
    padding: 14px 18px;
  }
}

.partner-section {
  padding: clamp(50px, 8vw, 110px) 32px 100px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
  justify-items: center;
}

.partner-card { text-align: center; }
.partner-card__link { color: inherit; text-decoration: none; display: inline-block; }
.partner-card__link:hover .partner-card__name,
.partner-card__link:focus .partner-card__name { color: var(--color-primary-light); }

.partner-card__photo {
  width: min(320px, 80vw);
  height: 320px; /* einheitliche Höhe */
  object-fit: cover;
  display: block;
  margin: 0 auto; /* zentriert in Karten/Artikeln */
  border-radius: 6px;
  box-shadow: 0 18px 40px rgba(31, 48, 117, 0.12);
}

/* Fokuspunkt je Bild für sichtbaren Kopf */
.partner-card__photo--scharlemann { object-position: center top; }
/* Show full image for Dr. Gross (avoid cropping/zoom) */
.partner-card__photo--gross { object-position: center top; }

.partner-card__name { margin: 24px 0 6px; font-size: 24px; color: var(--color-text); }
.partner-card__place { margin: 0 0 6px; font-size: 18px; color: var(--color-muted); }
.partner-card__role { margin: 0 0 16px; font-size: 20px; color: var(--color-text); }

.mail-btn {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: #ffffff;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.mail-btn:hover, .mail-btn:focus { background: var(--color-primary); color: #ffffff; box-shadow: 0 10px 24px rgba(31,48,117,.18); transform: translateY(-1px); }
.mail-btn::before { content: none; }
.mail-btn svg { width: 24px; height: 24px; fill: currentColor; }

.contact-row { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 8px; }
.mail-link { color: var(--color-primary); font-weight: 700; }

@media (max-width: 900px) {
  .partner-grid { grid-template-columns: 1fr; gap: 60px; }
}

/* Dark Reader specific contrast fixes
   Dark Reader sets data-darkreader-scheme="dark" on <html> when active.
   We tweak key variables and a few components to maintain readability. */
html[data-darkreader-scheme="dark"] {
  /* Brighten core palette for better contrast on darkened backgrounds */
  --color-text: #e8ecf8;
  --color-muted: #b8c3e0;
  --color-primary: #a9c1ff;
  --color-primary-light: #c7d7ff;
  --color-border: rgba(255, 255, 255, 0.22);
}

/* Headings and nav should inherit the brightened variables automatically.
   Ensure partner cards stay readable as they use mixed tones. */
html[data-darkreader-scheme="dark"] .partner-card__name,
html[data-darkreader-scheme="dark"] .partner-card__role { color: var(--color-text); }
html[data-darkreader-scheme="dark"] .partner-card__place { color: var(--color-muted); }
html[data-darkreader-scheme="dark"] .mail-link { color: var(--color-primary); }
html[data-darkreader-scheme="dark"] .mail-btn {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Correct hard-coded text color in intro section under Dark Reader */
html[data-darkreader-scheme="dark"] .intro p { color: var(--color-text) !important; }

/* Keep dropdowns and cards contrasted when DR darkens backgrounds */
html[data-darkreader-scheme="dark"] .nav__submenu,
html[data-darkreader-scheme="dark"] .ref-detail__section,
html[data-darkreader-scheme="dark"] .core-block,
html[data-darkreader-scheme="dark"] .news__card {
  border-color: var(--color-border);
}
/* Local Nunito webfont (self-hosted, GDPR-friendly) */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(fonts/XRXV3I6Li01BKofINeaB.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/XRXV3I6Li01BKofINeaB.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/XRXV3I6Li01BKofINeaB.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/XRXV3I6Li01BKofINeaB.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
