/* telefonanleitungen.de – Grundgestaltung
   Leitidee: Postgelber Kopfstreifen wie ein Typenschild, DIN-Schrift aus dem
   Bestand des Betriebssystems (keine Webfonts), ruhige Lesespalte. */

:root {
  --ground: #e3e4df;      /* Lichtgrau, Seitenhintergrund */
  --paper: #ffffff;       /* Inhaltsfläche */
  --ink: #1e2328;         /* Text */
  --muted: #555d66;       /* Nebentext */
  --rule: #c8cbc4;        /* Linien */
  --post: #f2b700;        /* Postgelb, Kopfstreifen */
  --bar: #2c3338;         /* Anthrazit, Menüleiste */
  --bar-ink: #f3f3ef;
  --link: #2f6141;        /* Farngrün */
  --focus: #1d64c8;
  --ok-bg: #e4efe6;
  --err: #9b1c1c;
  --err-bg: #f8e3e1;
  --info-bg: #fdf3d1;
  --font-plate: "Bahnschrift", "DIN Alternate", "DIN 1451", "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #16191c;
    --paper: #1f2327;
    --ink: #e7e7e2;
    --muted: #a6adb4;
    --rule: #3a4046;
    --bar: #0f1215;
    --bar-ink: #e7e7e2;
    --link: #8cc79e;
    --focus: #7fb0ff;
    --ok-bg: #1f3326;
    --err: #ffb4ab;
    --err-bg: #3b1f1d;
    --info-bg: #3a3218;
    color-scheme: dark;
  }
}

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

html { font-size: 106.25%; } /* 17px */
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  line-height: 1.6;
}

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -10000px; top: 0;
  background: var(--paper); color: var(--ink); padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---- Kopf: Typenschild ---------------------------------------------------- */
.site-header { position: relative; z-index: 5; }

.plate {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  background: var(--post);
  color: #1e2328;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 4px solid #1e2328;
}
.site-name {
  font-family: var(--font-plate);
  font-stretch: condensed;
  font-weight: 700;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  letter-spacing: 0.01em;
  color: #1e2328;
  text-decoration: none;
  margin-right: auto;
}
.account { display: flex; align-items: center; gap: 1rem; font-size: 0.95rem; }
.account a, .account .link-button { color: #1e2328; font-weight: 600; }
.account-name { font-weight: 400; }
.inline-form { display: inline; margin: 0; }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.15em;
}
.plate :focus-visible { outline-color: #1e2328; }

/* ---- Navigation ---------------------------------------------------------- */
.nav-toggle {
  display: none;
  font: 600 0.95rem var(--font-text);
  background: #1e2328; color: var(--post);
  border: 0; border-radius: 3px; padding: 0.45rem 0.9rem; cursor: pointer;
}
.site-nav { background: var(--bar); color: var(--bar-ink); }
.nav-list { list-style: none; margin: 0; padding: 0; }
.site-nav a, .site-nav summary {
  display: block; color: inherit; text-decoration: none;
  padding: 0.6rem clamp(1rem, 2vw, 1.2rem); cursor: pointer;
}
.site-nav summary { list-style: none; }
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav summary::after {
  content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin-left: 0.5em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-0.2em) rotate(45deg); transition: transform 0.15s;
}
.site-nav details[open] > summary::after { transform: translateY(0.05em) rotate(225deg); }
.site-nav a[aria-current="page"] { font-weight: 700; box-shadow: inset 4px 0 0 var(--post); }
.nav-overview a { font-style: italic; }

@media (min-width: 56.25rem) {
  .nav-level-0 { display: flex; flex-wrap: wrap; padding: 0 clamp(0rem, 3vw, 1.3rem); }
  .nav-level-0 > li { position: relative; }
  .nav-level-0 > li > a:hover,
  .nav-level-0 > li > details > summary:hover { background: rgba(255, 255, 255, 0.08); }
  .nav-level-0 > li.in-trail > details > summary { box-shadow: inset 0 -3px 0 var(--post); }
  .nav-level-0 > li > a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--post); }

  /* Erste Ebene als Aufklappmenü */
  .nav-level-0 > li > details > .nav-list {
    position: absolute; left: 0; top: 100%;
    min-width: 17rem; max-width: min(28rem, 90vw); max-height: 75vh; overflow-y: auto;
    background: var(--paper); color: var(--ink);
    border: 1px solid var(--rule); border-top: 3px solid var(--post);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    padding: 0.3rem 0;
  }
  .nav-level-0 > li:last-child > details > .nav-list,
  .nav-level-0 > li:nth-last-child(2) > details > .nav-list { left: auto; right: 0; }
  .nav-level-1 a, .nav-level-1 summary { padding: 0.4rem 1rem; }
  .nav-level-1 a:hover, .nav-level-1 summary:hover { background: var(--ground); }
  /* Tiefere Ebenen innerhalb des Aufklappmenüs eingerückt */
  .nav-level-2, .nav-level-3, .nav-level-4, .nav-level-5, .nav-level-6 {
    margin-left: 1rem; border-left: 2px solid var(--rule);
  }
}

@media (max-width: 56.24rem) {
  .nav-toggle { display: inline-block; margin-left: auto; }
  .js .site-nav:not(.is-open) { display: none; }
  .site-nav { padding: 0.3rem 0 0.6rem; }
  .site-nav .nav-list .nav-list { margin-left: 1rem; border-left: 2px solid rgba(255, 255, 255, 0.2); }
  .site-nav a, .site-nav summary { padding-top: 0.7rem; padding-bottom: 0.7rem; } /* Fingergerecht */
}

/* ---- Inhalt -------------------------------------------------------------- */
.sheet {
  background: var(--paper);
  max-width: 62rem;
  margin: clamp(0rem, 3vw, 2rem) auto;
  padding: clamp(1.25rem, 4vw, 2.75rem) clamp(1rem, 5vw, 3.5rem);
  min-height: 50vh;
}
.sheet > *, .content > * { max-width: 46rem; }

h1, h2, h3, h4 {
  font-family: var(--font-plate);
  font-stretch: condensed;
  line-height: 1.2;
  margin: 1.6em 0 0.5em;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin-top: 0; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.hint { color: var(--muted); font-size: 0.9rem; font-weight: 400; }

/* Altinhalte aus TinyMCE robust darstellen */
.content img, .content video, .content iframe { max-width: 100%; height: auto; }
.content table {
  display: block; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; margin: 1rem 0;
}
.content td, .content th { border: 1px solid var(--rule); padding: 0.35rem 0.6rem; vertical-align: top; }
.content [style*="width"] { max-width: 100% !important; }
.content pre { overflow-x: auto; }

/* ---- Meldungen ----------------------------------------------------------- */
.notice { padding: 0.75rem 1rem; border-left: 5px solid; margin: 0 0 1.5rem; }
.notice-success { background: var(--ok-bg); border-color: var(--link); }
.notice-error { background: var(--err-bg); border-color: var(--err); }
.notice-info { background: var(--info-bg); border-color: var(--post); }

/* ---- Formulare ----------------------------------------------------------- */
.form { max-width: 28rem; display: grid; gap: 0.35rem; }
.form label { font-weight: 600; margin-top: 0.8rem; }
.form input[type="text"], .form input[type="email"], .form input[type="password"] {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--muted); border-radius: 3px; padding: 0.55rem 0.7rem; width: 100%;
}
.form input[aria-invalid="true"] { border-color: var(--err); border-width: 2px; }
.field-error { color: var(--err); margin: 0.2rem 0 0; font-size: 0.95rem; }
.button {
  justify-self: start; margin-top: 1.2rem;
  font: 600 1rem var(--font-text);
  background: var(--bar); color: var(--bar-ink);
  border: 0; border-bottom: 3px solid var(--post); border-radius: 3px;
  padding: 0.65rem 1.4rem; cursor: pointer;
}
.button:hover { filter: brightness(1.2); }
.form-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1.5rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Fuß ----------------------------------------------------------------- */
.site-footer {
  max-width: 62rem; margin: 0 auto 2rem; padding: 0 clamp(1rem, 5vw, 3.5rem);
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  color: var(--muted); font-size: 0.9rem;
}
.site-footer a { color: var(--muted); }

.debug { white-space: pre-wrap; font-size: 0.8rem; background: var(--ground); padding: 1rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
