/* ============================================================
   UI-Bausteine (View\Ui) — gemeinsames Vokabular für Profil, Team, Magazin, Regioinfo, Objektseite.
   Doku: docs/PATTERNS.md › „UI-Bausteine". Seitenspezifische Dateien setzen hier NICHTS neu,
   höchstens Abstände im eigenen Kontext.
   ============================================================ */

/* --- Zurück-Leiste (Ui::zurueck) — EIN Baustein für alle Zurück-Links (Magazin-Artikel, Team-Profil, Stellenanzeige; Dirk 02.11.2026):
       Linie oben und unten über die Inhaltsbreite, ohne Fläche, Link mit Chevron leicht eingerückt. display:flex statt Zeilenbox —
       sonst bleibt unter dem Link die Unterlänge stehen (unten 3,5 px mehr als oben). Steht sie oben (Stellenanzeige), Abstand nach unten. --- */
.back-bar {
  display: flex;
  margin-block: var(--gap-block) 0;
  padding: var(--space-4) 0.25rem;
  border-block: 0.0625rem solid var(--color-border);
}
.back-bar:first-child { margin-block: 0 var(--gap-block); }
.back-bar a { display: inline-flex; align-items: center; gap: var(--space-1); color: inherit; text-decoration: none; }
.back-bar a:hover { color: var(--color-primary); }

/* --- „Mehr"-Aufforderung: Pill-Knopf mit Pfeil (Ui::more) --- */
.more {
  margin: var(--space-3) 0 0;
}
/* --- Pfeil-Knopf ohne Text (Ui::pfeil, 22.10.2026): Objektliste (Feature-Karte, →) und Objekt-Kategorien (↗, .schraeg).
   EIN Aussehen — ein Design stellt Form/Farbe nur hier um (z. B. eckig per border-radius), Seiten-CSS setzt nur die Position. --- */
.pfeil-knopf {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0.0625rem solid var(--color-primary);
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  transition: background var(--transition), border-color var(--transition);
}
.pfeil-knopf.schraeg svg { rotate: -45deg; }
.pfeil-knopf svg { transition: translate var(--transition); }
/* Hover am Knopf selbst oder am umschließenden Link (Kachel); Pfeil rückt in seine Richtung (reduced-motion global in 02-base.css) */
a.pfeil-knopf:hover,
a:hover > .pfeil-knopf {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-inverse);   /* sonst greift a:hover (02-base.css) mit der Hauptfarbe — Pfeil verschwände im Knopf */
}
a.pfeil-knopf:hover svg,
a:hover > .pfeil-knopf svg { translate: 0.125rem 0; }
a.pfeil-knopf.schraeg:hover svg,
a:hover > .pfeil-knopf.schraeg svg { translate: 0.125rem -0.125rem; }
/* .hell: auf Bildern (Kacheln Objekt-Kategorien) weißer Kreis mit dunklem Pfeil statt Hauptfarbe (Dirk 22.10.2026: „nicht in der dark color“) */
.pfeil-knopf.hell {
  border-color: var(--color-bg);
  background: var(--color-bg);
  color: var(--color-text);
}
a.pfeil-knopf.hell:hover,
a:hover > .pfeil-knopf.hell {
  border-color: var(--color-bg-alt);
  background: var(--color-bg-alt);
  color: var(--color-text);
}

/* --- Zeilen mit Icon (Ui::icon_lines) --- */
.icon-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.icon-lines li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  overflow-wrap: anywhere;
}
.icon-lines svg {
  flex: none;
  align-self: center;
  color: var(--color-icon);
}
/* Zentriert (Kasten, Karte, Kopf am Handy): Icon fließt mit dem umbrechenden Text statt verloren am Rand zu stehen */
.icon-lines.center li { display: block; text-align: center; }
.icon-lines.center svg { display: inline-block; vertical-align: -0.15em; margin-inline-end: var(--space-2); }
/* Nur am Handy zentriert (Kopf, der ab Tablet linksbündig wird) */
@media (max-width: 47.99rem) {
  .icon-lines.center-sm li { display: block; text-align: center; }
  .icon-lines.center-sm svg { display: inline-block; vertical-align: -0.15em; margin-inline-end: var(--space-2); }
}

/* --- Bewertung (Ui::rating): Sterne · Schnitt · Anzahl auf einer Grundlinie --- */
.rating {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  line-height: 1.2;
}
.rating .avg { font-weight: 600; }

/* --- Sterne (Ui::stars) — Vorbild Google-Bewertungen: grau, beim Hineinscrollen gestaffelt golden.
   `.in-view` setzt assets/js/global/review-stars.js; ohne JS färbt der <noscript>-Block in FrontendView. --- */
.stars { display: inline-flex; gap: 0.05em; line-height: 1; white-space: nowrap; }
.stars .star { display: inline-block; color: var(--color-border-dark); transition: color 400ms ease; }
.stars.in-view .star.full { color: var(--color-star); }
.stars.in-view .star.half {
  background: linear-gradient(90deg, var(--color-star) 50%, var(--color-border-dark) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stars.in-view .star:nth-child(2) { transition-delay: 100ms; }
.stars.in-view .star:nth-child(3) { transition-delay: 200ms; }
.stars.in-view .star:nth-child(4) { transition-delay: 300ms; }
.stars.in-view .star:nth-child(5) { transition-delay: 400ms; }
.rating a, .rating .count { color: var(--color-text-muted); }

/* --- Schlagworte (Ui::tags): Liste globaler .pill (02-base.css) --- */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }

/* --- Social-Links als runde Knöpfe (Ui::social) — Modifier zu .social (components/social.css) --- */
/* grid-area zurücksetzen: .social trägt global `grid-area: social` (Footer-Raster) — in einem anderen Grid (Profilkopf)
   erzeugte das eine zusätzliche benannte Spalte und zerlegte den Kopf in zwei Spalten (gemessen 29.09.2026). */
.social.round { grid-area: auto; gap: var(--space-2); padding: 0; margin: var(--space-3) 0 0; }
.social.round a {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 0.0625rem solid var(--color-border);   /* sichtbar auf weißen Karten UND grauen Flächen */
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), color var(--transition);
}
.social.round a:hover { background: var(--color-primary); color: var(--color-text-inverse); transform: none; }

/* --- Karte (.card) — Fläche + Hover wie die Referenz components/property-card.css (Hover-System, PATTERNS.md).
   Anatomie: [.cover > img] · .body > [.meta | .eyebrow] · h2/h3 · .teaser · … · .more
   `.center` = zentrierte Variante ohne .body (Team-Karte: rundes Foto, Name, Rolle …). --- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--color-bg);
  border: 0.0625rem solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-0.125rem); }
.card .cover { display: block; overflow: hidden; }
.card .cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition); }
.card:hover .cover img { transform: scale(1.03); }
.card .body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); flex: 1; }
.card h2, .card h3 { margin: 0; font-size: var(--text-lg); line-height: 1.3; }
.card h2 a, .card h3 a { color: inherit; text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }
.card .teaser { color: var(--color-text-muted); }
.card .teaser p { margin: 0; }
.card .teaser p + p { margin-block-start: var(--space-2); }
.card.center { align-items: center; gap: var(--space-2); padding: var(--space-6) var(--space-4) var(--space-4); text-align: center; }

/* In Karten: an den Fuß schieben (Karte = Flex-Spalte) */
.card .more,
.magazine-card .more,
.team-card .more {
  margin-block-start: auto;
  padding-block-start: var(--space-3);
}

/* --- Bürozeiten (Ui::hours / Ui::open_status, Wochenplan 29.09.2026) ---
   Status: grüner Punkt „Jetzt erreichbar", sonst grauer Punkt „Wieder erreichbar Mo 9:00". Pulsieren nur, wenn
   der Nutzer Bewegung zulässt. Plan: je Zeile Tage + Zeiten, Zeiten tabellarisch (gleich breite Ziffern). */
.open-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.open-status .dot {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--color-text-muted);
  opacity: 0.6;
}
.open-status.is-open .dot { background: var(--color-success); opacity: 1; }
.open-status.is-open strong { color: color-mix(in srgb, var(--color-success) 75%, #000); font-weight: 600; }   /* Grün als Schrift dunkler: 3,1 → 5:1 (PageSpeed, Dirk 19.11.2026); Punkt bleibt hell */
@media (prefers-reduced-motion: no-preference) {
  .open-status.is-open .dot { animation: open-pulse 2s ease-out infinite; }
}
@keyframes open-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-success) 50%, transparent); }
  100% { box-shadow: 0 0 0 0.5rem transparent; }
}
/* Wochenplan als Tabelle (Ui::hours_table) — Öffnungszeiten-Baustein, Team-Profil, Ansprechpartner im Exposé (Dirk 28.10.2026):
   ein Tag je Zeile, Trennlinien, Zeile unter dem Zeiger getönt, heutiger Tag kräftiger getönt. Kein Linksbalken
   (docs/wissen/feedback_kein_linker_akzentbalken.md). Linienfarbe gemischt: --color-border verschwindet auf getöntem Grund. */
.hours-table {
  --hours-line: color-mix(in srgb, var(--color-text) 18%, var(--color-bg));
  width: 100%;
  border-collapse: collapse;
  border-block-start: 0.0625rem solid var(--hours-line);
  font-variant-numeric: lining-nums tabular-nums;   /* Werte ersetzen sich — lining aus body sonst weg */
}
.hours-table tr {
  border-block-end: 0.0625rem solid var(--hours-line);
  transition: background var(--transition);
}
.hours-table th,
.hours-table td {
  padding: var(--space-2);   /* kompakter: 8 statt 12 px rundum (Dirk 06.11.2026: „weniger padding“, alle Öffnungszeiten) */
  text-align: start;
  vertical-align: top;
}
.hours-table th { width: 40%; font-weight: 600; }
/* Außen bündig mit den Linien; nur die hinterlegte Zeile (Hover, heute) rückt Tag und Zeit ein, damit der Text nicht an der Fläche
   klebt (Dirk 09.11.2026: „nur bei hover und aktiven tag die texte ein padding … ansonsten bündig“); Einzug 2 px überall (Dirk 19.11.2026). */
.hours-table th { padding-inline-start: 0; }
.hours-table td { padding-inline-end: 0; }
.hours-table :is(th, td) { transition: padding var(--transition); }
.hours-table tr:is(:hover, .is-today) th { padding-inline-start: 0.125rem; }
.hours-table tr:is(:hover, .is-today) td { padding-inline-end: 0.125rem; }
.hours-table td { color: var(--color-text-muted); text-align: end; }   /* Zeiten rechtsbündig (Dirk 02.11.2026: „Öffnungszeiten-Daten rechts ausrichten“) */
.hours-table .hours-slot { display: block; white-space: nowrap; }   /* ein Zeitfenster je Zeile, nie in sich umbrochen */
.hours-table tr:hover { background: color-mix(in srgb, var(--color-primary) 8%, transparent); }
.hours-table tr.is-today { background: color-mix(in srgb, var(--color-primary) 14%, transparent); }
.hours-table tr.is-today th { color: var(--color-primary-text); }   /* auf der getönten Zeile — DesignStyle rechnet die Variante gegen getönten Grund (Dirk 19.11.2026) */
.hours-table tr.is-today td { color: var(--color-text); font-weight: 600; }
.hours .open-status + .hours-table { margin-top: var(--space-2); }
.hours-note { margin: var(--space-1) 0 0; }
