/* ============================================================
   RMH Knowledgebase – Wide (Full-Width / Homepage, Kurse & Suche)
   Stand: 09/2026 – alle Ergänzungen konsolidiert
   ============================================================ */

/* ── Design Tokens ──────────────────── */
:root {
    --accent:      #f9423a;
    --accent-weak: rgba(249,66,58,.12);
    --accent-line: rgba(249,66,58,.35);
    --topbar-bg:   #3b3c3f;
    --hero-bg:     #3b3c3f;
    --text:        #3b3c3f;
    --text-strong: #1f2937;
    --muted:       #475569;
    --faint:       #94a3b8;
    --fainter:     #b0b8c4;
    --border:      #e2e8f0;
    --border-soft: #ebebea;
    --surface:     #ffffff;
    --shadow-card: 0 1px 3px rgba(0,0,0,.05), 0 2px 12px rgba(249,66,58,.06);
}

/* ── Reset ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Metropolis', system-ui, sans-serif;
    font-weight: 400; font-size: 15px; line-height: 1.65;
    color: var(--text); background: var(--surface);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── Topbar ─────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 36px; background: var(--topbar-bg); border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar-logo img { height: 40px; width: auto; display: block; }
.topbar-nav { display: flex; align-items: center; gap: 4px; font-size: 13px; }

/* Nav-Links: subtil, uppercase, leicht */
.topbar-nav a.topbar-link,
.topbar-nav button.topbar-link {
  color: rgba(255,255,255,.5); background: none;
  border: none; border-radius: 6px;
  cursor: pointer; font-size: 11px; font-weight: 300;
  text-transform: uppercase; letter-spacing: .09em;
  padding: 6px 12px; font-family: 'Metropolis', sans-serif;
  text-decoration: none; transition: color .15s, background .15s;
  display: inline-flex; align-items: center;
  line-height: 1; box-sizing: border-box;
}
.topbar-nav a.topbar-link:hover,
.topbar-nav button.topbar-link:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.07); }

/* Aktiver Link (Kurse) */
.topbar-nav a.topbar-link-active { color: rgba(255,255,255,.9); background: rgba(255,255,255,.1); }

/* "Meine Kurse" Button – gleiche Größe und Optik wie normale Links */
.topbar-btn {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 6px;
  font-size: 11px; font-weight: 300; font-family: 'Metropolis', sans-serif;
  text-transform: uppercase; letter-spacing: .09em;
  border: none; color: rgba(255,255,255,.5);
  background: none; text-decoration: none;
  transition: color .15s, background .15s;
  cursor: pointer;
}
.topbar-btn:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.07); }

/* Fallback für ältere topbar-nav a/button ohne Klasse */
.topbar-nav > a:not([class]),
.topbar-nav > form > button:not([class]) { color: rgba(255,255,255,.45); background: none; border: none; cursor: pointer; font-size: 11px; font-weight: 300; text-transform: uppercase; letter-spacing: .09em; padding: 0; font-family: 'Metropolis', sans-serif; }
.topbar-nav > a:not([class]):hover,
.topbar-nav > form > button:not([class]):hover { color: #fff; }

/* ── Locale Toggle DE | EN ──────────────────────────────────── */
.locale-toggle {
  display: inline-flex; align-items: center;
  border: 1px solid rgba(255,255,255,.15); border-radius: 5px;
  overflow: hidden; margin-left: 10px;
}
.locale-toggle form { margin: 0; display: flex; }
.locale-btn {
  background: none; border: none; border-radius: 0;
  color: rgba(255,255,255,.3); cursor: pointer;
  font-size: 10px; font-weight: 500; letter-spacing: .1em;
  padding: 5px 9px; font-family: 'Metropolis', sans-serif;
  text-transform: uppercase; transition: color .15s, background .15s;
  line-height: 1;
}
.locale-btn:hover { color: rgba(255,255,255,.7); background: rgba(255,255,255,.06); }
.locale-btn.active { color: #fff; background: rgba(255,255,255,.12); }

/* ── Buttons (für alle Wide-Layout-Seiten) ── */
/* Doppelte Klasse (.btn.btn-primary) = höhere Spezifität, überschreibt Konflikte */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; border: 1px solid #e2e8f0; background: transparent;
  color: #3b3c3f; text-decoration: none; font-family: 'Metropolis', sans-serif;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.btn:hover { background: #f6f6f4; text-decoration: none; }

.btn.btn-primary { background-color: #f9423a; color: #ffffff; border: 1px solid #f9423a; }
.btn.btn-primary:hover { filter: brightness(1.05); background-color: #f9423a; color: #ffffff; text-decoration: none; }

.btn.btn-ghost { background-color: transparent; color: #5f6570; border: 1px solid #e2e8f0; }
.btn.btn-ghost:hover { background-color: #f6f6f4; color: #3b3c3f; border-color: #c5cad2; }

.btn.btn-sm   { padding: 6px 13px; font-size: 12px; }
.btn.btn-block { width: 100%; justify-content: center; }

/* Sicherstellen dass Card-Hover die Buttons nicht beeinträchtigt */
.course-card:hover .btn.btn-primary { background-color: #f9423a; color: #ffffff; border-color: #f9423a; }
.course-card:hover .btn.btn-ghost   { background-color: transparent; color: #5f6570; border-color: #e2e8f0; }
.course-card:hover .btn.btn-sm      { padding: 6px 13px; font-size: 12px; }

/* ── Abschnitts-Label ──────────────── */
.section-eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }

/* ── Notice ─────────────────────────── */
.notice        { border-radius: 7px; padding: 11px 15px; font-size: 13.5px; margin-bottom: 18px; border: 1px solid var(--border); }
.notice-ok     { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.3); }
.notice-danger { background: rgba(249,66,58,.07); border-color: rgba(249,66,58,.3); }

/* ── Hero ───────────────────────────── */
.hero { background: var(--hero-bg); padding: 72px 20px 80px; text-align: center; position: relative; overflow: hidden; }
.hero::before, .hero::after { content: none; }
.hero h1  { font-size: 2.6rem; font-weight: 700; color: #fff; margin-bottom: 6px; letter-spacing: -.03em; position: relative; }
.hero-sub { color: rgba(255,255,255,.45); font-size: 15px; margin-bottom: 28px; position: relative; font-weight: 400; }
.hero-search { max-width: 560px; margin: 0 auto; position: relative; }
.hero-search input { width: 100%; padding: 15px 20px 15px 50px; border-radius: 50px; border: 1px solid rgba(255,255,255,.12); font-size: 15px; background: rgba(255,255,255,.07); color: #fff; outline: none; transition: .15s; font-family: 'Metropolis', sans-serif; font-weight: 300; }
.hero-search input::placeholder { color: rgba(255,255,255,.3); }
.hero-search input:focus { background: rgba(255,255,255,.12); border-color: rgba(249,66,58,.5); }
.hero-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.3); pointer-events: none; }

/* ── Content Wrapper ────────────────── */
.content { max-width: 900px; margin: 0 auto; padding: 60px 24px 80px; }

/* ── Kategorie-Sektion (Homepage) ───── */
.cat-section { margin-bottom: 56px; }
.cat-header  { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border-soft); }
.cat-header-left { display: flex; align-items: center; gap: 10px; }
.cat-dot     { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; display: inline-block; }
.cat-logo    { height: 80px; width: auto; object-fit: contain; flex-shrink: 0; }
.cat-name    { font-size: 1.15rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.cat-see-all {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-line);
  padding: 5px 12px; border-radius: 7px; flex-shrink: 0;
  text-decoration: none; transition: background .15s;
}
.cat-see-all:hover { background: var(--accent-weak); }
.article-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 40px; }
.article-link { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13.5px; color: var(--muted); font-weight: 400; }
.article-link::before { content: "·"; color: var(--faint); flex-shrink: 0; font-size: 16px; line-height: 1; }
.article-link:hover { color: var(--accent); text-decoration: none; }
.sub-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 16px 0 8px; grid-column: 1 / -1; }
.cat-empty { font-size: 13.5px; color: var(--fainter); padding: 4px 0; }

/* ── Highlights (Neu & Beliebt) ─────── */
.highlights { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-bottom: 56px; padding-bottom: 52px; border-bottom: 1px solid var(--border-soft); }
/* Wie .cat-name – bewusste User-Entscheidung */
.highlight-label { font-size: 1.15rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; margin-bottom: 18px; }
.highlight-row { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-soft); gap: 12px; text-decoration: none; }
.highlight-row:hover .hl-title { color: var(--accent); }
.hl-title { font-size: 14px; font-weight: 500; color: var(--text); transition: color .12s; }
.hl-cat   { font-size: 12px; color: var(--faint); margin-left: 8px; }
.hl-meta  { font-size: 12px; color: var(--fainter); white-space: nowrap; flex-shrink: 0; }
.hl-rank  { font-size: 12px; font-weight: 700; color: var(--faint); min-width: 18px; flex-shrink: 0; }
.hl-left  { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }

/* ── Suchseite ──────────────────────── */
.search-card { display: block; padding: 18px 20px; border-radius: 10px; border: 1px solid var(--border); text-decoration: none; transition: border-color .15s, box-shadow .15s; background: var(--surface); margin-bottom: 10px; }
.search-card:hover { border-color: var(--accent); box-shadow: var(--shadow-card); }
.search-title   { font-size: 15px; font-weight: 600; color: var(--text); display: block; margin-bottom: 6px; }
.search-excerpt { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin-bottom: 10px; font-weight: 400; }
.search-meta    { display: flex; gap: 12px; font-size: 12.5px; color: var(--faint); font-weight: 400; align-items: center; }

/* ── Kurs-Übersicht (Index) ─────────── */
.courses-header { margin-bottom: 40px; }
.courses-title  { font-size: 1.6rem; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -.02em; }
.courses-sub    { font-size: 15px; color: var(--muted); }
.courses-grid   { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.course-card   {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--surface); display: flex; flex-direction: column;
  transition: box-shadow .15s, border-color .15s;
}
.course-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); border-color: var(--accent-line); }
.course-card-img img { width: 100%; height: 180px; object-fit: cover; display: block; }
.course-card-body   { padding: 20px 22px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.course-card-title  { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.25; }
.course-card-desc   { font-size: 14px; color: var(--muted); line-height: 1.6; flex: 1; }
.course-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.course-card-meta   { display: flex; gap: 12px; font-size: 13px; color: var(--faint); align-items: center; }

/* ── Kurs-Vorschau (Show) ───────────── */
.course-hero-img img    { width: 100%; height: 280px; object-fit: cover; border-radius: 12px; margin-bottom: 28px; }
.course-hero-title      { font-size: 2.2rem; font-weight: 700; color: var(--text); margin-bottom: 12px; letter-spacing: -.025em; line-height: 1.15; }
.course-hero-desc       { font-size: 15px; color: var(--muted); line-height: 1.7; margin-bottom: 22px; max-width: 640px; }
.course-hero-meta       { display: flex; gap: 20px; font-size: 14px; color: var(--muted); margin-bottom: 28px; align-items: center; }
.course-progress-bar-wrap { background: var(--border); border-radius: 99px; height: 6px; overflow: hidden; max-width: 320px; margin-bottom: 8px; }
.course-progress-bar    { background: var(--accent); height: 6px; border-radius: 99px; transition: width .3s ease; }

/* Kursinhalt-Liste */
.course-outline-section  { margin-top: 48px; }
.course-outline-list     { display: flex; flex-direction: column; gap: 6px; }
.course-outline-item     { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: border-color .12s; }
.course-outline-item:hover { border-color: var(--accent-line); }
.course-outline-item.is-read { border-color: var(--accent-line); }
.course-outline-num      { width: 32px; height: 32px; border-radius: 50%; background: var(--border); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.is-read .course-outline-num { background: var(--accent); color: #fff; }
.course-outline-text     { flex: 1; min-width: 0; }
.course-outline-title    { font-size: 14.5px; font-weight: 500; color: var(--text); display: block; }
.course-outline-cat      { font-size: 12px; color: var(--faint); margin-top: 2px; display: block; }

/* ── Learner Dashboard ──────────────── */
.dashboard-course-card   { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); margin-bottom: 16px; }
.dashboard-course-cover  { width: 100%; height: 160px; object-fit: cover; display: block; border-bottom: 1px solid var(--border); }
.dashboard-course-body   { padding: 22px 24px; }
.dashboard-course-head   { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.dashboard-course-title  { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.dashboard-course-status { font-size: 13px; color: var(--muted); font-weight: 400; }
.dashboard-progress-wrap { background: var(--border); border-radius: 99px; height: 6px; overflow: hidden; width: 100%; }
.dashboard-progress-bar  { background: var(--accent); height: 6px; border-radius: 99px; transition: width .4s ease; }
.dashboard-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 7px; }

/* ── Responsive ─────────────────────── */
@media (max-width: 640px) {
    .hero h1        { font-size: 1.8rem; }
    .article-grid   { grid-template-columns: 1fr; }
    .highlights     { grid-template-columns: 1fr; }
    .topbar         { padding: 12px 20px; }
    .courses-grid   { grid-template-columns: 1fr; }
}

/* ── Kurs-Bilder nicht croppen ──────────────────────────────── */
.course-card-img img { width: 100%; height: auto; display: block; }
.course-hero-img img { width: 100%; height: auto; border-radius: 12px; margin-bottom: 28px; }
