/* When the Markets Get COVID — site stylesheet.
   Base palette and components shared with international-climate-news.github.io; additions at the bottom. */

:root {
  --ink: #13233a;
  --accent: #1f5fa8;
  --accent-dark: #174a85;
  --gray: #5b6778;
  --gray-light: #93a0b2;
  --border: #dde4ee;
  --tint: #eaf1f9;
  --tint-border: #cfdcee;
  --bg: #f6f8fb;
  --card-bg: #ffffff;
  --max-w: 1080px;
  --slate: #5aa7d8;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 600;
}

p { margin: 0 0 1em; color: var(--ink); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow.muted { color: var(--gray-light); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header / nav */
header.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand-text .brand-title {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.brand-text .brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-light);
}

nav.site-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

nav.site-nav a {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

nav.site-nav a:hover,
nav.site-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  max-width: 820px;
}

.hero .dateline {
  color: var(--gray-light);
  font-size: 0.88rem;
  margin-top: 6px;
}

.authorline {
  font-size: 1.02rem;
  margin: 18px 0 22px;
  color: var(--ink);
}

.authorline .aff {
  color: var(--gray);
  font-size: 0.86rem;
}

/* Centered hero (Home) */
.hero-center > .container > .eyebrow,
.hero-center > .container > h1,
.hero-center > .container > .dateline,
.hero-center > .container > .authorline {
  text-align: center;
}
.hero-center h1 { margin-left: auto; margin-right: auto; }
.hero-center .btn-row { justify-content: center; }

/* Justified, wide-measure paragraphs */
.justify { text-align: justify; text-align-last: left; }
.wide-justify {
  max-width: none !important;
  text-align: justify;
  text-align-last: left;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  cursor: pointer;
  font-family: inherit;
}

.btn.solid {
  background: var(--accent);
  color: #fff;
}
.btn.solid:hover { background: var(--accent-dark); text-decoration: none; }

.btn.outline {
  background: transparent;
  color: var(--ink);
}
.btn.outline:hover { background: var(--tint); text-decoration: none; }

/* Abstract card */
.card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 30px;
  background: var(--card-bg);
}

.abstract-card {
  margin-top: 34px;
  background: var(--tint);
  border-color: var(--tint-border);
}

.abstract-card h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.keywords {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--gray);
}

.keywords strong { color: var(--ink); }

/* Sections */
section.page-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

section.page-section:last-of-type { border-bottom: none; }

.section-label {
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.7rem;
  max-width: 760px;
}

.section-intro {
  color: var(--gray);
  max-width: none;
  margin-top: 10px;
}

/* Authors grid */
.authors-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 32px;
}

@media (max-width: 820px) {
  .authors-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .authors-grid { grid-template-columns: 1fr; }
}

.author-card { text-align: center; }

.author-photo {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
  background: var(--tint);
}

.author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-name {
  font-family: "Fraunces", serif;
  font-weight: 700;
  color: var(--ink);
  font-size: 1.02rem;
}

.author-role {
  font-size: 0.82rem;
  color: var(--gray);
  margin-top: 3px;
  line-height: 1.4;
}

.author-links {
  margin-top: 8px;
  font-size: 0.78rem;
}

.author-links a { color: var(--accent); margin: 0 4px; }

/* Videos */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 32px;
}

@media (max-width: 820px) {
  .video-grid { grid-template-columns: 1fr; }
}

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.video-frame video,
.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-caption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--gray);
}

.video-caption strong { color: var(--ink); }

/* Stat strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 34px;
}

@media (max-width: 820px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}

.stat-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.stat-num {
  font-family: "Fraunces", serif;
  font-size: 1.9rem;
  color: var(--ink);
  font-weight: 700;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--gray);
  margin-top: 4px;
}

/* Figure block */
.figure-block {
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg);
}

.figure-block img { width: 100%; }

.figure-caption {
  padding: 16px 22px 20px;
  border-top: 1px solid var(--border);
  background: #f9fbfd;
}

.figure-caption .fig-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-light);
}

.figure-caption p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--gray);
}

/* Methodology steps */
.steps {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 820px) {
  .steps { grid-template-columns: 1fr; }
}

.step {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}

.step-num {
  font-family: "Fraunces", serif;
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step h4 { font-size: 1rem; margin-bottom: 6px; }
.step p { font-size: 0.88rem; color: var(--gray); margin: 0; }

/* Results category cards */
.result-card {
  margin-top: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.result-head {
  padding: 24px 28px 0;
}

.result-head .eyebrow { color: var(--accent); }

.result-head h3 {
  font-size: 1.4rem;
  margin: 6px 0 10px;
}

.result-head p {
  color: var(--gray);
  text-align: justify;
  text-align-last: left;
}

.result-figure { padding: 8px 28px 28px; }

.result-figure img {
  border: 1px solid var(--border);
  border-radius: 8px;
}

.result-figure .figure-caption {
  border: none;
  padding: 14px 2px 0;
  background: transparent;
}

.finding-box {
  margin: 0 28px 26px;
  background: var(--tint);
  border: 1px solid var(--tint-border);
  border-radius: 8px;
  padding: 16px 20px;
}

.finding-box .eyebrow { color: var(--ink); font-size: 0.72rem; }
.finding-box p { margin: 6px 0 0; font-size: 0.92rem; }

/* Download cards */
.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 30px;
}

@media (max-width: 820px) {
  .download-grid { grid-template-columns: 1fr; }
}

.download-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.2rem;
}

.download-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.download-card p { color: var(--gray); font-size: 0.92rem; flex-grow: 1; }

/* Bibtex */
.bibtex-box {
  margin-top: 14px;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--accent);
  font-family: "Inter", sans-serif;
}
.copy-btn:hover { background: var(--tint); }

/* Data dictionary table */
.data-table {
  margin-top: 16px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td { color: var(--gray); }

/* Footer */
footer.site-footer {
  background: var(--ink);
  color: #dbe6f3;
  padding: 34px 0;
  margin-top: 20px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-inner a {
  color: #dbe6f3;
  font-size: 0.85rem;
  margin-left: 18px;
}

.footer-inner a:first-of-type { margin-left: 0; }

.footer-note {
  font-size: 0.8rem;
  color: #9fb2c8;
}

/* Utility */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }

/* ------------------------------------------------------------------
   Additions for the COVID site
   ------------------------------------------------------------------ */


/* Authors without a photo */
.author-photo.initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-size: 2.6rem;
  font-weight: 600;
  color: var(--accent);
}

/* Study cards on Home */
.study-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 30px;
}
@media (max-width: 820px) { .study-grid { grid-template-columns: 1fr; } }

.study-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  color: var(--ink);
}
.study-card:hover { border-color: var(--accent); text-decoration: none; }
.study-card h3 { font-size: 1.2rem; margin: 6px 0 8px; }
.study-card p { color: var(--gray); font-size: 0.92rem; flex-grow: 1; }
.study-card .go { color: var(--accent); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }

/* Narrative blocks (the Google Sites "grey band" text, restyled) */
.lead-band {
  background: var(--tint);
  border-top: 1px solid var(--tint-border);
  border-bottom: 1px solid var(--tint-border);
  padding: 34px 0;
}
.lead-band p {
  font-family: "Fraunces", serif;
  font-size: 1.18rem;
  line-height: 1.6;
  margin: 0;
  max-width: none;
}

.story { padding: 44px 0 8px; }
.story h2 { font-size: 1.45rem; margin-top: 6px; }
.story p { max-width: none; }

/* Body text spans the full content column, like the charts and figures */
.story p, .lead-band p, .takeaway p, .takeaway li, .footnote, .section-intro, .figure-caption p, .study-card p {
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}
.story .muted { color: var(--gray); font-size: 0.92rem; }

.takeaway {
  background: var(--tint);
  border: 1px solid var(--tint-border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 22px 0 0;
  max-width: none;
}
.takeaway .eyebrow { font-size: 0.72rem; }
.takeaway p { margin: 6px 0 0; }
.takeaway ol { margin: 8px 0 0; padding-left: 20px; }
.takeaway li { margin-bottom: 6px; }

.footnote {
  font-size: 0.86rem;
  color: var(--gray);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 14px;
  max-width: none;
}

/* Interactive charts */
.chart-block {
  margin-top: 26px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card-bg);
}
.chart-head {
  padding: 18px 22px 0;
}
.chart-head h3 { font-size: 1.08rem; margin: 4px 0 0; }
.chart-head .eyebrow { font-size: 0.7rem; }
.plot { width: 100%; height: 440px; }
.plot.tall { height: 560px; }
.plot-hint { font-size: 0.78rem; color: var(--gray-light); padding: 0 22px; }

/* Math */
.math-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  margin: 18px 0;
  max-width: none;
  overflow-x: auto;
}
.math-block .katex-display { margin: 0.6em 0; }
.katex { font-size: 1.08em; }

/* Two figures side by side */
.fig-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.fig-pair > div { min-width: 0; padding: 14px; }
.fig-pair > div + div { border-left: 1px solid var(--border); }
.fig-pair .panel-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray);
  text-align: center;
  margin-bottom: 6px;
}
@media (max-width: 640px) {
  .fig-pair { grid-template-columns: 1fr; }
  .fig-pair > div + div { border-left: none; border-top: 1px solid var(--border); }
}
.figure-block .pad { padding: 14px; background: #fff; }

/* Tables with numbers */
.table-scroll { overflow-x: auto; margin-top: 18px; }
.data-table.num td, .data-table.num th { text-align: right; white-space: nowrap; }
.data-table.num td:first-child, .data-table.num th:first-child { text-align: left; }
.data-table tfoot td { font-weight: 700; color: var(--ink); }
.data-table .bar { display: inline-block; height: 6px; border-radius: 3px; background: var(--accent); opacity: .5; vertical-align: middle; margin-right: 8px; }

details.more {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  background: var(--card-bg);
}
details.more summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}
details.more[open] summary { margin-bottom: 6px; }

/* Announcements explorer */
.explorer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}
.explorer-controls select, .lda-controls select {
  font: inherit;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
}
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.82rem; color: var(--gray); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.explorer-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 16px 22px 4px;
}
.explorer-summary > div { border-top: 2px solid var(--border); padding-top: 8px; }
.explorer-summary .n { font-family: "Fraunces", serif; font-size: 1.35rem; font-weight: 600; }
.explorer-summary .l { font-size: 0.78rem; color: var(--gray); }
@media (max-width: 640px) { .explorer-summary { grid-template-columns: repeat(2, 1fr); } }
#chart { position: relative; padding: 4px 16px 0; }
#chart svg { width: 100%; height: auto; display: block; }
#chart .tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: #eaf1f9;
  font-size: 0.8rem;
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .1s;
}

/* LDA viewer */
.lda-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.lda-controls button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--gray);
  cursor: pointer;
}
.lda-controls button:hover { border-color: var(--accent); color: var(--accent); }
.lda-controls button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.lda-frame {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.lda-frame iframe { display: block; width: 1220px; height: 900px; border: 0; }

/* Mobile */
@media (max-width: 640px) {
  .container, .header-inner, .footer-inner { padding-left: 16px; padding-right: 16px; }
  nav.site-nav { gap: 14px; }
  .author-photo { width: 140px; height: 140px; }
  .plot { height: 360px; }
  .plot.tall { height: 520px; }
  .card { padding: 22px 18px; }
}

/* Bank of Italy / Federal Reserve disclaimer */
.disclaimer {
  margin: 34px auto 0;
  max-width: 820px;
  text-align: center;
  font-size: 0.84rem;
  font-style: italic;
  color: var(--gray);
}
.footer-disclaimer {
  max-width: var(--max-w);
  margin: 18px auto 0;
  padding: 16px 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.74rem;
  line-height: 1.5;
  color: #9fb2c8;
}
@media (max-width: 640px) { .footer-disclaimer { padding-left: 16px; padding-right: 16px; } }
