/* =============================================================
   Prosperity Link Hub — style.css
   E-Ink / Paper aesthetic · Newsreader editorial type
   ============================================================= */

/* ── Fonts ─────────────────────────────────────────────────── */
/* Loaded via <link> in head.js */

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  background: #fdfbf7;
  color: #1a1a1a;
  font-family: 'Newsreader', Georgia, 'Times New Roman', serif;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.4rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.15rem, 3vw, 1.7rem); margin-top: 2rem; }
h3 { font-size: clamp(1rem, 2.5vw, 1.35rem); margin-top: 1.5rem; }

p { margin-top: 1rem; }
p:first-child { margin-top: 0; }

a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: none;
}
a:hover { opacity: 0.65; }

ul, ol { padding-left: 1.4rem; margin-top: 1rem; }
li { margin-top: 0.4rem; }

strong { font-weight: 700; }
em { font-style: italic; }

hr {
  border: none;
  border-top: 1px solid #1a1a1a;
  margin: 1rem 0;
}

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

/* ── Site wrap ─────────────────────────────────────────────── */
.site-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fdfbf7;
  border-bottom: 1px solid #1a1a1a;
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  height: 56px;
  width: 100%;
  overflow: hidden;
}

/* Brand centered via flex */
.brand {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1a1a;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.brand-mark { border: 1px solid #1a1a1a; flex-shrink: 0; }

.brand-name {
  font-family: 'Newsreader', serif;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Menu toggle ───────────────────────────────────────────── */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid #1a1a1a;
  padding: 10px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

.toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #1a1a1a;
}

/* ── Header CTAs ───────────────────────────────────────────── */
.header-ctas {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.6rem;
  min-height: 44px;
  font-family: 'Roboto', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: none;
  flex-shrink: 0;
}

.cta-signup {
  background: #1a1a1a;
  color: #fdfbf7;
  border: 1px solid #1a1a1a;
}

.cta-signup:hover { background: #333; opacity: 1; }

.cta-login {
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
}

.cta-login:hover { background: #f5f5f5; opacity: 1; }

/* ── Desktop nav (anchor strip below header-inner) ─────────── */
.desktop-nav {
  display: none;
  border-top: 1px solid #e0e0e0;
  overflow-x: auto;
  width: 100%;
}

.desktop-nav > p {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 1rem;
  flex-wrap: wrap;
  margin: 0;
}

.desktop-nav > p > a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.9rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: #1a1a1a;
  border-right: 1px solid #e0e0e0;
  min-height: 44px;
  white-space: nowrap;
}

.desktop-nav > p > a:first-child { border-left: 1px solid #e0e0e0; }
.desktop-nav > p > a:hover { background: #f5f5f5; }

@media (min-width: 769px) {
  .desktop-nav { display: block; }
  .menu-toggle { display: none; }
}

/* ── Fullscreen overlay nav ────────────────────────────────── */
.fullscreen-nav {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #fdfbf7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  transform: translateX(-100%);
  transition: none;
  overflow-y: auto;
}

.fullscreen-nav.is-open {
  transform: translateX(0);
}

.fullscreen-nav nav > p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.fullscreen-nav nav > p > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  padding: 0.85rem 1.25rem;
  font-family: 'Newsreader', serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  color: #1a1a1a;
  border-bottom: 1px solid #e0e0e0;
  min-height: 52px;
  text-align: center;
}

.fullscreen-nav nav > p > a:hover { background: #f5f5f5; }

.nav-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid #1a1a1a;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.3rem 0.7rem;
  min-width: 44px;
  min-height: 44px;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  padding: 0 1rem;
  width: 100%;
  overflow: hidden;
}

.breadcrumb > p {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.78rem;
  color: #555;
  flex-wrap: wrap;
  margin: 0;
  min-height: 44px;
}

.breadcrumb > p > a {
  color: #555;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.15rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumb > p > span[aria-current="page"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bc-sep {
  color: #999;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ── Hero (home) ───────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #1a1a1a;
  background: #f5f5f5;
  width: 100%;
}

.hero-collage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  object-fit: cover;
}

.hero-img--main {
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  opacity: 0.18;
}

.hero-img--offset {
  bottom: 0;
  right: 0;
  width: 45%;
  height: 80%;
  opacity: 0.12;
}

.hero-copy {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 1.25rem;
  max-width: 780px;
  width: 100%;
}

.hero-h1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.hero-desc {
  margin-top: 1rem;
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  color: #444;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Inner hero (about / privacy / topic) ──────────────────── */
.inner-hero,
.inner-hero--about,
.topic-hero {
  background: #f5f5f5;
  border-bottom: 1px solid #1a1a1a;
  padding: 2.5rem 1.25rem;
  width: 100%;
}

.inner-hero-copy h1,
.topic-hero-copy h1 {
  font-size: clamp(1.3rem, 4vw, 2.4rem);
}

.topic-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topic-hero-media { flex-shrink: 0; }

.topic-hero-img {
  width: 180px;
  height: 140px;
  object-fit: cover;
  border: 1px solid #1a1a1a;
}

.topic-hero-copy { flex: 1; min-width: 0; }

/* ── Article header ────────────────────────────────────────── */
.article-header {
  padding: 2rem 1.25rem 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.article-hero-wrap { margin-top: 1.5rem; }

.article-hero-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border: 1px solid #1a1a1a;
}

/* ── Byline ────────────────────────────────────────────────── */
.byline {
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

.byline time { font-style: italic; }

/* ── Eyebrow / stage label ─────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-family: 'Roboto', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 0.5rem;
}

.stage-label {
  display: inline-block;
  font-family: 'Roboto', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border: 1px solid #1a1a1a;
  margin-bottom: 0.5rem;
}

.stage-label--awareness  { border-color: #555; color: #555; }
.stage-label--consideration { border-color: #888; color: #888; }
.stage-label--decision   { border-color: #1a1a1a; color: #1a1a1a; }

/* ── Main layout (content + sidebar) ──────────────────────── */
.content-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 1rem 3rem;
  align-items: start;
}

@media (min-width: 900px) {
  .content-main {
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    padding: 2rem 1.5rem 4rem;
  }
}

.content-article {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.content-section {
  padding-top: 1.5rem;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  order: -1;
  min-width: 0;
}

@media (min-width: 900px) {
  .sidebar {
    order: 1;
    position: sticky;
    top: 120px;
  }
}

.sidebar-inner {
  background: rgba(245, 245, 245, 0.6);
  border: 1px solid #1a1a1a;
  border-radius: 28px;
  padding: 1.25rem 1.25rem 1.5rem;
}

.sidebar-heading {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Roboto', sans-serif;
  margin-top: 0;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
}

.sidebar-list li {
  margin: 0;
  border-bottom: 1px solid #e0e0e0;
}

.sidebar-list li:last-child { border-bottom: none; }

.sidebar-list a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.25rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.82rem;
  text-decoration: none;
  min-height: 44px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.sidebar-list a:hover { background: #f5f5f5; }

.sidebar-num {
  font-family: 'Roboto', sans-serif;
  font-size: 0.7rem;
  color: #999;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sidebar-about {
  margin-top: 1rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.82rem;
}

.sidebar-trust {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  font-family: 'Roboto', sans-serif;
}

/* ── Prose (body copy) ─────────────────────────────────────── */
.prose {
  max-width: 70ch;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }

.prose a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover { opacity: 0.6; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose table th,
.prose table td {
  border: 1px solid #1a1a1a;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.prose table th {
  background: #f5f5f5;
  font-weight: 700;
}

.prose blockquote {
  border-left: 3px solid #1a1a1a;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  background: #f5f5f5;
  font-style: italic;
}

/* ── Section rule ──────────────────────────────────────────── */
.section-rule {
  margin: 2rem 0;
}

/* ── Card list (home children) ─────────────────────────────── */
.card-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 1.25rem;
}

.card-item {
  border-radius: 28px;
  border: 1px solid #1a1a1a;
  background: rgba(245, 245, 245, 0.55);
  overflow: hidden;
  min-width: 0;
}

.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: #1a1a1a;
}

.card-link:hover { background: #f5f5f5; opacity: 1; }

.card-thumb img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-bottom: 1px solid #1a1a1a;
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card-title {
  font-family: 'Newsreader', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-desc {
  font-family: 'Roboto', sans-serif;
  font-size: 0.82rem;
  color: #444;
  line-height: 1.45;
}

.card-date {
  font-family: 'Roboto', sans-serif;
  font-size: 0.75rem;
  color: #888;
}

/* ── Child list (topic children) ───────────────────────────── */
.children-section {
  margin-top: 2.5rem;
}

.section-heading {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Roboto', sans-serif;
}

.child-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.child-item {
  border-bottom: 1px solid #e0e0e0;
}

.child-item:last-child { border-bottom: none; }

.child-item a {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0.25rem;
  text-decoration: none;
  color: #1a1a1a;
  min-height: 44px;
}

.child-item a:hover { background: #f5f5f5; }

.child-num {
  font-family: 'Roboto', sans-serif;
  font-size: 0.75rem;
  color: #aaa;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.child-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.child-title {
  font-family: 'Newsreader', serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.child-desc {
  font-family: 'Roboto', sans-serif;
  font-size: 0.82rem;
  color: #555;
  line-height: 1.4;
}

/* Stagger animation */
@media (prefers-reduced-motion: no-preference) {
  .child-item--stagger {
    animation: staggerIn 0.25s both;
    animation-delay: calc(var(--stagger-i, 0) * 60ms);
  }

  @keyframes staggerIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ── Rank section ──────────────────────────────────────────── */
.rank-summary { margin-top: 2.5rem; }

.rank-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid #e0e0e0;
  font-family: 'Roboto', sans-serif;
}

.rank-item:last-child { border-bottom: none; }

.rank-pos {
  font-weight: 700;
  font-size: 0.85rem;
  color: #888;
  flex-shrink: 0;
  min-width: 2rem;
}

.rank-name { font-size: 0.95rem; }

/* ── Author section ────────────────────────────────────────── */
.author-section { margin-top: 3rem; }

.author-heading {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Roboto', sans-serif;
}

.author-card {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid #1a1a1a;
  border-radius: 28px;
  background: rgba(245, 245, 245, 0.5);
}

.author-name {
  font-family: 'Newsreader', serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0;
}

.author-credentials {
  font-family: 'Roboto', sans-serif;
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.35rem;
}

.author-bio {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid #1a1a1a;
  background: #f5f5f5;
  padding: 2rem 1.25rem;
  width: 100%;
}

/* Footer holds only p and small per structure lottery */
.site-footer p,
.site-footer small {
  font-family: 'Roboto', sans-serif;
  font-size: 0.82rem;
  color: #444;
  line-height: 1.5;
  margin-top: 0.5rem;
}

.site-footer p:first-child {
  margin-top: 0;
}

.site-footer p a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  min-height: 44px;
}

.footer-brand { font-weight: 500; }

.footer-rg {
  display: block;
  font-size: 0.75rem;
  color: #777;
  line-height: 1.55;
  border-top: 1px solid #e0e0e0;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

/* ── Utility ───────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Mobile nav guard (≤768px) ─────────────────────────────── */
@media (max-width: 768px) {
  .desktop-nav { display: none !important; }

  .header-inner {
    height: 56px;
    padding: 0 0.6rem;
    gap: 0.35rem;
  }

  .brand-name {
    font-size: 0.82rem;
  }

  .cta {
    font-size: 0.68rem;
    padding: 0 0.45rem;
    letter-spacing: 0.03em;
  }

  .hero { min-height: 42vh; }

  .topic-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .topic-hero-img { width: 100%; height: 160px; }

  .content-main {
    padding: 1rem 1rem 2rem;
    display: block;
  }

  .sidebar {
    margin-bottom: 1.5rem;
  }

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

  .article-header {
    padding: 1rem 1rem 0;
  }

  .prose { max-width: 100%; }

  .site-footer {
    padding: 1.5rem 1rem;
  }

  /* Footer trust links: ensure tap targets on mobile */
  .footer-trust a {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0;
    min-height: 44px;
  }

  .inner-hero,
  .inner-hero--about,
  .topic-hero {
    padding: 1.5rem 1rem;
  }

  /* Breadcrumb: ensure full row is tall enough for tap targets */
  .breadcrumb {
    padding: 0 0.75rem;
  }

  .breadcrumb > p {
    min-height: 44px;
    gap: 0.25rem;
  }

  .breadcrumb > p > a {
    min-height: 44px;
    padding: 0 0.2rem;
  }

  .breadcrumb > p > span[aria-current="page"] {
    max-width: 140px;
  }
}

/* ── Hover micro-interactions (desktop only) ───────────────── */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .card-link:hover .card-title {
    text-decoration: underline;
  }

  .child-item a:hover .child-title {
    text-decoration: underline;
  }

  .sidebar-list a:hover {
    background: #f5f5f5;
  }
}

a[data-cta],button[aria-controls]{min-height:44px;min-width:44px;box-sizing:border-box}main p a{text-decoration:underline}