/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1a1a1a;
  --ink-light:  #555;
  --ink-faint:  #888;
  --rule:       #e0e0e0;
  --bg:         #fafaf8;
  --bg-card:    #ffffff;
  --accent:     #b5342a;   /* deep red — editorial */
  --accent-dim: #f3ebe9;
  --flag-bg:    #fff8e6;
  --flag-border:#e0c060;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --max-w:      860px;
}

html { font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ───────────────────────────────────────────────── */
header {
  border-bottom: 2px solid var(--ink);
  padding: 1.5rem 0 1rem;
  margin-bottom: 1.5rem;
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.site-title span {
  color: var(--accent);
}

.site-tagline {
  font-size: 0.78rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.15rem;
}

nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-light);
}

nav a:hover { color: var(--ink); }
nav a.active { color: var(--accent); font-weight: 600; }

/* ── Date bar ─────────────────────────────────────────────── */
.date-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.date-label {
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.date-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.date-pill {
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  border: 1px solid var(--rule);
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.15s;
}

.date-pill:hover { border-color: var(--ink-light); color: var(--ink); text-decoration: none; }
.date-pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── Filter bar ───────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.filter-label {
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.25rem;
}

.filter-pill {
  padding: 0.25rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  border: 1px solid var(--rule);
  color: var(--ink-light);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.filter-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Category section ─────────────────────────────────────── */
.category-section { margin-bottom: 2.5rem; }

.category-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.category-icon { font-size: 1rem; }

.category-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-light);
}

.category-count {
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-left: auto;
}

/* ── Digest card ──────────────────────────────────────────── */
.digest-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.6rem;
  transition: border-color 0.15s;
}

.digest-card:hover { border-color: #bbb; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.card-country {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.card-sources {
  font-size: 0.72rem;
  color: var(--ink-faint);
}

.card-sources a {
  color: var(--ink-faint);
  text-decoration: underline;
  text-decoration-color: var(--rule);
}

.card-sources a:hover { color: var(--ink-light); }

.card-headline {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: normal;
  line-height: 1.4;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.card-summary {
  font-size: 0.875rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

/* ── Expandable summary ───────────────────────────────────── */
.card-details {
  margin-bottom: 0.5rem;
}

.card-details summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--ink-light);
  line-height: 1.6;
}

.card-details summary::-webkit-details-marker { display: none; }

.card-details[open] summary .expand-hint { display: none; }

.expand-hint {
  font-size: 0.75rem;
  color: var(--accent);
  font-style: normal;
  white-space: nowrap;
}

.card-summary-full {
  font-size: 0.875rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--rule);
}

/* ── Source links ─────────────────────────────────────────── */
.card-source-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.source-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  transition: all 0.15s;
  white-space: nowrap;
}

.source-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  justify-content: space-between;
}

.ai-disclaimer {
  font-size: 0.68rem;
  color: var(--ink-faint);
  font-style: italic;
}

.editorial-flag {
  font-size: 0.68rem;
  color: #7a6000;
  background: var(--flag-bg);
  border: 1px solid var(--flag-border);
  border-radius: 3px;
  padding: 0.15rem 0.45rem;
}

/* ── Search ───────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--ink);
  outline: none;
}

.search-input:focus { border-color: var(--ink-light); }

.search-btn {
  padding: 0.5rem 1.1rem;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font-sans);
}

.search-btn:hover { background: #333; }

/* ── About ────────────────────────────────────────────────── */
.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: normal;
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
}

.prose p, .prose li { font-size: 0.9rem; color: var(--ink-light); margin-bottom: 0.5rem; }
.prose ul { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.prose strong { color: var(--ink); }

/* ── Footer ───────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-align: center;
}

.top-newsletter {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-newsletter-label {
  font-size: 0.9rem;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.newsletter-form {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-card);
  width: 220px;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.newsletter-form button {
  padding: 0.45rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  cursor: pointer;
  font-weight: 600;
}

.newsletter-form button:hover {
  background: #9e2c23;
}

.footer-meta {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.subscribe-banner {
  background: #f0f7f0;
  border: 1px solid #b8d8b8;
  border-radius: 4px;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #2a6b2a;
  margin-bottom: 1.5rem;
}

.subscribe-banner.error {
  background: #fff3f3;
  border-color: #f0b8b8;
  color: #8b2020;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* ── Map ──────────────────────────────────────────────────── */
#region-map {
  height: 320px;
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--rule);
  margin-bottom: 1.75rem;
  background: #f0ede8;
}

.map-tooltip {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 0.3rem 0.6rem;
  color: var(--ink);
}

.leaflet-tooltip.map-tooltip {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--ink);
}


/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-title { font-size: 1.5rem; }
  nav { gap: 1rem; }
  .digest-card { padding: 0.85rem; }
}
