/* ===== B3S-Status-Ampel page =====
 * Styles for the bilingual KRITIS B3S live matrix.
 * Uses theme CSS variables exclusively - no :root block, no dark-mode block.
 * Status colours (green / amber / red) use fixed hex values for the dots/badges
 * but tint backgrounds via rgba(); text uses the same fixed hex.
 */

/* ---------- Status colour tokens (local, not :root) ---------- */
.b3s-page {
  --b3s-green:      #4a7c3a;
  --b3s-green-bg:   rgba(74,124,58,.12);
  --b3s-amber:      #c08a1f;
  --b3s-amber-bg:   rgba(192,138,31,.12);
  --b3s-red:        #a83232;
  --b3s-red-bg:     rgba(168,50,50,.12);
}

/* ---------- Page wrapper ---------- */
.b3s-page {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: clamp(var(--sp-12), 6vw, var(--sp-24)) var(--sp-6);
}

/* ---------- Hero ---------- */
.b3s-hero {
  text-align: center;
  padding-bottom: clamp(var(--sp-8), 4vw, var(--sp-12));
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: clamp(var(--sp-8), 4vw, var(--sp-12));
}
.b3s-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin: 0 0 var(--sp-4) 0;
}
.b3s-hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--color-text);
  margin: 0 0 var(--sp-4) 0;
}
.b3s-hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 720px;
  margin: 0 auto var(--sp-6);
  line-height: 1.6;
}
.b3s-hero-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: .04em;
  justify-content: center;
}
.b3s-hero-meta strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ---------- Stats bar ---------- */
.b3s-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.b3s-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
}
.b3s-stat-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-text-faint);
  margin-bottom: var(--sp-1);
}
.b3s-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--color-text);
  line-height: 1;
}
.b3s-stat.is-green .b3s-stat-value { color: var(--b3s-green); }
.b3s-stat.is-amber .b3s-stat-value { color: var(--b3s-amber); }
.b3s-stat.is-red   .b3s-stat-value { color: var(--b3s-red); }

/* ---------- Toolbar ---------- */
.b3s-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.b3s-filter-group {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.b3s-filter-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  color: var(--color-text-muted);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: border-color .15s, background .15s, color .15s;
}
.b3s-filter-btn:hover {
  border-color: var(--color-border);
  color: var(--color-text);
}
.b3s-filter-btn.is-active {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}
.b3s-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.b3s-dot.is-green { background: var(--b3s-green); }
.b3s-dot.is-amber { background: var(--b3s-amber); }
.b3s-dot.is-red   { background: var(--b3s-red); }

.b3s-search-wrap {
  position: relative;
  flex: 1;
  max-width: 360px;
  min-width: 200px;
}
.b3s-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  opacity: .45;
  pointer-events: none;
  color: var(--color-text-muted);
}
.b3s-search-input {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-8);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--color-text);
  transition: border-color .15s;
}
.b3s-search-input::placeholder { color: var(--color-text-faint); }
.b3s-search-input:focus {
  outline: none;
  border-color: var(--color-border);
}

/* ---------- Table ---------- */
.b3s-table-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--sp-10);
}
.b3s-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.b3s-table thead {
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
}
.b3s-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.b3s-table th:hover { color: var(--color-text); }
.b3s-sort-ind {
  display: inline-block;
  margin-left: var(--sp-1);
  opacity: .3;
  font-size: 10px;
}
.b3s-table th.is-sorted .b3s-sort-ind { opacity: 1; }

.b3s-table tbody tr {
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
  transition: background .12s;
}
.b3s-table tbody tr:last-child { border-bottom: none; }
.b3s-table tbody tr:hover { background: var(--color-surface-2); }
.b3s-table tbody tr.is-open { background: var(--color-surface-2); }

.b3s-table td {
  padding: var(--sp-4);
  vertical-align: middle;
}
.b3s-sector-cell {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}
.b3s-sector-icon {
  display: inline-block;
  margin-right: var(--sp-2);
  font-size: 15px;
}
.b3s-title-cell {
  color: var(--color-text);
  max-width: 360px;
}
.b3s-title-cell small {
  display: block;
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  margin-top: 2px;
}
.b3s-version-cell,
.b3s-date-cell {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Status badge ---------- */
.b3s-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.b3s-badge.is-green { background: var(--b3s-green-bg); color: var(--b3s-green); }
.b3s-badge.is-amber { background: var(--b3s-amber-bg); color: var(--b3s-amber); }
.b3s-badge.is-red   { background: var(--b3s-red-bg);   color: var(--b3s-red); }
.b3s-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.b3s-badge.is-green .b3s-badge-dot { background: var(--b3s-green); }
.b3s-badge.is-amber .b3s-badge-dot { background: var(--b3s-amber); }
.b3s-badge.is-red   .b3s-badge-dot { background: var(--b3s-red); }

/* ---------- Chevron ---------- */
.b3s-chevron {
  width: 16px;
  height: 16px;
  transition: transform .2s;
  color: var(--color-text-faint);
  flex-shrink: 0;
}
.b3s-table tbody tr.is-open .b3s-chevron { transform: rotate(180deg); }

/* ---------- Detail / expand row ---------- */
.b3s-detail-row { display: none; }
.b3s-detail-row.is-visible { display: table-row; }
.b3s-detail-row > td {
  padding: 0;
  background: var(--color-surface-2);
}
.b3s-detail-inner {
  padding: var(--sp-6) var(--sp-8) var(--sp-7);
  border-top: 1px solid var(--color-divider);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-8);
}
.b3s-detail-eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--color-text-faint);
  margin-bottom: var(--sp-2);
}
.b3s-detail-highlight {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--color-text);
  margin: 0 0 var(--sp-5) 0;
  font-weight: 400;
}
.b3s-detail-text {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-muted);
  margin: 0 0 var(--sp-4) 0;
}

.b3s-detail-side {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--text-xs);
  align-self: start;
}
.b3s-detail-side dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-3);
}
.b3s-detail-side dt {
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-top: 2px;
}
.b3s-detail-side dd {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}
.b3s-detail-actions {
  margin-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.b3s-btn-open {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--color-accent);
  color: var(--color-bg);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: 600;
  transition: opacity .15s;
}
.b3s-btn-open:hover { opacity: .85; }
.b3s-btn-open.is-disabled {
  background: var(--color-divider);
  color: var(--color-text-faint);
  cursor: not-allowed;
  pointer-events: none;
}

.b3s-recommendation {
  margin-top: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-left: 3px solid var(--b3s-red);
  background: var(--b3s-red-bg);
  color: var(--color-text);
  font-size: var(--text-xs);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  line-height: 1.6;
}
.b3s-recommendation.is-amber {
  border-left-color: var(--b3s-amber);
  background: var(--b3s-amber-bg);
}
.b3s-recommendation strong { font-weight: 700; }

/* ---------- Empty state ---------- */
.b3s-empty {
  padding: var(--sp-12);
  text-align: center;
  color: var(--color-text-faint);
  font-style: italic;
  font-size: var(--text-sm);
}
.b3s-empty.is-hidden { display: none; }

/* ---------- Page footer meta ---------- */
.page-footer-meta {
  margin-top: clamp(var(--sp-8), 4vw, var(--sp-12));
  padding-top: var(--sp-5);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-align: center;
  line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .b3s-stats { grid-template-columns: repeat(2, 1fr); }
  .b3s-detail-inner { grid-template-columns: 1fr; }
  .b3s-table { font-size: var(--text-xs); }
  .b3s-table th,
  .b3s-table td { padding: var(--sp-2) var(--sp-3); }
  .b3s-hide-mobile { display: none; }
}
@media (max-width: 600px) {
  .b3s-stats { grid-template-columns: 1fr 1fr; }
  .b3s-toolbar { flex-direction: column; align-items: stretch; }
  .b3s-search-wrap { max-width: none; }
}

/* Print */
@media print {
  .b3s-table tbody tr { cursor: default; }
  .b3s-chevron { display: none; }
  .b3s-detail-row { display: none !important; }
  [data-lang="en"] [lang="de"],
  [data-lang="de"] [lang="en"] { display: none !important; }
}
