/* ==========================================================================
   Research pages — /research/ hub and the individual post pages.
   Loaded in addition to styles.css (and on index.html, for the card links).
   ========================================================================== */

/* ---------- Clickable insight cards (homepage + hub) ----------
   The title is the real link; ::after stretches it over the whole card so
   the entire card is clickable while screen readers still read one link. */
.insight-card { position: relative; border-radius: 12px; }
.insight-card h3 { margin: 0; }
.insight-card__link { color: var(--text); text-decoration: none; }
.insight-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.insight-card:hover .insight-card__link,
.insight-card__link:focus-visible { color: var(--primary); }
.insight-card:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.insight-card__link:focus-visible { outline: none; }

/* "Read more" affordance */
.insight-card__more {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0.15rem;
}
.insight-card__more::after {
  content: " →";
  display: inline-block;
  transition: transform 0.2s ease;
}
.insight-card:hover .insight-card__more::after { transform: translateX(3px); }

/* ---------- Hub hero (/research/) ----------
   Mirrors .page-hero in legal.css so the hub doesn't have to load that file. */
.page-hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { max-width: 800px; margin: 0 auto 1rem; }
.page-hero .hero-sub { margin: 0 auto; max-width: 640px; }

/* ---------- Post layout ----------
   Named .research-post, not .research — styles.css already uses .research for
   the Google Sheets section, and it centres every h2 inside it. */
.research-post { padding: 2.5rem 0 4rem; background: var(--bg); }
.research-post .container { max-width: 820px; }
/* Long-form copy stays left-aligned whatever styles.css does elsewhere */
.research-post h1,
.research-post h2,
.research-post h3 { text-align: left; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span[aria-current] { color: var(--text); }

.research-head {
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.research-head h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.6rem);
  margin: 0.6rem 0 0.9rem;
}
.research-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
}
.research-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Post body ---------- */
.research-content { font-size: 1rem; line-height: 1.75; }
.research-content h2 {
  font-size: 1.4rem;
  margin: 2.75rem 0 0.9rem;
  color: var(--text);
}
.research-content h3 {
  font-size: 1.1rem;
  margin: 2rem 0 0.6rem;
  color: var(--text);
}
.research-content p { color: var(--text-muted); margin: 0 0 1.15rem; }
.research-content ul,
.research-content ol { color: var(--text-muted); padding-left: 1.4rem; margin: 0 0 1.25rem; }
.research-content li { padding: 0.2rem 0; }
.research-content strong { color: var(--text); }
.research-content a { text-decoration: underline; text-underline-offset: 2px; }

.research-content blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.35rem;
  border-left: 3px solid var(--primary);
  background: var(--bg-alt);
  border-radius: 0 10px 10px 0;
  color: var(--text);
  font-size: 1.02rem;
}
.research-content figure { margin: 2rem 0; }
.research-content figure img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.research-content figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Tables scroll inside their own box so the page never scrolls sideways */
.table-scroll { overflow-x: auto; margin: 1.75rem 0; }
.research-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 480px;
}
.research-content th,
.research-content td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.research-content th {
  color: var(--text);
  font-weight: 600;
  background: var(--bg-alt);
  white-space: nowrap;
}

/* ---------- Full report embedded from Google Drive ---------- */
.report-embed {
  margin: 2rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-alt);
}
.report-embed iframe {
  display: block;
  width: 100%;
  height: min(80vh, 720px);
  border: 0;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0 0 2.25rem;
}
.report-actions .btn { text-decoration: none; }
.report-note { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

@media (max-width: 768px) {
  /* A PDF is unreadable in a small frame — the button below it does the work */
  .report-embed iframe { height: 60vh; }
}

/* ---------- Key takeaways ---------- */
.key-points {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem 1.5rem;
  margin: 0 0 2.25rem;
}
.key-points h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin: 0 0 0.75rem;
}
.key-points ul { margin: 0; padding-left: 1.2rem; color: var(--text-muted); }

/* ---------- Scaffolding helpers (remove as you write) ---------- */
.draft-banner {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
  background: rgba(200, 160, 80, 0.12);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  margin: 0 0 2rem;
}
.draft-banner code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(127, 127, 127, 0.18);
}
.placeholder {
  color: var(--text-muted);
  opacity: 0.75;
  font-style: italic;
  border-left: 2px dashed var(--border);
  padding-left: 0.9rem;
}

/* ---------- Disclosures ---------- */
.disclosures {
  margin-top: 3.5rem;
  padding: 1.5rem 1.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.65;
}
.disclosures h2 {
  font-size: 0.95rem;
  margin: 0 0 1rem;
  color: var(--text);
}
.disclosures p { color: var(--text-muted); margin: 0 0 0.85rem; }
.disclosures p:last-child { margin-bottom: 0; }
.disclosures strong { color: var(--text); }

.research-back { margin: 2.5rem 0 0; font-weight: 600; }

@media (max-width: 768px) {
  .research { padding: 1.5rem 0 3rem; }
  .disclosures { padding: 1.25rem; }
}
