/* Tagesspott — styled to match tagesschau.de's visual design (own implementation).
   Type: self-hosted Fira Sans (OFL), a free humanist sans standing in for tagesschau's
   licensed "Thesis" face — closest free match for the thin, humanist look. */
@font-face { font-family:"Fira Sans"; font-weight:300; font-display:swap; src:url("/static/fonts/fira-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family:"Fira Sans"; font-weight:400; font-display:swap; src:url("/static/fonts/fira-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Fira Sans"; font-weight:500; font-display:swap; src:url("/static/fonts/fira-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Fira Sans"; font-weight:700; font-display:swap; src:url("/static/fonts/fira-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --blue: #015999;          /* tagesschau signature blue: headlines, headings, boxes */
  --blue-dark: #014d84;
  --ink: #33322f;           /* body text */
  --gray: #6d6d6d;          /* toplines / muted */
  --bg: #f1f1f1;            /* page background */
  --white: #ffffff;
  --line: #e2e2e2;          /* hairline dividers */
  --label: #14181f;         /* eyecatcher label bg (near-black) */
  --maxw: 1104px;
  --sans: "Fira Sans", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Slim satire strip (kept for honesty; unobtrusive) */
.satirebar {
  background: #ffd400; color: #14181f; text-align: center;
  font-size: 12px; font-weight: 700; padding: 3px 10px; letter-spacing: .01em;
}

/* Header (white, like tagesschau) */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 16px 14px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo-icon { width: 42px; height: 42px; flex: none; }
.wordmark { font-size: 33px; line-height: 1; letter-spacing: -.2px; color: var(--blue); }
.wordmark .w1 { font-weight: 300; }
.wordmark .w2 { font-weight: 700; }
.header-center { flex: 1; text-align: center; }
.live-label { color: #d61e8c; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.live-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: #d61e8c; color: #fff;
  font-size: 11px; margin-left: 6px; vertical-align: middle;
}
.header-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.refresh-btn {
  background: var(--white); color: var(--blue); border: 1px solid var(--blue); border-radius: 2px;
  padding: 7px 13px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
}
.refresh-btn:hover { background: var(--blue); color: #fff; }
.hamburger { display: inline-block; width: 30px; height: 22px; position: relative; cursor: default; }
.hamburger span { position: absolute; left: 0; right: 0; height: 3px; background: var(--ink); border-radius: 2px; }
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }

/* Nav */
.site-nav { background: var(--white); border-bottom: 1px solid var(--line); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 20px; height: 46px; overflow: hidden;
}
.nav-inner a { font-size: 18px; font-weight: 300; color: var(--ink); white-space: nowrap; }
.nav-inner a:hover { color: var(--blue); }
.nav-inner a.active { font-weight: 700; }
.topicpill {
  background: #ececec; border-radius: 16px; padding: 5px 13px; font-size: 15px;
  color: var(--ink); white-space: nowrap;
}
.topicpill:hover { background: #e0e0e0; }

/* Main */
.site-main { max-width: var(--maxw); margin: 0 auto; padding: 20px 16px 30px; }

/* Topline / eyecatcher */
.topline { color: var(--gray); font-size: 16px; line-height: 20px; margin: 14px 0 2px; }
.eyecatcher {
  display: inline-block; background: var(--label); color: #fff; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; margin: 12px 0 4px;
}

/* Lead story */
.lead-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #dcdcdc; }
.lead-headline {
  color: var(--blue); font-size: 32px; line-height: 1.14; font-weight: 400; margin: 4px 0 10px;
  letter-spacing: .1px;
}
.lead:hover .lead-headline { text-decoration: underline; }
.lead-teaser { color: var(--ink); font-size: 18px; line-height: 1.5; margin: 0; }
.mehr { color: var(--blue); font-weight: 700; }

/* Secondary horizontal teasers (thumb left, text right) */
.secondary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 26px 0 8px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.teaser-h { display: flex; gap: 14px; align-items: flex-start; }
.teaser-h img { width: 160px; aspect-ratio: 16/9; object-fit: cover; flex: none; background: #dcdcdc; }
.teaser-h .th-text { min-width: 0; }
.teaser-h .th-topline { color: var(--gray); font-size: 15px; margin: 0 0 2px; }
.teaser-h .th-headline { color: var(--blue); font-size: 21px; line-height: 1.15; font-weight: 400; margin: 0; }
.teaser-h:hover .th-headline { text-decoration: underline; }

/* KURZÜBERBLICK blue box */
.kurz {
  background: var(--blue); color: #fff; margin: 26px 0; padding: 30px 40px 34px; border-radius: 2px;
}
.kurz .kurz-sub { text-align: center; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; font-weight: 300; margin: 0; opacity: .95; }
.kurz .kurz-title { text-align: center; text-transform: uppercase; font-weight: 300; font-size: 40px; letter-spacing: .5px; margin: 2px 0 20px; }
.kurz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px; }
.kurz-item {
  display: flex; gap: 12px; align-items: flex-start; padding: 13px 0;
  border-top: 1px solid rgba(255,255,255,.28); font-size: 17px; line-height: 1.3;
}
.kurz-item::before { content: "▶"; color: #fff; font-size: 12px; margin-top: 3px; flex: none; }
.kurz-more { text-align: right; margin-top: 18px; }
.kurz-more span {
  display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.16);
  padding: 10px 20px; border-radius: 2px; font-size: 15px;
}

/* Section heading (LIVE UND TOPTHEMEN) */
.section-head {
  text-align: center; color: var(--blue); text-transform: uppercase; font-weight: 300;
  font-size: 40px; letter-spacing: .5px; margin: 34px 0 22px;
}

/* Card grid */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 26px; }
.card { display: flex; flex-direction: column; }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #dcdcdc; }
.card-img--ph { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.card .c-topline { color: var(--gray); font-size: 15px; margin: 10px 0 2px; }
.card .c-headline { color: var(--blue); font-size: 20px; line-height: 1.16; font-weight: 400; margin: 0 0 6px; }
.card:hover .c-headline { text-decoration: underline; }
.card .c-teaser { color: var(--ink); font-size: 15px; line-height: 1.4; margin: 0 0 8px; }

/* Votes */
.votes { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.votes--lead { margin: 12px 0 4px; }
.votes--article { padding: 16px 0; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 16px; }
.votes-label { font-weight: 700; margin-right: 6px; }
.vote-btn {
  border: 1px solid #cfcfcf; background: #fff; cursor: pointer; border-radius: 2px;
  padding: 4px 9px; font-size: 13px; font-family: inherit; color: var(--gray);
}
.vote-btn.up:hover, .vote-btn.up.chosen { color: #fff; background: #2e8b57; border-color: #2e8b57; }
.vote-btn.down:hover, .vote-btn.down.chosen { color: #fff; background: #c1002a; border-color: #c1002a; }
.score { font-weight: 700; min-width: 18px; text-align: center; color: var(--ink); }

/* Article page */
.article { max-width: 760px; margin: 0 auto; }
.back-link { color: var(--blue); font-weight: 700; font-size: 15px; display: inline-block; margin: 6px 0 10px; }
.article-headline { color: var(--blue); font-size: 34px; line-height: 1.15; font-weight: 400; margin: 4px 0 12px; }
.article-teaser { font-size: 20px; line-height: 1.5; color: var(--ink); font-weight: 400; margin: 0 0 14px; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--gray); font-size: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
.article-figure { margin: 18px 0; }
.article-figure img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #dcdcdc; }
.article-figure figcaption { font-size: 12px; color: var(--gray); padding: 6px 2px; }
.article-body { font-size: 18px; line-height: 1.7; }
.article-body p { margin: 0 0 16px; }
.article-body blockquote { margin: 18px 0; padding: 6px 0 6px 16px; border-left: 4px solid var(--blue); font-style: italic; color: #2a2a2a; }
.source-note { margin-top: 20px; font-size: 13px; color: var(--gray); }
.source-note a { color: var(--blue); text-decoration: underline; }

.empty-state { background: #fff; border: 1px solid var(--line); padding: 40px; text-align: center; }

/* Footer */
.site-footer { background: #14181f; color: #b9bcc2; margin-top: 30px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 22px 16px; font-size: 13px; }
.footer-small { color: #8a8d94; }

/* Refresh overlay */
.refresh-overlay { position: fixed; inset: 0; background: rgba(1,89,153,.9); display: flex; align-items: center; justify-content: center; z-index: 50; }
.refresh-overlay[hidden] { display: none; }
.refresh-box { background: #fff; padding: 30px 36px; border-radius: 4px; text-align: center; max-width: 340px; }
.refresh-box p { margin: 6px 0 0; font-weight: 700; color: var(--ink); }
.refresh-sub { font-weight: 400 !important; color: var(--gray); font-size: 14px; }
.spinner { width: 38px; height: 38px; border: 4px solid #dce6ee; border-top-color: var(--blue); border-radius: 50%; margin: 0 auto 14px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 900px) {
  .secondary-row { grid-template-columns: 1fr; gap: 18px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .kurz-grid { grid-template-columns: 1fr; }
  .lead-headline { font-size: 26px; }
  .kurz .kurz-title, .section-head { font-size: 30px; }
  .header-center { display: none; }
}
@media (max-width: 560px) {
  .card-grid { grid-template-columns: 1fr; }
  .kurz { padding: 24px 20px; }
  .wordmark { font-size: 27px; }
  .teaser-h img { width: 120px; }
  .article-headline { font-size: 26px; }
}

/* Dark theme — mirrors tagesschau's dark mode (deep-navy #000e29, white headlines).
   Auto-applies on dark-mode devices, just like the original. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000e29;          /* tagesschau dark-mode background (measured) */
    --ink: #d6dbe1;         /* body text */
    --gray: #9aa7b4;        /* toplines / muted */
    --line: rgba(255,255,255,.14);
  }
  body { color: var(--ink); }

  .site-header, .site-nav { background: #000e29; }
  .wordmark { color: #e9edf2; }
  .hamburger span { background: #d6dbe1; }
  .topicpill { background: rgba(255,255,255,.09); color: #cdd4dc; }
  .topicpill:hover { background: rgba(255,255,255,.16); }
  .nav-inner a { color: #d6dbe1; }
  .nav-inner a:hover, .nav-inner a.active { color: #fff; }
  .live-label { color: #e0509f; }

  /* Headlines go near-white in dark mode (like tagesschau).
     Selectors match the base rules' specificity so they actually win. */
  .lead-headline, .teaser-h .th-headline, .card .c-headline, .article-headline { color: #e6e8eb; }
  .lead:hover .lead-headline, .teaser-h:hover .th-headline, .card:hover .c-headline { color: #fff; }
  .mehr, .back-link { color: #e6e8eb; }
  .source-note a { color: #7bb5e0; }
  .lead-teaser, .article-teaser, .article-body, .c-teaser { color: var(--ink); }
  .article-body blockquote { color: #cfd6de; border-left-color: #2f7fbf; }

  /* Media placeholders */
  .lead-img, .card-img, .article-figure img, .teaser-h img { background: #14233d; }
  .card-img--ph { color: #6a7890; }

  /* KURZÜBERBLICK box: keep the tagesschau blue (reads as a lighter block on navy) */
  .kurz { background: #01508a; }
  .section-head { color: #4a9fd8; }

  /* Votes */
  .vote-btn { background: transparent; border-color: rgba(255,255,255,.22); color: #9aa7b4; }
  .score { color: var(--ink); }

  /* Refresh button */
  .refresh-btn { background: transparent; color: #cdd4dc; border-color: #3a5a7c; }
  .refresh-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

  .empty-state { background: #071a33; color: var(--ink); }
  .site-footer { background: #00081c; color: #9aa7b4; }
  .refresh-box { background: #10233f; }
  .refresh-box p { color: #e6e8eb; }
  .spinner { border-color: #26405f; border-top-color: #4a9fd8; }
}
