/* ==========================================================================
   HSD-Theme für LimeSurvey (Kind-Theme von fruity)
   Corporate Design Hochschule Düsseldorf
   Verbindliche Quelle: HSD_CD_Manual_Web.pdf (Kap. 4.1/4.2 Schrift & Typografie,
   4.6 Farbe, 4.7 Illustration) + HSD_Excel_Designprofil.md
   Basisfarben liefert css/variations/sea_green.css (HSD-Fassung, per Vererbung
   ersetzt). Diese Datei ergänzt Typografie, Komponenten und Barrierefreiheit.
   Quelle/Doku: Projekte/limesurvey-theme-hsd/ (lokal, mit Original-Backup)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. HSD-Farbpalette (CD-Manual 4.6; Raster nur für Schwarz und Rot, 4.7)
   -------------------------------------------------------------------------- */
:root {
  --primary-color: #E60028;      /* Kompatibilität zum alten Theme-Stand */
  --hsd-rot: #E60028;            /* Pantone 185 – Hausfarbe, nur Akzent/Auszeichnung */
  --hsd-rot-hover: #BE0021;      /* Interaktionsstufe (Hover/Checked), keine CD-Fläche */
  --hsd-rot-80: #EB3353;
  --hsd-rot-60: #F0667E;
  --hsd-rot-40: #F599A9;
  --hsd-rot-20: #FACCD4;
  --hsd-schwarz: #000000;
  --hsd-schwarz-80: #333333;
  --hsd-schwarz-60: #666666;
  --hsd-schwarz-40: #999999;
  --hsd-schwarz-20: #CCCCCC;
  --hsd-petrol: #004C5F;         /* ruhige Sekundärfarbe (Office-Theme dk2) */
  --hsd-gelb: #FFEB00;           /* Schmuckfarbe Gestaltung – nie als Textfarbe */
  --hsd-grau-bg: #F5F5F5;
  --hsd-fokus: var(--hsd-rot);
}

/* --------------------------------------------------------------------------
   2. Typografie (CD-Manual 4.2: Hausschrift Arial, Satz linksbündig,
      Überschriften/Auszeichnungen Arial Bold, keine Farb-Auszeichnung im Text)
   -------------------------------------------------------------------------- */
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;               /* Lesegröße Web, responsiv ausreichend groß */
  color: #1E1E1E;
  text-align: left;
}

h1, h2, h3, h4, h5, h6,
.question-title, .group-title, .survey-name {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;              /* „Für die meisten Anwendungen Arial Bold." */
  color: #000000;
  text-align: left;
}

/* Displayschrift HSD Sans nur für die Wortmarke (kompress, CD-Manual 4.2) */
@font-face {
  font-family: 'HSD-Sans-Regular';
  src: url("/upload/themes/survey/HSD/files/HSD-Sans-Regular.ttf") format('truetype');
  font-display: swap;
}

/* --------------------------------------------------------------------------
   3. Marke / Navbar (Dachmarke rot; Kopfbereich hell und ruhig,
      Rot nur als Akzent – CD: Rot nicht als große Kopffläche)
   -------------------------------------------------------------------------- */
.hsd-regular {
  font-size: 68px;
  text-transform: uppercase;
  line-height: 68px;             /* kompress gesetzt (CD-Manual 4.2 HSD Sans) */
  margin-left: -5px;
  font-weight: lighter;
  margin-bottom: .5px;
}

.hsd-brand-wordmark,
#survey-nav .navbar-brand .hsd-regular,
#survey-nav .navbar-brand .hsd-brand-wordmark,
#survey-nav .navbar-brand .hsd-regular span {
  font-family: "HSD-Sans-Regular", Arial, sans-serif !important;
  color: var(--hsd-rot) !important;
}

#survey-nav {
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--hsd-schwarz-20) !important;
}

#survey-nav .nav-link,
#survey-nav .nav-link a {
  color: #000000;
}

.hsd-surveylist-logo {
  width: auto;
  max-height: 64px;
}

@media (max-width: 600px) {
  .hsd-regular {
    font-size: 32px;
    margin-bottom: 0;
    margin-left: 0;
    line-height: 1;
  }
}

/* --------------------------------------------------------------------------
   4. Links (Rot als Auszeichnung; Hover unterstrichen – CD 4.2 „Auszeichnungen:
      … unterstrichen"; Fokus deutlich sichtbar, WCAG 2.2 AA 2.4.7/2.4.11)
   -------------------------------------------------------------------------- */
.fruity a {
  color: var(--hsd-rot);
  text-decoration: none;
  background-color: transparent;
}

.fruity a:hover {
  color: var(--hsd-rot-hover);
  text-decoration: underline;
}

/* Einheitlicher, sichtbarer Fokusindikator für alle Bedienelemente */
.fruity a:focus-visible,
.fruity button:focus-visible,
.fruity .btn:focus-visible,
.fruity input:focus-visible,
.fruity select:focus-visible,
.fruity textarea:focus-visible,
.fruity [tabindex]:focus-visible {
  outline: 2px solid var(--hsd-fokus) !important;
  outline-offset: 2px;
  box-shadow: none;
}

/* --------------------------------------------------------------------------
   5. Buttons
      Primäraktion: Rote Fläche mit weißer Schrift ist CD-konform
      (CD 4.6: rote Fläche „muss … mit weißer (nicht mit schwarzer) Schrift
      kombiniert werden"). Kontrast Weiß/HSD-Rot = 4,8:1 (AA).
   -------------------------------------------------------------------------- */
.fruity .btn-primary,
.fruity .btn-info,
.fruity .btn-default {
  color: #FFFFFF !important;
  background-color: var(--hsd-rot);
  border: 1px solid var(--hsd-rot);
}

.fruity .btn-primary:hover, .fruity .btn-primary:focus, .fruity .btn-primary:active,
.fruity .btn-info:hover, .fruity .btn-info:focus, .fruity .btn-info:active,
.fruity .btn-default:hover, .fruity .btn-default:focus, .fruity .btn-default:active {
  color: #FFFFFF !important;
  background-color: var(--hsd-rot-hover);
  border-color: var(--hsd-rot-hover);
}

.fruity .btn-check:checked + .btn-primary {
  color: #FFFFFF !important;
  background-color: var(--hsd-rot-hover);
  border-color: var(--hsd-rot-hover);
}

/* Sekundäraktionen: ruhig, Schwarz-Raster (CD: Schwarz/Grau als Grundfarben) */
.fruity .btn-outline-secondary,
.fruity .btn-secondary {
  background-color: #FFFFFF;
  color: #1E1E1E;
  border: 1px solid var(--hsd-schwarz-80);
}

.fruity .btn-outline-secondary:hover, .fruity .btn-outline-secondary:focus,
.fruity .btn-secondary:hover, .fruity .btn-secondary:focus {
  background-color: var(--hsd-schwarz-80);
  color: #FFFFFF;
  border-color: var(--hsd-schwarz-80);
}

/* Warnaktionen: Gelb nie als Textfarbe (CD 4.6) – schwarze Schrift auf Gelb */
.fruity .btn-warning {
  background-color: var(--hsd-gelb);
  color: #000000 !important;
  border: 1px solid #000000;
}

.fruity .btn-warning:hover, .fruity .btn-warning:focus {
  background-color: #000000;
  color: #FFFFFF !important;
}

/* --------------------------------------------------------------------------
   6. Formulare & Frageelemente
   -------------------------------------------------------------------------- */
.fruity .form-control,
.fruity .form-select {
  border: 1px solid var(--hsd-schwarz-60); /* 3:1-Kontrast für UI-Grenzen (AA 1.4.11) */
  color: #1E1E1E;
}

.fruity .form-control:focus,
.fruity .form-select:focus {
  border-color: var(--hsd-rot);
  box-shadow: 0 0 0 0.2rem rgba(230, 0, 40, 0.25);
}

/* Radio / Checkbox: Rot als Auszeichnung des gewählten Zustands */
.fruity .radio-item label::before {
  border-color: var(--hsd-schwarz-60);
}

.fruity .radio-item input[type="radio"]:checked + label::before {
  border-color: var(--hsd-rot);
}

.fruity .radio-item input[type="radio"]:checked + label::after {
  background-color: var(--hsd-rot);
}

.checkbox-item input[type=checkbox]:checked + label::before {
  border-color: var(--hsd-rot);
}

.checkbox-item input[type=checkbox]:checked + label:after,
.checkbox-item input[type=radio]:checked + label:after {
  background-color: var(--hsd-rot);
  color: #FFFFFF;
}

/* Klickfläche für Radio-Buttons vergrößern (Bedienbarkeit, WCAG 2.5.8) */
.radio-item label,
.array-flexible-row .answer-item label {
  display: inline-block;
  padding: 6px 10px;
  cursor: pointer;
}

/* Matrixfragen: ruhige Grau-Struktur, gewählte Zeile dezent rot ausgezeichnet */
.fruity table.subquestion-list thead,
.fruity table.subquestion-list thead th {
  background-color: var(--hsd-schwarz-80);
  color: #FFFFFF;
  font-weight: 700;
}

.fruity table.subquestion-list tbody tr:nth-of-type(even) {
  background-color: var(--hsd-grau-bg);
}

.fruity .ls-answers .answer-item.checked,
.fruity table.subquestion-list tr.ls-answers-selected {
  background-color: var(--hsd-rot-20);
}

/* Slider und Range-Elemente */
.fruity .slider-handle {
  background-color: var(--hsd-rot);
}

.fruity .slider-selection {
  background-color: var(--hsd-rot-40);
}

/* --------------------------------------------------------------------------
   7. Fortschrittsbalken (Rot als Akzent auf neutraler Bahn)
   -------------------------------------------------------------------------- */
.fruity .progress {
  background-color: #E6E6E6;
}

.fruity .progress-bar {
  color: #FFFFFF;
  background-color: var(--hsd-rot);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* "Frage X von Y"-Text: Fruity-Grundfarbe erreichte nur 3,69:1 auf Weiß
   (axe/HTML_CodeSniffer-Scan 06.07.2026). AA verlangt 4,5:1 für Fließtext. */
.question-count-text {
  color: var(--hsd-schwarz-80);
}

/* --------------------------------------------------------------------------
   8. Meldungen (Alerts)
      CD kennt kein Ampel-Schema → konsistente Ergänzung im CD-Rahmen:
      Fehler = HSD-Rot, Erfolg = Petrol (ruhige Sekundärfarbe),
      Warnung = Gelb-Akzent mit schwarzer Schrift, Info = Schwarz-Raster.
   -------------------------------------------------------------------------- */
.fruity .alert {
  border-radius: 0;
  border: 1px solid var(--hsd-schwarz-20);
  border-left-width: 4px;
  background-color: #FFFFFF;
  color: #1E1E1E;
}

.fruity .alert-danger, .fruity .alert-error {
  border-left-color: var(--hsd-rot);
  background-color: var(--hsd-rot-20);
  color: #000000;
}

.fruity .alert-success {
  border-left-color: var(--hsd-petrol);
  color: #000000;
}

.fruity .alert-warning {
  border-left-color: var(--hsd-gelb);
  color: #000000;
}

.fruity .alert-info {
  border-left-color: var(--hsd-schwarz-80);
  color: #000000;
}

/* Pflichtfeld-/Fehlerhinweise in Rot – Kontrast 4,8:1 auf Weiß (AA) */
.fruity .text-danger,
.fruity .asterisk,
.fruity .ls-error-mandatory {
  color: var(--hsd-rot) !important;
}

/* Fruity-Farbklassen neutralisieren (kein Buntschema im Fließtext) */
.fruity .text-info, .fruity .text-primary, .fruity .text-success {
  color: var(--hsd-schwarz-80) !important;
}

/* --------------------------------------------------------------------------
   9. Tabellen (Kopfzeilen schwarz/dunkelgrau mit weißer Bold-Schrift –
      Designprofil „Kopf-/Titelzeilen"; gilt auch für Statistik-Tabellen)
   -------------------------------------------------------------------------- */
.fruity .table thead th,
.fruity table.statisticstable thead th,
.fruity .statisticsbrowsecolumn th {
  background-color: #000000;
  color: #FFFFFF;
  font-weight: 700;
  text-align: left;
  border-color: var(--hsd-schwarz-80);
}

.fruity .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: var(--hsd-grau-bg);
  color: #1E1E1E;
}

.fruity .table tbody td, .fruity .table tbody th {
  border-color: var(--hsd-schwarz-20);
}

/* --------------------------------------------------------------------------
   10. Statistikseiten (öffentliche Statistik)
       Diagrammfarben setzt scripts/custom.js (monochrome CD-Palette).
       Hier: Rahmen, Überschriften, Legenden.
   -------------------------------------------------------------------------- */
#statsContainer .card,
.statistics-question .card {
  border: 1px solid var(--hsd-schwarz-20);
  border-radius: 0;
}

#statsContainer .card-header,
.statistics-question .card-header {
  background-color: var(--hsd-schwarz-80);
  color: #FFFFFF;
  font-weight: 700;
}

#statsContainer .list-group-item {
  border-color: var(--hsd-schwarz-20);
}

/* --------------------------------------------------------------------------
   11. Infoboxen, Panels, Listen, Pagination
   -------------------------------------------------------------------------- */
.info-box {
  border: 1px solid var(--hsd-schwarz-20);
  border-left: 4px solid var(--hsd-rot);
  padding: 20px;
  margin: 20px 0;
}

.info-box-icon {
  color: var(--hsd-schwarz-80);
  margin-right: 10px;
}

.info-box-content {
  display: flex;
  align-items: center;
}

.fruity .card, .fruity .panel {
  border-radius: 0;                /* klare, sachliche Flächen (CD-Duktus) */
}

.fruity .pagination > li > a,
.fruity .page-link {
  color: var(--hsd-rot);
  border-color: var(--hsd-schwarz-20);
}

.fruity .page-item.active .page-link {
  background-color: var(--hsd-rot);
  border-color: var(--hsd-rot);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   12. Layout, Umfrageliste, Footer (bestehende HSD-Anpassungen)
   -------------------------------------------------------------------------- */
.container {
  max-width: 90%;
}

#surveys-list-container {
  min-height: 75vh !important;
}

.icon-space {
  margin-right: 10px;
}

#surveyListFooter {
  text-align: left;
}

#surveyListFooter ul {
  margin: 0;
  padding-left: 1.1rem;
}

.fruity .footer {
  border-top: 2px solid var(--hsd-schwarz-20);
}

.footer-heading {
  font-size: calc(0.9271875rem + 0.32625vw);
  font-weight: 700;
  margin-bottom: 0;
}

/* Footer-Wortmarke: gleiche Behandlung wie Navbar (Abschnitt 3), nur kleiner
   dimensioniert für den Footer-Kontext. Rot bleibt Textakzent, keine Fläche. */
.footer-wordmark {
  font-family: "HSD-Sans-Regular", Arial, sans-serif !important;
  color: var(--hsd-rot) !important;
  font-size: 28px;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: .5rem;
}

/* Zusätzliche Zeile "Weitere ZWEK-Angebote" unterhalb der Hauptspalten */
.footer-services-row {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hsd-schwarz-20);
}

.footer-services-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding-left: 0;
}

@media (max-width: 767px) {
  .footer section {
    flex: 0 0 100%;
    max-width: 100%;
    margin-bottom: 1rem;
  }
}

/* --------------------------------------------------------------------------
   13. Druckansicht: Diagramm-/Flächenfarben drucksicher halten
   -------------------------------------------------------------------------- */
@media print {
  .fruity .table thead th {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    border-bottom: 2px solid #000000;
  }
  .fruity a { color: #000000; text-decoration: underline; }
}
