/* =========================================================
   Berufsbildung IDS – Kopfzeile aller Anwendungen
   Vorbild ist die Noten-Übersicht: Logo · Anwendungsname | Menü (Unterstrich beim aktiven Punkt)
   | Name · Hell/Dunkel · Abmelden. Jede Anwendung bindet diese Datei als letzte ein,
   damit Abstände, Schrift und Hover überall gleich sind (kein eigenes Kopfzeilen-CSS pro Anwendung).
   Die Regeln stammen aus /assets/css/style.css (Abschnitt 3) und gelten unverändert.
   ========================================================= */

/* ---------- 3. Kopfzeile (wie stadt.sg.ch, ohne Farbstreifen) ---------- */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--container);
  min-height: 72px;
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
  flex: none;
}
.brand:hover { color: var(--text); }
.brand-logo {
  display: block;
  width: 128px;
  height: auto;
  filter: var(--logo-filter);
}
.brand-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-unit {
  font-size: .75rem;
  letter-spacing: .02em;
  color: var(--text-muted);
}
.app-name {
  font-size: 1.125rem;
  font-weight: bold;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .9375rem;
}
.header-actions > a,
.header-actions .text-button,
.header-actions .link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.header-actions > a:hover,
.header-actions .text-button:hover,
.header-actions .link-btn:hover {
  background: var(--surface);
  color: var(--text);
}
/* Name der angemeldeten Person (Konto-Seiten: .konto-name, Journal: .benutzer, Noten: .user) */
.header-actions .konto-name,
.header-actions .benutzer,
.header-actions .user {
  color: var(--text-muted);
  font-size: .875rem;
}
.header-actions > .konto-name,
.header-actions > .benutzer,
.header-actions > .user {
  margin-left: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  border-radius: 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex: none;
}
.icon-button:hover { background: var(--surface); }
.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Mond im Hellmodus, Sonne im Dunkelmodus (main.js setzt .is-dark) */
.icon-sun { display: none; }
.icon-button.is-dark .icon-sun { display: block; }
.icon-button.is-dark .icon-moon { display: none; }

/* Hauptnavigation einer Anwendung (z. B. Noten) */
.main-nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin: -12px 0 -13px auto; /* volle Höhe der Kopfzeile, Unterstrich sitzt auf deren Linie */
  align-self: stretch;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px 0;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  font-size: .9375rem;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--accent-text); }
.main-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: bold;
  border-bottom-color: var(--accent);
}

@media (max-width: 640px) {
  .header-inner { min-height: 60px; padding: 10px var(--gutter); gap: 12px; }
  .brand { gap: 10px; }
  .brand-logo { width: 100px; }
  .brand-divider { height: 30px; }
  .brand-unit { font-size: .6875rem; }
  .app-name { font-size: 1rem; }
  .header-actions > .konto-name,
  .header-actions > .benutzer,
  .header-actions > .user { display: none; }
  .header-actions > a,
  .header-actions .text-button,
  .header-actions .link-btn { padding: 0 8px; }
}
@media (max-width: 380px) {
  .brand-divider, .brand-unit { display: none; }
}


/* Knopf «Abmelden» ohne Knopf-Aussehen (Noten, Azure-LAB) */
.header-actions .link-btn { background: none; border: 0; font: inherit; font-size: .9375rem; cursor: pointer; }
/* Name der angemeldeten Person ist reiner Text, auch wenn er als Link kommt */
.header-actions .konto-name:hover { background: none; }
.site-header .brand:hover, .site-header .brand:hover .app-name { color: var(--text); }

/* Schmale Bildschirme: Menü unter Logo und Knöpfe, seitlich scrollbar (wie Noten) */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; margin: 0; overflow-x: auto; align-self: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 10px 8px 7px; }
  .header-actions { margin-left: auto; }
}
.site-header [hidden] { display: none !important; }
@media (max-width: 640px) { :root { --gutter: 16px; } }
.header-actions .user, .header-actions .benutzer, .header-actions .konto-name { white-space: nowrap; }
