/*
Theme Name: MagazinStadt
Theme URI: https://magazinstadt.de/
Author: MagazinStadt Redaktion
Author URI: https://magazinstadt.de/
Description: Standalone theme matching the approved MagazinStadt preview (v2): newspaper-style masthead, persistent header and footer, topic ticker, lead story with Meistgelesen, labelled ad slots, light/dark toggle, Steckbrief tables and plain-text FAQ. System fonts only, no frameworks, no external fonts.
Version: 1.0.4
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: magazinstadt
Tags: news, magazine, custom-header, custom-menu, featured-images, translation-ready
*/

/* ---- Tokens (preview v2 light theme) ---- */
:root {
  --paper: #ffffff;
  --ink: #1b1a17;
  --ink-soft: #5c574f;
  --line: #e4ded4;
  --panel: #f5f2ec;
  --red: #d63c22;
  --red-dark: #b22e18;
  --chip: #efece5;
  --ad: #faf8f4;
  --steck-th-bg: #eceae6;
  --steck-th-color: #1b1a17;
  /* System-font approximation of the preview's Archivo / Newsreader stacks.
     No external fonts are loaded, per the performance brief. */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151310;
    --ink: #f0ece4;
    --ink-soft: #b8b0a4;
    --line: #2e2a24;
    --panel: #1f1c18;
    --red: #ff5a3c;
    --red-dark: #ff5a3c;
    --chip: #25211c;
    --ad: #1b1814;
    --steck-th-bg: #2a2620;
    --steck-th-color: #f0ece4;
  }
}
html[data-theme="light"] {
  --paper: #ffffff; --ink: #1b1a17; --ink-soft: #5c574f; --line: #e4ded4;
  --panel: #f5f2ec; --red: #d63c22; --red-dark: #b22e18; --chip: #efece5;
  --ad: #faf8f4; --steck-th-bg: #eceae6; --steck-th-color: #1b1a17;
}
html[data-theme="dark"] {
  --paper: #151310; --ink: #f0ece4; --ink-soft: #b8b0a4; --line: #2e2a24;
  --panel: #1f1c18; --red: #ff5a3c; --red-dark: #ff5a3c; --chip: #25211c;
  --ad: #1b1814; --steck-th-bg: #2a2620; --steck-th-color: #f0ece4;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ---- Reading progress ---- */
.progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--red); width: 0; z-index: 60; }

/* ---- Header (persistent: header.php is outside every template's main content) ---- */
.site-header { background: var(--paper); }
.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-size: 12.5px; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.topbar .pill { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.theme-btn { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: inherit; cursor: pointer; font: inherit; font-size: 12.5px; }
.masthead { text-align: center; padding: 26px 20px 18px; border-bottom: 3px double var(--ink); }
.wordmark { text-decoration: none; display: inline-block; }
.wordmark .w1 {
  display: block; font-weight: 800; font-size: clamp(13px, 2vw, 17px);
  letter-spacing: .42em; text-indent: .42em; line-height: 1; margin: 0 0 4px;
}
.wordmark .w2 {
  display: block; font-family: var(--serif); font-weight: 800;
  font-size: clamp(56px, 10vw, 104px); line-height: .9; letter-spacing: -.01em; margin: 0;
}
.wordmark .w2 .dot { font-style: italic; font-weight: 600; color: var(--red); }
.main-nav {
  position: sticky; top: 0; z-index: 40; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.main-nav a { text-decoration: none; font-size: 14px; font-weight: 700; padding: 7px 10px; border-radius: 6px; display: inline-block; }
.main-nav .current-menu-item a, .main-nav .current-category-ancestor a { background: var(--ink); color: var(--paper); }
.searchbox { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.searchbox input { border: 0; background: transparent; color: inherit; width: 150px; padding: 5px 12px; font: inherit; font-size: 13.5px; }
.searchbox button { border: 0; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; padding: 5px 12px; cursor: pointer; }
@media (max-width: 900px) { .searchbox input { width: 110px; } }
@media (max-width: 600px) {
  .topbar .topbar-meta { display: none; }
  .searchbox { width: 100%; margin-left: 0; }
  .searchbox input { width: 100%; }
}
.ticker { display: flex; flex-wrap: wrap; gap: 14px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ticker-label { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.ticker a { text-decoration: none; font-size: 13.5px; font-weight: 600; }
.ticker .num { font-family: var(--serif); color: var(--red); margin-right: 4px; }

/* ---- Front grid: lead + Meistgelesen ---- */
.front-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 28px; padding-top: 26px; }
@media (max-width: 900px) { .front-grid { grid-template-columns: 1fr; } }
.kicker { font-size: 12px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: .08em; }
.kicker::after { content: ""; display: block; width: 22px; height: 3px; background: var(--red); margin-top: 6px; }
.lead h1, .lead h2 { font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.06; margin: 12px 0; }
.lead h1 a, .lead h2 a { text-decoration: none; }
.lead p { font-family: var(--serif); font-size: 19px; line-height: 1.5; color: var(--ink-soft); }
.lead figcaption, .card figcaption, .article-figure figcaption { font-size: 12.5px; color: var(--ink-soft); padding-top: 7px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.byline { font-size: 13px; color: var(--ink-soft); }
.read-more { color: var(--red); text-decoration: underline; font-weight: 700; }
.meist { background: var(--panel); border: 1px solid var(--line); padding: 18px; align-self: start; }
.meist h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 12px; }
.meist ol { list-style: none; margin: 0; padding: 0; }
.meist li { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.meist li:first-child { border-top: 0; }
.meist .num { font-family: var(--serif); font-size: 24px; color: var(--red); line-height: 1; }
.meist a { text-decoration: none; font-size: 15.5px; font-weight: 600; }

/* ---- Cards / sections ---- */
.section { margin-top: 30px; }
.section h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 14px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .card-grid { grid-template-columns: 1fr; } }
.card { border-top: 3px solid var(--ink); padding-top: 12px; }
.card .cat { font-size: 11.5px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: .08em; }
.card h3 { font-family: var(--serif); font-size: 22px; line-height: 1.2; margin: 8px 0; }
.card h3 a { text-decoration: none; }
.card p { color: var(--ink-soft); margin: 0; }
.split { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.newsletter { background: var(--panel); border: 1px solid var(--line); padding: 18px; margin-top: 18px; }
.newsletter h3 { font-family: var(--serif); margin: 0 0 8px; }
.newsletter input[type="email"] { width: 100%; padding: 9px 10px; border: 1px solid var(--line); background: var(--paper); color: inherit; font: inherit; }
.newsletter button { margin-top: 10px; background: var(--red); color: #fff; border: 0; padding: 8px 14px; font-weight: 700; cursor: pointer; }

/* ---- Ad slots (labelled, nothing served) ---- */
.ad-slot { border: 1px dashed var(--line); background: var(--ad); padding: 18px 16px; margin: 30px 0 6px; text-align: center; }
.ad-slot .ad-label { font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); }
.ad-slot p { color: var(--ink-soft); margin: 8px 0 0; }

/* ---- Article (760px) ---- */
.article { max-width: 760px; margin: 0 auto; padding-top: 24px; }
.back-link, .breadcrumb { font-size: 13.5px; color: var(--ink-soft); }
.back-link { text-decoration: none; }
.article h1 { font-family: var(--serif); font-weight: 800; font-size: clamp(32px, 5.4vw, 50px); line-height: 1.05; margin: 12px 0; }
.standfirst { font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--ink-soft); }
.article-byline { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 13.5px; color: var(--ink-soft); margin: 16px 0; }
.entry-content { font-size: 17px; line-height: 1.7; }
.entry-content h2 { font-family: var(--serif); font-weight: 800; font-size: 27px; margin: 30px 0 10px; line-height: 1.25; }
.entry-content h3 { font-size: 16.5px; margin: 18px 0 4px; }
.entry-content p { margin: 0 0 14px; }
.entry-content .sources { font-size: 14px; color: var(--ink-soft); }
table.steckbrief { border-collapse: collapse; width: 100%; margin: 6px 0 22px; font-size: 15px; }
table.steckbrief th, table.steckbrief td { border: 1px solid #cfcfcf; padding: 9px 12px; text-align: left; vertical-align: top; }
table.steckbrief th { width: 38%; font-weight: 700; background: var(--steck-th-bg); color: var(--steck-th-color); }
.related h2 { font-family: var(--serif); font-size: 22px; }

/* ---- Pages / legal (720px) ---- */
.page-narrow { max-width: 720px; margin: 0 auto; padding-top: 24px; font-size: 16px; line-height: 1.65; }
.page-narrow h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 42px); line-height: 1.1; }
.page-narrow h2 { font-size: 23px; font-family: var(--serif); }

/* ---- Archive / search ---- */
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .archive-grid { grid-template-columns: 1fr; } }
.page-title { font-family: var(--serif); font-size: clamp(28px, 4vw, 40px); }

/* ---- Footer (persistent: footer.php is called by every template) ---- */
.site-footer { margin-top: 44px; border-top: 3px double var(--ink); background: var(--panel); color: var(--ink); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px; padding: 30px 0 26px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-wordmark { font-family: var(--serif); font-weight: 800; font-size: 34px; line-height: 1; }
.foot-wordmark em { font-style: italic; font-weight: 600; color: var(--red); }
.foot-intro { font-size: 14px; color: var(--ink-soft); }
.site-footer h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--red); }
.legal-strip { border-top: 1px solid var(--line); padding: 14px 0 22px; font-size: 12.5px; color: var(--ink-soft); }
