/*
Theme Name: Themenraum
Theme URI: https://example.com/themenraum
Author: Andreas Gutmann
Description: A Wikipedia-inspired WordPress theme with topic navigation, article focus and a hideable timeline.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: themenraum
*/

:root {
  --ink: #15232b;
  --muted: #718087;
  --line: #dce5e6;
  --paper: #f7faf8;
  --panel: #ffffff;
  --teal: #0d7775;
  --teal-dark: #075754;
  --orange: #e77f43;
  --yellow: #f2bd59;
  --shadow: 0 18px 45px rgba(23, 44, 48, 0.08);
  --radius-lg: 26px;
  --radius-md: 16px;
  --font-sans: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
button { font: inherit; }

.site-shell { min-height: 100vh; padding: 0 28px 28px; }

.site-header {
  position: relative;
  min-height: 245px;
  overflow: hidden;
  padding: 26px clamp(24px, 5vw, 76px) 40px;
  color: #fff;
  background: linear-gradient(118deg, #0b4f53 0%, #118482 53%, #85a54e 150%);
  border-radius: 0 0 34px 34px;
  isolation: isolate;
}

.site-header::before,
.site-header::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 50%;
}
.site-header::before { width: 610px; height: 610px; top: -445px; right: 7%; box-shadow: 0 0 0 42px rgba(255,255,255,.035), 0 0 0 84px rgba(255,255,255,.025); }
.site-header::after { width: 260px; height: 260px; right: -40px; bottom: -150px; border-color: rgba(242, 189, 89, .35); }

.header-inner, .content-grid, .timeline-inner { width: min(1440px, 100%); margin: 0 auto; }

.topline { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; color: var(--teal-dark); background: var(--yellow); border-radius: 11px; font-weight: 900; }
.header-meta { color: rgba(255,255,255,.7); font-size: 13px; letter-spacing: .04em; }

.hero-copy { max-width: 760px; margin-top: 54px; }
.eyebrow { margin: 0 0 10px; color: var(--yellow); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.site-title { margin: 0; font-family: var(--font-serif); font-size: clamp(42px, 6vw, 78px); font-weight: 400; letter-spacing: -.05em; line-height: .98; }
.site-description { max-width: 560px; margin: 17px 0 0; color: rgba(255,255,255,.78); font-size: 16px; }

.content-grid { display: grid; grid-template-columns: 265px minmax(0, 1fr); gap: clamp(24px, 5vw, 86px); padding: 66px 0 195px; }
.topic-sidebar { min-width: 0; }
.sidebar-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.sidebar-heading h2 { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.topic-count { color: var(--muted); font-size: 12px; }
.topic-list { margin: 0; padding: 0; list-style: none; }
.topic-item { border-top: 1px solid var(--line); }
.topic-item:last-child { border-bottom: 1px solid var(--line); }
.topic-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; color: var(--ink); background: transparent; border: 0; cursor: pointer; text-align: left; }
.topic-toggle:hover { color: var(--teal); }
.topic-name { font-size: 15px; font-weight: 650; }
.topic-plus { display: grid; flex: 0 0 23px; width: 23px; height: 23px; place-items: center; color: var(--teal); border: 1px solid currentColor; border-radius: 50%; font-size: 17px; font-weight: 400; line-height: 1; transition: transform .2s ease, color .2s ease, background .2s ease; }
.topic-item.is-open .topic-plus { color: #fff; background: var(--teal); transform: rotate(45deg); }
.topic-articles { display: none; margin: -3px 0 13px 13px; padding: 0 0 0 14px; border-left: 1px solid var(--line); list-style: none; }
.topic-item.is-open .topic-articles { display: block; }
.topic-article-link { display: block; padding: 5px 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.topic-article-link:hover, .topic-article-link[aria-current="page"] { color: var(--teal-dark); }
.topic-article-link[aria-current="page"] { font-weight: 700; }
.empty-topics { color: var(--muted); font-size: 14px; }

.article-column { min-width: 0; }
.article-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.article-intro h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(30px, 4vw, 48px); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; }
.article-intro p { max-width: 225px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; text-align: right; }
.article-card { overflow: hidden; background: var(--panel); border: 1px solid rgba(220, 229, 230, .9); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.article-card.has-thumbnail .article-body { padding-top: 36px; }
.article-visual { position: relative; min-height: 220px; overflow: hidden; background: linear-gradient(120deg, #b5d4c6, #f2d19c 65%, #da8c68); }
.article-visual::after { position: absolute; inset: 0; content: ""; background: linear-gradient(90deg, rgba(6, 65, 68, .34), transparent 60%); }
.article-visual img { display: block; width: 100%; height: 310px; object-fit: cover; }
.visual-label { position: absolute; z-index: 1; left: 30px; bottom: 26px; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.article-body { max-width: 840px; padding: 45px clamp(25px, 5vw, 65px) 50px; }
.article-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 15px; color: var(--teal); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.article-kicker span + span::before { margin-right: 10px; color: var(--line); content: "/"; }
.article-title { margin: 0; max-width: 770px; font-family: var(--font-serif); font-size: clamp(36px, 5vw, 66px); font-weight: 400; letter-spacing: -.055em; line-height: 1.01; }
.article-excerpt { max-width: 650px; margin: 25px 0 0; color: #4a5b60; font-size: 18px; line-height: 1.6; }
.article-content { max-width: 690px; margin-top: 37px; font-family: var(--font-serif); font-size: 18px; line-height: 1.8; }
.article-content > *:first-child { margin-top: 0; }
.article-content a { color: var(--teal-dark); text-decoration: underline; text-decoration-color: rgba(13,119,117,.35); text-underline-offset: 3px; }
.article-content h2, .article-content h3 { font-family: var(--font-sans); line-height: 1.2; }
.article-content blockquote { margin: 28px 0; padding: 4px 0 4px 24px; color: var(--teal-dark); border-left: 3px solid var(--yellow); font-size: 24px; font-style: italic; }
.article-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; margin-top: 40px; padding-top: 17px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.read-more { display: inline-flex; align-items: center; gap: 9px; color: var(--teal); font-weight: 750; }
.read-more::after { content: "→"; font-size: 17px; transition: transform .2s ease; }
.read-more:hover::after { transform: translateX(4px); }

.timeline-shell { position: fixed; z-index: 10; right: 28px; bottom: 28px; left: 28px; color: #fff; background: rgba(18, 48, 53, .97); border-radius: 22px; box-shadow: 0 18px 55px rgba(12, 36, 40, .2); transition: transform .3s ease, opacity .3s ease; }
.timeline-shell.is-hidden { transform: translateY(calc(100% + 34px)); opacity: 0; pointer-events: none; }
.timeline-inner { padding: 20px 25px 23px; }
.timeline-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.timeline-title { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.timeline-controls { display: flex; align-items: center; gap: 7px; }
.timeline-button { display: grid; width: 30px; height: 30px; place-items: center; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 50%; cursor: pointer; }
.timeline-button:hover { background: rgba(255,255,255,.2); }
.timeline-track { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; scrollbar-color: rgba(255,255,255,.35) transparent; }
.timeline-track::-webkit-scrollbar { height: 5px; }
.timeline-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,.35); border-radius: 5px; }
.timeline-card { display: flex; flex: 0 0 min(340px, 74vw); min-height: 74px; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; scroll-snap-align: start; }
.timeline-card:hover { background: rgba(255,255,255,.15); }
.timeline-date { display: flex; flex: 0 0 54px; height: 54px; flex-direction: column; align-items: center; justify-content: center; color: var(--teal-dark); background: var(--yellow); border-radius: 10px; font-size: 11px; font-weight: 800; line-height: 1.15; text-transform: uppercase; }
.timeline-date strong { font-size: 20px; }
.timeline-card-title { display: block; overflow: hidden; font-family: var(--font-serif); font-size: 17px; line-height: 1.18; text-overflow: ellipsis; }
.timeline-card-topic { display: block; margin-top: 4px; color: rgba(255,255,255,.6); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.show-timeline { position: fixed; z-index: 9; right: 38px; bottom: 30px; display: none; padding: 10px 16px; color: #fff; background: var(--teal-dark); border: 0; border-radius: 999px; box-shadow: var(--shadow); cursor: pointer; font-size: 12px; font-weight: 800; }
.show-timeline.is-visible { display: block; }

.no-results { padding: 50px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.site-footer { padding: 0 0 30px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 800px) {
  .site-shell { padding: 0 14px 14px; }
  .site-header { min-height: 230px; border-radius: 0 0 25px 25px; }
  .header-meta { display: none; }
  .hero-copy { margin-top: 46px; }
  .content-grid { grid-template-columns: 1fr; gap: 42px; padding-top: 40px; }
  .topic-sidebar { order: 2; }
  .article-column { order: 1; }
  .article-intro { display: block; }
  .article-intro p { margin-top: 11px; text-align: left; }
  .article-visual img { height: 230px; }
  .timeline-shell { right: 14px; bottom: 14px; left: 14px; }
  .show-timeline { right: 24px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Wikipedia-inspired editorial layer */
:root {
  --ink: #202122;
  --muted: #54595d;
  --line: #c8ccd1;
  --paper: #f8f9fa;
  --panel: #fff;
  --teal: #36c;
  --teal-dark: #0645ad;
  --orange: #36c;
  --yellow: #eaecf0;
  --shadow: none;
  --radius-lg: 0;
  --radius-md: 0;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

body { background: #fff; color: var(--ink); font-size: 14px; line-height: 1.6; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.site-shell { padding: 0; }

.site-header {
  min-height: 132px;
  padding: 18px 28px 24px;
  color: var(--ink);
  background: #eaecf0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  isolation: auto;
}
.site-header::before, .site-header::after { display: none; }
.header-inner, .content-grid, .timeline-inner { width: min(1320px, calc(100% - 56px)); }
.topline { align-items: center; }
.brand { gap: 10px; color: var(--ink); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.brand-mark { width: 28px; height: 28px; color: #fff; background: var(--ink); border-radius: 2px; font-size: 18px; }
.header-meta { color: var(--muted); font-size: 12px; letter-spacing: 0; }
.hero-copy { margin-top: 20px; }
.eyebrow { display: none; }
.site-title { font-size: clamp(34px, 5vw, 48px); font-weight: 400; letter-spacing: -.025em; line-height: 1.08; }
.site-description { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.content-grid { grid-template-columns: 220px minmax(0, 860px); gap: 42px; justify-content: start; padding: 34px 0 190px; }
.topic-sidebar { padding: 0 16px 18px 0; border-right: 1px solid var(--line); }
.sidebar-heading { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sidebar-heading h2 { color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.topic-count { font-size: 11px; }
.topic-item { border-top: 0; }
.topic-item:last-child { border-bottom: 0; }
.topic-toggle { gap: 8px; padding: 7px 4px; color: var(--teal); }
.topic-toggle:hover { color: var(--teal-dark); background: #eaecf0; text-decoration: underline; }
.topic-name { font-size: 14px; font-weight: 400; }
.topic-plus { display: inline; flex-basis: auto; width: auto; height: auto; color: inherit; border: 0; border-radius: 0; font-size: 16px; line-height: 1; }
.topic-item.is-open .topic-plus { color: inherit; background: transparent; transform: rotate(45deg); }
.topic-articles { margin: 0 0 7px 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.topic-article-link { padding: 3px 0; color: var(--teal); font-size: 13px; }
.topic-article-link:hover, .topic-article-link[aria-current="page"] { color: var(--teal-dark); }
.empty-topics { font-size: 13px; }

.article-intro { display: block; margin-bottom: 15px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.article-intro h2 { color: var(--ink); font-family: var(--font-serif); font-size: 30px; font-weight: 400; letter-spacing: 0; }
.article-intro p { max-width: none; margin: 3px 0 0; color: var(--muted); font-size: 13px; text-align: left; }
.article-card { overflow: visible; background: #fff; border: 0; border-radius: 0; box-shadow: none; }
.article-visual { min-height: 0; background: #eaecf0; }
.article-visual::after { display: none; }
.article-visual img { height: 260px; }
.visual-label { left: 14px; bottom: 12px; color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.article-body, .article-card.has-thumbnail .article-body { max-width: 760px; padding: 8px 0 40px; }
.article-kicker { gap: 7px; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.article-kicker a { color: var(--teal); }
.article-kicker span + span::before { margin-right: 7px; color: var(--line); }
.article-title { max-width: 760px; color: var(--ink); font-size: clamp(34px, 4.5vw, 52px); font-weight: 400; letter-spacing: -.02em; line-height: 1.08; }
.article-title a { color: inherit; }
.article-title a:hover { text-decoration: none; }
.article-excerpt { max-width: 680px; margin: 17px 0 0; color: var(--ink); font-size: 16px; line-height: 1.65; }
.article-content { max-width: 720px; margin-top: 25px; color: var(--ink); font-size: 16px; line-height: 1.75; }
.article-content a { color: var(--teal); text-decoration: underline; text-decoration-color: currentColor; text-underline-offset: 2px; }
.article-content h2, .article-content h3 { font-size: 22px; font-weight: 600; }
.article-content blockquote { margin: 20px 0; padding: 2px 0 2px 18px; color: var(--muted); border-left: 3px solid var(--line); font-size: 18px; }
.article-footer { margin-top: 26px; padding-top: 9px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.read-more { color: var(--teal); font-weight: 400; }
.read-more::after { font-size: 14px; }

.timeline-shell { right: 0; bottom: 0; left: 0; color: var(--ink); background: #f8f9fa; border-top: 1px solid var(--line); border-radius: 0; box-shadow: 0 -3px 12px rgba(0,0,0,.06); }
.timeline-inner { padding: 11px 0 13px; }
.timeline-top { margin-bottom: 8px; }
.timeline-title { color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.timeline-button { width: 25px; height: 25px; color: var(--teal); background: #fff; border: 1px solid var(--line); border-radius: 2px; font-size: 13px; }
.timeline-button:hover { color: var(--teal-dark); background: #eaecf0; }
.timeline-track { gap: 8px; scrollbar-color: #a2a9b1 transparent; }
.timeline-track::-webkit-scrollbar-thumb { background: #a2a9b1; }
.timeline-card { flex-basis: 270px; min-height: 56px; gap: 10px; padding: 6px 10px 6px 6px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 2px; }
.timeline-card:hover { background: #eaecf0; text-decoration: none; }
.timeline-date { flex-basis: 42px; height: 42px; color: var(--ink); background: #eaecf0; border-radius: 2px; font-size: 10px; }
.timeline-date strong { font-size: 16px; }
.timeline-card-title { font-family: var(--font-sans); font-size: 13px; line-height: 1.25; }
.timeline-card-topic { color: var(--muted); font-size: 10px; letter-spacing: 0; }
.show-timeline { right: 16px; bottom: 14px; padding: 7px 12px; color: var(--teal); background: #f8f9fa; border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.12); font-size: 12px; font-weight: 400; }
.show-timeline:hover { background: #eaecf0; }
.no-results { padding: 35px 0; text-align: left; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.site-footer { padding: 0 0 22px; color: var(--muted); font-size: 12px; }

@media (max-width: 800px) {
  .site-header { min-height: 120px; padding: 14px 18px 20px; }
  .header-inner, .content-grid, .timeline-inner { width: calc(100% - 36px); }
  .hero-copy { margin-top: 15px; }
  .content-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 25px; }
  .topic-sidebar { order: 2; padding-right: 0; border-right: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .article-column { order: 1; }
  .article-intro p { text-align: left; }
  .article-visual img { height: 210px; }
  .article-body, .article-card.has-thumbnail .article-body { padding-bottom: 28px; }
  .timeline-shell { right: 0; bottom: 0; left: 0; }
  .timeline-inner { padding-top: 9px; padding-bottom: 10px; }
  .show-timeline { right: 18px; bottom: 14px; }
}
