/* BlueBird Tracker — News: light, readable, modern */
:root {
  --bg: #f4f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0284c7;
  --accent-soft: #e0f2fe;
  --accent-hover: #0369a1;
  --mint: #0d9488;
  --mint-soft: #ccfbf1;
  --amber-soft: #fef3c7;
  --rose-soft: #ffe4e6;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --measure: 40rem;
  --content: 44rem;
  --wide: 58rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Soft page wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 0% -10%, rgba(14, 165, 233, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(13, 148, 136, 0.08), transparent 50%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #f1f5f9;
  color: #0e7490;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* —— Shell —— */
.wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
  padding-top: max(1.25rem, env(safe-area-inset-top));
}

.wrap.wide {
  max-width: var(--wide);
}

/* —— Top nav —— */
.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.15rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 2rem;
  padding: 0.55rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: 100%;
}

.topnav .topnav-lang {
  margin-left: 0.35rem;
  padding-left: 0.45rem;
  border-left: 1px solid var(--border);
}

.topnav .lang-switch--inline {
  min-height: auto;
  padding: 0.15rem 0.35rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.topnav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-weight: 500;
}
.topnav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.topnav span {
  color: #cbd5e1;
  user-select: none;
  padding: 0 0.1rem;
}
.topnav strong {
  color: var(--text);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
}

/* —— Page header —— */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mint);
  font-weight: 600;
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.65rem;
  background: var(--mint-soft);
  border-radius: 999px;
}

h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin: 0 0 0.85rem;
  color: var(--text);
}

h1 span {
  color: var(--accent);
  font-weight: 700;
}

.lede {
  margin: 0 0 1.35rem;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.65;
  max-width: 38rem;
  font-weight: 400;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.meta-row time {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* —— CTAs —— */
.cta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0 0 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.btn:hover {
  background: var(--accent-hover);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn.ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary) !important;
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover {
  border-color: var(--border-strong);
  color: var(--text) !important;
  background: #fff;
}

/* —— Index cards —— */
.news-grid {
  display: grid;
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  text-decoration: none !important;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}
.card:hover {
  border-color: #bae6fd;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card .tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.55rem;
  padding: 0.22rem 0.55rem;
  background: var(--accent-soft);
  border-radius: 999px;
}

.card h2 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  line-height: 1.35;
  color: var(--text);
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  flex: 1;
}

.card .when {
  display: block;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.card.featured {
  background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
  border-color: #bae6fd;
  padding: 1.6rem 1.55rem;
}
.card.featured h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.45rem);
}
.card.featured .tag {
  background: #0ea5e9;
  color: #fff;
}

/* —— Article body —— */
.article {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: var(--measure);
}

.article h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.25rem 0 0.7rem;
  color: var(--text);
  line-height: 1.3;
}

.article h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 1.5rem 0 0.45rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.article p {
  margin: 0 0 1.15rem;
  color: var(--text-secondary);
}

.article ul,
.article ol {
  margin: 0 0 1.2rem;
  padding-left: 1.35rem;
  color: var(--text-secondary);
}

.article li {
  margin-bottom: 0.45rem;
  padding-left: 0.2rem;
}

.article li::marker {
  color: var(--accent);
}

.article strong {
  color: var(--text);
  font-weight: 650;
}

.article a {
  font-weight: 500;
}

/* Fact box */
.factbox {
  margin: 1.5rem 0;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid #99f6e4;
  background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.factbox h3 {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
  font-weight: 700;
}

.factbox dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 0.45rem 1rem;
  align-items: baseline;
}

.factbox dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}
.factbox dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

/* Callout CTA */
.callout {
  margin: 1.75rem 0;
  padding: 1.2rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid #bae6fd;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 70%);
  box-shadow: var(--shadow-sm);
}

.callout p {
  margin: 0 0 0.85rem;
  color: var(--text-secondary);
  font-size: 1rem;
}

.callout .btn {
  margin-top: 0.15rem;
}

/* Related */
.related {
  margin-top: 2.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.related h2 {
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.related ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.related li {
  margin-bottom: 0.4rem;
}

/* Footer disclaimer */
.disclaimer {
  margin-top: 2.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 36rem;
}

.site-disclaimer {
  opacity: 0.85;
  letter-spacing: 0.02em;
}

.site-author {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.4;
}

.site-author a {
  color: inherit;
  text-decoration: none;
}

.site-author a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Index intro on wide layout */
.wrap.wide > .lede {
  max-width: 42rem;
}

/* Responsive */
@media (min-width: 720px) {
  .news-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
  }
  .news-grid .card.featured {
    grid-column: 1 / -1;
  }
  .article {
    font-size: 1.1rem;
  }
}

@media (max-width: 520px) {
  .topnav {
    border-radius: 14px;
    width: 100%;
  }
  .factbox dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .factbox dt {
    margin-top: 0.35rem;
  }
  .factbox dt:first-child {
    margin-top: 0;
  }
}

/* Print-friendly reading */
@media print {
  body::before {
    display: none;
  }
  .cta-bar,
  .topnav {
    display: none;
  }
  .card,
  .factbox,
  .callout,
  .related {
    box-shadow: none;
    border-color: #ccc;
  }
}
