/* ==========================================================================
   Bauen und Leben GmbH – Stylesheet
   Schriften lokal eingebunden (keine Anfragen an Google o. ä.)
   ========================================================================== */

/* ---------- Schriften ---------- */
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/fira-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fira-sans-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Fira Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fira-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bitter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/bitter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bitter";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/bitter-latin-wght-italic.woff2") format("woff2");
}

/* ---------- Farben & Masse ---------- */
:root {
  /* Marke «Bauen und Leben» – gilt für alles oberhalb der Mitgliedschaft */
  --marke: #7e725c;        /* Akzentfarbe, auch für Links (Kontrast 4.7:1 auf Weiss) */
  --marke-dunkel: #665c4a; /* Links auf der hellen Fläche (Kontrast 5.5:1) */
  --marke-hell: #efebe4;   /* helle Fläche: Kontaktkarte, Bild-Platzhalter */
  --auswahl: #e4ddd1;      /* Textmarkierung */

  /* BAUmediation – nur im Mitgliedschafts-Block ganz unten */
  --gruen-link: #467311;   /* dunkles Logo-Grün für Links (Kontrast 5.6:1) */

  --schwarz: #000;         /* Titel und Leitsätze */
  --text: #3a3a38;         /* Fliesstext */
  --text-leise: #5f5f5a;   /* Fusszeile, Nebeninformationen */
  --linie: #e0dbd3;

  --font-sans: "Fira Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Bitter", Georgia, "Times New Roman", serif;

  /* Logo «Bauen & Leben» oben und unter der Kontaktkarte gleich gross;
     höchstens halbe Originalbreite (505 px), damit es auf Retina scharf bleibt */
  --logo-breite: clamp(12.5rem, 21vw, 15.75rem);

  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --abstand-section: clamp(3rem, 7vw, 5.5rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-kerning: normal;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }
}

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

p {
  margin: 0 0 1em;
  hyphens: auto;
  overflow-wrap: break-word;
}

h1,
h2 {
  margin: 0;
  color: var(--schwarz);
  text-wrap: balance;
}

strong {
  font-weight: 600;
  color: var(--schwarz);
}

a {
  color: var(--marke);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--schwarz);
  text-decoration-thickness: 2px;
}

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

::selection {
  background: var(--auswahl);
  color: var(--schwarz);
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -10rem;
  left: var(--gutter);
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--schwarz);
  color: #fff;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Kopfzeile ---------- */
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: clamp(1.25rem, 3vw, 2rem);
}

.site-logo {
  display: block;
}

.site-logo img {
  width: var(--logo-breite);
}

.header-link {
  color: var(--schwarz);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid var(--marke);
  padding-bottom: 0.15em;
}

.header-link:hover {
  border-bottom-color: var(--schwarz);
}

/* ---------- Stimmungsbild ---------- */
.hero {
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--marke-hell); /* sichtbar, solange kein Bild hinterlegt ist */
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 40rem) {
  .hero {
    aspect-ratio: 8 / 3;
  }
}

/* ---------- Leitsatz oben (h1) und Seitentitel ---------- */
.lead {
  max-width: 19em;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  font-family: var(--font-serif);
  font-size: clamp(2rem, 1.25rem + 2.6vw, 3rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

@media (max-width: 39.99rem) {
  .lead {
    font-size: 1.875rem;
    text-wrap: pretty;
  }
}

/* ---------- Abschnitte: Titel links, Text rechts ---------- */
.section {
  display: grid;
  row-gap: 1rem;
  padding-top: var(--abstand-section);
}

.section > h2 {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
}

.section__body > :last-child {
  margin-bottom: 0;
}

@media (min-width: 62rem) {
  .section {
    grid-template-columns: 17rem minmax(0, 42rem);
    column-gap: clamp(3rem, 6vw, 5.5rem);
  }

  .section > h2 {
    position: sticky;
    top: 2rem;
    align-self: start;
    font-size: 1.5rem;
    /* optisch auf die erste Textzeile ausrichten */
    margin-top: -0.1em;
  }
}

/* ---------- Leitsätze im Text ---------- */
.leitsatz {
  position: relative;
  margin: 2.25rem 0;
  font-family: var(--font-serif);
  font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
  color: var(--schwarz);
  hyphens: manual;
  text-wrap: pretty;
}

.leitsatz .gm {
  color: var(--marke);
  font-weight: 600;
}

/* öffnendes Guillemet hängt in den Rand, damit der Text bündig bleibt */
.leitsatz .gm:first-child {
  position: absolute;
  right: 100%;
  margin-right: 0.08em;
}

.signatur {
  margin-top: 1.75rem;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.45;
  color: var(--schwarz);
}

/* ---------- Typische Situationen ---------- */
.situationen {
  display: grid;
  gap: 1.75rem 2.5rem;
  margin: 0;
}

.situation {
  padding-top: 0.9rem;
  border-top: 1px solid var(--linie);
}

.situation dt {
  margin-bottom: 0.35rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--schwarz);
}

.situation dd {
  margin: 0;
  font-size: 1rem;
  hyphens: auto;
}

@media (min-width: 40rem) {
  .situationen {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Kontakt ---------- */
.kontakt-karte {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 1.75rem;
  margin-top: 2rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--marke-hell);
}

.kontakt-karte img {
  flex: none;
  width: 7.5rem;
}

.kontakt-karte address {
  flex: 1 1 14rem;
  font-style: normal;
  line-height: 1.65;
}

.kontakt-karte a {
  color: var(--marke-dunkel);
  overflow-wrap: anywhere;
}

.kontakt-karte a:hover {
  color: var(--schwarz);
}

/* Logo «Bauen & Leben» als Abschluss unter der Kontaktkarte */
.logo-abschluss {
  width: var(--logo-breite);
  margin-top: 2.5rem;
}

.mitgliedschaft {
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--linie);
  font-size: 1rem;
}

/* Zwei Zeilen Text links, Logo rechtsbündig. Wird es auf schmalen
   Bildschirmen umbrochen, steht es allein auf der Zeile und damit links. */
.mitgliedschaft__kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1em;
}

.mitgliedschaft__kopf p {
  margin: 0;
}

.mitgliedschaft__kopf img {
  width: 12.5rem;
}

/* Der BAUmediation-Block behält das Grün der Fachgruppe */
.mitgliedschaft a {
  color: var(--gruen-link);
}

.mitgliedschaft a:hover {
  color: var(--schwarz);
}

.mitgliedschaft :focus-visible {
  outline-color: var(--gruen-link);
}

/* ---------- Impressum und Datenschutzerklärung ---------- */
.seite {
  padding-top: clamp(1.5rem, 4vw, 3rem);
}

.section--kompakt {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.section--kompakt > h2 {
  font-size: 1.125rem;
}

@media (min-width: 62rem) {
  .section--kompakt > h2 {
    font-size: 1.125rem;
    margin-top: 0.15em;
  }
}

.section--kompakt address {
  font-style: normal;
}

.fussnote {
  margin-top: var(--abstand-section);
  font-size: 0.9375rem;
  color: var(--text-leise);
}

@media (min-width: 62rem) {
  .fussnote {
    /* auf die Textspalte ausrichten */
    margin-left: calc(17rem + clamp(3rem, 6vw, 5.5rem));
  }
}

/* ---------- Fusszeile ---------- */
.site-footer {
  margin-top: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--linie);
  font-size: 0.9375rem;
  color: var(--text-leise);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: 1.75rem 2.5rem;
}

.site-footer a {
  color: inherit;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-footer a:hover {
  color: var(--schwarz);
}

.adresse {
  display: flex;
  flex-direction: column;
  font-style: normal;
}

@media (min-width: 64rem) {
  .adresse {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .adresse > span + span::before {
    content: "|";
    content: "|" / "";
    margin-inline: 0.65em;
    color: #b9bdb1;
  }
}

/* ---------- Geschützte Kontaktangaben ----------
   Telefonnummern und E-Mail-Adressen stehen nur zerlegt im HTML und werden von
   js/kontakt.js zu Links zusammengesetzt. Ohne JavaScript zeigt CSS sie als Text
   an (dann nicht anklickbar). */
.geschuetzt[data-u]:not(.ist-bereit)::before {
  content: attr(data-u) "@" attr(data-d);
}

.geschuetzt[data-vorwahl]:not(.ist-bereit)::before {
  content: attr(data-vorwahl) " " attr(data-nummer);
}

.geschuetzt[data-vorwahl] {
  white-space: nowrap;
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
