/* ==========================================================================
   oesterreich.com – Helles, amtliches Design-System (Vanilla CSS)
   ========================================================================== */

:root {
  --bg-page: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-subtle: #eef2f6;
  --bg-tint: #f9fafb;

  --ink-primary: #142030;
  --ink-secondary: #3e4e63;
  --ink-muted: #5c6c80;

  --brand-red: #c8102e;
  --brand-red-dark: #9c0c23;
  --brand-red-soft: #fdf1f3;

  --brand-navy: #1b365d;
  --brand-navy-mid: #2f5487;
  --brand-navy-soft: #edf2f8;

  --eu-blue: #003399;
  --status-pos: #156d3e;
  --status-neg: #b42318;
  --status-info-bg: #eef4fb;
  --status-info-border: #bfd4ed;

  --border-light: #dce2ea;
  --border-strong: #b8c4d4;

  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-card: 0 1px 2px rgba(20, 32, 48, 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --container-max: 1280px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background: var(--bg-page);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-red);
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==================== Amtlicher Kopfbereich ==================== */
.gov-stripe {
  height: 5px;
  background: linear-gradient(90deg, var(--brand-red) 0%, var(--brand-red) 33.3%, #ffffff 33.3%, #ffffff 66.6%, var(--brand-red) 66.6%, var(--brand-red) 100%);
  border-bottom: 1px solid var(--border-light);
}

.site-header {
  background: var(--bg-surface);
  border-bottom: 2px solid var(--brand-navy);
}

.header-inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
}

@media (max-width: 980px) {
  .header-inner {
    flex-wrap: wrap;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-mark {
  width: 42px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.brand-mark span {
  flex: 1;
  display: block;
}

.brand-mark .stripe-red { background: var(--brand-red); }
.brand-mark .stripe-white { background: #ffffff; }

.brand-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
  line-height: 1.15;
}

.brand-title .domain-tld {
  color: var(--brand-red);
}

.brand-subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  text-decoration: none;
  padding: 7px 11px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover {
  background: var(--bg-subtle);
  color: var(--brand-navy);
}

.main-nav a.is-active {
  background: var(--brand-navy);
  color: #ffffff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

.btn-primary {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--brand-navy-mid);
  border-color: var(--brand-navy-mid);
  color: #ffffff;
}

.btn-accent {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
  color: #ffffff;
}

.btn-subtle {
  background: transparent;
  border-color: var(--border-light);
  color: var(--ink-secondary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* ==================== Druckkopf (nur im Druckmodus sichtbar) ==================== */
.print-banner {
  display: none;
}

.print-preview-bar {
  display: none;
  background: var(--brand-navy);
  color: #ffffff;
  padding: 10px 0;
  font-size: 0.88rem;
}

.print-preview-bar .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ==================== Seiten-Intro & Hinweiszeile ==================== */
.page-hero {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 24px 0 20px;
}

.page-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--brand-red);
  margin: 0 0 6px;
}

.page-title {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-lead {
  margin: 8px 0 0;
  max-width: 78ch;
  color: var(--ink-secondary);
  font-size: 0.98rem;
}

.meta-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ==================== Globale Filterleiste ==================== */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 2px 6px rgba(20, 32, 48, 0.05);
  padding: 14px 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.filter-field label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.filter-field select,
.filter-field input[type="search"] {
  width: 100%;
  height: 38px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.filter-field select:hover,
.filter-field input[type="search"]:hover {
  border-color: var(--brand-navy);
}

.filter-active-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  font-size: 0.84rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--brand-red-soft);
  border: 1px solid #f0b8c1;
  color: var(--brand-red-dark);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
}

.filter-chip button {
  background: none;
  border: none;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}

/* ==================== Hauptinhalt & Sektionen ==================== */
.main-content {
  padding: 24px 0 48px;
}

.section-block {
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-light);
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.section-sub {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

/* ==================== Karten / Panels ==================== */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.panel-desc {
  margin: 3px 0 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.panel-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-btn {
  padding: 5px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.seg-btn:hover {
  border-color: var(--brand-navy);
  color: var(--brand-navy);
}

.seg-btn.is-active {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #ffffff;
}

.source-footnote {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--ink-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.source-footnote a {
  color: var(--brand-navy);
  font-weight: 600;
}

.scope-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  color: var(--brand-navy);
}

.scope-badge.is-filtered {
  background: var(--brand-red-soft);
  border-color: #f0b8c1;
  color: var(--brand-red-dark);
}

/* ==================== KPI Grid ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--brand-navy);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

.kpi-card.is-accent {
  border-top-color: var(--brand-red);
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
}

.kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink-primary);
  font-variant-numeric: tabular-nums;
}

.kpi-detail {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.35;
}

.kpi-source {
  font-size: 0.74rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--bg-subtle);
  padding-top: 7px;
}

.kpi-source a {
  font-weight: 600;
}

/* ==================== Dashboard 2-Spalten-Raster ==================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* ==================== Österreich-Karte ==================== */
.map-svg-wrapper {
  position: relative;
  width: 100%;
  background: var(--bg-tint);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.austria-map-svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-region {
  cursor: pointer;
}

.map-region path {
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.map-region:hover path {
  filter: brightness(0.92);
  stroke: #142030;
  stroke-width: 2.2;
}

.map-label {
  font-size: 13px;
  font-weight: 700;
  fill: var(--ink-primary);
  pointer-events: none;
}

.map-sublabel {
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--ink-secondary);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.map-label.is-light-text,
.map-sublabel.is-light-text {
  fill: #ffffff;
}

.map-tooltip {
  position: absolute;
  z-index: 10;
  background: #ffffff;
  border: 1px solid var(--brand-navy);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.8rem;
  color: var(--ink-primary);
  box-shadow: 0 4px 12px rgba(20, 32, 48, 0.14);
  pointer-events: none;
  max-width: 220px;
}

.map-tooltip small {
  color: var(--ink-muted);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

.map-legend-swatches {
  display: inline-flex;
  height: 12px;
  width: 130px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  overflow: hidden;
}

.map-legend-swatches span {
  flex: 1;
}

.map-legend-selected {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.map-legend-selected i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* ==================== Regionales Profil neben der Karte ==================== */
.region-profile-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.region-profile-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
}

.metric-table th,
.metric-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

.metric-table th {
  font-weight: 700;
  color: var(--ink-secondary);
  background: var(--bg-tint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-table td.num,
.metric-table th.num {
  text-align: right;
  white-space: nowrap;
}

.metric-table.is-compact th,
.metric-table.is-compact td {
  padding: 7px 7px;
  font-size: 0.82rem;
}

.metric-table.is-compact th {
  white-space: normal;
  line-height: 1.25;
}

.metric-table tbody tr:hover {
  background: var(--brand-navy-soft);
}

.metric-table tbody tr.is-highlighted {
  background: var(--brand-red-soft);
  font-weight: 600;
}

.delta-pos { color: var(--status-pos); font-weight: 600; }
.delta-neg { color: var(--status-neg); font-weight: 600; }

/* ==================== SVG Charts ==================== */
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-bar-group {
  cursor: pointer;
}

.chart-bar-group:hover rect.bar-fill {
  filter: brightness(0.88);
}

.chart-legend-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.chart-legend-inline span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
}

/* ==================== Institutionen-Highlights (BMWET & IV) ==================== */
.highlight-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.highlight-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}

.highlight-list li:last-child {
  border-bottom: none;
}

.highlight-label {
  font-size: 0.88rem;
  color: var(--ink-primary);
  font-weight: 500;
}

.highlight-detail {
  display: block;
  font-size: 0.77rem;
  color: var(--ink-muted);
}

.highlight-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-navy);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ==================== Leitbetriebe Karten ==================== */
.company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.company-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--brand-navy);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-card);
}

.company-card.is-certified {
  border-left-color: var(--brand-red);
}

.company-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-primary);
}

.company-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--border-light);
}

.tag-red {
  background: var(--brand-red-soft);
  border-color: #f0b8c1;
  color: var(--brand-red-dark);
}

.tag-navy {
  background: var(--brand-navy-soft);
  border-color: #c7d6e9;
  color: var(--brand-navy);
}

.company-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.company-foot {
  padding-top: 8px;
  border-top: 1px solid var(--bg-subtle);
  font-size: 0.78rem;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.empty-state {
  background: var(--bg-tint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--ink-secondary);
}

/* ==================== Bundesland-Auswahl-Leiste ==================== */
.state-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.state-pill {
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.state-pill:hover {
  border-color: var(--brand-navy);
  background: var(--brand-navy-soft);
}

.state-pill.is-active {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #ffffff;
}

/* ==================== Tabellen-Wrapper (mobil scrollbar) ==================== */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}

/* ==================== Footer ==================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 2px solid var(--brand-navy);
  padding: 24px 0 32px;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 24px;
}

.footer-heading {
  margin: 0 0 8px;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-navy);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-bottom {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
}

/* ==================== Responsive ==================== */
@media (max-width: 1080px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-map-layout,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .company-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    padding: 0 14px;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid,
  .company-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 1.45rem;
  }
  .filter-bar {
    position: static;
  }
}
