/* DE·AKTÜEL — Authentic German Newspaper Layout (Zero Boxed-Card AI Slop)
   Inspired by Die Zeit, FAZ, Der Spiegel & Tagesschau */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f4f3ef;
  --ink: #121417;
  --ink-muted: #4b5260;
  --ink-faint: #737a87;
  --border: #e2e0d8;
  --border-strong: #121417;
  --accent: #c8102e;
  --trust-blue: #0b3d91;
  --font-serif: 'Newsreader', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 1240px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #14171d;
  --surface-alt: #1c2028;
  --ink: #f1f3f5;
  --ink-muted: #a1aab8;
  --ink-faint: #707988;
  --border: #262b36;
  --border-strong: #e5e7eb;
  --accent: #e11d48;
  --trust-blue: #60a5fa;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* 1. Top Strip (Desktop) */
.top-strip {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.top-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  gap: 16px;
}
.data-tickers {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 700;
  font-size: 12px;
}
.ticker-item strong { font-weight: 800; }

.utility-actions { display: flex; align-items: center; gap: 16px; }
.util-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-muted);
  padding: 2px 0;
}
.util-link:hover { color: var(--ink); text-decoration: underline; }

.btn-flat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
}
.btn-flat:hover { border-color: var(--ink); }
.btn-flat.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* 2. Masthead & Ressort Nav */
.masthead {
  background: var(--surface);
  border-bottom: 2px solid var(--border-strong);
  position: sticky;
  top: 0;
  z-index: 40;
}
.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0 11px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-mark { display: flex; align-items: center; color: var(--ink); flex-shrink: 0; }
.brand-logo {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}
.brand-logo span { color: var(--accent); }
.brand-logo .brand-24 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  background: var(--accent);
  color: #fff;
  padding: 2px 5px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}
.brand-tagline {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-top: 2px;
}
.masthead-controls { display: flex; align-items: center; gap: 8px; }

.search-box {
  border-bottom: 1.5px solid var(--border);
  padding: 4px 2px;
  width: 220px;
}
.search-box:focus-within { border-color: var(--ink); }
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--ink);
  font-size: 13.5px;
  width: 100%;
}
.mobile-menu-btn { display: none; padding: 6px; min-width: 36px; min-height: 36px; align-items: center; justify-content: center; }

.nav-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }
.nav-cat {
  padding: 10px 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.nav-cat:hover { color: var(--ink); }
.nav-cat.active {
  color: var(--ink);
  font-weight: 800;
  border-bottom: 3px solid var(--accent);
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  background: var(--surface);
  z-index: 150;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.mobile-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-strong);
  font-family: var(--font-serif);
  font-size: 22px;
}
.mobile-drawer-data {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.mobile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 3. Breaking Strip */
.breaking-bar {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 7px 0;
}
.breaking-inner { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.breaking-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  white-space: nowrap;
}
.breaking-text {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.breaking-text:hover { text-decoration: underline; }

/* 4. Hero Newspaper Front Page */
.main-content { padding: 24px 0 60px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.85fr 1fr;
  gap: 34px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--border-strong);
}
.hero-lead { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.hero-cover-wrap {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface-alt);
}
.hero-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-lead:hover .hero-cover-wrap img { transform: scale(1.02); }
.cat-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.region-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}
.hero-lead:hover .hero-title { text-decoration: underline; text-underline-offset: 4px; }
.hero-summary { font-size: 15.5px; color: var(--ink-muted); margin: 0; line-height: 1.5; }
.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
}

/* Right Rail: 2 Secondary Photo Stories + Tagesschau Clock Newsticker */
.hero-rail {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@media (min-width: 960px) {
  .hero-grid { gap: 28px; }
  .hero-rail {
    border-left: 1px solid var(--border);
    padding-left: 28px;
  }
  .rubrik-list {
    border-left: 1px solid var(--border);
    padding-left: 26px;
  }
}
.rail-photo-stories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.rail-story { cursor: pointer; }
.rail-story img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin-bottom: 7px;
  background: var(--surface-alt);
}
.rail-story h3 {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  margin: 3px 0 0;
}
.rail-story:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

.newsticker-box { border-top: 2px solid var(--border-strong); padding-top: 10px; }
.newsticker-head {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  color: var(--ink);
}
.ticker-rows { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.ticker-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: baseline;
}
.ticker-row:last-child { border-bottom: none; padding-bottom: 0; }
.ticker-time {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.ticker-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.28;
}
.ticker-row:hover .ticker-title { text-decoration: underline; text-underline-offset: 3px; }

/* 5. Editorial Category Rubriken (Asymmetric: 1 Lead + 3 Headline Rows, NO boxed cards!) */
.cat-section {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 2px solid var(--border-strong);
}
.cat-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cat-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 800;
  margin: 0;
}
.cat-accent-bar { width: 5px; height: 20px; display: inline-block; }
.cat-view-all {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 2px;
}
.cat-view-all:hover { color: var(--accent); border-color: var(--accent); }

.rubrik-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  align-items: start;
}
.rubrik-lead { cursor: pointer; }
.rubrik-lead img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  margin-bottom: 10px;
  background: var(--surface-alt);
}
.rubrik-lead h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.22;
  margin: 6px 0;
}
.rubrik-lead:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.rubrik-lead p { font-size: 14px; color: var(--ink-muted); margin: 0; }

.rubrik-list { display: flex; flex-direction: column; }
.rubrik-row {
  display: grid;
  grid-template-columns: 1fr 124px;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: start;
}
.rubrik-row:first-child { padding-top: 0; }
.rubrik-row:last-child { border-bottom: none; padding-bottom: 0; }
.rubrik-row img {
  width: 124px;
  height: 76px;
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
}
.rubrik-row h4 {
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.28;
  margin: 3px 0 4px;
}
.rubrik-row:hover h4 { text-decoration: underline; text-underline-offset: 3px; }

/* 6. Newspaper Archive List (Clean Horizontal Rows, Spiegel/Zeit style) */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 38px 0 12px;
  padding-top: 18px;
  border-top: 2px solid var(--border-strong);
}
.section-title { font-family: var(--font-serif); font-size: 23px; font-weight: 800; margin: 0; }

.feed-list { display: flex; flex-direction: column; }
.feed-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  align-items: start;
}
.feed-row img {
  width: 220px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
}
.feed-row h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.24;
  margin: 4px 0 6px;
}
.feed-row:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.feed-row p { font-size: 14px; color: var(--ink-muted); margin: 0 0 8px; }

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.page-btn {
  padding: 7px 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  min-height: 36px;
}
.page-btn:hover:not(:disabled) { border-color: var(--ink); }
.page-btn.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* 7. Article Reader View */
.read-progress { position: fixed; top: 0; left: 0; width: 0%; height: 3px; background: var(--accent); z-index: 200; }
.article-view { max-width: 760px; margin: 0 auto; padding: 12px 0 32px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-bottom: 14px; flex-wrap: wrap; }
.breadcrumb button:hover { color: var(--ink); text-decoration: underline; }
.back-btn { display: inline-flex; font-size: 13px; font-weight: 700; border-bottom: 1.5px solid var(--ink); padding-bottom: 2px; margin-bottom: 18px; }
.article-title { font-family: var(--font-serif); font-size: clamp(26px, 4vw, 42px); font-weight: 700; line-height: 1.14; margin: 10px 0 14px; }
.article-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0;
  margin: 14px 0 22px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.why-box { background: var(--surface-alt); border-left: 3px solid var(--ink); padding: 14px 18px; margin: 22px 0; }
.why-box-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.article-prose { font-family: var(--font-serif); font-size: 19px; line-height: 1.72; }
.article-prose p { margin: 0 0 18px; }
.article-prose h3 { font-family: var(--font-sans); font-size: 19px; font-weight: 700; margin: 28px 0 10px; }
.source-box { margin-top: 28px; padding: 12px 16px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 13px; color: var(--ink-muted); }
.related-section { margin-top: 36px; padding-top: 24px; border-top: 2px solid var(--border-strong); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 14px; }
.related-item { cursor: pointer; }
.related-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; margin-bottom: 8px; }
.related-item h4 { font-family: var(--font-serif); font-size: 16px; margin: 4px 0 0; line-height: 1.28; }

/* 8. Footer, DSGVO & Accessibility */
.site-footer { background: var(--surface); border-top: 2px solid var(--border-strong); padding: 30px 0; font-size: 13px; color: var(--ink-muted); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 600; }
.footer-links button:hover, .footer-links a:hover { color: var(--ink); text-decoration: underline; }

.cookie-banner {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: min(410px, calc(100% - 28px));
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  padding: 15px 18px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.rubrik-row,
.ticker-row,
.feed-row {
  transition: background-color 0.14s ease;
}
.rubrik-row:hover,
.ticker-row:hover,
.feed-row:hover {
  background-color: var(--surface-alt);
}

@media print {
  .top-strip, .masthead, .breaking-bar, .article-tools, .cookie-banner, .site-footer, .related-section {
    display: none !important;
  }
  body { background: #fff; color: #000; }
}
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--surface); border: 1.5px solid var(--border-strong); max-width: 640px; width: 100%; max-height: 82vh; overflow-y: auto; padding: 26px; }
.hidden { display: none !important; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 8px 14px; z-index: 200; font-weight: 700; }
.skip-link:focus { left: 12px; top: 12px; }

[data-contrast="high"] { --bg: #ffffff; --surface: #ffffff; --surface-alt: #eeeeee; --ink: #000000; --ink-muted: #111111; --border: #000000; --border-strong: #000000; }
[data-theme="dark"][data-contrast="high"] { --bg: #000000; --surface: #0a0a0a; --surface-alt: #161616; --ink: #ffffff; --ink-muted: #eeeeee; --border: #ffffff; --border-strong: #ffffff; }

/* =========================================================
   MOBILE-FIRST OPTIMIZATION (<= 767px)
   Clean, native Tagesschau/Spiegel mobile experience
   ========================================================= */
@media (max-width: 767px) {
  .container { padding: 0 14px; }
  .top-strip, .brand-tagline { display: none; }
  .masthead-top { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .brand-logo { font-size: 24px; }
  .search-box { display: none; width: 100%; }
  .search-box.open { display: block; position: absolute; left: 0; right: 0; top: 52px; background: var(--surface); padding: 10px 14px; border-bottom: 1px solid var(--border); z-index: 50; }
  .mobile-menu-btn { display: inline-flex; }
  .nav-bar { gap: 18px; -webkit-overflow-scrolling: touch; }
  .nav-cat { padding: 9px 0; font-size: 13px; }

  .main-content { padding: 16px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 22px; padding-bottom: 22px; }
  .hero-cover-wrap { margin: 0 -14px; }
  .hero-title { font-size: 24px; }
  .hero-summary { font-size: 14.5px; }

  .rubrik-grid { grid-template-columns: 1fr; gap: 16px; }
  .rubrik-row { grid-template-columns: 1fr 96px; gap: 12px; }
  .rubrik-row img { width: 96px; height: 64px; }

  .feed-row { grid-template-columns: 1fr 104px; gap: 12px; padding: 14px 0; }
  .feed-row img { width: 104px; height: 68px; order: 2; }
  .feed-row > div { order: 1; }
  .feed-row h3 { font-size: 16.5px; margin: 2px 0 4px; }
  .feed-row p { display: none; }

  .related-grid { grid-template-columns: 1fr; }
  .article-prose { font-size: 17.5px !important; line-height: 1.66; }
  .footer-inner { flex-direction: column; gap: 12px; }
}

/* Tablet (768px – 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .brand-tagline { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .rubrik-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .feed-row { grid-template-columns: 180px 1fr; }
  .feed-row img { width: 180px; }
}
