:root {
  --ink: #1a1712;
  --paper: #fbf7ee;
  --paper-edge: #e8e0cf;
  --accent: #8a1f1f;
  --social: #1d6fb8;
  --good: #2e7d4f;
  --mid: #c79320;
  --bad: #b23b3b;
  --bg: #cdbfa6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #d8ccb4, transparent 60%),
    radial-gradient(circle at 80% 90%, #c2b294, transparent 55%),
    var(--bg);
  min-height: 100vh;
}

/* ── masthead ─────────────────────────────────────────────── */
.masthead {
  text-align: center;
  padding: 1.4rem 1rem 1rem;
  border-bottom: 3px double var(--ink);
  background: rgba(251, 247, 238, 0.7);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(4px);
}
.brand h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: 0.12em;
  font-weight: 900;
}
.tagline {
  margin: 0.1rem 0 0.8rem;
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b5f4a;
}
.searchbar {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}
.searchbar input {
  width: min(560px, 80vw);
  padding: 0.55rem 0.8rem;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
}
.searchbar button {
  padding: 0.55rem 1.1rem;
  font-family: Georgia, serif;
  font-weight: bold;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.searchbar button.ghost { background: var(--paper); color: var(--ink); }
.status { min-height: 1.1em; margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--accent); }

/* ── floating newspaper feed ──────────────────────────────── */
.feed {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1.2rem 4rem;
  max-width: 1300px;
  margin: 0 auto;
}

.paper {
  width: 250px;
  background: var(--paper);
  /* the centre "fold" of a folded newspaper */
  background-image: linear-gradient(
    to right, transparent 49.3%, rgba(0,0,0,0.07) 49.7%, rgba(0,0,0,0.07) 50.3%, transparent 50.7%);
  border: 1px solid var(--paper-edge);
  border-radius: 3px;
  padding: 0.9rem 0.95rem 1.1rem;
  box-shadow: 3px 5px 12px rgba(40, 30, 15, 0.28);
  cursor: pointer;
  position: relative;
  transform: rotate(var(--rot, -1.2deg));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: bob 7s ease-in-out infinite;
}
.paper:nth-child(even) { --rot: 1.4deg; animation-delay: -2.5s; }
.paper:nth-child(3n)  { --rot: -0.6deg; animation-delay: -4s; }
.paper:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.03);
  box-shadow: 6px 10px 22px rgba(40, 30, 15, 0.38);
  z-index: 2;
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

/* card thumbnail */
.paper .thumb {
  margin: -0.2rem -0.2rem 0.55rem;
  height: 120px;
  overflow: hidden;
  border-radius: 3px;
  background: #e7ddc8;
}
.paper .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.paper .kicker {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--paper-edge);
  padding-bottom: 0.25rem;
  margin-bottom: 0.45rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* blindspot chip on cards */
.paper .blindspot {
  margin-top: 0.5rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8a4a1e;
  background: #f3e4cf;
  border-left: 3px solid #c06a2a;
  padding: 0.25rem 0.4rem;
  border-radius: 2px;
}

/* reader hero image + coverage bar */
.reader-article .hero {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 0 1rem;
  display: block;
}
.cov {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: #ddd3bf;
  margin: 0.2rem 0 0.35rem;
}
.cov-l { background: #4a6fa5; }
.cov-c { background: #9a917d; }
.cov-r { background: #b0492e; }
.cov-key {
  display: flex;
  justify-content: space-between;
  font-size: 0.66rem;
  color: #6b5f4a;
}
.cov-n { font-size: 0.78rem; color: #463d2c; margin: 0.2rem 0 0.4rem; }
.cov-blind {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8a4a1e;
  background: #f3e4cf;
  border-left: 3px solid #c06a2a;
  padding: 0.35rem 0.5rem;
  border-radius: 3px;
  margin: 0.5rem 0 0;
}
.paper .kicker span:last-child { text-align: right; }
.paper .headline {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.18;
  margin: 0 0 0.5rem;
}
.paper .dek {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #463d2c;
  max-height: 4.2em;
  overflow: hidden;
}

/* social posts look like a post bubble, not a newspaper */
.paper.social {
  background: #eef6fd;
  background-image: none;
  border: 1px solid #bcd9f0;
  border-left: 4px solid var(--social);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
}
.paper.social .kicker { color: var(--social); }
.paper.social .headline { font-weight: 700; font-size: 0.95rem; }

/* topical vertical cards (tech / science / business / health) */
.paper.vertical {
  background-image: none;
  border-left: 4px solid #5a7d5a;
}
.paper.vertical .kicker { color: #5a7d5a; text-transform: capitalize; }

/* Live web results are indexed + styled identically to bundle articles —
   no separate treatment (they get the same trust badge, band, reader). */

/* link out to the source's original article */
.orig {
  display: inline-block;
  margin-top: 1.2rem;
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.orig:hover { opacity: 0.7; }

/* trust badge in the corner of every card */
.badge {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  border: 2px solid var(--paper);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* ── reader overlay (the unfolded article) ───────────────── */
.reader {
  position: fixed;
  inset: 0;
  background: rgba(25, 18, 8, 0.55);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 1.2rem;
}
.reader.hidden { display: none; }
.reader-inner {
  background: var(--paper);
  width: min(960px, 96vw);
  height: 90vh;
  max-height: 90vh;
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 290px;
  /* The row MUST be constrained (minmax floor 0), or it grows to content
     size and the article column can never scroll within the box. This is
     the actual scroll fix — min-height:0 on the children isn't enough on
     its own. */
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: unfold 0.28s ease;
}
@keyframes unfold {
  from { transform: scaleY(0.5) rotateX(35deg); opacity: 0; }
  to   { transform: scaleY(1) rotateX(0); opacity: 1; }
}
.reader-article {
  padding: 2rem 2.2rem;
  overflow-y: auto;
  /* Grid children default to min-height:auto and refuse to shrink below
     their content, so overflow-y never engages and the parent clips it.
     min-height:0 lets the column actually scroll within the 90vh box. */
  min-height: 0;
}
.reader-article .kicker {
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.reader-article h2 { font-size: 1.8rem; margin: 0.3rem 0 1rem; line-height: 1.15; }
.reader-article p { font-size: 1.02rem; line-height: 1.6; }
.close {
  position: absolute; top: 0.4rem; right: 0.6rem;
  border: none; background: none; font-size: 1.8rem; cursor: pointer; color: var(--ink); z-index: 3;
}

.sidebar {
  background: #f1ebdc;
  border-left: 1px solid var(--paper-edge);
  padding: 1.4rem 1.2rem;
  overflow-y: auto;
  min-height: 0; /* same grid-child scroll fix as .reader-article */
  font-family: system-ui, sans-serif;
}
.sidebar h3 { font-family: Georgia, serif; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: #6b5f4a; margin: 1.2rem 0 0.5rem; }
.sidebar h3:first-child { margin-top: 0; }

/* trust meter */
.meter { margin-bottom: 0.55rem; }
.meter .lab { display: flex; justify-content: space-between; font-size: 0.72rem; color: #463d2c; margin-bottom: 0.12rem; }
.meter .track { height: 7px; background: #ddd3bf; border-radius: 4px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 4px; }

.relitem {
  font-family: Georgia, serif;
  font-size: 0.82rem;
  line-height: 1.25;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--paper-edge);
  cursor: pointer;
}
.relitem:hover { color: var(--accent); }
.relitem .src { display: block; font-size: 0.68rem; color: #8a7d63; font-style: italic; }

@media (max-width: 720px) {
  /* Stack into one column that scrolls as a whole, rather than two
     separate tiny scroll panes. */
  .reader-inner { grid-template-columns: 1fr; overflow-y: auto; }
  .reader-article, .sidebar { overflow-y: visible; }
  .sidebar { border-left: none; border-top: 1px solid var(--paper-edge); }
}

/* ── top nav ──────────────────────────────────────────────── */
.topnav {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.topnav a {
  color: #6b5f4a;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.topnav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ── site footer (subscribe + tip) ───────────────────────── */
.sitefoot {
  margin-top: 2rem;
  padding: 2.4rem 1.2rem 2rem;
  border-top: 3px double var(--ink);
  background: rgba(251, 247, 238, 0.82);
}
.foot-cols {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.4rem;
}
.sitefoot h3 {
  font-size: 1.15rem;
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
}
.sitefoot p { margin: 0 0 0.9rem; font-size: 0.92rem; line-height: 1.5; color: #453d2e; }
.subform { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.subform input[type="email"] {
  flex: 1 1 200px;
  min-width: 0;
  padding: 0.55rem 0.75rem;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 0.88rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
}
.subform button {
  padding: 0.55rem 1.2rem;
  font-family: Georgia, serif;
  font-weight: bold;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.subform button:disabled { opacity: 0.55; cursor: wait; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.submsg { min-height: 1.1em; margin: 0.5rem 0 0; font-size: 0.82rem; font-style: italic; }
.submsg.ok { color: var(--good); font-style: normal; }
.submsg.err { color: var(--bad); font-style: normal; }
.tipbtn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  border-radius: 6px;
  border: 2px solid var(--accent);
}
.tipbtn:hover { background: #6f1717; border-color: #6f1717; }
.pledge {
  max-width: 900px;
  margin: 2rem auto 0.4rem;
  text-align: center;
  font-size: 0.86rem;
  font-weight: bold;
  color: var(--ink);
}
.pledge a { color: var(--accent); }
.foot-legal { max-width: 900px; margin: 0 auto; text-align: center; font-size: 0.74rem; color: #8a7d63; font-style: italic; }

@media (max-width: 640px) {
  .foot-cols { grid-template-columns: 1fr; gap: 1.6rem; }
}

/* ── document pages (About, Pricing) ─────────────────────── */
.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.4rem 1.3rem 1rem;
}
.doc-h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.12;
  margin: 0 0 0.8rem;
}
.doc .lede {
  font-size: 1.12rem;
  line-height: 1.55;
  color: #3f382b;
  margin: 0 0 1.8rem;
}
.doc h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-edge);
}
.doc p { font-size: 1rem; line-height: 1.62; color: #2e2820; }
.doc ul { padding-left: 1.2rem; }
.doc li { font-size: 1rem; line-height: 1.55; margin-bottom: 0.5rem; }
.doc a { color: var(--accent); }
.callout {
  background: rgba(138, 31, 31, 0.06);
  border-left: 4px solid var(--accent);
  padding: 0.9rem 1.1rem;
  border-radius: 3px;
  font-size: 1.02rem !important;
  line-height: 1.55;
}
.pledge-list li { margin-bottom: 0.7rem; }

/* pricing card */
.price-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 1.6rem;
  margin: 0 0 1.5rem;
  box-shadow: 4px 6px 0 rgba(26, 23, 18, 0.12);
}
.price-tag { text-align: center; min-width: 150px; flex: 0 0 auto; }
.price-amt { font-size: 3rem; font-weight: 900; }
.price-per { font-size: 1rem; color: #6b5f4a; }
.price-alt { margin: 0.2rem 0 0; font-size: 0.86rem; color: #6b5f4a; }
.price-cta { flex: 1 1 300px; }
.price-cta p { margin: 0 0 0.6rem; font-size: 0.95rem; }
.founder { font-weight: bold; color: var(--accent) !important; }

/* comparison table */
.cmp-wrap { overflow-x: auto; }
.cmp {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
}
.cmp th, .cmp td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--paper-edge);
}
.cmp thead th {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cmp th:nth-child(2), .cmp th:nth-child(3),
.cmp td:nth-child(2), .cmp td:nth-child(3) { text-align: center; width: 22%; }
.cmp td.y { color: var(--good); font-weight: bold; }
.cmp td.n { color: #a99; }
.cmp td.p { color: var(--mid); font-style: italic; font-size: 0.86rem; }
.cmp tbody tr:hover { background: rgba(138, 31, 31, 0.04); }
.fine { font-size: 0.9rem; color: #453d2e; margin-top: 1.3rem; }

/* ── TruthVane+ chip, gate, saved searches, source table ──── */
.plus-chip {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  vertical-align: middle;
}
.plus-gated { position: relative; min-height: 320px; }
.plus-gated > *:not(.plus-lock) { filter: blur(5px); opacity: 0.5; pointer-events: none; user-select: none; }
.plus-lock {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.plus-lock-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 1.6rem 1.8rem;
  max-width: 420px; text-align: center;
  box-shadow: 4px 6px 0 rgba(26, 23, 18, 0.14);
}
.plus-lock-card h3 { margin: 0.7rem 0 0.4rem; font-size: 1.3rem; }
.plus-lock-card p { margin: 0 0 1rem; font-size: 0.95rem; color: #453d2e; }
.plus-lock-card .tipbtn { margin-right: 0.5rem; }
.plus-preview {
  background: none; border: none; color: #6b5f4a;
  font-family: Georgia, serif; font-size: 0.85rem; text-decoration: underline;
  cursor: pointer; padding: 0.4rem;
}

/* saved-search chips under the search bar */
.savedbar { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin: 0.55rem 0 0; }
.savechip {
  display: inline-flex; align-items: center;
  background: var(--paper); border: 1px solid var(--ink); border-radius: 999px;
  font-size: 0.74rem; overflow: hidden;
}
.savechip button { background: none; border: none; cursor: pointer; font-family: "SF Mono", ui-monospace, monospace; }
.savechip > button:first-child { padding: 0.2rem 0.2rem 0.2rem 0.65rem; color: var(--ink); }
.savechip > button:first-child:hover { color: var(--accent); }
.savechip-x { padding: 0.2rem 0.5rem 0.2rem 0.35rem !important; color: #a08c6a !important; font-size: 0.9rem; }
.savechip-x:hover { color: var(--accent) !important; }
#saveBtn { font-size: 1.05rem; line-height: 1; }
body.is-plus #saveBtn { color: var(--accent); border-color: var(--accent); }

/* source track-record table */
.src-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0.4rem 0 0.8rem; }
.src-controls select { font-family: Georgia, serif; padding: 0.3rem 0.5rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); }
.src-count { font-size: 0.86rem; color: #6b5f4a; font-style: italic; }
.src-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--paper); }
.src-table th, .src-table td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--paper-edge); text-align: left; vertical-align: middle; }
.src-table thead th { background: var(--ink); color: var(--paper); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.src-name { font-weight: bold; }
.src-band { font-size: 0.72rem; letter-spacing: 0.06em; color: #6b5f4a; }
.src-num { text-align: center; }
.sbar { position: relative; height: 15px; min-width: 90px; background: #e3d9c4; border-radius: 4px; overflow: hidden; }
.sbar-fill { height: 100%; }
.sbar span { position: absolute; right: 5px; top: 0; font-size: 0.68rem; line-height: 15px; color: #2e2820; }

.preview-line { margin-top: 0.7rem !important; font-size: 0.86rem !important; }
.linkbtn { background: none; border: none; color: var(--accent); font-family: Georgia, serif; font-size: 0.86rem; text-decoration: underline; cursor: pointer; padding: 0; }
.linkbtn:hover { color: #6f1717; }
