/* =========================================================================
   mailtools. DAS Stylesheet. Es gibt nur diese Datei.
   Farben/Typo/Abstände sind LIVE von frankysweb.de übernommen (GeneratePress-
   Customizer, Stand 2026-08-31). Frankysweb.de gibt das Design vor.
   Kein Tool und keine Seite bringt eigenes CSS oder eigene Markup-Varianten mit.
   Aufbau:  1) Font  2) Tokens  3) Reset/Basis  4) Layout  5) Komponenten  6) Utilities
   Klassen-Vokabular siehe CLAUDE.md → "Design-System".
   ========================================================================= */

/* ---------- 1) Font (selbst gehostet, wie auf frankysweb.de) ------------- */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/open-sans-var.woff2") format("woff2");
}
@font-face {
  font-family: "Open Sans";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/open-sans-var-italic.woff2") format("woff2");
}

/* ---------- 2) Tokens --------------------------------------------------- */
:root {
  /* Chrome (frankysweb.de) */
  --c-utilbar-bg: #12314d;   /* .top-bar / .site-info */
  --c-utilbar-fg: #a9c1d6;
  --c-utilbar-fg-hover: #f0f2f5;
  --c-header-bg: #1b4266;    /* .site-header */
  --c-header-fg: #ffffff;
  --c-header-sub: #a9c1d6;   /* .site-description */
  --c-nav-bg: #222831;       /* .main-navigation */
  --c-nav-fg: #dbdfec;
  --c-nav-hover-bg: #2d333c;
  --c-nav-active-bg: #3f3f3f;
  --c-footer-bg: #12314d;
  --c-footer-fg: #a9c1d6;

  --c-page-bg: #eef1f4;      /* body */
  --c-card-bg: #ffffff;

  /* Text (frankysweb.de: body #3a3a3a, --contrast-2 #575760) */
  --c-text: #3a3a3a;
  --c-text-muted: #575760;

  /* Akzente (frankysweb.de: --accent / link #1e73be, hover #000) */
  --c-primary: #1e73be;
  --c-primary-hover: #155a94;
  --c-link: #1e73be;
  --c-link-hover: #000000;
  --c-focus: #1e73be;

  /* Severity (eigene Ergänzung; Info an den Akzent angeglichen) */
  --c-info: #1e73be;   --c-info-bg: #e7f0f8;
  --c-warn: #b7791f;   --c-warn-bg: #fbf1e0;   --c-warn-border: #e7d3ad;
  --c-error: #c23934;  --c-error-bg: #fbe9e8;  --c-error-border: #f0c6c4;
  --c-ok: #2f855a;     --c-ok-bg: #e6f3ec;

  /* Neutrale (Grenzen, Flächen, sonstige Literale außerhalb der obigen Chrome-/Akzentfarben) */
  --c-white: #ffffff;
  --c-border: #c4ccd6;         /* Input/Textarea-Rahmen */
  --c-border-light: #e2e5e9;   /* Trennlinien, Baum, Kacheln, Spinner */
  --c-border-hover: #b7c6d6;   /* Kachel-Hover */
  --c-border-dashed: #b7c0cc;  /* Ad-Slot-Platzhalter */
  --c-surface-muted: #f6f8fa;  /* Baum-Knoten/-Record-Hintergrund */
  --c-surface-subtle: #f0f2f5; /* .prose code */
  --c-surface-faint: #f3f5f8;  /* Ad-Slot-Platzhalter */
  --c-btn-secondary-hover-bg: #eef2f7;
  --c-placeholder-text: #97a1ae;

  /* Typografie (frankysweb.de: Open Sans; h1/h2 font-weight 300) */
  --font-sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;

  /* Abstände (8er-Raster) */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;  --sp-5: 24px;  --sp-6: 32px;
  --sp-gutter: 24px;   /* linker/rechter Seitenrand */
  --sp-card: 30px;     /* Card-Innenabstand (frankysweb.de .inside-article) */

  --radius: 4px;
  --shadow-card: 0 1px 3px rgba(16, 24, 40, 0.08);
  --maxw: 1600px;      /* frankysweb.de .grid-container */
  --control-h: 42px;   /* gemeinsame Höhe von Inputs UND Buttons */
}

/* ---------- 3) Reset / Basis ------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-page-bg);
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 var(--sp-3); }
h1 { font-weight: 300; font-size: 32px; }
h2 { font-weight: 300; font-size: 24px; }
h3 { font-weight: 600; font-size: 18px; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--c-link); text-decoration: none; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 2px; }

/* ---------- 4) Layout ----------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-gutter); }

/* Sticky Footer: Seite füllt immer die volle Höhe, Footer schließt bündig ab. */
.site-main { flex: 1 0 auto; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-6);
  padding: var(--sp-5) 0 40px;
}
.content > :last-child, .sidebar > :last-child { margin-bottom: 0; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }

/* --- Utility-Leiste (.top-bar) --- */
.utilbar { background: var(--c-utilbar-bg); color: var(--c-utilbar-fg); font-size: 13px; }
.utilbar .wrap { display: flex; justify-content: flex-end; gap: 18px; padding: 8px var(--sp-gutter); }
.utilbar a { color: var(--c-utilbar-fg); }
.utilbar a:hover { color: var(--c-utilbar-fg-hover); text-decoration: none; }

/* --- Header (.site-header) --- */
.site-header { background: var(--c-header-bg); color: var(--c-header-fg); }
.site-header .wrap { padding: 40px var(--sp-gutter); }
.site-header__brand { display: inline-flex; align-items: baseline; gap: var(--sp-3); }
.site-header__brand:hover { text-decoration: none; }
/* frankysweb.de .main-title: Open Sans 700, 50px, line-height 1.2 */
.site-header__title {
  font-size: clamp(32px, 6vw, 50px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-header-fg);
}
.site-header__badge {
  font-size: 15px; font-weight: 600; color: var(--c-header-sub);
  text-transform: uppercase; letter-spacing: 0.08em;
}
/* frankysweb.de .site-description: 15px, weight 400 */
.site-header__claim { margin: var(--sp-2) 0 0; color: var(--c-header-sub); font-size: 15px; font-weight: 400; }

/* --- Navigation (.main-navigation) --- */
.site-nav { background: var(--c-nav-bg); }
.site-nav .wrap { display: flex; flex-wrap: wrap; padding: 0 var(--sp-gutter); }
.site-nav__link {
  display: block; padding: 13px 20px; color: var(--c-nav-fg); font-size: 15px;
}
.site-nav__link:hover { text-decoration: none; background: var(--c-nav-hover-bg); color: var(--c-white); }
.site-nav__link.is-active { background: var(--c-nav-active-bg); color: var(--c-white); font-weight: 600; }
.site-nav__spacer { flex: 1; }

/* --- Footer (.site-info) --- */
.site-footer { background: var(--c-footer-bg); color: var(--c-footer-fg); font-size: 13.5px; }
.site-footer .wrap {
  padding: 20px var(--sp-gutter); display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-2);
}
.site-footer a { color: var(--c-footer-fg); }
.site-footer a:hover { color: var(--c-utilbar-fg-hover); }

/* ---------- 5) Komponenten --------------------------------------------------- */

/* --- Card: die einzige Flächen-Komponente --- */
.card {
  background: var(--c-card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: var(--sp-card); margin-bottom: var(--sp-5);
}
.card > :last-child { margin-bottom: 0; }

/* --- Button: IMMER <button class="btn">. Zweitrangig: .btn--secondary. --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font: inherit; font-weight: 600; line-height: 1;
  height: var(--control-h); padding: 0 22px; cursor: pointer;
  color: var(--c-white); background: var(--c-primary);
  border: 1px solid var(--c-primary); border-radius: var(--radius);
}
.btn:hover {
  background: var(--c-primary-hover); border-color: var(--c-primary-hover);
  text-decoration: none; color: var(--c-white);
}
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn--secondary { color: var(--c-primary); background: var(--c-white); }
.btn--secondary:hover { color: var(--c-primary); background: var(--c-btn-secondary-hover-bg); }

/* --- Formular: aus spec.fields generiert, ein einziges Markup (partials/_tool_form.html) --- */
.tool-form { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: var(--sp-1); }
.field--wide { flex: 1 1 100%; }  /* mehrzeiliges Feld spannt die ganze Formularbreite */
.field > label { font-size: 13px; font-weight: 600; color: var(--c-text-muted); }
.field > input {
  font: inherit; line-height: 1.2; height: var(--control-h); padding: 0 12px; min-width: 280px;
  border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-white);
}
.field > textarea {
  font: 12px/1.45 var(--font-mono); padding: 10px 12px; width: 100%; resize: vertical;
  min-height: 220px;
  border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-white);
}
.field > input:focus, .field > textarea:focus {
  outline: 2px solid var(--c-focus); outline-offset: 0; border-color: var(--c-focus);
}

/* --- Badge: Status-Chip. .badge--info | --warn | --error | --ok --- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge--info  { background: var(--c-info-bg);  color: var(--c-info); }
.badge--warn  { background: var(--c-warn-bg);  color: var(--c-warn); }
.badge--error { background: var(--c-error-bg); color: var(--c-error); }
.badge--ok    { background: var(--c-ok-bg);    color: var(--c-ok); }

/* --- Ergebnis-Block (partials/_result.html, für JEDES Tool gleich) --- */
.result { margin-top: var(--sp-5); border-top: 1px solid var(--c-border-light); padding-top: var(--sp-4); }
.result__head { display: flex; align-items: center; gap: var(--sp-3); font-size: 15px; margin-bottom: var(--sp-3); }
.result__target { font-weight: 700; }

.findings { list-style: none; margin: var(--sp-4) 0 0; padding: 0; }
.finding {
  display: flex; gap: var(--sp-3); justify-content: space-between;
  padding: 10px var(--sp-3); border-radius: var(--radius); margin-bottom: var(--sp-2);
}
.finding > span { min-width: 0; overflow-wrap: anywhere; }
.finding__code { flex: none; }
.finding--ok    { background: var(--c-ok-bg); }
.finding--info  { background: var(--c-info-bg); }
.finding--warn  { background: var(--c-warn-bg); }
.finding--error { background: var(--c-error-bg); }
.finding__code { font-family: var(--font-mono); font-size: 12px; color: var(--c-text-muted); white-space: nowrap; }
.finding__detail { display: block; margin-top: 3px; font-size: 13px; color: var(--c-text-muted); }

/* --- Aufgelöster Record-Baum (partials/_result.html, für JEDES Tool mit .tree) --- */
.tree { margin-top: var(--sp-4); }
.tree__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.tree__root, .tree__children { list-style: none; margin: 0; padding: 0; }
.tree__children { margin-left: var(--sp-4); border-left: 2px solid var(--c-border-light); padding-left: var(--sp-3); }
.tree__node { margin: var(--sp-2) 0; }
.tree__summary {
  cursor: pointer; font-size: 14px; padding: 8px 10px;
  background: var(--c-surface-muted); border: 1px solid var(--c-border-light); border-radius: var(--radius);
  overflow-wrap: anywhere;  /* lange, umbruchlose Werte (Antispam-Header) nicht ausbrechen lassen */
}
.tree__node--warn  > .tree__item > .tree__summary { background: var(--c-warn-bg); border-color: var(--c-warn-border); }
.tree__node--error > .tree__item > .tree__summary { background: var(--c-error-bg); border-color: var(--c-error-border); }
.tree__detail { color: var(--c-text-muted); }
.tree__label { font-family: var(--font-mono); font-weight: 700; }
.tree__record {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  margin: var(--sp-2) 0 0 var(--sp-3); padding: var(--sp-3);
  background: var(--c-surface-muted); border: 1px solid var(--c-border-light); border-radius: var(--radius);
}
.tree__record code {
  flex: 1; font-family: var(--font-mono); font-size: 13px;
  white-space: pre-wrap; word-break: break-all;
}
.tree__copy { flex: none; height: auto; padding: 4px 10px; font-size: 12px; }

/* --- Fließtext + FAQ (Tool-Seiten, SEO-Content) --- */
.prose { max-width: 70ch; }
.prose p { margin: 0 0 var(--sp-3); }
.prose code { background: var(--c-surface-subtle); padding: 1px 5px; border-radius: 3px; }
.faq { margin: var(--sp-3) 0 0; max-width: 70ch; }
.faq dt { font-weight: 600; margin-top: var(--sp-3); }
.faq dd { margin: var(--sp-1) 0 0; color: var(--c-text); }

/* --- Werkzeug-Kacheln (Startseite) --- */
.hero h1 { margin-bottom: var(--sp-1); }
.tool-group__title {
  font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--c-text-muted); font-weight: 600; margin: var(--sp-5) 0 var(--sp-3);
}
.tool-group:first-of-type .tool-group__title { margin-top: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-3); }
.tool-tile {
  display: block; padding: var(--sp-4); background: var(--c-white);
  border: 1px solid var(--c-border-light); border-radius: var(--radius);
}
.tool-tile:hover { text-decoration: none; border-color: var(--c-border-hover); }
.tool-tile__name { display: block; color: var(--c-primary); font-size: 16px; font-weight: 700; margin-bottom: var(--sp-1); }
.tool-tile__summary { color: var(--c-text-muted); font-size: 13.5px; }

/* --- Breadcrumb --- */
.breadcrumb { font-size: 13px; margin-bottom: var(--sp-2); color: var(--c-text-muted); }

/* --- Ad-Slot (Sidebar + Banner) --- */
.ad-slot {
  border: 1px dashed var(--c-border-dashed); border-radius: var(--radius); background: var(--c-surface-faint);
  min-height: 250px; display: flex; align-items: center; justify-content: center;
  color: var(--c-placeholder-text); font-size: 13px; text-align: center; padding: var(--sp-3);
}
.ad-slot--banner { min-height: 90px; }
@media (min-width: 700px) { .ad-slot--banner { min-height: 120px; } }
.ad-slot--vertical { min-height: 600px; }

/* --- Notice: einzeiliger Hinweis (Laden, Fehler, leeres Ergebnis) --- */
.notice { color: var(--c-text-muted); font-size: 14px; margin-top: var(--sp-4); }

/* --- Pending: "läuft"-Zustand für async Werkzeuge (SMTP Test) --- */
.pending .notice { display: flex; align-items: center; gap: var(--sp-3); }
.spinner {
  width: 16px; height: 16px; flex: none;
  border: 2px solid var(--c-border-light);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* --- Styleguide --- */
.sg-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-4); }
.sg-label { font-family: var(--font-mono); font-size: 12px; color: var(--c-text-muted); }
.sg-label--spaced { margin-top: var(--sp-3); }

/* ---------- 6) Utilities (sparsam) ---------------------------------------- */
.muted { color: var(--c-text-muted); }
.stack > * + * { margin-top: var(--sp-4); }
