/*
Theme Name: Brnic Academic
Theme URI: https://www.uni-muenster.de/IDMI/
Author: Maxim Brnic (erstellt mit Claude)
Description: Persönliches akademisches Theme für Maxim Brnic – PostDoc in Didaktik der Mathematik, Universität Münster. Barrierefrei, wartungsarm, mit Zotpress-Integration für automatische Publikationslisten.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: brnic-academic
*/

/* ==========================================================================
   Schriften (selbst gehostet, DSGVO-konform)
   ========================================================================== */

@font-face {
  font-family: 'STIX Two Text';
  src: url('fonts/STIXTwoText-VF.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/AtkinsonHyperlegible-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('fonts/AtkinsonHyperlegible-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ==========================================================================
   Design-Tokens
   ========================================================================== */

:root {
  --paper: #F6F7F4;
  --card: #FFFFFF;
  --ink: #182E28;
  --muted: #4E6159;
  --board: #24493E;       /* Tafelgrün */
  --board-deep: #1B3A31;
  --chalk: #F4F2E7;
  --chalk-dim: rgba(244, 242, 231, 0.72);
  --accent: #C9932B;      /* Ocker – dekorativ */
  --accent-text: #8A5F10; /* Ocker – Textlinks, AA-Kontrast */
  --line: #D9DED6;
  --focus: #1455C0;

  --font-display: 'STIX Two Text', 'Times New Roman', Georgia, serif;
  --font-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;

  --maxw: 72rem;
  --maxw-text: 46rem;
  --radius: 6px;
}

/* ==========================================================================
   Basis
   ========================================================================== */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--ink); }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img { max-width: 100%; height: auto; }

::selection { background: var(--accent); color: var(--ink); }

/* Skip-Link (Barrierefreiheit) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.wrap-text { max-width: var(--maxw-text); margin: 0 auto; padding: 0 1.25rem; }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}
.site-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.site-brand .brand-mark {
  display: inline-block;
  width: 0.55em; height: 0.55em;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 0.45em;
  vertical-align: 6%;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}
.main-nav a {
  display: block;
  padding: 0.45rem 0.75rem;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.97rem;
  border-radius: var(--radius);
}
.main-nav a:hover { background: #EAEDE7; }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  background: var(--board);
  color: var(--chalk);
}

.nav-toggle { display: none; }

/* Sprachumschalter (DE/EN) */
.lang-switch {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.lang-switch:hover {
  border-color: var(--board);
  background: var(--board);
  color: var(--chalk);
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.45rem 0.8rem;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
  }
  .main-nav { display: none; width: 100%; }
  .main-nav.is-open { display: block; padding-bottom: 0.75rem; }
  .main-nav ul { flex-direction: column; }
  .site-header .wrap { flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
}

/* ==========================================================================
   Hero (Tafel) – Signatur: Baumdiagramm
   ========================================================================== */

.hero {
  background: linear-gradient(160deg, var(--board) 0%, var(--board-deep) 100%);
  color: var(--chalk);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 2.5rem;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.hero h1 { color: var(--chalk); margin-bottom: 0.35em; }
.hero .hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chalk-dim);
  margin-bottom: 1rem;
}
.hero .hero-sub {
  font-size: 1.15rem;
  color: var(--chalk-dim);
  max-width: 34rem;
}
.hero .hero-actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.97rem;
}
.btn-chalk { background: var(--chalk); color: var(--board-deep); }
.btn-chalk:hover { background: #fff; color: var(--board-deep); }
.btn-outline { border: 1.5px solid var(--chalk-dim); color: var(--chalk); }
.btn-outline:hover { border-color: var(--chalk); color: var(--chalk); }
.btn-solid { background: var(--board); color: var(--chalk); }
.btn-solid:hover { background: var(--board-deep); color: var(--chalk); }

.hero-figure { display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }
.hero-photo {
  width: 14rem; height: 14rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--chalk-dim);
}
.hero-monogram {
  width: 14rem; height: 14rem;
  border-radius: 50%;
  border: 3px solid var(--chalk-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--chalk);
}

/* Projekt-Logos (Forschungsseite, optional über den Customizer) */
.project-logo {
  display: block;
  max-height: 3.25rem;
  max-width: 11rem;
  width: auto;
  margin-bottom: 0.6rem;
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-top: 3rem; padding-bottom: 3rem; }
  .hero-figure { order: -1; }
  .hero-photo, .hero-monogram { width: 10rem; height: 10rem; }
  .hero-monogram { font-size: 2.5rem; }
}

/* ==========================================================================
   Inhaltsbereiche
   ========================================================================== */

.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-top: 0; }
.card .card-rule {
  width: 2.25rem; height: 3px;
  background: var(--accent);
  border: none;
  margin: 0 0 1rem;
}

/* Seitenkopf für Unterseiten */
.page-head {
  background: var(--board);
  color: var(--chalk);
  padding: 2.75rem 0;
}
.page-head h1 { color: var(--chalk); margin: 0; }
.page-head .page-head-sub { color: var(--chalk-dim); margin: 0.5rem 0 0; max-width: 40rem; }

/* Tabellen (Vita, Projekte) */
.vita-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2.5rem;
}
.vita-table th, .vita-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.vita-table th { font-weight: 700; white-space: nowrap; width: 11rem; color: var(--muted); font-variant-numeric: tabular-nums; }
caption { text-align: left; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; padding-bottom: 0.6rem; }

@media (max-width: 600px) {
  .vita-table th { width: auto; display: block; padding-bottom: 0; border-bottom: none; }
  .vita-table td { display: block; padding-top: 0.15rem; }
}

/* Publikationen */
.pub-section { margin-bottom: 2.75rem; }
.pub-section h2 {
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.2rem;
}
.pub-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.pub-list li {
  padding: 0.85rem 0 0.85rem 1.4rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.pub-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 1.45rem;
  width: 0.5rem; height: 0.5rem;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
}
.pub-year {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--muted);
  margin: 2rem 0 0.25rem;
}

.notice-setup {
  background: #FBF3E2;
  border: 1px solid #E4CD96;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

/* Zotpress-Ausgabe ans Theme anpassen */
.zp-Zotpress { font-size: 1rem; }
.zp-Zotpress .zp-Entry { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }

/* Kontakt */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.contact-grid address { font-style: normal; }
.profile-links { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.profile-links li { padding: 0.3rem 0; }

/* Inhalt aus dem WordPress-Editor */
.entry-content { max-width: var(--maxw-text); }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--board-deep);
  color: var(--chalk-dim);
  margin-top: 4rem;
  padding: 2.5rem 0 2rem;
  font-size: 0.95rem;
}
.site-footer a { color: var(--chalk); }
.site-footer .wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
}
.site-footer h3 { color: var(--chalk); font-size: 1.05rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 0.2rem 0; }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(244, 242, 231, 0.18);
  font-size: 0.85rem;
}

/* ==========================================================================
   Druckansicht (z. B. Vita oder Publikationsliste ausdrucken)
   ========================================================================== */

@media print {
  .site-header, .site-footer, .hero-actions, .nav-toggle, .skip-link, .notice-setup {
    display: none !important;
  }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-head { background: none; color: #000; padding: 0 0 1rem; }
  .page-head h1, .page-head .page-head-sub { color: #000; }
  .hero { background: none; color: #000; }
  .hero h1, .hero .hero-sub, .hero .hero-eyebrow { color: #000; }
  a { color: #000; text-decoration: none; }
  /* In Fließtexten die Ziel-URL mit ausdrucken (in der Publikationsliste
     steht die DOI-URL bereits als Linktext – dort nicht doppeln) */
  .entry-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
  .card { border: 1px solid #999; break-inside: avoid; }
  .vita-table th, .vita-table td { border-bottom: 1px solid #999; }
  .pub-list li { break-inside: avoid; }
}
