/* =========================================================
   GLOBALE SEITENBASIS
   ========================================================= */

/*
  Grundlayout der Seite:
  - keine Browser-Standardabstände
  - leicht grauer Seitenhintergrund, damit sich die weiße Tabelle absetzt
  - neutrale, gut lesbare Sans-Serif-Schrift
*/
body {
  margin: 0;
  padding: 24px;
  background: #f3f3f3;
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
}

/*
  Wird per JavaScript gesetzt, sobald ein Popup offen ist.
  Verhindert Scrollen des Hintergrunds bei geöffnetem Dialog.
*/
body.popup-open {
  overflow: hidden;
}

/*
  Äußerer Seitencontainer:
  - begrenzt die Maximalbreite
  - zentriert die ganze Tabelle
*/
.page {
  max-width: 1400px;
  margin: 0 auto;
}


/* =========================================================
   TABELLE: GRUNDSTRUKTUR
   ========================================================= */

/*
  Haupttabelle:
  - feste Breitenlogik über table-layout: fixed
  - weißer Hintergrund als "Dokumentfläche"
  - etwas kräftiger Außenrahmen
*/
.fa-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
  border: 1.5px solid #666;
  font-family: Arial, Helvetica, sans-serif;
}

/*
  Spaltenbreiten:
  - 1. Spalte: Kompetenzen
  - 2. Spalte: Themen/Inhalte
  - 3. Spalte: Hinweise
*/
.fa-table colgroup col:nth-child(1) {
  width: 34%;
}

.fa-table colgroup col:nth-child(2) {
  width: 31%;
}

.fa-table colgroup col:nth-child(3) {
  width: 35%;
}

/*
  Grundstil für Tabellenzellen und Kopfzellen
*/
.fa-table th,
.fa-table td {
  border: 1px solid #7a7a7a;
  vertical-align: top;
  text-align: left;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.45;
}

/*
  Tabellenkopf
*/
.fa-table th {
  background: #d9d9d9;
  font-size: 15px;
  font-weight: 700;
  vertical-align: bottom;
  border-bottom: 2px solid #6f6f6f;
}

.head-main {
  font-weight: 700;
  margin-bottom: 4px;
}

.head-sub {
  font-style: italic;
  font-weight: 400;
}


/* =========================================================
   TYPOGRAFIE INNERHALB DER TABELLE
   ========================================================= */

.fa-table p {
  margin: 0 0 10px 0;
}

.fa-table p:last-child {
  margin-bottom: 0;
}

.group-label {
  margin: 0 0 4px 0;
}

.fa-table ul {
  margin: 0 0 12px 0;
  padding-left: 18px;
}

.fa-table ul:last-child {
  margin-bottom: 0;
}

.fa-table li {
  margin: 0 0 4px 0;
}


/* =========================================================
   FARBLOGIK AUS DEM ORIGINALDOKUMENT
   ========================================================= */

.mark-gray {
  background: #d9d9d9;
  padding: 0 2px;
}

.mark-gray-bold {
  background: #d9d9d9;
  padding: 0 2px;
  font-weight: 700;
}


/* =========================================================
   INTERAKTIVE HERVORHEBUNGEN IN DER TABELLE
   ========================================================= */

.highlighted {
  cursor: pointer;
  display: inline;
  padding: 0 2px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.highlight-yellow {
  background: #fff29a;
}

.highlight-green {
  background: #bfe7b8;
}

.highlight-yellow:hover {
  box-shadow: 0 0 0 2px rgba(181, 155, 37, 0.18);
}

.highlight-green:hover {
  box-shadow: 0 0 0 2px rgba(95, 140, 84, 0.18);
}


/* =========================================================
   POPUP-OVERLAY
   ========================================================= */

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 40, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
}


/* =========================================================
   POPUP-CONTAINER UND EINBLENDUNG
   ========================================================= */

.smallPopupContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(680px, calc(100vw - 32px));
  max-height: min(80vh, 700px);
  z-index: 1000;
  opacity: 0;
  transform: translate(-50%, -48%) scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.smallPopupContainer:not(.hidden) {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.smallPopupContent {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  padding: 22px 24px 20px;
  overflow: auto;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

.popup-yellow .smallPopupContent {
  background: rgba(255, 248, 180, 0.9);
  border-color: rgba(180, 150, 40, 0.25);
}

.popup-green .smallPopupContent {
  background: rgba(220, 245, 220, 0.9);
  border-color: rgba(80, 130, 80, 0.25);
}

.popup-yellow .smallPopupContent h4 {
  color: #8a6d00;
}

.popup-green .smallPopupContent h4 {
  color: #2f6b2f;
}

.smallPopupContent h4 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
}

.smallPopupContent p {
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.smallPopupContent a {
  color: #0a4f95;
}


/* =========================================================
   CLOSE-BUTTON
   ========================================================= */

.closeButton {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.closeButton:hover {
  background: rgba(0, 0, 0, 0.12);
  transform: scale(1.05);
}


/* =========================================================
   SICHTBARKEITSLOGIK
   ========================================================= */

.hidden {
  display: none;
}


/* =========================================================
   TABELLENLOGIK: STANDARD-LINIEN
   ========================================================= */

.fa-table td {
  border-top: 1px solid #7a7a7a;
  border-bottom: 1px solid #7a7a7a;
}


/* =========================================================
   SUBROW-LOGIK FÜR KOMPLEXE BLÖCKE
   ========================================================= */

.subrow-top td {
  border-bottom: 0;
  padding-bottom: 8px;
}

.subrow-middle td {
  border-top: 0;
  border-bottom: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

.subrow-bottom td {
  border-top: 0;
  padding-top: 8px;
}


/* =========================================================
   RESPONSIVE ANPASSUNGEN
   ========================================================= */

@media (max-width: 900px) {
  body {
    padding: 12px;
  }

  .fa-table th,
  .fa-table td {
    font-size: 14px;
    padding: 8px 10px;
  }

  .smallPopupContainer {
    width: calc(100vw - 20px);
    max-height: 85vh;
  }

  .smallPopupContent {
    padding: 18px 18px 16px;
    border-radius: 12px;
  }

  .smallPopupContent h4 {
    font-size: 17px;
  }
}


/* =========================================================
   DYNAMISCH ERWEITERTER POPUP-TITEL
   ========================================================= */

.popup-title span {
  font-weight: 400;
  opacity: 0.8;
}

.popup-yellow .popup-context {
  color: #8a6d00;
}

.popup-green .popup-context {
  color: #2f6b2f;
}

.popup-context {
  display: block;
  margin-top: 4px;
  font-size: 0.95em;
}