/*
 * Unterseiten (Login, Termin, Projekt, Rechtliches, Fehler).
 * Farben, Schriften und Knöpfe kommen aus kern.css. Hier steht der Rahmen der
 * Unterseiten (Block "us") und ihre Inhalte (Blöcke "buchung", "projekt", "rechtstext").
 * Schreibweise: BEM, also block__element--variante.
 */

/* ---------- Rahmen: Kopf, Inhalt, Fuß. Anders als der OnePager scrollt die Seite normal. */
html:has(.us) { height: auto; }
body:has(.us) { height: auto; overflow: auto; background: var(--papier); }

.us {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.us__kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem max(16px, env(safe-area-inset-right, 0px)) .5rem max(16px, env(safe-area-inset-left, 0px));
  background: var(--weiss);
  border-bottom: 1.5px solid var(--tusche);
}
.us__marke { display: flex; }
.us__marke img { height: 40px; width: auto; }
.us__rechts { display: flex; align-items: center; gap: .5rem; }
.us__rechts .pill { display: inline-flex; align-items: center; }
.us__rechts .pill svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.us__inhalt {
  width: min(1180px, 100% - 32px);
  margin-inline: auto;
  padding: clamp(20px, 4vw, 48px) 0 clamp(32px, 6vw, 72px);
  display: grid;
  gap: 1.2rem;
  align-content: start;
}
.us__titel { display: grid; gap: .3rem; }
.us__titel h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  letter-spacing: -.025em;
  line-height: 1;
}
.us__titel p { margin: 0; color: var(--grau); max-width: 60ch; }
.us__zurueck { justify-self: start; color: var(--grau); }

/* Weißes Blatt mit Tuscherand, wie die Karten im Kundenbereich */
.us__blatt {
  background: var(--weiss);
  border: 1.5px solid var(--tusche);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(20, 20, 20, .9);
  padding: clamp(1.1rem, 3vw, 2rem);
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}
.us__blatt--schmal { max-width: 46rem; }
.us__blatt--bild { padding: 0; overflow: hidden; }
.us__blatt--bild img { display: block; width: 100%; height: 100%; object-fit: cover; }
.us__zwei {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 1.2rem;
  align-items: start;
}
.us__meldung {
  margin: 0;
  padding: .7rem 1rem;
  border: 1.5px solid #167a68;
  border-radius: 10px;
  background: #e6f7f3;
  color: #0f5a4d;
  font-weight: 600;
}
.us__meldung--fehler { border-color: #b3261e; background: #fdecea; color: #8c1d18; }
.us__check { display: flex; gap: .6rem; align-items: flex-start; }
.us__check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; }

.us__fuss {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: .9rem max(16px, env(safe-area-inset-right, 0px)) calc(.9rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--weiss);
  border-top: 1.5px solid var(--tusche);
  font-size: .85rem;
}
.us__fuss ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.us__fuss a { color: var(--tusche); text-underline-offset: 3px; }
.us__version { color: var(--grau); font-family: var(--font-mono); font-size: .72rem; }

/* ---------- Terminbuchung (/termin) */
.buchung__form { display: grid; gap: 1.6rem; }
.buchung__gruppe { border: 0; margin: 0; padding: 0; display: grid; gap: .9rem; min-width: 0; }
.buchung__gruppe legend {
  padding: 0;
  margin-bottom: .4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}
.buchung__zeile { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.buchung__feld { display: grid; gap: .3rem; }
.buchung__feld span { font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.buchung__feld input,
.buchung__feld select,
.buchung__feld textarea {
  font: inherit;
  width: 100%;
  min-height: 44px;
  padding: .6rem .7rem;
  background: #fff;
  color: var(--tusche);
  border: 1.5px solid #c9ccd2;
  border-radius: 10px;
}
.buchung__feld textarea { min-height: 110px; resize: vertical; }
.buchung__feld :focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(30, 159, 208, .2); }
.buchung__feld [aria-invalid="true"] { border-color: #b3261e; }
.buchung__hinweis { margin: 0; color: var(--grau); font-size: .9rem; }
.buchung__fehler { margin: 0; color: #b3261e; font-weight: 600; font-size: .9rem; }
.buchung__senden { justify-self: start; }
.buchung__honig { position: absolute; left: -9999px; }

/* ---------- Projektseite (/projekte/…) */
.projekt__fakten { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .8rem 1.2rem; }
.projekt__fakten dt { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--grau); }
.projekt__fakten dd { margin: 0; font-weight: 600; }
.projekt__drei { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.2rem; }
.projekt__drei h2 { margin: 0 0 .3rem; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.projekt__drei p { margin: 0; }
.projekt__tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.projekt__tags li { border: 1.5px solid var(--tusche); border-radius: 999px; padding: .15rem .7rem; font-size: .82rem; font-weight: 600; }
.projekt__bilder { display: grid; gap: 1.2rem; }
.projekt__bilder figure { margin: 0; }
.projekt__bilder figcaption { padding: .6rem 1rem; font-size: .85rem; color: var(--grau); border-top: 1.5px solid var(--tusche); }
.projekt__bilder img { height: auto; }

/* ---------- Fließtext: Rechtliches und einfache Seiten */
.rechtstext { max-width: 70ch; }
.rechtstext h2,
.rechtstext h3,
.rechtstext h4 { margin: 1.2rem 0 .3rem; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.rechtstext > :first-child { margin-top: 0; }
.rechtstext p,
.rechtstext ul { margin: 0 0 .7rem; }
.rechtstext a { color: inherit; text-underline-offset: 3px; }

/* ---------- Fehlerseiten 404 und 500 als eigene Seiten (Klassen fs-* in fehlerseite.css) */
html:has(.fs--seite) { height: auto; }
body:has(.fs--seite) { height: auto; overflow: auto; }
.fs--seite { position: static; min-height: 100dvh; animation: none; }
.fs--seite .fs-kopf a { display: flex; text-decoration: none; }
.fs--seite .fs-chip { text-decoration: none; }
.fs--seite .btn { text-decoration: none; }

/* ---------- Login: Fehlerbox des Entwurfs im Formular */
.us__blatt .login-fehler span { display: block; }

@media (max-width: 760px) {
  .us__zwei { grid-template-columns: minmax(0, 1fr); }
  .us__rechts .pill .txt { display: none; }
  .us__rechts .pill { padding: 0 .7rem; }
  .us__marke img { height: 34px; }
}

/* ---------- Links eines Projekts (snippets/projekt-links.php) */
.projekt-links { margin: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
