/*
Theme Name: Dispatch
Theme URI: https://example.com/dispatch
Author: Your Name
Description: A modern general-news theme. A scrolling latest-headlines ticker, a big dated masthead, an overlay lead story beside a ranked top-stories column, editor's picks, section blocks, an "In pictures" band and an opinion row. Serif reading type, light and dark modes, self-hosted fonts and one-click demo content with original artwork.
Version: 1.0.0
Requires at least: 6.4
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: dispatch
Tags: news, blog, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks
*/

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #0f1b2d;
  --text-2: #33425a;
  --muted: #66748a;
  --line: #dde3ea;
  --navy: #0f1b2d;
  --accent: #d62839;
  --accent-ink: #ffffff;
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-ui: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --w-display: 800;
  --track-display: -0.02em;
  --lh-display: 1.1;
  --radius: 4px;
  --radius-ui: 4px;
  --sticky-top: 24px;
  --footer-bg: #0f1b2d;
  --footer-text: #eef2f7;
  --footer-muted: #a7b4c7;
  --footer-line: rgba(255,255,255,.14);
  --overlay: linear-gradient(180deg, rgba(10,18,32,0) 30%, rgba(10,18,32,.88) 100%);
  --accent-hover: #0f1b2d;
  --accent-hover-ink: #ffffff;
}
:root[data-theme="dark"] {
  --bg: #0b1320;
  --surface: #111b2b;
  --surface-2: #162234;
  --text: #edf1f7;
  --text-2: #c6cfdc;
  --muted: #8f9cb0;
  --line: #243349;
  --accent: #ff4d5e;
  --footer-bg: #060c16;
  --accent-hover: #edf1f7;
  --accent-hover-ink: #0b1320;
}

body { font-size: 18px; line-height: 1.6; }
.card__excerpt, .entry-dek, .page-desc { font-family: var(--font-body); }

/* ---------- Ticker ---------- */
.dp-ticker { background: var(--navy); color: #fff; font-family: var(--font-ui); font-size: .9rem; }
[data-theme="dark"] .dp-ticker { background: #060c16; }
.dp-ticker__inner { display: flex; align-items: center; gap: 1rem; min-height: 42px; }
.dp-ticker__label { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .45rem; padding: .22rem .6rem; border-radius: 3px; background: var(--accent); font-weight: 800; }
.dp-ticker__dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.dp-ticker__viewport { display: flex; flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.dp-ticker__track { display: flex; gap: 2.4rem; flex: 0 0 auto; list-style: none; margin: 0; padding: 0 2.4rem 0 0; animation: dp-scroll 60s linear infinite; }
.dp-ticker__viewport:hover .dp-ticker__track, .dp-ticker__viewport:focus-within .dp-ticker__track { animation-play-state: paused; }
.dp-ticker li { white-space: nowrap; }
.dp-ticker__time { color: #9fb0c8; margin-right: .5rem; font-variant-numeric: tabular-nums; }
.dp-ticker a:hover { text-decoration: underline; }
@keyframes dp-scroll { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .dp-ticker__viewport { overflow-x: auto; } .dp-ticker__track { animation: none; } .dp-ticker__track[aria-hidden] { display: none; } }

/* ---------- Masthead ---------- */
.site-header { position: relative; border-bottom: 0; }
.site-header__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "left brand actions" "nav nav nav"; align-items: center; min-height: 0; padding-top: 22px; column-gap: 1rem; }
.site-header__social { grid-area: left; display: flex; flex-direction: column; gap: .5rem; }
.site-header__social .social a { width: 32px; height: 32px; }
.dp-date { font-family: var(--font-ui); font-weight: 700; font-size: .88rem; color: var(--text-2); }
.site-brand { grid-area: brand; justify-self: center; }
.brand { gap: .7rem; }
.brand__mark { width: 44px; height: 44px; }
.brand__name { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 900; letter-spacing: -.045em; }
.site-header__actions { grid-area: actions; justify-self: end; margin-left: 0; }
.primary-nav { grid-area: nav; margin-top: 20px; border-top: 3px solid var(--text); border-bottom: 1px solid var(--line); }
.primary-menu { justify-content: center; gap: .3rem; padding-block: .3rem; }
.primary-menu > li > a { font-weight: 800; font-size: .98rem; }
@media (max-width: 1023px) {
  .site-header__inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions"; padding-block: 14px; }
  .site-header__social { display: none; }
  .site-brand { justify-self: start; min-width: 0; }
  .brand { flex-direction: row; }
  .brand__name { font-size: 2rem; }
  .brand__mark { width: 34px; height: 34px; }
}

.cat { font-family: var(--font-ui); color: var(--accent); font-weight: 800; }
.card__title, .mini__title, .card-row .card__title { font-family: var(--font-display); letter-spacing: -.015em; }
.dp-label { font-family: var(--font-ui); font-size: 1.05rem; font-weight: 800; padding-bottom: .55rem; margin-bottom: 1.1rem; border-bottom: 3px solid var(--text); }
.section-head { border-bottom: 3px solid var(--text); padding-bottom: .55rem; }
.section-title { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }

/* ---------- Lead + top stories ---------- */
.dp-top { display: grid; gap: clamp(24px, 3vw, 40px); padding-block: clamp(24px, 3vw, 40px); }
@media (min-width: 1000px) { .dp-top { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.dp-lead .card-overlay { min-height: clamp(420px, 42vw, 560px); }
.dp-lead .card__title { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.05; max-width: 22ch; }
.dp-lead .card__excerpt { font-size: 1.08rem; max-width: 60ch; }
.dp-lead .cat { display: inline-block; padding: .15rem .5rem; background: var(--accent); color: #fff; border-radius: 3px; }
.dp-topstories .mini__title { font-size: 1.08rem; line-height: 1.25; }
.dp-topstories .ranked > li::before { color: var(--accent); }

/* ---------- Picks, blocks, pictures, opinion ---------- */
.dp-picks .card__title { font-size: 1.1rem; }
.dp-picks .media { aspect-ratio: 3 / 2; }
.dp-block + .dp-block { margin-top: clamp(40px, 5vw, 60px); }
.dp-block__grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .dp-block__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.dp-block__main .card__title { font-size: 1.6rem; line-height: 1.12; }
.dp-block .card-row { grid-template-columns: 84px minmax(0, 1fr); }
.dp-block .card-row .card__title { font-size: 1.02rem; }
.dp-pictures { background: var(--navy); color: #fff; }
[data-theme="dark"] .dp-pictures { background: #060c16; }
.dp-pictures .section-head { border-bottom-color: rgba(255,255,255,.6); }
.dp-pictures .card-overlay { min-height: 380px; }
.dp-op { display: flex; flex-direction: column; align-items: flex-start; gap: .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.dp-op__pic { width: 88px; border-radius: 50%; }
.dp-op__title { font-family: var(--font-body); font-style: italic; font-weight: 600; font-size: 1.3rem; line-height: 1.3; letter-spacing: 0; }
.dp-op__title a:hover { color: var(--accent); }

/* ---------- Sidebar and single ---------- */
.signup--sidebar { background: var(--surface-2); color: var(--text); border-top: 4px solid var(--accent); border-radius: 0 0 var(--radius) var(--radius); }
.signup--sidebar .signup__button { background: var(--accent); color: #fff; }
.signup--sidebar input[type="email"] { border-color: var(--line); }
.entry-title { font-size: clamp(2.2rem, 4.8vw, 3.5rem); letter-spacing: -.03em; }
.entry-content { font-size: 1.2rem; line-height: 1.72; }
.entry-content h2, .entry-content h3 { letter-spacing: -.02em; }
.entry-content blockquote { font-family: var(--font-body); font-style: italic; font-weight: 500; }
.site-footer .signup { background: rgba(255,255,255,.06); color: var(--footer-text); padding: 1.4rem; }
.site-footer .signup__title { font-size: 1.15rem; }
