/* =========================================================
   Berufsbildung IDS – gemeinsames Design
   Angelehnt an stadt.sg.ch: weisse Kopfzeile,
   Logo «//st.gallen» links, Arial, Rot #E00025, Beige #D8D5C5.
   Farben nur über die Variablen unten ändern.
   ========================================================= */

:root {
  --sg-red: #E00025;
  --sg-red-dark: #B8001E;
  --sg-beige: #D8D5C5;

  --bg: #FFFFFF;
  --surface: #F2F2F2;
  --text: #1A1A1A;
  --text-muted: #5C5C5C;
  --border: var(--sg-beige);
  --accent: var(--sg-red);
  --accent-hover: var(--sg-red-dark);
  --header-bg: #FFFFFF;
  --logo-filter: none;
  --focus: #1A1A1A;
}

/* Dunkelmodus: per Knopf (data-theme="dark") oder Systemeinstellung.
   Die beiden Blöcke müssen gleich bleiben. */
:root[data-theme="dark"] {
  --bg: #161616;
  --surface: #222222;
  --text: #EDEDED;
  --text-muted: #B0B0B0;
  --border: #3A3A3A;
  --accent: #FF3B50;
  --accent-hover: #FF6676;
  --header-bg: #161616;
  --logo-filter: invert(1);
  --focus: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616;
    --surface: #222222;
    --text: #EDEDED;
    --text-muted: #B0B0B0;
    --border: #3A3A3A;
    --accent: #FF3B50;
    --accent-hover: #FF6676;
    --header-bg: #161616;
    --logo-filter: invert(1);
    --focus: #FFFFFF;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 16px;
  top: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  z-index: 10;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- Kopfzeile (wie stadt.sg.ch, ohne Farbstreifen) ---------- */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand-logo {
  display: block;
  width: 128px;
  height: auto;
  filter: var(--logo-filter);
}
.brand-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.brand-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.app-name {
  font-size: 1.1rem;
  font-weight: bold;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-actions a {
  color: var(--text);
  text-decoration: none;
}
.header-actions a:hover { color: var(--accent); }

.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;
}
.icon-button:hover { background: var(--surface); }
.icon-button svg {
  width: 22px;
  height: 22px;
  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; }

@media (max-width: 480px) {
  .header-inner { padding: 12px 16px; }
  .brand { gap: 10px; }
  .brand-logo { width: 96px; }
}

/* ---------- Begrüssung ---------- */
main { flex: 1; }

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 40px 0 32px;
  padding: 40px 44px;
  background: var(--surface);
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 2.4rem;
  line-height: 1.15;
}
.hero p:last-child {
  margin: 0;
  max-width: 60ch;
  color: var(--text-muted);
}
@media (max-width: 700px) {
  .hero { padding: 28px 20px; margin-top: 24px; }
  .hero h1 { font-size: 1.9rem; }
}

/* ---------- Kacheln ---------- */
.section-title {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

.tiles {
  list-style: none;
  margin: 0 0 56px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .tiles { grid-template-columns: 1fr; }
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 22px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.tile:hover {
  background: var(--surface);
  border-color: var(--accent);
}
.tile-number {
  font-size: 1.8rem;
  font-weight: bold;
  line-height: 1;
  color: var(--accent);
}
.tile-title {
  font-size: 1.25rem;
  font-weight: bold;
}
.tile-text {
  flex: 1;
  color: var(--text-muted);
}
.tile-link {
  margin-top: 8px;
  font-weight: bold;
  color: var(--accent);
}
.tile-link::after { content: " \2192"; }
.tile:hover .tile-link { text-decoration: underline; }

/* ---------- Fusszeile ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 600px) {
  .footer-inner { padding: 0 16px; }
}

a { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
}
