/* =====================================================================
   WSJ article-page styling — close as we can get without their fonts.
   Reference: wsj.com Personal Technology column pages.
   ===================================================================== */

:root {
  --ink: #222;
  --ink-light: #666;
  --rule: #ccc;
  --rule-dark: #222;
  --link: #0274b6;          /* WSJ's blue — author links, etc. */
  --wsj-blue: #0274b6;      /* Subscribe button bg */
  --gold: #c9a227;
  --serif: "Exchange", "Escrow", Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --col: 640px;
  --col-wide: 760px;        /* hed/dek/toolbar/lede sit a bit wider than body */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--serif); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }

/* =====================================================================
   MASTHEAD — article-page variant (no section nav, just ☰ / logo / auth)
   Logo is the real WSJ wordmark SVG scraped from their data-URI.
   ===================================================================== */

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #e6e6e6;
  gap: 20px;
}
.masthead-burger {
  width: 36px; height: 36px;
  border: 1px solid #e6e6e6;
  background: #fff;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: default;
  justify-self: start;
}
.masthead-logo {
  height: 26px;
  width: auto;
  display: block;
}
.masthead-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
}
.masthead-signin {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 14px;
  border: 1px solid #e6e6e6;
  cursor: default;
}
.masthead-sub {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--wsj-blue);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 18px;
  cursor: default;
}
@media (max-width: 720px) {
  .masthead-right { display: none; }
  .masthead { grid-template-columns: auto 1fr; }
  .masthead-logo { justify-self: center; height: 20px; }
}

/* ===== Article column ===== */

.article {
  max-width: var(--col);
  margin: 0 auto;
  padding: 36px 20px 100px;
}

/* ===== Headline block — centered, wider than body ===== */

.article-head {
  max-width: var(--col-wide);
  margin: 0 auto 28px;
  text-align: center;
  /* Break out of the narrower .article column */
  width: calc(100vw - 40px);
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
@media (min-width: 820px) {
  .article-head { width: var(--col-wide); }
}

.hed {
  font-size: clamp(28px, 5.5vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin-bottom: 14px;
}

.dek {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: #555;
  max-width: 580px;
  margin: 0 auto 20px;
}

/* ===== Toolbar (Share / Resize / Comments / Listen / ⋮) ===== */

.toolbar {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #e6e6e6;
  background: #fafafa;
  font-family: var(--sans);
}
.tool {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  cursor: default;
}
.tool svg { flex-shrink: 0; }
.tool-dim { color: #999; font-size: 13px; }
.tool-divider { width: 1px; background: #e6e6e6; margin: 8px 0; }
.tool-more { padding: 10px 12px; }
@media (max-width: 600px) {
  .toolbar { flex-wrap: wrap; justify-content: center; }
  .tool { padding: 8px 12px; font-size: 13px; }
  .tool-dim { display: none; }
}

/* ===== Section label — used on leaderboard page ===== */

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-dark);
  display: inline-block;
  padding-bottom: 4px;
  margin-bottom: 28px;
}

/* ===== Lede image (the big photo under the headline) ===== */

.lede-img {
  width: 100%;
  display: block;
  margin-bottom: 8px;
}
.lede-caption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.4;
  margin-bottom: 24px;
}
.lede-caption .credit { color: #999; }

/* ===== Byline — no rules, blue link, italic date ===== */

.byline {
  margin-bottom: 28px;
  font-family: var(--sans);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.byline img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 30%;
}
.byline-text { flex: 1; min-width: 0; }
.byline .who { font-style: italic; color: #555; }
.byline .who a { color: var(--link); font-style: normal; font-weight: 400; text-decoration: none; cursor: default; }
.byline .who a:hover { text-decoration: underline; }
.byline .when { color: var(--ink-light); font-size: 13px; font-style: italic; margin-top: 3px; }

.follow-pill {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  font-style: normal;
  padding: 2px 10px;
  margin-left: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #555;
  cursor: default;
  vertical-align: 1px;
}

/* Legacy — keeping in case leaderboard uses these */
.share-bar { display: flex; gap: 6px; }
.share-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
@media (max-width: 480px) {
  .share-bar { display: none; }
}

/* ===== Body copy ===== */

.body p {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 22px;
}
.body p:first-of-type::first-letter {
  /* WSJ drop cap */
  font-size: 64px;
  font-weight: 700;
  float: left;
  line-height: 0.85;
  padding: 6px 8px 0 0;
}

/* ===== Stars inline ===== */
.stars { color: var(--gold); font-size: 24px; letter-spacing: 3px; }

/* ===== Pros/Cons box — WSJ sidebar style ===== */

.proscons {
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  margin: 32px 0;
  padding: 20px;
  font-family: var(--sans);
}
.proscons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.proscons h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.proscons ul { list-style: none; }
.proscons li {
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 0 4px 14px;
  position: relative;
}
.proscons li::before {
  content: "•";
  position: absolute;
  left: 0;
}
@media (max-width: 540px) {
  .proscons-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ===== Inline quiz widget — styled as WSJ interactive ===== */

.interactive {
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  margin: 36px 0;
  font-family: var(--sans);
}
.interactive-hed {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rule);
}
.interactive-hed .tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-light);
}
.interactive-hed .title {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}
.interactive-body {
  padding: 24px 20px;
}

/* Name entry */
input.text-answer {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-family: var(--sans);
  border: 1px solid var(--rule);
  margin-bottom: 12px;
}
input.text-answer:focus { outline: none; border-color: var(--ink); }

/* Question */
.progress {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-light);
  margin-bottom: 12px;
}
.q-text {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 18px;
}
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s;
}
.option:hover { border-color: var(--ink); }
.option.selected { border-color: var(--ink); background: var(--ink); color: #fff; }
/* reveal states — shown after lock */
.option.correct { border-color: #1a7f37; background: #e7f5ec; color: var(--ink); }
.option.correct::after { content: " ✓"; color: #1a7f37; font-weight: 700; }
.option.wrong { border-color: #cf222e; background: #fde8ea; color: var(--ink); }
.option.wrong::after { content: " ✗"; color: #cf222e; font-weight: 700; }
.option:disabled { cursor: default; }
.option:disabled:hover { border-color: inherit; }

/* reveal card */
.reveal { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--rule); }
.reveal-verdict { font-family: var(--sans); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }
.reveal-verdict.good { color: #1a7f37; }
.reveal-verdict.bad { color: #cf222e; }
.reveal-note { font-size: 15px; line-height: 1.5; margin-bottom: 14px; font-family: var(--serif); }
.reveal-media iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.reveal-media iframe + iframe { margin-top: 12px; } /* gap when one question shows two videos */
.reveal-media img { width: 100%; display: block; }
.reveal-media .twitter-tweet { margin: 0 auto !important; }

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  background: var(--ink);
  color: #fff;
  border: none;
  cursor: pointer;
}
.btn:hover { background: #000; }
.btn:disabled { background: var(--ink-light); cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--rule); }
.btn.ghost:hover { border-color: var(--ink); }

.nav-row { display: flex; gap: 10px; margin-top: 18px; }
.nav-row .btn { flex: 1; }

.done { text-align: center; padding: 20px 0; }
.done h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 8px; }
.done p { color: var(--ink-light); font-size: 14px; }

/* ===== Tweet embeds ===== */
.tweet-embed { margin: 32px auto; max-width: 550px; }

/* ===== THE tweet section — toast closer ===== */
.the-tweet {
  margin: 56px 0;
  padding: 40px 0;
  border-top: 3px double var(--ink);
  border-bottom: 3px double var(--ink);
  text-align: center;
}
.the-tweet .label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-light);
  margin-bottom: 20px;
}
.the-tweet .coda {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-light);
  margin-top: 16px;
}

/* =====================================================================
   LEADERBOARD (separate page — big screen)
   ===================================================================== */

body.lb { background: #f7f7f5; }
.lb-wrap { max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.lb-hed { text-align: center; border-bottom: 3px double var(--ink); padding-bottom: 20px; margin-bottom: 28px; }
.lb-hed .eyebrow { margin-bottom: 16px; }
.lb-hed h1 { font-size: clamp(28px, 5vw, 44px); }
.lb-hed .sub { font-family: var(--sans); color: var(--ink-light); font-size: 14px; margin-top: 8px; }

.scores { list-style: none; }
.scores li {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  margin-bottom: 8px;
  background: #fff;
  border-left: 4px solid var(--rule);
  font-family: var(--sans);
  animation: slideIn 0.4s ease-out;
}
.scores li.top { border-left-color: var(--gold); }
.scores .rank { font-size: 24px; font-weight: 700; width: 50px; color: var(--ink-light); }
.scores li.top .rank { color: var(--gold); }
.scores .name { flex: 1; font-size: 20px; font-weight: 600; }
.scores .score { font-size: 24px; font-weight: 700; font-family: var(--serif); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }

.overlay {
  position: fixed; inset: 0; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 100;
}
.overlay h2 { font-size: clamp(24px, 4vw, 48px); text-align: center; padding: 0 40px; }
.overlay .hint { font-family: var(--sans); font-size: 14px; opacity: 0.5; display: block; margin-top: 12px; }
.overlay.hidden { display: none; }

/* =====================================================================
   QUIZ CTA — big obvious button after the intro. WSJ blue, same as
   the Subscribe button so it reads as the primary action on the page.
   ===================================================================== */

.quiz-cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--wsj-blue);
  color: #fff;
  font: 600 15px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 14px 28px;
  text-decoration: none;
  margin-top: 8px;
}
.quiz-cta:hover { background: #015a8f; color: #fff; }
.quiz-cta svg { transition: transform 0.15s; }
.quiz-cta:hover svg { transform: translateX(3px); }

/* =====================================================================
   LEADERBOARD (inside the done screen)
   ===================================================================== */

.done { text-align: left; padding: 12px 0; }  /* override the old centered version */
.done h3 { text-align: center; }
.done #done-score {
  text-align: center;
  font: 15px var(--sans);
  color: var(--ink-light);
  margin-bottom: 20px;
}
.leaderboard {
  border: 1px solid var(--rule);
  margin-bottom: 24px;
}
.leaderboard-title {
  font: 600 11px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: #fafafa;
}
.leaderboard ol { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.lb-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  font: 14px var(--sans);
  counter-increment: rank;
}
.lb-row:last-child { border-bottom: none; }
.lb-row::before {
  content: counter(rank);
  width: 22px;
  color: var(--ink-light);
  font-weight: 600;
  font-size: 12px;
}
.lb-row.me { background: #fffbe6; font-weight: 600; }
.lb-row.me::before { color: var(--gold); }
.lb-name { flex: 1; }
.lb-score { font-weight: 700; }
.lb-max { font-weight: 400; color: var(--ink-light); font-size: 12px; }
.lb-empty { padding: 14px; font: 13px var(--sans); color: var(--ink-light); text-align: center; }
/* Tester mark — subtle, not a scarlet letter. Legend only renders when one exists. */
.lb-ast { color: var(--ink-light); font-weight: 400; margin-left: 3px; font-size: 0.85em; }
.lb-legend { font: 11px var(--sans); color: var(--ink-light); text-align: right; padding: 6px 4px 0; }

.done-nudge {
  text-align: center;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
}
.done-nudge p { font: italic 14px var(--serif); color: var(--ink-light); margin-bottom: 10px; }

/* =====================================================================
   COMMENTS — WSJ-ish comment section. Above the fold of hope.
   ===================================================================== */

.comments {
  max-width: var(--col);
  margin: 48px auto;
  padding: 0 20px;
}
.comments-hed {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 3px solid var(--ink);
  padding-top: 16px;
  margin-bottom: 16px;
}
.comments-hed h3 {
  font: 700 20px var(--serif);
}
.comments-sub {
  font: italic 400 13px var(--serif);
  color: var(--ink-light);
}
.comments-count {
  font: 600 13px var(--sans);
  color: var(--ink-light);
}

.comment-form {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 28px;
}
.comment-form input,
.comment-form textarea {
  font: 14px var(--sans);
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: #fff;
  width: 100%;
}
.comment-form textarea { resize: vertical; min-height: 70px; font-family: var(--serif); font-size: 15px; }
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--ink); }
.comment-form .btn { align-self: flex-start; }

.comment {
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.comment-meta {
  font: 13px var(--sans);
  margin-bottom: 4px;
}
.comment-meta b { color: var(--ink); }
.comment-when { color: var(--ink-light); margin-left: 6px; }
.comment-body {
  font: 15px/1.5 var(--serif);
  white-space: pre-wrap;  /* preserve line breaks people type */
}
.comment-empty {
  font: italic 14px var(--serif);
  color: var(--ink-light);
  padding: 20px 0;
  text-align: center;
}
