/* ==========================================================================
   Ba the Bear · Designsystem „Bas Lächeln“ · bb.css (Komponenten)
   Voraussetzung: tokens.css. Alle Werte kommen aus --bb-*. Präfix .bb-
   Signatur: Lächel-Rahmen (.bb-laecheln) ersetzt überall die Standard-Karte.
   ========================================================================== */

/* --- Grundlage --- */
.bb-seite {
  margin: 0; background: var(--bb-papier); color: var(--bb-tinte);
  font: 400 var(--bb-groesse-text)/var(--bb-zeile) var(--bb-schrift-text);
  -webkit-font-smoothing: antialiased;
}
.bb-seite *, .bb-seite *::before, .bb-seite *::after { box-sizing: border-box; }
.bb-h1, .bb-h2, .bb-h3 { font-family: var(--bb-schrift-display); font-weight: 700; line-height: 1.1; margin: 0 0 var(--bb-abstand-2); }
.bb-h1 { font-size: var(--bb-groesse-1); letter-spacing: -0.01em; }
.bb-h2 { font-size: var(--bb-groesse-2); }
.bb-h3 { font-size: var(--bb-groesse-3); font-weight: 600; }
.bb-klein { font-size: var(--bb-groesse-klein); color: var(--bb-text-3); }
.bb-text-2 { color: var(--bb-text-2); }
/* :where() hält die Gewichtung niedrig, damit Navigation, Fuß und Komponenten ihre eigenen Linkfarben behalten */
.bb-link, :where(.bb-seite) a:not([class]) { color: var(--bb-signal); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
.bb-link:hover, :where(.bb-seite) a:not([class]):hover { color: var(--bb-signal-tief); }
:where(.bb-seite) :focus-visible { outline: 3px solid var(--bb-fokus); outline-offset: 3px; border-radius: 6px; }

/* --- Signatur 1: Lächel-Linie (Trenner, Unterstreichung). Bas gestickter Mund. --- */
.bb-laecheln-linie {
  display: block; width: min(160px, 40%); height: 18px; margin: var(--bb-abstand-2) 0;
  border: 0; border-bottom: var(--bb-laecheln-strich) solid var(--bb-tinte);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.bb-laecheln-linie--herz { border-bottom-color: var(--bb-signal); }      /* nur unter dem Haupttitel einer Ansicht */
.bb-laecheln-linie--mitte { margin-inline: auto; }
.bb-laecheln-linie--klein { width: 64px; height: 10px; border-bottom-width: 4px; }

/* Titel mit Lächeln: die Lächel-Linie hängt unter dem Titel */
.bb-titel { display: inline-block; }
.bb-titel::after {
  content: ""; display: block; width: 58%; height: 0.32em; margin-top: 0.06em;
  border-bottom: var(--bb-laecheln-strich) solid var(--bb-signal); border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

/* --- Signatur 2: Lächel-Rahmen. Ersetzt die Standard-Karte überall. ---
   Oben weiche Ecken, unten endet die Fläche in Bas Lächeln (elliptische Unterkante). */
.bb-laecheln {
  position: relative; display: block; overflow: hidden;
  background: var(--bb-flaeche); color: var(--bb-tinte);
  padding: var(--bb-abstand-3) var(--bb-abstand-3) calc(var(--bb-abstand-4) + 4%);
  border-radius: var(--bb-radius-flaeche) var(--bb-radius-flaeche) 50% 50% / var(--bb-radius-flaeche) var(--bb-radius-flaeche) var(--bb-laecheln-tiefe) var(--bb-laecheln-tiefe);
  box-shadow: var(--bb-schatten);
  transition: border-radius var(--bb-dauer) ease, background-color var(--bb-dauer) ease;
  text-decoration: none;
}
/* Interaktiv (Link/Knopf): Ba lächelt breiter */
a.bb-laecheln:hover, button.bb-laecheln:hover, .bb-laecheln--interaktiv:hover {
  --bb-laecheln-tiefe: 20%;
}
a.bb-laecheln:focus-visible, .bb-laecheln--interaktiv:focus-within { outline: 3px solid var(--bb-fokus); outline-offset: 4px; }
.bb-laecheln--hervor { background: var(--bb-sofa); color: var(--bb-auf-sofa); }   /* höchstens einmal pro Ansicht */
.bb-laecheln--statisch { transition: none; }
.bb-laecheln--bild { padding: 0; background: var(--bb-flaeche); }
.bb-laecheln--bild > img, .bb-laecheln--bild > video { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.bb-laecheln--hoch > img, .bb-laecheln--hoch > video { aspect-ratio: 9 / 16; }
.bb-laecheln__titel { font: 600 var(--bb-groesse-3)/1.15 var(--bb-schrift-display); margin: 0 0 var(--bb-abstand-1); }
.bb-laecheln__meta { font-size: var(--bb-groesse-klein); color: var(--bb-text-3); margin: 0; }
.bb-laecheln--hervor .bb-laecheln__meta { color: var(--bb-auf-sofa); }
.bb-laecheln__unter { padding: var(--bb-abstand-2) var(--bb-abstand-1) 0; }      /* Text unter einem Bild-Rahmen */

/* Raster: asymmetrisch, kein zentriertes Dreier-Kartenraster */
.bb-raster { display: grid; gap: var(--bb-abstand-4) var(--bb-abstand-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.bb-raster--gross-klein { grid-template-columns: 2fr 1fr; }
@media (max-width: 720px) { .bb-raster--gross-klein { grid-template-columns: 1fr; } }

/* --- Knöpfe --- */
.bb-knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: var(--bb-touch); padding: 0 1.4em; border: var(--bb-strich) solid var(--bb-tinte);
  border-radius: var(--bb-radius-knopf); background: var(--bb-tinte); color: var(--bb-papier);
  font: 700 1rem/1 var(--bb-schrift-text); text-decoration: none; cursor: pointer;
  transition: background-color var(--bb-dauer) ease, color var(--bb-dauer) ease;
}
.bb-knopf:hover { background: var(--bb-text-2); border-color: var(--bb-text-2); }
.bb-knopf--haupt { background: var(--bb-signal); border-color: var(--bb-signal); color: var(--bb-auf-signal); }  /* genau einer pro Ansicht */
.bb-knopf--haupt:hover { background: var(--bb-signal-tief); border-color: var(--bb-signal-tief); }
.bb-knopf--leise { background: transparent; color: var(--bb-tinte); }
.bb-knopf--leise:hover { background: var(--bb-flaeche); }
.bb-knopf:disabled, .bb-knopf[aria-disabled="true"] { background: var(--bb-flaeche); border-color: var(--bb-linie); color: var(--bb-text-3); cursor: not-allowed; }

/* --- Felder --- */
.bb-label { display: block; font-weight: 700; margin-bottom: 6px; }
.bb-feld {
  width: 100%; min-height: var(--bb-touch); padding: 0.6em 0.9em; font: inherit; color: var(--bb-tinte);
  background: var(--bb-papier); border: var(--bb-strich) solid var(--bb-linie); border-radius: var(--bb-radius-feld);
}
.bb-feld:focus-visible { outline: 3px solid var(--bb-fokus); outline-offset: 2px; border-color: var(--bb-tinte); }
.bb-hinweis { font-size: var(--bb-groesse-klein); color: var(--bb-text-2); margin-top: 6px; }
.bb-fehler { color: var(--bb-signal); font-weight: 700; }

/* --- Zitat: Fläche mit kleiner Lächel-Linie --- */
.bb-zitat { margin: 0; padding: var(--bb-abstand-3); background: var(--bb-flaeche); border-radius: var(--bb-radius-flaeche); }
.bb-zitat p { font: 600 var(--bb-groesse-3)/1.3 var(--bb-schrift-display); margin: 0; }
.bb-zitat footer { margin-top: var(--bb-abstand-2); font-size: var(--bb-groesse-klein); color: var(--bb-text-2); }
.bb-zitat footer::before {
  content: ""; display: block; width: 48px; height: 8px; margin-bottom: 8px;
  border-bottom: 4px solid var(--bb-signal); border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

/* --- Etikett (Folgennummer, Figur) --- */
.bb-etikett {
  display: inline-block; padding: 0.25em 0.75em; border-radius: var(--bb-radius-knopf);
  background: var(--bb-papier); color: var(--bb-tinte); border: var(--bb-strich) solid var(--bb-linie);
  font: 600 var(--bb-groesse-klein)/1.2 var(--bb-schrift-display);
}

/* --- Navigation und Fuß --- */
.bb-kopf { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-abstand-3); padding: var(--bb-abstand-2) 0; }
.bb-kopf__marke { display: inline-flex; align-items: center; gap: 12px; color: var(--bb-tinte); text-decoration: none; font: 700 1.5rem/1 var(--bb-schrift-display); }
.bb-kopf__marke img { width: 48px; height: 48px; }
.bb-nav { display: flex; gap: var(--bb-abstand-3); list-style: none; margin: 0; padding: 0; }
.bb-nav a { color: var(--bb-tinte); text-decoration: none; font-weight: 700; padding: 10px 2px; display: inline-block; }
.bb-nav a[aria-current="page"], .bb-nav a:hover { text-decoration: underline; text-decoration-color: var(--bb-signal); text-decoration-thickness: 3px; text-underline-offset: 0.35em; }
.bb-fuss { background: var(--bb-sofa); color: var(--bb-auf-sofa); padding: var(--bb-abstand-4) var(--bb-abstand-3); }
.bb-fuss a, .bb-fuss a:hover { color: var(--bb-auf-sofa); text-decoration: underline; }

/* --- Druck (A4: keine Lächel-Flächen, nur Linien) --- */
@media print {
  .bb-laecheln { background: none; border: 1.5pt solid #000; break-inside: avoid; }
  .bb-laecheln--hervor { color: #000; }
  .bb-knopf { border: 1pt solid #000; background: none; color: #000; }
  .bb-fuss { background: none; color: #000; }
}
