/*
Theme Name: Quanten Retro
Description: Modernes Retro-Theme für quanten.de – lila/schwarze Navigation, Formel-Tapete, mobil optimiert. Schriften lokal eingebunden (DSGVO-freundlich).
Version: 2.2
Author: quanten.de
Text Domain: quanten-retro
Requires at least: 6.0
Requires PHP: 7.4
*/

/* Schriften: siehe fonts.css (lokal eingebettet, keine Google-Server) */

/* ---------- Tokens ---------- */
/* Layout: schwarze Kopfleiste mit lila Streifen-Signet, Unterleiste mit orangem Aktiv-Reiter, Formel-Tapete; Inhalt als helle Karte, Info-Kästen rechts */
:root {
  --purple: #6a2bb8;
  --purple-deep: #24104a;
  --purple-hi: #8150d6;
  --purple-tint: #f3eefb;
  --orange: #f7a23a;
  --ink: #16131d;
  --muted: #5a5566;
  --line: #dcd6e8;
  --wall: #ebe9f0;
  --paper: #ffffff;
  --black: #0b0a0f;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --wrap: 1180px;
  --formulas: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='620' height='270'><g font-family='Arial,sans-serif' font-size='26' fill='%23000'><text x='10' y='40'>dU=dq+dw</text><text x='250' y='40'>E=mc²</text><text x='390' y='40'>F=ṗ</text><text x='490' y='40'>S=k lnW</text><text x='60' y='110'>HΨ=EΨ</text><text x='230' y='110'>S=k lnW</text><text x='420' y='110'>dU=dq+dw</text><text x='0' y='180'>F=ṗ</text><text x='120' y='180'>E=hν</text><text x='290' y='180'>HΨ=EΨ</text><text x='470' y='180'>E=mc²</text><text x='40' y='250'>S=k lnW</text><text x='230' y='250'>F=ṗ</text><text x='350' y='250'>dU=dq+dw</text><text x='540' y='250'>HΨ=EΨ</text></g></svg>");
  --formulas-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='620' height='270'><g font-family='Arial,sans-serif' font-size='26' fill='%23fff'><text x='10' y='40'>dU=dq+dw</text><text x='250' y='40'>E=mc²</text><text x='390' y='40'>F=ṗ</text><text x='490' y='40'>S=k lnW</text><text x='60' y='110'>HΨ=EΨ</text><text x='230' y='110'>S=k lnW</text><text x='420' y='110'>dU=dq+dw</text><text x='0' y='180'>F=ṗ</text><text x='120' y='180'>E=hν</text><text x='290' y='180'>HΨ=EΨ</text><text x='470' y='180'>E=mc²</text><text x='40' y='250'>S=k lnW</text><text x='230' y='250'>F=ṗ</text><text x='350' y='250'>dU=dq+dw</text><text x='540' y='250'>HΨ=EΨ</text></g></svg>");
  --stripes: repeating-linear-gradient(90deg, var(--purple) 0 4px, transparent 4px 7px);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wall); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.65; position: relative; }
body::before { content: ""; position: fixed; inset: 0; background-image: var(--formulas); opacity: .045; pointer-events: none; z-index: -1; }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; text-wrap: balance; color: var(--ink); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 20px; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; clip: auto; width: auto; height: auto; background: var(--orange); color: var(--black); padding: 8px 12px; z-index: 100; }

/* ---------- Kopfbereich ---------- */
.site-header { background: var(--black); color: #fff; position: sticky; top: 0; z-index: 50; }
.admin-bar .site-header { top: 32px; }
.stripe-band { height: 6px; background: repeating-linear-gradient(90deg, var(--purple) 0 5px, var(--black) 5px 9px); }
.bar { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.01em; flex: none; }
.logo:hover { color: #fff; }
.logo .mark { width: 26px; height: 26px; background: var(--stripes); border-radius: 0 0 14px 14px; }
.logo .tld { color: var(--orange); }

.site-nav { display: flex; align-items: center; gap: 8px; flex: 1; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.menu-main a { display: block; color: #fff; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 15.5px; padding: 8px 14px; border-radius: 6px; }
.menu-main a:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu-main .current-menu-item > a, .menu-main .current_page_item > a { background: var(--purple); }
.menu-extra { margin-left: auto !important; }
.menu-extra a { display: block; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--black); background: var(--orange); padding: 8px 16px; border-radius: 999px; }
.menu-extra a:hover { background: #fff; color: var(--black); }

.subbar { background: var(--purple); }
.subbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.subnav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.subnav a { display: block; color: #fff; text-decoration: none; font-size: 14.5px; padding: 9px 14px; }
.subnav a:hover { background: rgba(0,0,0,.18); color: #fff; }
.subnav .current-menu-item > a, .subnav .current_page_item > a { background: var(--orange); color: var(--black); font-weight: 600; }
.privacy { color: rgba(255,255,255,.8); font-size: 13px; white-space: nowrap; }
.privacy:hover { color: #fff; }

.menu-toggle { display: none; margin-left: auto; background: none; border: 2px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; padding: 7px 12px; font: 600 15px var(--display); cursor: pointer; align-items: center; gap: 8px; }
.menu-toggle .bars { width: 18px; height: 12px; background: linear-gradient(#fff 0 0) top/100% 2px no-repeat, linear-gradient(#fff 0 0) center/100% 2px no-repeat, linear-gradient(#fff 0 0) bottom/100% 2px no-repeat; }

/* ---------- Seitenkopf + Signatur-Linie ---------- */
.page-head { padding-block: 44px 8px; }
.page-head h1 { font-size: clamp(28px, 4.4vw, 42px); font-weight: 800; margin: 0 0 14px; letter-spacing: -.015em; }
.rule { height: 3px; background: var(--purple); position: relative; margin-bottom: 30px; border-radius: 2px; }
.rule::before { content: ""; position: absolute; left: 0; top: 0; width: 34px; height: 16px; border-radius: 0 0 18px 18px; background: repeating-linear-gradient(90deg, var(--purple) 0 3px, var(--black) 3px 6px); }
.meta { font-size: 14px; color: var(--muted); margin: -16px 0 24px; font-family: var(--mono); }

/* ---------- Inhalt + Seitenspalte ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; padding-bottom: 64px; align-items: start; }
.card { background: var(--paper); border-radius: 10px; box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px color-mix(in srgb, var(--purple-deep) 35%, transparent); padding: clamp(22px, 4vw, 44px); min-width: 0; }

.entry { max-width: 68ch; }
.entry > * { margin-top: 0; margin-bottom: 1.1em; }
.entry h2 { font-size: 26px; font-weight: 700; margin-top: 1.8em; }
.entry h3 { font-size: 20px; font-weight: 700; margin-top: 1.5em; color: var(--purple); }
.entry blockquote { margin-left: 0; padding: 6px 0 6px 20px; border-left: 4px solid var(--orange); font-size: 1.1em; font-weight: 600; }
.entry blockquote cite { display: block; font-weight: 400; font-size: 14px; color: var(--muted); font-style: normal; margin-top: 8px; }
.entry code { font-family: var(--mono); background: var(--purple-tint); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.entry pre { font-family: var(--mono); background: var(--purple-tint); padding: 14px; overflow-x: auto; border-radius: 6px; }
.entry table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.entry th, .entry td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.entry th { font-family: var(--display); }
.entry figure { margin-left: 0; margin-right: 0; }
.entry figcaption { font-size: 13px; color: var(--muted); }
.entry .alignright { float: right; margin: 0 0 1em 1.5em; }
.entry .alignleft { float: left; margin: 0 1.5em 1em 0; }
.entry .aligncenter { margin-left: auto; margin-right: auto; display: block; }
.entry::after { content: ""; display: table; clear: both; }
.entry ul, .entry ol { padding-left: 1.3em; }
.entry li { margin-bottom: .35em; }

.side { display: grid; gap: 22px; position: sticky; top: 140px; }
.box { background: var(--paper); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 0 var(--line); font-size: 15px; line-height: 1.55; padding-bottom: 14px; }
.box .box-title { margin: 0 0 12px; background: var(--black); color: #fff; font: 700 12.5px var(--display); letter-spacing: .09em; text-transform: uppercase; padding: 9px 14px; display: flex; align-items: center; gap: 10px; }
.box .box-title::before { content: ""; width: 16px; height: 12px; background: var(--stripes); flex: none; }
.box > :not(.box-title) { margin: 0 14px 8px; }
.box ul { padding-left: 18px; }
.box .formula { font-family: var(--mono); font-size: 24px; color: var(--purple); display: block; }

/* ---------- Seiten ohne Seitenspalte ---------- */
.layout.no-side { grid-template-columns: minmax(0, 1fr); }
.layout.no-side .card { max-width: 900px; }

/* ---------- Startseite: frei im Editor gebaut ---------- */
.front.entry { max-width: none; padding-bottom: 64px; }
.front > * { max-width: var(--wrap); margin: 0 auto 40px; padding-inline: 20px; }
.front > .alignfull { max-width: none; padding-inline: 0; }
.front > .alignwide { max-width: var(--wrap); }
.front > :first-child { margin-top: 0; }
.front > .alignfull > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; padding-inline: 20px; }
.front h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 800; }

/* ---------- Gestaltungs-Stile (im Editor unter „Stile“) ---------- */
/* Gruppe: Lila Bühne */
.is-style-quanten-buehne { background: var(--purple-deep); color: rgba(255,255,255,.9); position: relative; overflow: hidden; padding-block: clamp(40px, 6vw, 72px); }
.is-style-quanten-buehne::before { content: ""; position: absolute; inset: 0; background-image: var(--formulas-light); opacity: .07; pointer-events: none; }
.is-style-quanten-buehne::after { content: ""; position: absolute; right: -160px; top: -200px; width: 560px; height: 560px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--orange) 30%, transparent), transparent 65%); pointer-events: none; }
.is-style-quanten-buehne > * { position: relative; z-index: 1; }
.is-style-quanten-buehne h1, .is-style-quanten-buehne h2, .is-style-quanten-buehne h3 { color: #fff; }
.is-style-quanten-buehne h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 800; letter-spacing: -.02em; }
.is-style-quanten-buehne a:not(.wp-block-button__link) { color: #fff; }
.is-style-quanten-buehne a:not(.wp-block-button__link):hover { color: var(--orange); }
.is-style-quanten-buehne .visual figcaption { color: rgba(255,255,255,.7); }
/* Gruppe: Karten */
.is-style-quanten-karte { background: var(--paper); border-radius: 10px; padding: clamp(20px, 3vw, 32px); box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px color-mix(in srgb, var(--purple-deep) 35%, transparent); }
.is-style-quanten-dunkel { background: var(--black); color: rgba(255,255,255,.8); border-radius: 10px; padding: clamp(20px, 3vw, 32px); }
.is-style-quanten-dunkel h2, .is-style-quanten-dunkel h3 { color: #fff; }
.is-style-quanten-dunkel a { color: var(--orange); }
.is-style-quanten-karte > :first-child, .is-style-quanten-dunkel > :first-child { margin-top: 0; }
.is-style-quanten-karte > :last-child, .is-style-quanten-dunkel > :last-child { margin-bottom: 0; }
/* Spalten: Karten */
.wp-block-columns.is-style-quanten-karten { gap: 18px; }
.is-style-quanten-karten > .wp-block-column { background: var(--paper); border-radius: 10px; padding: 22px; box-shadow: 0 1px 0 var(--line); border-top: 4px solid var(--purple); transition: border-color .15s ease, box-shadow .15s ease; }
.is-style-quanten-karten > .wp-block-column:hover { border-top-color: var(--orange); box-shadow: 0 16px 30px -18px color-mix(in srgb, var(--purple-deep) 45%, transparent); }
.is-style-quanten-karten > .wp-block-column > :first-child { margin-top: 0; }
.is-style-quanten-karten > .wp-block-column > :last-child { margin-bottom: 0; }
.is-style-quanten-karten h3 { font-size: 19px; margin: 6px 0 8px; }
.is-style-quanten-karten p { font-size: 15.5px; color: var(--muted); }
/* Absätze */
p.is-style-quanten-kicker { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--purple); margin-bottom: 10px; }
.is-style-quanten-buehne p.is-style-quanten-kicker, .is-style-quanten-dunkel p.is-style-quanten-kicker { color: var(--orange); }
p.is-style-quanten-zitat { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2.4vw, 25px); line-height: 1.3; border-left: 4px solid var(--orange); padding-left: 16px; }
p.is-style-quanten-formel { font-family: var(--mono); font-size: clamp(22px, 3vw, 30px); color: var(--purple); line-height: 1.2; }
.is-style-quanten-buehne p.is-style-quanten-formel { color: var(--orange); }
/* Überschrift mit Quanten-Linie */
.is-style-quanten-linie { --g: 0px; position: relative; padding-bottom: 18px; }
.front > .is-style-quanten-linie { --g: 20px; }
.is-style-quanten-linie::after { content: ""; position: absolute; left: var(--g); right: var(--g); bottom: 0; height: 3px; background: var(--purple); border-radius: 2px; }
.is-style-quanten-linie::before { content: ""; position: absolute; left: var(--g); bottom: -13px; width: 34px; height: 16px; border-radius: 0 0 18px 18px; background: repeating-linear-gradient(90deg, var(--purple) 0 3px, var(--black) 3px 6px); }
.is-style-quanten-linie + * { margin-top: 32px; }
/* Buttons */
.wp-block-button.is-style-quanten-orange .wp-block-button__link { background: var(--orange); color: var(--black); border-radius: 999px; font: 700 15.5px var(--display); padding: 12px 22px; }
.wp-block-button.is-style-quanten-orange .wp-block-button__link:hover { background: #fff; }
.wp-block-button.is-style-quanten-rahmen .wp-block-button__link { background: transparent; color: inherit; border: 2px solid currentColor; border-radius: 999px; font: 700 15.5px var(--display); padding: 10px 20px; }
.wp-block-button.is-style-quanten-rahmen .wp-block-button__link:hover { color: var(--orange); }
/* Liste: Themenliste */
ul.is-style-quanten-themen { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 28px; }
ul.is-style-quanten-themen li { border-bottom: 1px dotted var(--purple-hi); padding: 10px 0; margin: 0; }
ul.is-style-quanten-themen a { font-weight: 600; text-decoration: none; }

/* Doppelspalt-Bild [doppelspalt] */
.visual { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.visual .screen { aspect-ratio: 4 / 5; max-height: 460px; background: color-mix(in srgb, var(--black) 85%, var(--purple-deep)); border-radius: 12px; position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
.visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.visual .label { position: absolute; left: 14px; top: 12px; font: 500 12px var(--mono); color: rgba(255,255,255,.6); letter-spacing: .06em; }
.visual figcaption { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.visual .screen { aspect-ratio: 4 / 5; }
.wp-block-buttons { gap: 12px; }

/* ---------- Beitragsliste ---------- */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--line); padding: 18px 0; }
.post-list li:first-child { padding-top: 0; }
.post-list h2 { font-size: 21px; margin: 0 0 6px; }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--purple); }
.post-list .meta { margin: 0 0 6px; }
.post-list p { margin: 0; color: var(--muted); font-size: 15.5px; }
.pagination { margin-top: 24px; font-family: var(--display); font-weight: 600; }
.pagination .page-numbers { padding: 4px 9px; }
.pagination .current { background: var(--purple); color: #fff; border-radius: 6px; }

/* ---------- Fußzeile ---------- */
.site-footer { background: var(--black); color: rgba(255,255,255,.7); font-size: 14px; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; padding-block: 30px; }
.foot .logo { font-size: 18px; }
.foot ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 0; margin: 0; }
.foot a { color: rgba(255,255,255,.8); text-decoration: none; }
.foot a:hover { color: var(--orange); }
.foot .formula { font-family: var(--mono); color: var(--orange); }

/* ---------- Tablet ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .visual .screen { aspect-ratio: 16 / 9; max-height: none; }
}

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .wrap { padding-inline: 16px; }
  .bar { min-height: 58px; gap: 12px; }
  .menu-toggle { display: inline-flex; }
  .site-nav, .subbar { display: none; }
  .site-header.menu-open .site-nav { display: block; padding-bottom: 12px; }
  .site-header.menu-open .subbar { display: block; }
  .bar { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .menu-main a { font-size: 17px; padding: 12px 12px; }
  .menu-extra { margin: 10px 0 0 !important; }
  .menu-extra a { display: inline-block; font-size: 16px; padding: 11px 20px; }
  .subbar .wrap { flex-direction: column; align-items: stretch; padding-block: 8px 14px; gap: 6px; }
  .subnav { flex-direction: column; }
  .subnav a { font-size: 16px; padding: 10px 12px; border-radius: 6px; }
  .privacy { padding: 6px 12px; }
  .site-header { position: sticky; }
  .admin-bar .site-header { top: 0; }
  .page-head { padding-block: 28px 4px; }
  .card { border-radius: 8px; }
  .front > *, .front > .alignfull > * { padding-inline: 16px; }
  .front > .is-style-quanten-linie { --g: 16px; }
  .entry .alignright, .entry .alignleft { float: none; margin: 0 0 1em; }
  body { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) { .is-style-quanten-karten > .wp-block-column { transition: none; } }
