/* ExtraReach redesign — dark navy editorial system
   Lean, offline-friendly, no third-party assets */

:root {
  --bg: #0b1220;
  --bg-elevated: #111a2e;
  --bg-card: #141f36;
  --bg-card-hover: #1a2742;
  --border: #243049;
  --border-strong: #334463;
  --text: #e8eef8;
  --text-muted: #9aa8c0;
  --text-dim: #6e7d96;
  --accent: #5b9fd4;
  --accent-soft: rgba(91, 159, 212, 0.14);
  --accent-hover: #7ab3e0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --max: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --leading: 1.65;
}

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

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

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* —— Layout —— */
.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.brand a {
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand a:hover {
  color: var(--accent-hover);
}

.brand-tag {
  color: var(--text-dim);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— Nav —— */
.nav-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
}

.nav-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  align-items: center;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* —— Hero —— */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0 2rem;
}

.hero-copy h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 740;
}

.hero-copy .lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 1.35rem;
  max-width: 38ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #0b1220;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #0b1220;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.hero-media {
  position: relative;
}

.hero-media .frame,
.media-frame {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(145deg, #152038 0%, #0e1628 100%);
  aspect-ratio: 16 / 10;
  box-shadow: var(--shadow);
}

.hero-media img,
.media-frame img,
.post-thumb img,
.article-hero img,
.article-inline img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(91, 159, 212, 0.12), transparent 55%),
    linear-gradient(160deg, #152038, #0c1424);
}

/* —— Trust card —— */
.trust-card {
  margin: 0 0 2.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.15rem;
  align-items: start;
}

.trust-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.trust-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 650;
}

.trust-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.trust-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 550;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

/* —— Sections —— */
.section {
  padding: 0 0 2.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.section-head a {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.section-head a:hover {
  color: var(--accent);
}

/* —— Cards —— */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  height: 100%;
}

.post-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0;
}

.post-thumb {
  aspect-ratio: 16 / 10;
  background: #0e1628;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.post-card.featured .post-thumb {
  aspect-ratio: auto;
  min-height: 220px;
  border-bottom: none;
  border-right: 1px solid var(--border);
  height: 100%;
}

.post-body {
  padding: 1.15rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.badge {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(91, 159, 212, 0.28);
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.post-card h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.post-card h3 a {
  color: var(--text);
}

.post-card h3 a:hover {
  color: var(--accent-hover);
}

.post-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  flex: 1;
}

.read-more {
  margin-top: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.post-card:hover .read-more {
  color: var(--accent-hover);
}

/* —— Two-col home layout —— */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.75rem;
  align-items: start;
}

.sidebar .panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}

.sidebar h2 {
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}

.sidebar p,
.sidebar li {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.sidebar ul {
  margin: 0;
  padding-left: 1.1rem;
}

.sidebar li {
  margin-bottom: 0.35rem;
}

.sidebar a {
  color: var(--text-muted);
}

.sidebar a:hover {
  color: var(--accent);
}

/* —— Article —— */
.article {
  padding: 2rem 0 3rem;
  max-width: 720px;
  margin-inline: auto;
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-header .post-meta {
  margin-bottom: 0.75rem;
}

.article-header h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.6rem, 3.5vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.article-subhead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.article-hero {
  margin: 0 0 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0e1628;
}

.article-hero figcaption,
.article-inline figcaption {
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
}

.article-inline {
  margin: 1.75rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #0e1628;
}

.article-inline .media-frame {
  aspect-ratio: 16 / 10;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.prose h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

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

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

.takeaway {
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--accent-soft);
  border: 1px solid rgba(91, 159, 212, 0.28);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.takeaway strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.takeaway p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.sources {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.sources h2 {
  margin-top: 0;
}

.sources ol {
  padding-left: 1.25rem;
}

.sources li {
  margin-bottom: 0.65rem;
  word-break: break-word;
}

.sources a {
  font-size: 0.92rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.back-link:hover {
  color: var(--accent);
}

/* —— Stub pages —— */
.stub {
  padding: 2.5rem 0 3.5rem;
  max-width: 640px;
}

.stub h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}

.stub p {
  color: var(--text-muted);
  margin: 0 0 1rem;
}

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  margin-top: auto;
}

.site-footer p {
  margin: 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-main {
  flex: 1;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1.75rem;
  }

  .home-layout {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .post-card.featured {
    grid-template-columns: 1fr;
  }

  .post-card.featured .post-thumb {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 180px;
  }

  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .sidebar .panel {
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - 1.25rem, var(--max));
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.35rem 0 0.75rem;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid var(--border);
  }

  .nav a[aria-current="page"] {
    border-bottom-color: var(--accent);
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .brand-tag {
    display: none;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .trust-card {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 1.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .post-card,
  a,
  .btn {
    transition: none;
  }

  .post-card:hover {
    transform: none;
  }
}
