/* ============================================================
   edu.rjk.de — Finanzbildung
   Pure CSS, mobile-first, no framework.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/Inter-Bold.woff2') format('woff2');
}

:root {
  --bg: #FAF7F2;
  --fg: #1A1A1A;
  --muted: #6B6B6B;
  --card: #FFFFFF;
  --border: #E8E2D8;
  --accent: #A04510;            /* Text accent — WCAG AA on --bg */
  --accent-strong: #C25A1B;     /* Hero / large display only */
  --accent-hover: #7E3608;
  --focus: #2563EB;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  --radius: 10px;
  --maxw: 720px;
  --maxw-wide: 1080px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 720px) {
  body { font-size: 18px; }
}

img, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 var(--space-4);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 var(--space-4); }

@media (min-width: 720px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.875rem; }
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.container-wide {
  max-width: var(--maxw-wide);
}

main { padding: var(--space-6) 0 var(--space-8); }

/* ---------- Header ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) 0;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(180%) blur(8px);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.site-logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-logo:hover { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: var(--space-4); }
.site-nav a {
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--muted);
}
.site-nav a:hover { color: var(--fg); }

/* Language switch */
.lang-switch {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  font-size: 0.875rem;
}
.lang-switch a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  min-width: 44px;
  text-align: center;
}
.lang-switch a[aria-current="true"] {
  background: var(--fg);
  color: var(--bg);
  font-weight: 500;
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-7) 0 var(--space-6);
  text-align: left;
}
.hero h1 {
  font-size: 2rem;
  letter-spacing: -0.02em;
}
@media (min-width: 720px) {
  .hero h1 { font-size: 3rem; }
}
.hero__sub {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: var(--space-5);
  max-width: 560px;
}

/* Reading-width text inside wide containers */
.prose-narrow { max-width: 640px; }

/* Email obfuscation — visually styled "user [at] domain [dot] tld" */
.obf {
  font-family: inherit;
  unicode-bidi: bidi-override;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn--primary {
  background: var(--fg);
  color: var(--bg);
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--fg); }

/* ---------- Section ---------- */
.section { padding: var(--space-6) 0; }
.section__title {
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

/* ---------- Course cards ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  min-height: 160px;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.card__num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}
.card__sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  flex-grow: 1;
}
.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.card__arrow { color: var(--accent); font-weight: 500; }

/* ---------- Module page ---------- */
.module-hero {
  padding: var(--space-5) 0 var(--space-4);
}
.module-hero__back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: var(--space-3);
}
.module-hero__back:hover { color: var(--fg); }
.module-hero__num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.video-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-5) 0;
  box-shadow: var(--shadow);
}
.video-wrap video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
}
.video-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -1rem;
  margin-bottom: var(--space-5);
}

.module-desc {
  font-size: 1.0625rem;
  color: var(--fg);
  margin-bottom: var(--space-6);
}

.module-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-6);
}
@media (min-width: 720px) {
  .module-nav { grid-template-columns: 1fr auto 1fr; }
}
.module-nav__link {
  display: flex;
  flex-direction: column;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--fg);
  background: var(--card);
  min-height: 64px;
  justify-content: center;
}
.module-nav__link:hover { border-color: var(--accent); }
.module-nav__link--disabled {
  opacity: 0.4;
  pointer-events: none;
}
.module-nav__link--next { text-align: right; }
.module-nav__label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.module-nav__title {
  font-weight: 500;
  margin-top: 2px;
}
.module-nav__overview {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-4);
  min-height: 64px;
}
.module-nav__overview:hover { color: var(--fg); border-color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--space-8);
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: flex-start;
}
@media (min-width: 720px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  margin-right: var(--space-4);
}
.site-footer a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- About / Prose ---------- */
.prose h1, .prose h2, .prose h3 { margin-top: var(--space-6); }
.prose p, .prose li { max-width: 65ch; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: var(--space-2); }

/* ---------- 404 ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}
.error-page__code {
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1;
  margin: 0;
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Dark mode (optional, low-effort) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110D;
    --fg: #F2EFE8;
    --muted: #9B958B;
    --card: #1E1A14;
    --border: #2C2620;
    --accent: #E07A3D;
    --accent-strong: #E07A3D;
    --accent-hover: #FF914D;
  }
  .btn--primary { background: var(--accent); color: #14110D; }
  .btn--primary:hover { background: var(--accent-hover); color: #14110D; }
}
