body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #163354;
  margin: 0;
  padding: 0;
}

.font-serif-title {
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}

.article-body p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

/* Farbpalette basierend auf dem ReadSmart-Logo */
.color-brand-navy { color: #163354; }
.bg-brand-navy { background-color: #163354; }

.color-brand-orange { color: #ea580c; }
.bg-brand-orange { background-color: #ea580c; }
.bg-brand-orange:hover { background-color: #c2410c; }

.color-brand-cyan { color: #0284c7; }
.bg-brand-cyan { background-color: #0284c7; }

/* Buttons & Akzente */
.btn-logo-orange, .btn-orange {
  background-color: #ea580c !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.25);
}
.btn-logo-orange:hover, .btn-orange:hover {
  background-color: #c2410c !important;
}

.btn-logo-navy, .btn-navy {
  background-color: #163354 !important;
  color: #ffffff !important;
}
.btn-logo-navy:hover, .btn-navy:hover {
  background-color: #0f233a !important;
}

.btn-navy-outline {
  border: 2px solid #163354;
  color: #163354;
  background-color: transparent;
}
.btn-navy-outline:hover {
  background-color: #163354;
  color: #ffffff;
}

/* 4 abgestufte Block-Hintergründe */
.section-block-hero {
  background-color: #ffffff !important;
}

.section-block-partners {
  background-color: #163354 !important;
  color: #ffffff !important;
}

.section-block-didaktik {
  background-color: #edf2f7 !important;
}

.section-block-steps {
  background-color: #e2e8f0 !important;
}

/* Header Softblue */
header.header-solid-softblue {
  background-color: #f0f7ff !important;
  border-bottom: 1px solid #bfdbfe !important;
  opacity: 1 !important;
}

/* Plastische Karten & dynamische Schatten */
.card-shadow {
  background-color: #ffffff !important;
  box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  border: 1px solid #cbd5e1;
}

.partner-card {
  background-color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease-in-out;
}
.partner-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  border-color: #ea580c;
}

/* Partner-Logo: Im Ruhezustand grau, bei Hover farbig */
.partner-card img {
  filter: grayscale(100%);
  opacity: 0.7;
  transition: filter 0.2s ease, opacity 0.2s ease;
}
.partner-card:hover img {
  filter: grayscale(0%) !important;
  opacity: 1 !important;
}

/* Primär- und Erfolgsbuttons für Portal & Quiz */
.btn-submit-primary {
  background-color: #2563eb !important;
  color: #ffffff !important;
}
.btn-submit-primary:hover {
  background-color: #1d4ed8 !important;
}

.btn-submit-success {
  background-color: #16a34a !important;
  color: #ffffff !important;
}
.btn-submit-success:hover {
  background-color: #15803d !important;
}
.btn-submit-success:disabled {
  background-color: #9ca3af !important;
  cursor: not-allowed;
}

/* Quiz Feedback */
.quiz-opt-correct {
  background-color: #ecfdf5 !important;
  border: 2px solid #10b981 !important;
  color: #064e3b !important;
}
.quiz-opt-wrong {
  background-color: #fff1f2 !important;
  border: 2px solid #f43f5e !important;
  color: #881337 !important;
}
.quiz-opt-dimmed {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  opacity: 0.45 !important;
}

.feedback-box-success {
  background-color: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #065f46 !important;
}
.feedback-box-error {
  background-color: #fff1f2 !important;
  border: 1px solid #fecdd3 !important;
  color: #9f1239 !important;
}

/* Navigation & Tabs */
.main-nav-btn {
  border-bottom: 3px solid transparent;
  color: #64748b;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}
.main-nav-btn.active {
  border-bottom-color: #ea580c;
  color: #ea580c;
  font-weight: 800;
}

.sub-nav-btn {
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}
.sub-nav-btn.active {
  border-bottom-color: #163354;
  color: #163354;
  font-weight: 800;
}

.tab-btn {
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-weight: 600;
  transition: all 0.15s ease;
  cursor: pointer;
}
.tab-btn.active {
  border-bottom: 2px solid #ea580c;
  color: #ea580c;
  font-weight: bold;
}

/* ==========================================================================
   SCHÜLERPORTAL SPEZIFISCH
   ========================================================================== */

/* Audio-Synchroner Fokus */
.tts-active-sentence {
  background-color: #fef08a !important;
  color: #713f12 !important;
  border-radius: 4px;
  padding: 2px 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: background-color 0.2s ease-in-out;
}

/* Manuelles Leselineal */
#reading-ruler-overlay {
  position: absolute;
  left: 0;
  right: 0;
  height: 38px;
  background: rgba(254, 240, 138, 0.28);
  border-top: 2px solid #eab308;
  border-bottom: 2px solid #eab308;
  pointer-events: none;
  border-radius: 6px;
  transition: top 0.05s ease-out;
  z-index: 20;
}

/* Worterklärungen / Glossar (Hellmodus) */
.glossar-word {
  border-bottom: 2px dotted #2563eb;
  color: #1e40af;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  border-radius: 2px;
  padding: 0 1px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.glossar-word:hover {
  background-color: #dbeafe;
}

/* Glossar Popover */
#glossar-popover {
  position: absolute;
  background: #1e293b;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 280px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  z-index: 100;
  pointer-events: auto;
  display: none;
}
#glossar-popover::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #1e293b transparent;
  display: block;
  width: 0;
}

/* ==========================================================================
   SCHÜLERPORTAL: LESE- & SCHRIFTSTUFEN (mit proportionalen Überschriften)
   ========================================================================== */

#artikel-text h1 *, #artikel-text h2 *, #artikel-text h3 * {
  font-size: inherit !important;
  line-height: inherit !important;
}

.text-highlight-word {
  font-weight: 700 !important;
  color: inherit;
}

/* 1. Stufe: Normal */
.text-size-normal, .text-size-normal p, .text-size-normal li { font-size: 1.05rem !important; line-height: 1.8 !important; }
.text-size-normal h1, .title-size-normal { font-size: 1.75rem !important; line-height: 1.25 !important; }
.text-size-normal h2 { font-size: 1.1em !important; line-height: 1.35 !important; font-weight: 700 !important; }
.text-size-normal h3 { font-size: 1.25em !important; line-height: 1.3 !important; font-weight: 800 !important; }

/* 2. Stufe: Groß */
.text-size-large, .text-size-large p, .text-size-large li { font-size: 1.3rem !important; line-height: 1.95 !important; }
.text-size-large h1, .title-size-large { font-size: 2.15rem !important; line-height: 1.25 !important; }
.text-size-large h2 { font-size: 1.1em !important; line-height: 1.35 !important; font-weight: 700 !important; }
.text-size-large h3 { font-size: 1.25em !important; line-height: 1.3 !important; font-weight: 800 !important; }

/* 3. Stufe: Sehr groß */
.text-size-xlarge, .text-size-xlarge p, .text-size-xlarge li { font-size: 1.6rem !important; line-height: 2.15 !important; }
.text-size-xlarge h1, .title-size-xlarge { font-size: 2.6rem !important; line-height: 1.25 !important; }
.text-size-xlarge h2 { font-size: 1.1em !important; line-height: 1.35 !important; font-weight: 700 !important; }
.text-size-xlarge h3 { font-size: 1.25em !important; line-height: 1.3 !important; font-weight: 800 !important; }

/* ==========================================================================
   DARK MODE STYLES
   ========================================================================== */
html.dark,
html.dark body {
  background-color: #0b1320 !important;
  color: #cbd5e1 !important;
}

html.dark header,
.dark header.header-solid-softblue {
  background-color: #0f172a !important;
  border-bottom: 1px solid #1e293b !important;
}

html.dark header .font-serif-title,
html.dark header a span {
  color: #f8fafc !important;
}

html.dark .bg-white {
  background-color: #152238 !important;
  color: #e2e8f0 !important;
  border-color: #243552 !important;
}

html.dark .bg-slate-50 {
  background-color: #0f1a2c !important;
  color: #cbd5e1 !important;
  border-color: #1e2e47 !important;
}

html.dark .bg-slate-100 {
  background-color: #1c2b42 !important;
  color: #e2e8f0 !important;
  border-color: #2d4265 !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800,
html.dark .text-slate-700 {
  color: #f1f5f9 !important;
}

html.dark .text-slate-600,
html.dark .text-slate-500 {
  color: #94a3b8 !important;
}

html.dark .text-slate-400 {
  color: #64748b !important;
}

html.dark .border-slate-200,
html.dark .border-slate-100,
html.dark .border-slate-300 {
  border-color: #243552 !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #243552 !important;
}

html.dark input,
html.dark select {
  background-color: #0f1a2c !important;
  color: #f8fafc !important;
  border-color: #2d4265 !important;
}

html.dark input:focus,
html.dark select:focus {
  border-color: #3b82f6 !important;
}

html.dark .hover\:bg-slate-50:hover {
  background-color: #1a2a44 !important;
}

html.dark .hover\:bg-slate-100:hover {
  background-color: #233654 !important;
}

html.dark .hover\:bg-slate-200:hover {
  background-color: #2b4369 !important;
}

html.dark .sub-nav-btn {
  color: #94a3b8 !important;
}

html.dark .sub-nav-btn.active {
  color: #38bdf8 !important;
  border-bottom-color: #38bdf8 !important;
}

html.dark footer {
  background-color: #111c2e !important;
  border-top-color: #1e293b !important;
}

/* Worterklärungen im Darkmode */
.dark .glossar-word {
  border-bottom: 2px dotted #93c5fd !important;
  color: #60a5fa !important;
}
.dark .glossar-word:hover {
  background-color: rgba(30, 58, 138, 0.45) !important;
  color: #93c5fd !important;
}

/* Lesezeiten Farben im Darkmode */
.dark .lesezeiten-row .text-emerald-700 { color: #4ade80 !important; }
.dark .lesezeiten-row .text-blue-700    { color: #60a5fa !important; }
.dark .lesezeiten-row .text-purple-700  { color: #c084fc !important; }

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
  body * {
    visibility: hidden !important;
  }
  #print-area, #print-area * {
    visibility: visible !important;
  }
  #print-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    display: block !important;
  }
  .no-print {
    display: none !important;
  }
}
