/*
Theme Name: nextXC
Theme URI: https://nextxc.one
Description: Child-Theme für den nextXC-Shop. Bindet das nextXC Design System ein (Saira self-hosted, Design-Tokens, Morse-Logo).
Author: Björn Egger
Template: twentytwentyfive
Version: 0.1.0
Text Domain: nextxc
*/

/* Saira self-gehostet — bewusst NICHT über die Google-Fonts-CDN:
   das überträgt die IP der Besucher an Google und ist in Deutschland
   abmahnfähig (LG München I, 20.01.2022, 3 O 17493/20).
   Eine Variable-Font-Datei deckt 400–700 ab. Lizenz: SIL OFL 1.1. */
@font-face {
  font-family: "Saira";
  src: url("assets/fonts/saira-latin.woff2") format("woff2-variations"),
       url("assets/fonts/saira-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Tokens kommen aus assets/tokens.css (generiert, nicht von Hand ändern). */

/* --- Logo ---
   Das Logo liegt als Inline-SVG im Header, damit es auf Dunkel und Hell
   funktioniert. Bogen und Wortmarke folgen currentColor, das "XC" dieser
   Variablen. Zwei verschiedene Gelbtöne, weil #F5C800 auf Weiß nur 2,3:1
   Kontrast erreicht und damit unlesbar wird. Vorgabe aus dem Design System. */
:root {
  --logo-xc: #D9A300;
  /* Feste Farben auf dunklem Grund (Hero, CTA, Footer): in beiden Modi gleich. */
  --on-slab: #F4F5F6;
  --on-slab-soft: #E3E6E9;
  --on-slab-muted: #B5BBC1;
  --on-slab-faint: #8A9198;
  --hero-scrim: 36, 40, 44;
  --todo-bg: #FFF4CC;
  --on-status: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --logo-xc: #F5C800; }
}
:root[data-theme="dark"] { --logo-xc: #F5C800; }

.nx-logo-link { display: inline-flex; color: var(--ink); line-height: 0; }
.nx-logo { width: 132px; height: auto; display: block; }
.nx-logo-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
}

h1, h2, h3, h4 { font-family: var(--font-sans); color: var(--ink); }
h1 { font-size: 36px; line-height: 40px; font-weight: 700; }
h2 { font-size: 26px; line-height: 32px; font-weight: 600; }
h3 { font-size: 20px; line-height: 26px; font-weight: 600; }

a { color: var(--signal-text); }

/* Fokusring: 2 px mit 2 px Abstand, laut Design System */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* Auf dunklem Grund wäre der anthrazitfarbene Ring unsichtbar. */
:where(.nx-hero, .nx-cta, .nx-footer) { --focus: var(--signal); }
:where(a, button, input, select, textarea, summary, .wp-element-button):active { transform: translateY(1px); }

html, body { overflow-x: clip; }
h1, h2, h3 { text-wrap: balance; }

/* --- WooCommerce auf die Marke ziehen (nur das Nötigste) --- */

/* signal ist der Akzent: höchstens EINE gelbe Fläche pro Ansicht.
   Deshalb nur der Haupt-Button gelb, alles Weitere bleibt neutral. */
.wp-element-button,
.wc-block-components-button,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce #respond input#submit.alt {
  background-color: var(--signal);
  color: var(--anthracite);   /* Text auf Gelb immer anthracite, 9,3:1 */
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
}

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background-color: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
}

.woocommerce ul.products li.product,
.woocommerce div.product {
  background: var(--surface);
  border-radius: var(--radius-md);
}

.woocommerce .price { color: var(--ink); font-weight: 700; }

/* Germanized blendet Steuer-/Versandhinweise an den Preisen ein — klein und ruhig */
.wc-gzd-additional-info { color: var(--ink-muted); font-size: 14px; line-height: 20px; }

/* Fristen-/Statusfarben nie allein über Farbe transportieren (Design-System-Regel).
   Klassen stehen bereit, Text oder Symbol gehört immer dazu. */
.nx-status-ok       { color: var(--status-ok); }
.nx-status-due      { color: var(--status-due); }
.nx-status-overdue  { color: var(--status-overdue); }

/* --- Ratgeber-Inhalte ---
   Die Artikel kommen aus der alten Next.js-Seite, wo jedes Element seine eigenen
   Utility-Klassen trug. Hier stattdessen semantisches HTML plus diese Handvoll
   Klassen, damit die Texte im Block-Editor pflegbar bleiben. */

.nx-guide { max-width: 46rem; }
.nx-guide h2 { margin-top: var(--space-8); margin-bottom: var(--space-3); }
.nx-guide h3 { margin-top: var(--space-6); margin-bottom: var(--space-2); }
.nx-guide p, .nx-guide li { line-height: 26px; }
.nx-guide ul, .nx-guide ol { padding-left: 1.25rem; }
.nx-guide li { margin-top: var(--space-1); }

/* Vorspann unter der Überschrift */
.nx-lead { font-size: 18px; line-height: 28px; color: var(--ink-muted); }

/* Inhaltsverzeichnis */
.nx-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
}
.nx-toc > p { font-weight: 600; margin: 0 0 var(--space-2); }
.nx-toc ol { margin: 0; }

/* Hinweiskästen. Die Bedeutung steht immer im Text, nie nur in der Farbe. */
.nx-callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink-muted);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-4) 0;
}
.nx-callout > :first-child { margin-top: 0; }
.nx-callout > :last-child { margin-bottom: 0; }
.nx-callout--warn     { border-left-color: var(--status-due); }
.nx-callout--critical { border-left-color: var(--status-overdue); }
.nx-callout--ok       { border-left-color: var(--status-ok); }
.nx-callout__title { font-weight: 600; display: block; margin-bottom: var(--space-1); }

/* Tabellen müssen auf dem Handy scrollen dürfen, ohne die Seite breit zu machen */
.nx-table-wrap { overflow-x: auto; margin: var(--space-4) 0; }
.nx-table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 14px; }
.nx-table th, .nx-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.nx-table th { background: var(--surface); font-weight: 600; }
.nx-table tbody tr:last-child td { border-bottom: none; }

/* Häufige Fragen: natives <details>, kein JavaScript nötig */
.nx-faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  background: var(--surface);
}
.nx-faq summary { font-weight: 600; cursor: pointer; }
.nx-faq summary::marker { color: var(--ink-muted); }
.nx-faq details p { margin: var(--space-2) 0 0; }

/* Quellenangaben */
.nx-sources {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.nx-sources ol { padding-left: 1.25rem; }
.nx-sources li { margin-top: var(--space-1); color: var(--ink-muted); }

/* Handlungsaufforderung am Artikelende */
/* slab ist in beiden Modi dunkel, die Textfarbe darf deshalb nicht aus --ink
   kommen (das kippt im Hellmodus auf dunkel und wäre unlesbar). */
.nx-cta {
  background: var(--slab);
  color: var(--on-slab);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: var(--space-8) 0;
}
.nx-cta a:not(.wp-element-button) { color: var(--signal); }
.nx-cta p { margin-top: 0; }
.nx-cta .wp-element-button { margin-top: var(--space-2); }

.nx-meta { font-size: 14px; color: var(--ink-muted); }

/* Hero über die volle Breite. Auf großen Schirmen soll die Seite nicht als
   schmale Spalte in der Mitte stehen, deshalb randlos statt Kachel.
   Gleiche Begründung wie bei .nx-cta: der Grund ist in beiden Modi dunkel,
   die Textfarbe muss deshalb fest hell sein statt aus --ink zu kommen. */
.nx-hero {
  position: relative;
  color: var(--on-slab);
  padding-block: clamp(72px, 12vw, 160px);
  background: var(--slab) url("assets/img/hero-sky.webp") center / cover no-repeat;
  isolation: isolate;
}
/* Abdunkelung: links kräftig für den Text, rechts bleibt der Himmel offen.
   Ohne sie ist weißer Text auf dem hellen Wolkenbild nicht lesbar. */
.nx-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(var(--hero-scrim), .92) 0%, rgba(var(--hero-scrim), .78) 45%, rgba(var(--hero-scrim), .35) 100%);
}
.nx-hero h1 { color: var(--on-slab); font-size: clamp(44px, 6vw, 76px); line-height: 1.02; margin: 0; }
.nx-hero .wp-element-button { margin-top: var(--space-2); }

/* Zeilenlänge NICHT über max-width einzelner Absätze begrenzen.
   Das Constrained-Layout von WordPress zentriert begrenzte Elemente mit
   !important im Container, dann stehen Absätze eingerückt gegenüber den
   Überschriften. Die Lesebreite macht deshalb die Spalte selbst
   (contentSize 760px in theme.json), damit fluchten Überschrift und Text. */
.nx-hero p { color: var(--on-slab-soft); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; }

/* Abgesetztes Band über die volle Breite. Dient dazu, inhaltliche Wechsel
   sichtbar zu machen, etwa vom Gerät zur App. Ohne diesen Bruch liest sich
   die Startseite als eine durchgehende Spalte und der Themenwechsel geht unter. */
.nx-band {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding-block: var(--space-12);
  margin-block: var(--space-12);
}
.nx-band > :first-child { margin-top: 0; }

/* Kleine Vorzeile über einer Überschrift, zur schnellen Orientierung beim Scannen. */
.nx-eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--signal-text);
  margin-bottom: var(--space-1);
}

/* Zwei Angebote nebeneinander: links das Gerät, rechts die App.
   Die Startseite soll beides auf einen Blick trennen, die Tiefe liegt auf den
   Detailseiten. Unter 56rem untereinander, sonst wird es auf dem Handy zu eng. */
.nx-duo { display: grid; gap: var(--space-8); grid-template-columns: 1fr; margin: var(--space-12) 0; }
@media (min-width: 56rem) { .nx-duo { grid-template-columns: 1fr 1fr; } }
.nx-duo > div { display: flex; flex-direction: column; }
/* Überschrift steht oben, darunter erst Bild oder Kasten. */
.nx-duo h2 { margin-top: 0; margin-bottom: var(--space-3); }
.nx-duo p { margin-top: 0; }
.nx-duo img,
.nx-duo .nx-duo__liste { margin-bottom: var(--space-4); }
.nx-duo img { width: 100%; height: auto; border-radius: var(--radius-md); display: block; }
.nx-duo img + .wp-element-caption { margin-top: calc(var(--space-4) * -1 + var(--space-2)); margin-bottom: var(--space-4); }
.nx-duo .nx-duo__cta { margin-top: auto; padding-top: var(--space-4); }

/* Ersatz für ein Bild in der rechten Spalte, damit beide Seiten optisch tragen. */
.nx-duo__liste {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin: 0;
  list-style: none;
}
.nx-duo__liste li { margin: 0 0 var(--space-3); padding-left: 1.4rem; position: relative; }
.nx-duo__liste li:last-child { margin-bottom: 0; }
.nx-duo__liste li::before {
  content: "";
  position: absolute; left: 0; top: 0.55em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
}

/* --- Warteliste --- */
.nx-wl { margin: var(--space-6) 0 0; }
.nx-wl__label { display: block; font-weight: 600; margin-bottom: var(--space-2); }
.nx-wl__zeile { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.nx-wl__zeile input[type="email"] {
  flex: 1 1 16rem;
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.nx-wl__zeile button { white-space: nowrap; }
.nx-wl__select {
  display: block;
  width: 100%;
  max-width: 24rem;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.nx-wl__check {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  margin-top: var(--space-3);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-muted);
}
.nx-wl__check input { margin-top: var(--space-1); flex: none; }
/* Honigtopf: für Menschen unsichtbar, für Bots im Quelltext sichtbar.
   Bewusst nicht display:none, das erkennen manche Bots. */
.nx-wl__honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nx-wl__ok, .nx-wl__fehler {
  border-left: 4px solid var(--status-ok);
  background: var(--surface);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
}
.nx-wl__fehler { border-left-color: var(--status-overdue); }

/* Bildunterschriften ruhig halten */
.wp-element-caption { font-size: 14px; color: var(--ink-muted); margin-top: var(--space-2); }

/* Dreispaltiger Einstieg. Karten gleich hoch, Button unten bündig. */
.nx-cards { display: grid; gap: var(--space-4); grid-template-columns: 1fr; margin: var(--space-8) 0; }
@media (min-width: 48rem) { .nx-cards { grid-template-columns: repeat(3, 1fr); } }
.nx-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-6);
}
.nx-card h3 { margin-top: 0; }
.nx-card > :last-child { margin-top: auto; }

/* --- Entwurfs-Markierung in Rechtstexten ---
   Platzhalter [[ERGÄNZEN: …]] und Entwurfshinweise sollen beim Durchsehen
   ins Auge springen. Nur für Eingeloggte sichtbar hervorgehoben, damit eine
   versehentlich veröffentlichte Seite nicht wie ein Fehler aussieht. */
.logged-in .nx-todo {
  background: var(--todo-bg);
  border-left: 4px solid var(--status-due);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
}
.logged-in .nx-platzhalter {
  background: var(--status-overdue);
  color: var(--on-status);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  white-space: normal;
}

/* --- Bautagebuch --- */
/* Beiträge in der Übersicht deutlich voneinander trennen, sonst laufen sie
   zu einer Textwand zusammen. */
.nx-beitraege > li { list-style: none; }
.nx-beitraege {
  display: grid;
  gap: var(--space-12);
  padding: 0;
  margin: 0;
}
.nx-beitraege .wp-block-post-title { margin: var(--space-4) 0 var(--space-1); }
.nx-beitraege .wp-block-post-date { margin: 0 0 var(--space-3); }
.nx-beitraege .wp-block-post-featured-image img { border-radius: var(--radius-md); }
.nx-beitraege .wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: var(--space-2);
  font-weight: 600;
}

/* Urheberangabe unter Beiträgen: deutlich abgesetzt, aber nicht laut. */
.nx-urheber {
  margin-top: var(--space-12);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-muted);
}

/* Knöpfe ohne Ziel, solange die App offline ist (data-href = alter Link). */
.wp-element-button.nx-bald { cursor: default; opacity: .6; pointer-events: none; }

/* Gelbes Band für die Warteliste: die eine gelbe Fläche der Ansicht.
   Rollen innerhalb neu belegt, damit Text, Felder und Fokus in beiden Modi
   auf Gelb lesbar bleiben; der Knopf wird dafür anthrazit. */
.nx-band--signal {
  --ink: var(--anthracite);
  --ink-muted: var(--anthracite);
  --line: var(--anthracite);
  --surface: var(--paper);
  --focus: var(--anthracite);
  --signal-text: var(--anthracite);
  background: var(--signal);
  color: var(--anthracite);
  border-block: none;
}
.nx-band--signal .wp-element-button,
.nx-band--signal button { background-color: var(--anthracite); color: var(--paper); }
.nx-band--signal a { text-decoration: underline; }

/* Fußzeile: Farben über Tokens, Links als Zeile mit Abstand statt Mittelpunkten. */
.nx-footer { background: var(--anthracite); padding-block: var(--space-12); }
.nx-footer p { color: var(--on-slab); font-size: 14px; margin: 0; }
.nx-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); list-style: none; margin: 0; padding: 0; font-size: 14px; }
.nx-footer__links a { color: var(--on-slab-muted); }
.nx-footer__links--leise li { color: var(--on-slab-faint); }
