/* DexApps – gemeinsames Stylesheet
   Mobil zuerst, Systemschriften, automatischer Dark Mode.
   Keine externen Ressourcen. */

/* ---------- Farben & Maße ---------- */
:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-subtle: #f4f6f9;
  --text: #1a1d23;
  --text-muted: #4f5766;
  --border: #d9dee6;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --on-accent: #ffffff;
  --todo-bg: #fff3c4;
  --todo-text: #4d3800;
  --todo-border: #b38600;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --radius: 12px;
  --gutter: 1rem;
  --measure: 44rem;
  --wide: 64rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --bg-subtle: #1a1d24;
    --text: #e8eaef;
    --text-muted: #a6adba;
    --border: #2e333d;
    --accent: #8db4ff;
    --accent-hover: #b5ceff;
    --on-accent: #0b1220;
    --todo-bg: #3a2f00;
    --todo-text: #ffe08a;
    --todo-border: #c9a227;
  }
}

/* ---------- Grundlagen ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

main {
  flex: 1;
  width: 100%;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: 1.875rem;
  margin-top: 2.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.375rem;
}

h3 {
  font-size: 1.125rem;
}

p,
ul,
ol,
dl,
address {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.25rem;
}

address {
  font-style: normal;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

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

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

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

.prose {
  max-width: var(--measure);
}

.lead {
  font-size: 1.1875rem;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.9375rem;
}

/* Sprunglink für Tastatur- und Screenreader-Nutzung */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 6px;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.5rem;
  color: var(--on-accent);
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.brand-name span {
  color: var(--accent);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li + li {
  margin-top: 0;
}

.site-header .nav-list a {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.site-header .nav-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.footer-inner p {
  margin: 0;
}

.site-footer .nav-list a {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--text-muted);
}

.site-footer .nav-list a:hover,
.site-footer .nav-list a[aria-current="page"] {
  color: var(--text);
}

/* ---------- App-Karten ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.cards li + li {
  margin-top: 0;
}

.card {
  position: relative;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.card:hover {
  border-color: var(--accent);
}

.card:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.card h3 {
  margin: 0 0 0.25rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

/* Ganze Karte klickbar, ohne den Link zu verschachteln */
.card a {
  color: var(--text);
  text-decoration: none;
}

.card a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card a:focus-visible {
  outline: none;
}

.app-icon {
  width: 3.5rem;
  height: 3.5rem;
  flex: none;
  border-radius: 22%;
}

/* ---------- Pfad (Breadcrumb) ---------- */
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.breadcrumb li + li {
  margin-top: 0;
}

.breadcrumb li + li::before {
  content: "›";
  content: "›" / "";
  padding: 0 0.5rem;
}

/* ---------- App-Seite ---------- */
.app-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-top: 2.5rem;
}

.app-hero h1 {
  margin: 0;
}

.app-hero p {
  margin: 0.25rem 0 0;
}

.app-hero .app-icon {
  width: 4.5rem;
  height: 4.5rem;
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
}

.store-links li + li {
  margin-top: 0;
}

.button {
  display: inline-block;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

/* Platzhalter, solange die App noch nicht im Store ist */
.button-placeholder {
  display: inline-block;
  padding: 0.625rem 1.125rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- Rechtstexte ---------- */
.toc {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  margin-bottom: 2rem;
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.toc ol {
  margin: 0;
}

.defs dt {
  font-weight: 600;
}

.defs dd {
  margin: 0 0 0.875rem;
}

.steps li + li {
  margin-top: 0.5rem;
}

.note {
  margin: 0 0 1.5rem;
  padding: 0.875rem 1.125rem;
  border-left: 4px solid var(--accent);
  background: var(--bg-subtle);
  border-radius: 0 8px 8px 0;
}

.note > :last-child {
  margin-bottom: 0;
}

.updated {
  margin-top: 2.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Sichtbarer Platzhalter: muss vor der Veröffentlichung ersetzt werden */
.todo {
  padding: 0.05em 0.35em;
  border: 1px dashed var(--todo-border);
  border-radius: 4px;
  background: var(--todo-bg);
  color: var(--todo-text);
}

/* ---------- Breitere Bildschirme ---------- */
@media (min-width: 40em) {
  :root {
    --gutter: 1.5rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .header-inner {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}

/* ---------- Druck ---------- */
@media print {
  .skip-link,
  .site-header nav,
  .site-footer nav,
  .toc {
    display: none;
  }

  body {
    font-size: 11pt;
  }

  a {
    color: inherit;
  }
}
