/*
Theme Name: TS Sovereign 2026
Theme URI: https://thorstenschiller.com
Description: Zero-Bloat, semantisches WordPress-Theme für GEO-Souveränität und KI-Lesbarkeit. Kein jQuery, kein Bloat, 0 KB JS.
Version: 1.2.0
Author: OWL for Thorsten Schiller
Author URI: https://thorstenschiller.com
Text Domain: ts-sovereign
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: Proprietary
*/

/* ============================================================
   0. LOKALER FONT — Inter (WOFF2, 35 KB total)
   ============================================================ */
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-v12-latin-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('assets/fonts/inter-v12-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   1. VARIABLES
   ============================================================ */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg:           #ffffff;
  --bg-alt:       #fefefe;
  --text:         #0a0a0a;
  --muted:        #0a0a0a;
  --border:       #35a29a;
  --h1-color:     #35a29a;
  --h3-color:     #35a29a;
  --primary:      #35a29a;
  --primary-hover:#2e948c;
  --s-xs: 0.5rem;
  --s-s:  1rem;
  --s-m:  2rem;
  --s-l:  4rem;
  --max-width: 75ch;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   2. BASE RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   3. LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--s-s);
}

/* ============================================================
   3a. GUTENBERG ALIGN WIDE / FULL
   ============================================================ */

/* --- Gutenberg Core Layout --- */

/* Standard-Breite: alle Direkt-Kinder von article/main */
article > *:not(.alignfull):not(.alignwide) {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Align Wide: breiter als Content */
.alignfull {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  border-radius: 0;
}

.alignwide {
  max-width: 1100px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Inhalt in .alignfull: auf Content-Breite begrenzen und zentrieren */
.alignfull > *:not(.alignfull):not(.alignwide) {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.wp-block-group.alignwide,
.wp-block-image.alignwide,
.wp-block-columns.alignwide {
  max-width: 1100px;
  width: 100%;
}

.wp-block-group.alignfull {
  width: 100vw;
  max-width: 100vw;
}

.alignfull img,
.alignwide img {
  border-radius: 4px;
}

@media (min-width: 769px) {
  .alignwide {
    max-width: 90ch;
  }
}

/* ============================================================
   3b. WP BLOCK CONTAINER LAYOUT (dynamische Hash-Klassen)

   WordPress generiert zufaellige Hash-Suffixe fuer is-layout-
   Klassen. Wir matchen mit [class*="praefix"] Selektoren.
   ============================================================ */

/* Columns: kein Wrap — Spalten bleiben nebeneinander */
[class*="wp-container-core-columns-is-layout-"] {
  flex-wrap: nowrap;
}

/* Group: zentriert, verschiedene Breiten */
[class*="wp-container-core-group-is-layout-"] > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 75%;
  margin-left: auto !important;
  margin-right: auto !important;
}
[class*="wp-container-core-group-is-layout-"] > .alignwide {
  max-width: 75%;
}
[class*="wp-container-core-group-is-layout-"] .alignfull {
  max-width: none;
}

/* Group: Margin-Reset fuer direkte Kinder */
[class*="wp-container-core-group-is-layout-"] > * {
  margin-block-start: 0;
  margin-block-end: 0;
}
[class*="wp-container-core-group-is-layout-"] > * + * {
  margin-block-start: 0;
  margin-block-end: 0;
}

/* Buttons: zentriert */
[class*="wp-container-core-buttons-is-layout-"] {
  justify-content: center;
}

/* Column: Margin-Reset fuer direkte Kinder */
[class*="wp-container-core-column-is-layout-"] > * {
  margin-block-start: 0;
  margin-block-end: 0;
}
[class*="wp-container-core-column-is-layout-"] > * + * {
  margin-block-start: 0;
  margin-block-end: 0;
}

/* ============================================================
   4. TYPOGRAFIE
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  margin-top: var(--s-l);
  margin-bottom: var(--s-s);
  hyphens: none;
  -webkit-hyphens: none;
  word-break: normal;
}
h1 { font-size: 2.5rem; color: var(--h1-color); margin-top: var(--s-m); }
h2 { font-size: 1.85rem; color: var(--text); border-bottom: 2px solid var(--border); padding-bottom: var(--s-xs); }
h3 { font-size: 1.4rem; color: var(--h3-color); }
h4 { font-size: 1.2rem; color: var(--text); }

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
  overflow-wrap: break-word;
  word-break: break-word;
}
a:hover, a:focus { color: var(--primary-hover); }

p, li { font-size: 1.05rem; }
p { margin-bottom: var(--s-s); }

/* Fliesstext: Silbentrennung */
p, li, td, th, blockquote, figcaption, address {
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

/* Content Stack */
article > * + * { margin-top: var(--s-m); }

strong, b { font-weight: 700; }
em, i { font-style: italic; }
small { font-size: 0.85rem; color: var(--muted); }

blockquote {
  border-left: 4px solid var(--border);
  padding-left: var(--s-s);
  margin: var(--s-m) 0;
  color: var(--muted);
  font-style: italic;
}

/* Bilder in Zitaten: rund */
blockquote img,
.wp-block-quote img,
.ts-geo-cite-box blockquote img {
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  max-width: 120px;
  height: auto;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}
pre { background: var(--bg-alt); padding: var(--s-s); border-radius: 6px; overflow-x: auto; margin: var(--s-m) 0; }
pre code { padding: 0; background: none; }
hr { border: none; border-top: 1px solid var(--border); margin: var(--s-l) 0; }

/* ============================================================
   4a. POST HERO IMAGE (vor H1)
   ============================================================ */
.post-hero {
  margin: 0 0 var(--s-m) 0;
  border-radius: 4px;
  overflow: hidden;
}
.post-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

/* ============================================================
   4b. BILDER IM CONTENT
   ============================================================ */
article img,
.wp-block-image img,
article picture img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Mobile: Bilder immer 100% */
@media (max-width: 768px) {
  article img,
  .wp-block-image img,
  .wp-block-image.alignleft img,
  .wp-block-image.alignright img,
  article img.alignleft,
  article img.alignright {
    width: 100%;
    max-width: 100%;
    float: none;
    margin-left: 0;
    margin-right: 0;
  }
  .alignleft, .alignright {
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Mobile: Lange Links umbrechen */
  article a, main a {
    overflow-wrap: anywhere;
    word-break: break-word;
    display: inline;
  }

  /* Mobile: Spalten untereinander */
  .wp-block-columns {
    flex-direction: column;
  }
}

/* ============================================================
   4c. WORDPRESS BLOCK COLORS & BACKGROUNDS
   ============================================================ */
.has-primary-background-color   { background-color: var(--primary) !important; }
.has-secondary-background-color { background-color: var(--text) !important; }
.has-accent-background-color    { background-color: var(--h3-color) !important; }
.has-bg-background-color        { background-color: var(--bg-alt) !important; }
.has-white-background-color     { background-color: #ffffff !important; }
.has-primary-color              { color: var(--primary) !important; }
.has-secondary-color            { color: var(--text) !important; }
.has-accent-color               { color: var(--h3-color) !important; }
.has-bg-color                   { color: var(--bg-alt) !important; }
.has-white-color                { color: #ffffff !important; }

/* ============================================================
   4d. WORDPRESS BUTTONS
   ============================================================ */
.wp-block-button .wp-block-button__link {
  display: inline-block;
  padding: var(--s-xs) var(--s-m);
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  color: #ffffff;
}
.wp-block-button .wp-block-button__link:not(.has-background) {
  background-color: var(--primary);
  border-color: var(--primary);
}
.wp-block-button .wp-block-button__link:not(.has-background):hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}
.wp-block-button .wp-block-button__link.has-background:hover {
  opacity: 0.85;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--primary);
  color: #ffffff;
}

/* ============================================================
   5. CITE-ME & E-E-A-T BOX
   ============================================================ */
.ts-geo-cite-box {
  background-color: var(--bg-alt);
  border-left: 4px solid var(--h1-color);
  padding: var(--s-s) var(--s-m);
  margin: var(--s-m) 0;
  border-radius: 0 8px 8px 0;
}
.ts-geo-cite-box small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: var(--s-xs);
}
.ts-geo-cite-box blockquote {
  margin: 0; padding: 0; border: none;
  font-size: 1.15rem; font-weight: 500; font-style: normal; color: var(--text);
}
.ts-geo-cite-box .citation-actions {
  margin-top: var(--s-s);
  display: flex;
  gap: var(--s-xs);
  flex-wrap: wrap;
}
.ts-geo-cite-box .btn-copy {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: var(--s-xs) var(--s-s);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
}
.ts-geo-cite-box .btn-copy:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.ts-author-bridge { font-size: 0.95rem; color: var(--muted); }
.ts-author-bridge a { font-weight: 600; }

/* ============================================================
   6. NAVIGATION
   ============================================================ */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-s) 0;
}
nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--s-s);
  align-items: center;
}
nav a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text);
  transition: color var(--transition);
}
nav a:hover, nav a:focus { color: var(--primary); }

/* Brand: Logo + Titel + Beschreibung */
nav .brand {
  display: flex;
  align-items: center;
  gap: var(--s-s);
}
nav .brand .logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
nav .brand .logo-link img {
  max-height: 40px;
  width: auto;
  display: block;
}
nav .brand .site-title-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
nav .brand .site-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--h1-color);
  line-height: 1.2;
}
nav .brand .site-description {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.2;
}

/* Hamburger — nur auf Mobile sichtbar */
.menu-trigger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--s-xs);
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}
.hamburger, .hamburger::before, .hamburger::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition);
  position: relative;
}
.hamburger::before { content: ''; position: absolute; left: 0; top: -6px; }
.hamburger::after  { content: ''; position: absolute; left: 0; top: 6px; }

/* Close-Button (X) */
.menu-close { display: none; }
.menu-close button {
  background: none;
  border: 2px solid var(--border);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.menu-close button:hover {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

/* Popover Navigation — Desktop */
.nav-links {
  margin: 0; padding: 0; border: none;
  background: transparent; position: static;
  display: flex; gap: var(--s-s); overflow: visible;
}

/* Desktop: Popover deaktivieren */
@media (min-width: 769px) {
  .nav-links[popover] {
    display: flex; position: static; inset: auto;
    width: auto; height: auto; padding: 0;
    background: transparent; overflow: visible;
  }
  .nav-links[popover]::backdrop { display: none; }
}

/* Mobile: Popover Fullscreen */
@media (max-width: 768px) {
  .menu-trigger { display: flex; }

  .nav-links[popover] {
    position: fixed; inset: 0;
    width: 100%; height: 100dvh; max-height: 100dvh;
    margin: 0; padding: var(--s-l) var(--s-m);
    background: var(--bg); box-shadow: none;
    overflow-y: auto;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform-origin: top right;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
  }
  .nav-links[popover]:not(:popover-open) {
    opacity: 0; transform: scale(0.95); pointer-events: none;
  }
  .nav-links[popover]:popover-open { opacity: 1; transform: scale(1); }
  .nav-links[popover]::backdrop {
    background: rgba(30, 64, 175, 0.15);
    backdrop-filter: blur(3px);
  }
  .nav-links[popover] li { width: 100%; }
  .nav-links[popover] a {
    display: block; padding: var(--s-s) 0;
    font-size: 1.25rem; border-bottom: 1px solid var(--border);
  }
  .menu-close { display: block; margin-bottom: var(--s-s); }
}

/* ============================================================
   7. HEADER
   ============================================================ */
header {
  background: var(--bg);
}

/* ============================================================
   7b. PERSON / AUTHOR SECTION (#person)
   ============================================================ */
.person-section {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: var(--s-l) 0;
  margin-top: var(--s-l);
}
.person-inner {
  display: flex;
  align-items: center;
  gap: var(--s-m);
}
.person-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.person-info {
  flex: 1;
}
.person-name {
  font-size: 1.2rem;
  color: var(--h1-color);
  display: block;
  margin-bottom: var(--s-xs);
}
.person-description {
  color: var(--muted);
  margin-bottom: var(--s-xs);
}
.person-expertise {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs);
}
.expertise-tag {
  font-size: 0.8rem;
  padding: 0.15em 0.6em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}
@media (max-width: 768px) {
  .person-inner { flex-direction: column; text-align: center; }
  .person-expertise { justify-content: center; }
}

/* ============================================================
   8. MAIN / ARTICLE
   ============================================================ */
main { min-height: 60vh; padding: var(--s-m) 0; }
article header h1 { margin-bottom: var(--s-xs); }
article header time { font-size: 0.9rem; color: var(--muted); }
.article-meta {
  display: flex; gap: var(--s-s);
  font-size: 0.85rem; color: var(--muted);
  margin-bottom: var(--s-s); flex-wrap: wrap;
}

/* ============================================================
   9. FOOTER
   ============================================================ */
footer[role="contentinfo"] {
  border-top: 1px solid var(--border);
  padding: var(--s-l) 0 var(--s-m);
  margin-top: var(--s-l);
  font-size: 0.9rem;
  color: var(--muted);
  width: 100%;
}
footer[role="contentinfo"] .container {
  max-width: 1100px;
}
footer[role="contentinfo"] a { color: var(--muted); text-decoration: none; }
footer[role="contentinfo"] a:hover { color: var(--primary); text-decoration: underline; }
footer[role="contentinfo"] ul { list-style: none; padding: 0; }
footer[role="contentinfo"] li { margin-bottom: var(--s-xs); }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-m);
  margin-bottom: var(--s-m);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--s-s);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-s);
}
.footer-bottom p { margin: 0; }

/* Widgets im Footer */
footer .widget { margin-bottom: var(--s-m); }
footer .widget h3 { color: var(--text); font-size: 1rem; margin-bottom: var(--s-xs); }
footer .widget_nav_menu ul { list-style: none; padding: 0; }
footer .widget_nav_menu li { margin-bottom: var(--s-xs); }
footer .widget_nav_menu a { color: var(--muted); text-decoration: none; }
footer .widget_nav_menu a:hover { color: var(--primary); }

/* ============================================================
   10. CITATION POPOVER
   ============================================================ */
.citation-popover {
  margin: auto; position: fixed; inset: 0;
  width: min(500px, 90vw); max-height: 80dvh;
  padding: var(--s-m); border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
  animation: popover-in 0.15s ease-out;
}
@keyframes popover-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.citation-popover::backdrop {
  background: rgba(30, 64, 175, 0.15);
  backdrop-filter: blur(3px);
}
.citation-popover p { margin-bottom: var(--s-xs); }
.citation-popover output {
  display: block; background: var(--bg-alt);
  border-radius: 4px; padding: var(--s-s); margin-top: var(--s-xs);
}
.citation-popover code {
  background: none; padding: 0; font-size: 0.9rem;
  line-height: 1.6; word-break: break-word; white-space: pre-wrap;
}

/* ============================================================
   11. SKIP LINK
   ============================================================ */
.skip-link {
  position: absolute; top: -100%; left: var(--s-s);
  background: var(--h1-color); color: var(--bg);
  padding: var(--s-xs) var(--s-s); z-index: 1000;
  border-radius: 4px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s-s); }

/* ============================================================
   12. ACCESSIBILITY
   ============================================================ */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ============================================================
   13. SCROLL TO TOP
   ============================================================ */
#scroll-top {
  display: none;
  position: fixed; bottom: var(--s-s); right: var(--s-s);
  z-index: 99; font-size: 1.25rem; line-height: 1;
  border: 2px solid var(--border); outline: none;
  background: var(--bg); color: var(--text);
  cursor: pointer; padding: 12px 14px;
  border-radius: 50%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: all var(--transition);
  text-decoration: none;
}
#scroll-top:hover {
  background: var(--primary); color: var(--bg);
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
body.is-scrolled #scroll-top { display: block; }

/* ============================================================
   14. PRINT
   ============================================================ */
@media print {
  header { position: static; }
  nav, .ts-geo-cite-box .citation-actions, footer[role="contentinfo"], #scroll-top { display: none; }
  body { font-size: 12pt; color: #000; }
  a { color: #000; }
 }

 /* ============================================================
  15. UTILITY
  ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-s { margin-top: var(--s-s); }
.mt-m { margin-top: var(--s-m); }
.mt-l { margin-top: var(--s-l); }
.mb-s { margin-bottom: var(--s-s); }
.mb-m { margin-bottom: var(--s-m); }
.mb-l { margin-bottom: var(--s-l); }
.hidden  { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }



.has-text-align-center {text-align: center !important}

.is-style-rounded  {border-radius: 50%}