/* styles.css
   - Light & Dark mode support
   - System dark via prefers-color-scheme, plus manual .dark class on <html> or <body>
   - Clean, minimal layout (mobile-first)
*/

/* ---------- Base variables (light mode) ---------- */
:root{
  --bg: #0A1025;
  --surface: #071021;
  --muted: #113355;
  --text: #E6EEF7;
  --subtle: #CBD5E1;
  --accent: #FF6868; /* etwas wärmer in dark */
  
  --radius: 8px;
  --gap: 20px;
  --maxw: 1080px;

  --focus-ring: 3px;
  --transition: 200ms ease;
}

/* ---------- Dark overrides via class ----------
   If <html class="dark"> or <body class="dark"> is present, these values apply.
   This allows manual toggling without relying solely on system settings.
*/

:root.dark {
  --bg: #fbfcef;
  --surface: #ffffff;
  --muted: #d7d7d7;
  --text: #334477;
  --subtle: #334155;
  --accent: #C92A2A;
}


/* ---------- System dark mode fallback (if user prefers dark) ---------- */
/*
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #071021;
    --muted: #071829;
    --text: #E6EEF7;
    --subtle: #CBD5E1;
    --accent: #FF6868;
  }
}
*/

/* ---------- Reset / basics ---------- */
* { box-sizing: border-box; }
html,body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  padding: 32px 26px;
  display: flex;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  text-align: justify;
}

/* Container */
.wrap {
  max-width: var(--maxw);
  width: 100%;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 8px 0 24px 0;
}

.logo {
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
  font-size: 1rem;
}

/* Header actions: nav + optional toggle */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.main-nav a,
.site-footer a {
  text-decoration: none;
  color: var(--text);
  opacity: 0.85;
}

.main-nav a {
  margin-left: 16px;
  font-size: 0.95rem;
}

.site-footer a {
  
}

/* Hero */
.hero {
  padding: 0;
  margin: 30px auto 60px;
  border-radius: var(--radius);
  display: grid;
  gap: 20px;
  align-items: start;
  background: linear-gradient(180deg, transparent 0%, transparent 100%); /* neutral, keeps it minimal */
}

.hero-inner { max-width: 78ch; }

h1 {
  margin: 0 0 24px 0;
  font-size: clamp(1.35rem, 3.5vw, 2.2rem);
  line-height: 1.12;
  font-weight: 700;
  color: var(--text);
}

.lead {
  margin: 0 0 40px;
  color: var(--subtle);
  font-size: 1rem;
}

/* Actions */
.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:focus,
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.link-plain {
  background: transparent;
  color: var(--text);
  opacity: 0.85;
  text-decoration: underline;
  padding: 0;
}

/* Category chips */
.cats {
  display: flex;
  gap: 10px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.cat {
  background: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* About */
.about {
  margin-top: 28px;
}
.about p {
  margin: 0;
  color: var(--subtle);
  max-width: 66ch;
}

/* Footer */
.site-footer {
  margin-top: 100px;
  padding-top: 10px;
  border-top: 1px solid rgba(99,102,241,0.25); /* subtle separator that adapts well */
  color: var(--subtle);
  font-size: 0.9rem;
}
.footer-inner { display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px; }

/* Icon button (theme toggle) */
.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.05rem;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:focus {
  outline: 3px solid rgba(0,0,0,0.08);
  outline-offset: 2px;
}

/* Accessibility: focus-visible outlines for keyboard users */
:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid rgba(59,130,246,0.35);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Responsive tweaks */
@media (min-width: 760px) {
  .hero { padding: 44px 44px 44px 0; }
  h1 {margin: 0 0 60px;}
  .lead {margin: 0 0 60px;}
  .main-nav a { margin-left: 24px; }
}

/* Small print: ensure buttons remain accessible in dark and light */
.btn-primary { /* ensure contrast in both themes */
  color: #fff;
}












/* ---------------------------
   Theme toggle: garantiert helle Icons im Dark-Mode
   --------------------------- */

/* explizite Icon-Farbe über Variable (wird in :root / :root.light abgeleitet) */
:root {
  --icon-color: var(--text); /* Dark-Mode: text ist bereits hell, daher Icon wird hell */
}
:root.light {
  
  --icon-color: var(--text); /* Light-Mode: dunkles Icon (text ist dunkel) */
}

/* Fallback falls prefers-color-scheme gesetzt ist und keine .light-Klasse */
@media (prefers-color-scheme: light) {
  :root {
    --icon-color: var(--text);
  }
}

/* Icon Sizing + Fill (setzt die Farbe über die Variable) */
.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-block;
  vertical-align: middle;
  fill: var(--icon-color);
  transition: fill 160ms ease, opacity 160ms ease, transform 160ms ease;
}

/* Optional: leicht stärkere Helligkeit / Kontrast für Dark-Mode-Icon
   (falls var(--text) in deinem Dark-Theme nicht hell genug ist) */
:root.dark .icon-btn svg {
  filter: none; /* hier kannst du z. B. 'brightness(1.06)' ergänzen, falls gewünscht */
}

