/* Bausteine des CMS.
 *
 * Gilt zusammen mit styles.css, der unveränderten Stilvorlage aus out/.
 * Geladen wird diese Datei zuerst: Die Schriftmodule (`mt-…`) in styles.css
 * liegen in `@media (max-width: 540px)` und sollen die Bausteine auf kleinen
 * Schirmen übersteuern dürfen.
 *
 * Alle Zahlen sind an der abgenommenen Fassung gemessen, nicht geschätzt
 * (tools/measure.py). Wo sich Ausprägungen desselben Bausteins wirklich
 * unterscheiden, steht ein benannter Zustand statt eines neuen Bausteins.
 * Geprüft wird mit tools/compare.py gegen out/.
 */

/* ------------------------------------------------ Abschlussabschnitt (cta) */

.cta-band {
  /* Grundzustand ist die Ausprägung "m" der Projektseite. */
  --cta-pad: 80px;
  --cta-tail: 36px;
  --cta-title-size: clamp(28.6px, 3.05556vw, 44px);
  --cta-title-line: 1.5;
  --cta-title-spacing: 0;
  --cta-title-color: #fff;
  --cta-text-size: 17px;
  --cta-text-line: 25.5px;
  --cta-text-color: #ffffffb2;
  --cta-text-width: 480px;
  --cta-text-gap: 20px;
  --cta-action-gap: 32px;
  --cta-gap: 16px;

  background: #002b5c;
  /* Der seitliche Abstand ist in der abgenommenen Fassung durchgehend 32px,
     nicht der schmalere --gutter. Auf kleinen Schirmen macht das den
     Unterschied zwischen ein- und zweizeiliger Überschrift. */
  padding: var(--cta-pad) 32px calc(var(--cta-pad) + var(--cta-tail));
}

.cta-band-inner {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
}

.cta-band-title {
  margin: -1px 0 0;
  font-family: var(--heading-font);
  font-size: var(--cta-title-size);
  font-weight: 500;
  line-height: var(--cta-title-line);
  letter-spacing: var(--cta-title-spacing);
  color: var(--cta-title-color);
}

.cta-band-text {
  margin: var(--cta-text-gap) 0 0;
  max-width: var(--cta-text-width);
  font-family: var(--body-font);
  font-size: var(--cta-text-size);
  font-weight: 400;
  line-height: var(--cta-text-line);
  /* Ohne eigene Angabe erbt der Absatz die Laufweite der Umgebung und bricht
     dadurch eine Zeile früher um als in der abgenommenen Fassung. */
  letter-spacing: 0;
  color: var(--cta-text-color);
}

.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cta-gap);
  margin-top: var(--cta-action-gap);
}

/* Mittig ------------------------------------------------------------------ */

.cta-band--center .cta-band-inner,
.cta-band--center .cta-band-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cta-band--center .cta-band-copy {
  width: 100%;
}

.cta-band--center .cta-band-title,
.cta-band--center .cta-band-text {
  text-align: center;
}

.cta-band--center .cta-band-actions {
  justify-content: center;
}

/* Geteilt: Text links, Schaltflächen rechts daneben ----------------------- */

.cta-band--split .cta-band-inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  align-items: center;
}

.cta-band--split .cta-band-actions {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
}

/* Ausprägungen ------------------------------------------------------------ */

.cta-band--xl {
  --cta-pad: 100px;
  --cta-tail: 0px;
  --cta-title-size: clamp(32.76px, 3.5vw, 50.4px);
  --cta-title-line: 1.101;
  --cta-text-line: 28px;
  --cta-text-color: #ffffffa6;
  --cta-text-width: 520px;
  --cta-text-gap: 24px;
  --cta-action-gap: 44px;
  --cta-gap: 12px;
}

.cta-band--l {
  --cta-pad: 100px;
  --cta-title-size: clamp(31.2px, 3.33333vw, 48px);
  --cta-action-gap: 40px;
}

.cta-band--xxl {
  --cta-pad: 120px;
  --cta-tail: 0px;
  --cta-title-size: clamp(35.1px, 3.75vw, 54px);
  --cta-title-line: 1.05;
  --cta-title-spacing: -1.08px;
  --cta-text-size: 16px;
  --cta-text-line: 28px;
  --cta-text-color: #ffffff8c;
  --cta-text-width: 704px;
  --cta-text-gap: 24px;
  --cta-gap: 12px;
}

.cta-band--s {
  --cta-pad: 56px;
  --cta-tail: 16px;
  --cta-title-size: 28px;
  --cta-title-line: 42px;
  --cta-text-size: 15px;
  --cta-text-line: 22.5px;
  --cta-text-width: 520px;
  --cta-text-gap: 8px;
  --cta-gap: 12px;
}

/* Helle Fläche (Karriere). */
.cta-band--light {
  --cta-title-color: var(--ink);
  --cta-text-color: var(--muted);
  background: #fff;
}

/* Kleine Schirme ---------------------------------------------------------- */

@media (max-width: 1023px) {
  .cta-band {
    --cta-gap: 24px;
  }

  .cta-band--split .cta-band-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  /* Die Schaltflächen stehen untereinander über die volle Breite. */
  .cta-band-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
}

/* ------------------------------------------- Kopf eines Rasterabschnitts */

.project-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 40px;
}

.project-section-head > .ds-kicker {
  flex: 1 0 100%;
  margin: 0;
}

.project-section-head > h2 {
  margin: 0;
}

/* --------------------------------------------------- Leistungsblock (service-block) */

.service-block {
  --sb-number-color: #fff;
  --sb-text-size: 17px;
  --sb-text-line: 28.9px;
  --sb-text-color: var(--ink);
  --sb-text-width: 601px;

  background: var(--surface);
  padding: 100px 32px;
}

.service-block-inner {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 80px;
  align-items: start;
}

.service-block-media {
  width: 100%;
  height: clamp(240px, 31.2493vw, 449.99px);
  background: #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
}

.service-block-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-block-number {
  margin: -1px 0 0;
  width: fit-content;
  font-family: var(--heading-font);
  font-size: clamp(41.6px, 4.44444vw, 64px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  color: var(--sb-number-color);
}

.service-block-rule {
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 8px;
  background: var(--yellow);
}

.service-block-title {
  margin: 20px 0 0;
  width: min(100%, 601px);
  font-family: var(--heading-font);
  font-size: clamp(28px, 2.5vw, 36px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0;
  color: var(--ink);
}

.service-block-text {
  margin: 20px 0 0;
  width: min(100%, var(--sb-text-width));
  font-family: var(--body-font);
  font-size: var(--sb-text-size);
  font-weight: 400;
  line-height: var(--sb-text-line);
  letter-spacing: 0;
  color: var(--sb-text-color);
}

.service-block-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.service-block-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 21px;
  color: var(--ink);
}

/* Der Aufzählungsstrich ist ein gelber Balken, kein Listenpunkt. */
.service-block-list li::before {
  content: '';
  flex: none;
  width: 5.99px;
  height: 1.99px;
  background: var(--yellow);
}

/* Ausprägung mit schmalerem, grauem Fließtext (Entwicklung). */
.service-block--muted {
  --sb-number-color: var(--surface);
  --sb-text-size: 15px;
  --sb-text-line: 25.5px;
  --sb-text-color: var(--muted);
  --sb-text-width: 330px;
}

/* Bild rechts statt links. */
.service-block--reverse .service-block-media {
  order: 2;
}

@media (max-width: 900px) {
  .service-block {
    padding: 64px var(--gutter);
  }

  .service-block-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .service-block--reverse .service-block-media {
    order: 0;
  }

  .service-block-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Projektbeispiele unter einem Leistungsblock. */

.service-block-examples {
  width: 100%;
  max-width: var(--content);
  margin: 32px auto 0;
}

.service-block-example-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.service-block-example {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.service-block-example img {
  display: block;
  width: 100%;
  aspect-ratio: 416 / 312;
  object-fit: cover;
}

.service-block-example-body {
  display: block;
  padding: 20px;
}

.service-block-example-name {
  display: block;
  font: 500 16px / 24px var(--heading-font);
  color: var(--ink);
}

.service-block-example-place {
  display: block;
  padding-top: 4px;
  font: 400 13px / 19.5px var(--body-font);
  color: var(--muted);
}

@media (max-width: 900px) {
  .service-block-example-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Dritte Fläche: hellgrau mit dunkler Schrift (Teamseite). */
.cta-band--surface {
  --cta-title-color: var(--ink);
  --cta-text-color: var(--muted);
  background: var(--surface);
}

/* Geteilt: zwölf Spalten wie in der abgenommenen Fassung, Text auf acht. */
.cta-band--split .cta-band-inner {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 28.8px;
}

.cta-band--split .cta-band-copy {
  grid-column: span 8;
}

.cta-band--split .cta-band-actions {
  grid-column: span 4;
}

/* Diese Regel steht bewusst am Ende: Sie muss die zwölfspaltige Aufteilung
   weiter oben übersteuern, sonst quetschen sich die Schaltflächen auf
   schmalen Schirmen in die rechte Spalte. */
@media (max-width: 1023px) {
  .cta-band--split .cta-band-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .cta-band--split .cta-band-copy,
  .cta-band--split .cta-band-actions {
    grid-column: span 1;
  }

  .cta-band--split .cta-band-actions {
    margin-top: 0;
  }
}

/* Dritte Anordnung: Text und Schaltflächen nebeneinander in einer Zeile,
   beide in natürlicher Breite (Karriere). */
.cta-band--inline .cta-band-inner {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.cta-band--inline .cta-band-actions {
  flex: none;
  margin-top: 0;
}

@media (max-width: 1023px) {
  .cta-band--inline .cta-band-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }
}

/* --------------------------------------------------------- Team (team-groups) */

.team-group-section {
  /* Der Elternknoten ist ein Flex-Container; ohne diese Angabe schrumpft der
     Abschnitt auf seinen Inhalt und die Fläche reicht nicht über die Breite. */
  width: 100%;
  align-self: stretch;
  padding: 72px 32px;
  background: #fff;
}

/* Die Flächen wechseln von Gruppe zu Gruppe. */
.team-group-section--surface {
  background: var(--surface);
}

.team-group-inner {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
}

.team-group-title {
  margin: 0;
  padding-top: 12px;
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 500;
  line-height: 30px;
  letter-spacing: 0;
  color: var(--ink);
}

/* Die erste Gruppe trägt die größere Überschrift. */
.team-group-section--lead .team-group-title {
  font-size: 26px;
  line-height: 39px;
}

/* Feste Spaltenbreite statt gleichmäßiger Teilung: Eine Gruppe mit zwei
   Personen zeigt zwei Karten in Normalbreite, nicht zwei halbe Seiten. */
/* Die Inhaltsspalte ist mittig; das Raster beginnt an ihrer linken Kante. */
.team-grid {
  display: grid;
  /* Feste Spurbreite wie in der Vorlage: Eine Gruppe mit zwei Personen zeigt
     zwei Karten in Normalbreite, nicht zwei halbe Seiten. */
  grid-template-columns: repeat(var(--team-cols-1, 5), minmax(0, var(--team-card-width, 249.594px)));
  gap: 8px;
  margin-top: 28px;
}

/* Die zweite Reihe schließt enger an das Schaufenster an als an eine
   Überschrift: In der Vorlage sind es dort 28, hier 8 Pixel. */
.team-grid--folge {
  margin-top: 8px;
}

/* Die Karte ist wie in der abgenommenen Fassung eine weiße Fläche mit feinem
   Rahmen; auf den weißen Gruppenflächen ist der Rahmen das Einzige, was sie
   von der Umgebung abhebt. */
.team-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #fff;
  border: 1px solid #f0f0f0;
}

/* Der Textcontainer unter dem Foto: Innenabstand 13 / 14 / 16 wie in der
   Vorlage gemessen. Er füllt die Karte nach unten, damit in einer Reihe alle
   weißen Flächen gleich tief enden – auch wenn eine Karte weniger Zeilen hat. */
.team-card-body {
  flex: 1;
  padding: 13px 14px 16px;
  background: #fff;
}

/* Gelbe Linie zwischen Foto und Text – in der Vorlage die Oberkante des
   Textcontainers, 1.92 Pixel stark, hier auf 2 gerundet. Als Innenschatten
   statt als Rahmen, damit sie keinen Platz einnimmt: Der Text steht dann auf
   derselben Höhe wie in der Karte daneben ohne Linie. Das Kennzeichen ist
   unabhängig vom Schaufenster wählbar. */
.team-card--line .team-card-body {
  box-shadow: inset 0 2px 0 var(--yellow);
}

.team-card-photo {
  display: block;
  width: 100%;
  /* Das Bild behält sein Verhältnis und wächst mit der Spalte – so wie in der
     abgenommenen Fassung, wo es bei 1440 Pixeln 248 zu 330 misst. */
  aspect-ratio: 248 / 330;
  height: auto;
  object-fit: cover;
  object-position: top;
}

/* Die Abstände sind an der abgenommenen Fassung gemessen (tools/measure.py):
   Foto 330, dann 16 / 13 / 2 / 7 Pixel zwischen den Zeilen. Die 16 unter dem
   Foto setzen sich aus dem Innenabstand des Textcontainers (13) und dem Rand
   der ersten Zeile (3) zusammen. */
.team-card-label {
  margin: 3px 0 0;
  padding: 0;
  font: 600 9px / 13.5px var(--body-font);
  letter-spacing: 0.63px;
  color: var(--blue);
}

.team-card-name {
  margin: 13px 0 0;
  font: 600 16px / 21.6px var(--body-font);
  color: var(--ink);
}

/* Ohne Beschriftung rückt der Name an deren Stelle. */
.team-card-body > .team-card-name:first-child {
  margin-top: 3px;
}

.team-card-position {
  margin: 2px 0 0;
  padding: 0;
  font: 400 13px / 19.5px var(--body-font);
  color: var(--muted);
}

.team-card-contact {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.team-card-contact li + li {
  margin-top: 7px;
}

.team-card-contact a {
  font: 400 13px / 21px var(--body-font);
  color: var(--muted);
}

/* Schmale Karte: der abgenommene Empfangsblock zeigt kein Porträt, sondern
   Name, Funktion und Kontakt in einem weißen Rahmen. Zwei davon stehen
   nebeneinander in einer Reihe von 600 Punkten – nicht untereinander. */
.team-grid--compact {
  --team-card-width: 296px;
  max-width: 600px;
}

.team-card--compact {
  padding: 24px 28px;
}

/* Die Karte selbst trägt hier den Innenabstand; der Textcontainer braucht
   keinen zweiten. */
.team-card--compact .team-card-body {
  padding: 0;
}

.team-card--compact .team-card-photo {
  display: none;
}

.team-card--compact .team-card-body .team-card-name {
  margin: 0;
  font: 500 17px / 25.5px var(--heading-font);
  color: var(--ink);
}

.team-card--compact .team-card-position {
  margin: 0;
  padding-top: 4px;
}

.team-card--compact .team-card-contact {
  margin: 0;
  padding-top: 14px;
}

.team-card--compact .team-card-contact li + li {
  margin-top: 4px;
}

.team-card--compact .team-card-contact a {
  color: var(--ink);
}

/* Große Karte: doppelte Spaltenbreite und größeres Foto. Diese Ausprägung
   kommt in der abgenommenen Fassung nicht vor; sie steht für Leitungsrollen
   bereit und ist über das Feld `card_variant` wählbar. */
.team-grid--large {
  --team-card-width: 507.188px;
}

.team-card--large .team-card-photo {
  width: 100%;
  height: 430px;
}

.team-card--large .team-card-name {
  font-size: 20px;
  line-height: 27px;
}

.team-card--large .team-card-position {
  font-size: 15px;
  line-height: 22.5px;
}

/* Schmalere Schirme: Die Spalten teilen sich die Breite. Die Stufen sind an
   der abgenommenen Fassung abgelesen – 4 Spalten ab 900, 3 ab 541, sonst 2. */
@media (max-width: 1023px) {
  .team-group-section {
    padding: 56px var(--gutter);
  }

  .team-grid {
    grid-template-columns: repeat(var(--team-cols-2, 4), minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .team-grid {
    grid-template-columns: repeat(var(--team-cols-3, 3), minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .team-grid {
    grid-template-columns: repeat(var(--team-cols-4, 2), minmax(0, 1fr));
  }
}

/* Karte ohne eigenes Foto: ruhige Fläche mit den Initialen statt eines
   fremden Gesichts. Die Vorlage liefert zehn Porträts für 61 Personen. */
.team-card-photo--leer {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  color: #9aa2ac;
  font: 500 clamp(28px, 4vw, 44px) / 1 var(--heading-font);
  letter-spacing: 0.04em;
  user-select: none;
}

/* Einzug von Kicker und Überschrift der Teambühne.
 *
 * Der Einleitungstext rechts hat im Raster 32 Pixel Innenabstand, der
 * Überschriftenblock links hatte keinen – dadurch standen beide Spalten
 * unterschiedlich weit innen. Der Wert ist im Bauplan einstellbar; auf
 * schmalen Schirmen entfällt er, dort ist die Breite ohnehin knapp.
 */
.team-hero-copy {
  padding-left: var(--team-hero-indent, 0);
}

@media (max-width: 900px) {
  .team-hero-copy {
    padding-left: 0;
  }
}

/* Karriereseite ohne offene Stelle.
 *
 * Kein leerer Abschnitt und kein nackter Satz: Wer hier landet, sucht Arbeit –
 * die Seite sagt, woran sie ist, und lässt einen Weg offen. Der Block nimmt die
 * Maße der Aufklapper daneben auf, damit die Seite nicht auffällig schmaler
 * wird, sobald die letzte Stelle abgeschaltet ist. */
.jobs-leer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 40px 44px;
  background: #fff;
  border: 0.64px solid #f0f0f0;
  border-radius: 3px;
}

.jobs-leer-titel {
  margin: 0;
  font: 500 18px / 27px var(--heading-font);
  color: var(--ink);
}

.jobs-leer-text {
  margin: 12px 0 0;
  max-width: 620px;
  font-size: 14px;
  line-height: 22.8px;
  color: var(--muted);
}

.jobs-leer .container-275 {
  margin-top: 28px;
}

@media (max-width: 540px) {
  .jobs-leer {
    padding: 28px 24px;
  }
}

/* ------------------------------------------------- Anfahrt (contact-form) */

/* Unter den Kontaktdaten, in der schmalen Spalte neben dem Formular. Die
   Skizzen stehen untereinander und füllen die Spalte; die Überschrift nimmt
   die kleine Versalzeile der Kontaktangaben (Adresse, Telefon, …). */

.contact-route {
  margin-top: 28px;
  max-width: 480px;
}

.master-contact-data .contact-route-text {
  margin: 0 0 16px;
  color: var(--muted);
}

.contact-route-figure {
  margin: 0 0 16px;
}

.contact-route-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.contact-route-figure figcaption {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
