/* MediaMonitoring.uk — Reuters-inspired editorial */

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-2: #F7F7F7;
  --header-bg: rgba(255, 255, 255, 0.95);
  --panel: #FFFFFF;
  --panel-2: #F7F7F7;
  --line: #E2E2E2;
  --line-hover: #C8C8C8;
  --text: #0D0D0D;
  --text-2: #404040;
  --text-3: #8A8A8A;
  --accent: #0D0D0D;
  --accent-2: #0D0D0D;
  --accent-ink: #FFFFFF;
  --r: 0px;
  --display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --bg-2: #1A1A1A;
  --header-bg: rgba(17, 17, 17, 0.95);
  --panel: #181818;
  --panel-2: #222222;
  --line: #2C2C2C;
  --line-hover: #444444;
  --text: #E8E8E8;
  --text-2: #A0A0A0;
  --text-3: #666666;
  --accent: #E8E8E8;
  --accent-2: #E8E8E8;
  --accent-ink: #111111;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding-left: 18px; }

body {
  margin: 0; font-family: var(--body); font-size: 0.95rem;
  color: var(--text); background: var(--bg);
  min-height: 100vh; overflow-x: hidden; line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text-2); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
img { max-width: 100%; }

.skip-link {
  position: absolute; left: -999px; top: 10px;
  background: var(--text); color: var(--bg);
  padding: 6px 12px; border-radius: 2px; font-weight: 700; z-index: 100;
}
.skip-link:focus { left: 16px; }

/* Reading progress */
.reading-progress {
  position: fixed; top: 0; left: 0; width: 0; height: 2px;
  background: var(--text); z-index: 100; pointer-events: none;
}

/* Header — clean, Reuters-style */
.site-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6vw; height: 56px;
  background: var(--header-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 2px; border: none;
  background: var(--text); color: var(--bg);
  font-weight: 800; font-size: 0.68rem; letter-spacing: 0.04em;
}
.site-name { font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.site-tagline { font-size: 0.72rem; color: var(--text-3); display: none; }

.header-right { display: flex; align-items: center; gap: 6px; }

.header-topics {
  display: flex; gap: 0; align-items: center;
  overflow-x: auto; scrollbar-width: none;
}
.header-topics::-webkit-scrollbar { display: none; }
.header-topics a {
  padding: 4px 10px; border-radius: 0;
  font-size: 0.78rem; font-weight: 500; color: var(--text-2);
  white-space: nowrap; flex-shrink: 0;
}
.header-topics a:hover { color: var(--text); }

.search-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 2px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--text-2); font-size: 0.78rem; font-weight: 500; cursor: pointer;
}
.search-btn:hover { border-color: var(--line-hover); color: var(--text); }
.search-btn .kbd {
  font-size: 0.65rem; padding: 1px 4px; border-radius: 2px;
  border: 1px solid var(--line); background: var(--bg-2); font-family: inherit;
}

.theme-toggle {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 2px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2);
  cursor: pointer; font-size: 0.95rem; padding: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-hover); }

.hamburger {
  display: none; width: 32px; height: 32px; place-items: center;
  border-radius: 2px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2);
  cursor: pointer; font-size: 1rem; padding: 0;
}

/* Search modal */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.35);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 16vh;
}
.search-overlay.open { display: flex; }

.search-modal {
  width: 90vw; max-width: 520px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 2px; box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  overflow: hidden;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.search-input-wrap svg { flex-shrink: 0; color: var(--text-3); }
.search-input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 0.95rem; font-family: var(--body); color: var(--text);
}
.search-input::placeholder { color: var(--text-3); }
.search-results { max-height: 50vh; overflow-y: auto; padding: 4px; }
.search-results:empty::after {
  content: "Type to search..."; display: block; padding: 18px;
  text-align: center; color: var(--text-3); font-size: 0.85rem;
}
.search-result { display: block; padding: 10px 12px; border-radius: 2px; }
.search-result:hover, .search-result.active { background: var(--bg-2); }
.search-result-title { font-weight: 600; font-size: 0.9rem; }
.search-result-meta { font-size: 0.75rem; color: var(--text-3); margin-top: 2px; }
.search-result + .search-result { border-top: 1px solid var(--line); }

/* Main */
.page { max-width: 1080px; margin: 0 auto; padding: 40px 6vw 80px; }

/* Eyebrow */
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.72rem; color: var(--text); font-weight: 700;
}

/* Buttons — monochrome, solid */
.button {
  background: var(--text); color: var(--bg);
  padding: 10px 22px; border-radius: 2px; border: none;
  font-weight: 700; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer;
  font-family: var(--body); font-size: 0.85rem;
  letter-spacing: 0.01em;
}
.button:hover { opacity: 0.85; color: var(--bg); }
.button.secondary {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--text);
}
.button.secondary:hover { background: var(--text); color: var(--bg); }
.button.ghost { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); }
.button.small { padding: 6px 14px; font-size: 0.8rem; }

/* Hero — centered */
.hero {
  text-align: center; max-width: 680px; margin: 0 auto 60px;
  padding-bottom: 48px; border-bottom: 1px solid var(--line);
}
.hero h1, .topic-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  line-height: 1.1; margin: 12px 0 18px; font-weight: 700;
  letter-spacing: -0.025em;
}
.hero-text {
  font-size: 1.05rem; color: var(--text-2); max-width: 50ch;
  line-height: 1.6; margin: 0 auto;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; justify-content: center; }

.hero-panel, .sidebar-card {
  background: var(--panel); border-radius: 0;
  padding: 20px; border: 1px solid var(--line);
}

/* Hero quick-links strip */
.hero-links {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line);
}
.hero-links a {
  padding: 8px 16px; border-radius: 2px;
  border: 1px solid var(--line); background: var(--panel);
  font-weight: 600; font-size: 0.82rem; color: var(--text-2);
}
.hero-links a:hover { border-color: var(--text); color: var(--text); }

/* Legacy mini-links */
.hero-panel h2 { font-family: var(--display); font-size: 1.1rem; margin: 6px 0 10px; font-weight: 700; }
.hero-panel ul { margin: 8px 0 0; padding-left: 16px; color: var(--text-2); font-size: 0.88rem; }
.mini-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.mini-links a {
  padding: 8px 12px; border-radius: 2px;
  border: 1px solid var(--line); background: var(--bg-2);
  font-weight: 600; font-size: 0.82rem; color: var(--text-2);
}
.mini-links a:hover { border-color: var(--text); color: var(--text); }

/* Featured grid — clean, no shadow */
.featured-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px; margin-bottom: 60px;
  background: var(--line);
}
.featured-card {
  background: var(--panel);
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
}
.featured-card:hover { background: var(--bg-2); }
.featured-card .card-topic {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3); font-weight: 700;
}
.featured-card h3 {
  font-family: var(--display); margin: 0; line-height: 1.25;
  font-size: 1.1rem; font-weight: 700;
}
.featured-card p { color: var(--text-2); margin: 0; line-height: 1.55; font-size: 0.88rem; }
.featured-card .card-meta { font-size: 0.75rem; color: var(--text-3); margin-top: auto; }

/* Section */
.section { margin-bottom: 60px; }
.section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 2px solid var(--text);
}
.section-header h2 {
  font-family: var(--display); margin: 0;
  font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em;
}
.section-header .muted::before { content: ""; }

/* Card grid */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px; background: var(--line);
}
.card {
  background: var(--panel);
  padding: 24px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 160px;
}
.card:hover { background: var(--bg-2); }
.card .meta { color: var(--text-3); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.card h3 {
  margin: 0; font-family: var(--display); line-height: 1.25;
  font-size: 1.05rem; font-weight: 700;
}
.card p { margin: 0; color: var(--text-2); font-size: 0.88rem; }

/* Topic grid */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px; background: var(--line);
}
.topic-card {
  padding: 20px; background: var(--panel);
}
.topic-card:hover { background: var(--bg-2); }
.topic-card h3 {
  margin: 0 0 6px; font-family: var(--display);
  font-size: 1rem; font-weight: 700;
}
.topic-card p { color: var(--text-2); font-size: 0.85rem; margin: 0; line-height: 1.5; }
.topic-card .article-count { margin-top: 8px; font-size: 0.75rem; font-weight: 600; color: var(--text-3); }

/* About section */
.about-section {
  padding: 32px 0; border-top: 1px solid var(--line);
  max-width: 60ch;
}
.about-section h2 { font-family: var(--display); margin: 0 0 10px; font-size: 1.2rem; font-weight: 700; }
.about-section p { color: var(--text-2); line-height: 1.65; margin: 0 0 8px; font-size: 0.92rem; }

/* Topic page */
.topic-hero { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 2px solid var(--text); }
.topic-hero .topic-meta { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.topic-hero .topic-meta span { font-size: 0.82rem; color: var(--text-3); font-weight: 500; }

.importance-group { margin-bottom: 36px; }
.importance-label {
  display: inline-block; font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.1em; font-weight: 700; padding: 3px 8px;
  border-radius: 2px; margin-bottom: 12px;
}
.importance-label.foundational { background: var(--bg-2); color: var(--text); }
.importance-label.major { background: var(--bg-2); color: var(--text-2); }
.importance-label.standard { background: var(--bg-2); color: var(--text-3); }

.article-list { display: flex; flex-direction: column; gap: 0; }
.article-list-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
.article-list-item:first-child { border-top: 1px solid var(--line); }
.article-list-item:hover { background: var(--bg-2); padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; }
.article-list-item h4 { margin: 0 0 3px; font-family: var(--display); font-size: 1rem; font-weight: 700; }
.article-list-item p { margin: 0; font-size: 0.85rem; color: var(--text-2); }
.article-list-item .item-meta { font-size: 0.75rem; color: var(--text-3); white-space: nowrap; }

/* Article page */
.breadcrumbs {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--text-3); margin-bottom: 16px;
}
.breadcrumbs a { font-weight: 600; color: var(--text-2); }
.breadcrumbs .sep { color: var(--line-hover); }

.article-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-header h1 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.12; margin-bottom: 12px; font-weight: 700;
  letter-spacing: -0.02em;
}
.article-header .subtitle { font-size: 1rem; color: var(--text-2); max-width: 64ch; line-height: 1.6; }
.article-meta {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  margin-top: 12px; font-size: 0.78rem; color: var(--text-3);
}
.article-meta .tag {
  padding: 2px 8px; border-radius: 2px;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 0.72rem; font-weight: 600;
}

.article-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 200px;
  gap: 48px; margin-top: 24px;
}

.article-body { max-width: 72ch; }
.article-body h2 {
  font-family: var(--display); margin: 36px 0 12px; font-size: 1.3rem;
  scroll-margin-top: 72px; font-weight: 700;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.article-body h3 {
  font-family: var(--display); margin: 28px 0 8px; font-size: 1.1rem;
  scroll-margin-top: 72px; font-weight: 700;
}
.article-body h4 { font-family: var(--display); margin: 20px 0 6px; font-size: 0.98rem; font-weight: 700; }
.article-body p { color: var(--text-2); line-height: 1.8; font-size: 0.95rem; margin: 0 0 14px; }
.article-body ul, .article-body ol { color: var(--text-2); line-height: 1.75; margin: 0 0 14px; font-size: 0.95rem; }
.article-body li { margin: 5px 0; }
.article-body blockquote {
  margin: 18px 0; padding: 14px 20px;
  background: var(--bg-2); border-left: 3px solid var(--text);
  border-radius: 0;
}
.article-body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--text-2); }
.article-body section { margin-bottom: 4px; }

/* TOC sidebar */
.toc-sidebar { position: sticky; top: 72px; align-self: start; }
.toc-sidebar .toc-title {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em;
  font-weight: 700; color: var(--text-3); margin-bottom: 10px;
}
.toc-sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.toc-sidebar nav a {
  display: block; padding: 4px 10px;
  font-size: 0.78rem; color: var(--text-3); font-weight: 500;
  border-left: 2px solid transparent; line-height: 1.4;
}
.toc-sidebar nav a:hover { color: var(--text); }
.toc-sidebar nav a.active { color: var(--text); border-left-color: var(--text); font-weight: 600; }
.toc-sidebar nav a.toc-h3 { padding-left: 20px; font-size: 0.75rem; }

/* Mobile TOC */
.mobile-toc {
  display: none; margin-bottom: 24px;
  border: 1px solid var(--line); border-radius: 0;
  background: var(--panel); overflow: hidden;
}
.mobile-toc-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 16px; border: none; background: none;
  font-family: var(--body); font-size: 0.85rem; font-weight: 700;
  color: var(--text); cursor: pointer;
}
.mobile-toc-toggle .arrow { font-size: 0.65rem; }
.mobile-toc.open .mobile-toc-toggle .arrow { transform: rotate(180deg); }
.mobile-toc-content { display: none; padding: 0 16px 12px; }
.mobile-toc.open .mobile-toc-content { display: block; }
.mobile-toc-content a { display: block; padding: 4px 0; font-size: 0.82rem; color: var(--text-2); }
.mobile-toc-content a.toc-h3 { padding-left: 14px; }
.mobile-toc-content a:hover { color: var(--text); }

/* Related */
.backlinks { margin-top: 40px; padding-top: 24px; border-top: 2px solid var(--text); }
.backlinks h3 { font-family: var(--display); margin: 0 0 14px; font-size: 1.1rem; font-weight: 700; }
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px; background: var(--line);
}
.related-card {
  padding: 16px; background: var(--panel);
}
.related-card:hover { background: var(--bg-2); }
.related-card h4 { margin: 0 0 4px; font-family: var(--display); font-size: 0.95rem; font-weight: 700; }
.related-card p { margin: 0; font-size: 0.75rem; color: var(--text-3); }

/* Ads */
.ad-section { display: flex; flex-direction: column; gap: 8px; }
.ad-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); font-weight: 700; }
.ad-slot {
  background: var(--bg-2); border: 1px dashed var(--line);
  border-radius: 0; padding: 18px; min-height: 90px;
  display: grid; place-items: center; color: var(--text-3);
}
.ad-inline { margin: 24px 0; }

/* FAQ */
.faq-section { margin-top: 32px; }
.faq-section h2 { font-family: var(--display); margin: 0 0 14px; font-size: 1.15rem; font-weight: 700; }
.faq {
  padding: 16px 0; border-bottom: 1px solid var(--line);
  background: var(--panel); margin-bottom: 0;
}
.faq:first-of-type { border-top: 1px solid var(--line); }
.faq h3 { margin: 0 0 4px; font-size: 0.95rem; font-family: var(--display); font-weight: 700; }
.faq p { margin: 0; color: var(--text-2); line-height: 1.6; font-size: 0.9rem; }

/* Footer */
.site-footer {
  padding: 40px 6vw 24px; border-top: 2px solid var(--text);
  background: var(--bg);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
.footer-title {
  margin-bottom: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 0.68rem; color: var(--text-3);
}
.footer-grid a { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--text-2); }
.footer-grid a:hover { color: var(--text); }
.site-footer p { margin: 0 0 6px; color: var(--text-2); line-height: 1.55; font-size: 0.85rem; }
.footer-meta {
  margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--text-3); font-size: 0.75rem;
}

/* Static pages */
.page-simple { max-width: 72ch; }
.page-simple h1 { font-family: var(--display); margin: 0 0 12px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.page-simple h2 { font-family: var(--display); margin: 0 0 10px; font-size: 1.15rem; font-weight: 700; }
.page-simple p { margin: 0 0 14px; color: var(--text-2); line-height: 1.8; font-size: 0.95rem; }
.page-simple a { text-decoration: underline; text-underline-offset: 3px; }
.page-simple ul { margin: 0 0 14px; font-size: 0.95rem; }
.page-simple section { margin-bottom: 16px; }

/* Feature grid */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px; background: var(--line);
}
.feature {
  padding: 18px; background: var(--panel);
}
.feature:hover { background: var(--bg-2); }
.feature-title { font-family: var(--display); font-weight: 700; font-size: 0.95rem; }
.feature-text { margin: 5px 0 0; color: var(--text-2); line-height: 1.55; font-size: 0.85rem; }

.muted { color: var(--text-2); font-size: 0.9rem; }

/* Reveal — subtle */
.reveal { opacity: 0; transform: translateY(6px); transition: opacity 0.4s ease, transform 0.4s ease; }
.reveal.reveal-in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Mobile nav */
.mobile-nav { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.35); }
.mobile-nav.open { display: block; }
.mobile-nav-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: 280px;
  background: var(--panel); border-left: 1px solid var(--line);
  padding: 24px; overflow-y: auto;
}
.mobile-nav-panel .nav-close { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.mobile-nav-panel .nav-close button {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 2px;
  background: var(--panel); cursor: pointer; color: var(--text); font-size: 1rem;
}
.mobile-nav-panel a {
  display: block; padding: 10px 0; font-size: 0.92rem; font-weight: 600;
  color: var(--text); border-bottom: 1px solid var(--line);
}
.mobile-nav-panel .nav-section-title {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3); font-weight: 700; margin-top: 18px; margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .header-topics { display: none; }
  .hamburger { display: grid; }
}

@media (max-width: 980px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
  .mobile-toc { display: block; }
  .hero { max-width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .page { padding: 24px 5vw 56px; }
  .site-header { padding: 0 5vw; }
  .site-footer { padding: 28px 5vw 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1, .topic-hero h1 { font-size: clamp(1.7rem, 6vw, 2.2rem); }
  .hero-links { flex-direction: column; align-items: center; }
  .featured-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .search-btn .kbd { display: none; }
}

@media (min-width: 1025px) { .site-tagline { display: block; } }
