/* Market Research Newspaper — single stylesheet */
:root {
  --paper: #f5f0e6;
  --paper-deep: #ece4d4;
  --ink: #161412;
  --ink-soft: #3d3934;
  --rule: #161412;
  --rule-soft: #b9b0a0;
  --accent: #a3161a;
  --focus: #a3161a;
  --head: "Playfair Display", "Times New Roman", Georgia, serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --wrap: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

a { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
main:focus { outline: none; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; z-index: 10; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Masthead */
.masthead { text-align: center; padding-top: 0.5rem; }
.masthead-top {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem;
}
.nameplate {
  display: inline-block; margin: 0.9rem 0 0.2rem;
  font-family: var(--head); font-weight: 900;
  font-size: clamp(1.7rem, 7vw, 4rem); line-height: 1.05;
  text-decoration: none; letter-spacing: -0.01em;
}
.nameplate:hover { color: var(--ink); }
.tagline { margin: 0 0 0.8rem; font-style: italic; color: var(--ink-soft); }
.mainnav { border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule); }
.mainnav ul {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.25rem 1.5rem; padding-top: 0.5rem; padding-bottom: 0.5rem; margin: 0 auto;
}
.mainnav a {
  text-decoration: none; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.85rem; font-weight: 600; padding: 0.2rem 0;
}
.mainnav a[aria-current="page"] { color: var(--accent); border-bottom: 2px solid var(--accent); }

main { padding-top: 1.5rem; padding-bottom: 3rem; display: block; }

/* Type */
h1, h2, h3 { font-family: var(--head); line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); margin: 0.2rem 0 0.6rem; font-weight: 900; }
h2 { font-size: 1.6rem; margin: 2.2rem 0 0.6rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 0.4rem; }
p { margin: 0 0 1rem; }
code { font-family: Consolas, "Courier New", monospace; background: var(--paper-deep); padding: 0.05em 0.3em; font-size: 0.92em; }

.kicker {
  margin: 0; color: var(--accent); text-transform: uppercase;
  font-size: 0.78rem; letter-spacing: 0.12em; font-weight: 600; font-family: var(--body);
}
.dek { font-size: 1.2rem; font-style: italic; color: var(--ink-soft); max-width: 44rem; }
.dateline { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); padding: 0.35rem 0; display: inline-block; }

/* Front page */
.front-rule {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em;
  border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; margin-bottom: 1.5rem;
}
.front-rule span:first-child { color: var(--accent); font-weight: 600; }
.front { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.lead-title { font-size: clamp(2rem, 6.5vw, 3.6rem); margin: 0.3rem 0 0.8rem; font-weight: 900; }
.lead-title a { text-decoration: none; }
.lead-text p:first-child::first-letter { font-family: var(--head); font-weight: 900; float: left; font-size: 3.6rem; line-height: 0.85; padding: 0.3rem 0.5rem 0 0; color: var(--accent); }
.more a { font-weight: 600; }
.sidebar .box { border-top: 3px solid var(--ink); padding: 0.8rem 0 1rem; margin-bottom: 1rem; }
.sidebar h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.box-formula { background: var(--paper-deep); padding: 0.8rem 1rem 1rem !important; }
.mini-gloss dt { font-weight: 600; margin-top: 0.5rem; }
.mini-gloss dd { margin: 0; font-size: 0.95rem; }

.section-label {
  font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.14em;
  border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule);
  padding: 0.4rem 0; margin: 2.5rem 0 1.2rem; font-family: var(--body);
}
.columns { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.column h3 { font-size: 1.35rem; margin: 0.3rem 0 0.5rem; }
.column h3 a { text-decoration: none; }
.column h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

@media (min-width: 48rem) {
  .front { grid-template-columns: 2fr 1fr; }
  .lead { border-right: 1px solid var(--rule); padding-right: 2rem; }
  .lead-text { column-count: 2; column-gap: 2rem; column-rule: 1px solid var(--rule-soft); }
  .columns { grid-template-columns: repeat(2, 1fr); }
  .column { border-left: 1px solid var(--rule-soft); padding-left: 1.25rem; }
}
@media (min-width: 64rem) {
  .columns { grid-template-columns: repeat(4, 1fr); }
  .column:first-child { border-left: 0; padding-left: 0; }
}

/* Articles */
.breadcrumbs ol { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.3rem; font-size: 0.85rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.3rem; color: var(--rule-soft); }
.breadcrumbs [aria-current] { color: var(--ink-soft); }
.article-head, .page-head { border-bottom: 3px double var(--rule); padding-bottom: 1rem; margin-bottom: 1.5rem; max-width: 46rem; }
.article-body, .prose { max-width: 42rem; }
.article-body > p:first-child::first-letter { font-family: var(--head); font-weight: 900; float: left; font-size: 3.4rem; line-height: 0.85; padding: 0.3rem 0.5rem 0 0; color: var(--accent); }

.table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); -webkit-overflow-scrolling: touch; }
.table-wrap:focus-visible { outline: 3px solid var(--focus); }
table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: 0.95rem; }
caption { text-align: left; font-style: italic; padding: 0.5rem 0; color: var(--ink-soft); }
th, td { text-align: left; vertical-align: top; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule-soft); }
thead th { border-bottom: 1px solid var(--ink); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.06em; }
tbody th { font-weight: 600; }

.formula { border: 2px solid var(--ink); background: var(--paper-deep); padding: 1rem 1.2rem; margin: 1.2rem 0 1.5rem; }
.formula p:last-child { margin-bottom: 0; }
.formula-eq { font-family: var(--head); font-size: 1.35rem; font-weight: 700; margin-bottom: 0.6rem; }

.note { border-left: 4px solid var(--accent); padding: 0.4rem 0 0.4rem 0.9rem; background: rgba(163, 22, 26, 0.05); }

.steps { padding-left: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: 2.6rem; margin-bottom: 0.9rem; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.05rem;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--ink); color: var(--paper);
  font-family: var(--head); font-weight: 700; text-align: center; line-height: 1.8rem; font-size: 0.95rem;
}

.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 2rem; margin-bottom: 0.8rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.35rem; width: 1.05rem; height: 1.05rem;
  border: 2px solid var(--accent);
}
.checklist li::after {
  content: ""; position: absolute; left: 0.32rem; top: 0.45rem; width: 0.4rem; height: 0.7rem;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.takeaways { border-top: 4px solid var(--accent); border-bottom: 1px solid var(--ink); background: var(--paper-deep); padding: 1rem 1.2rem; margin: 2rem 0; }
.takeaways h2 { margin-top: 0; font-size: 1.3rem; }
.takeaways ul { margin: 0; padding-left: 1.2rem; }
.takeaways li { margin-bottom: 0.4rem; }

.related { max-width: 42rem; border-top: 3px double var(--rule); margin-top: 2rem; }
.related h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.1em; font-family: var(--body); }
.related ul { list-style: none; padding: 0; display: grid; gap: 1rem; }
.related a { display: block; font-family: var(--head); font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.related a .kicker { display: block; }
.related a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
@media (min-width: 40rem) { .related ul { grid-template-columns: 1fr 1fr; } }

.glossary-pointer { font-style: italic; color: var(--ink-soft); }

/* Explainer index */
.ex-list { list-style: none; padding: 0; margin: 0; max-width: 46rem; }
.ex-item { border-bottom: 1px solid var(--rule-soft); padding: 1rem 0 0.5rem; }
.ex-item h2 { margin: 0.2rem 0 0.4rem; font-size: 1.6rem; }
.ex-item h2 a { text-decoration: none; }
.ex-item h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* Glossary */
.jump { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.jump a { display: inline-block; min-width: 2.2rem; text-align: center; padding: 0.25rem 0.4rem; border: 1px solid var(--ink); text-decoration: none; font-weight: 600; }
.jump a:hover { background: var(--ink); color: var(--paper); }
.glossary { max-width: 46rem; }
.gloss-letter h2 { color: var(--accent); border-bottom: 1px solid var(--ink); padding-bottom: 0.2rem; margin-top: 1.8rem; }
.glossary dt { font-family: var(--head); font-weight: 700; font-size: 1.15rem; margin-top: 1rem; scroll-margin-top: 1rem; }
.glossary dt:target { background: var(--paper-deep); outline: 2px solid var(--accent); outline-offset: 4px; }
.glossary dd { margin: 0.2rem 0 0; }
.anchor { color: var(--rule-soft); text-decoration: none; font-family: var(--body); font-weight: 400; }
.anchor:hover, .anchor:focus-visible { color: var(--accent); }

/* Prose pages */
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.callout { border: 2px solid var(--ink); padding: 1rem 1.2rem; font-weight: 600; background: var(--paper-deep); }
.contact-email { font-size: 1.25rem; }

/* Footer */
.site-footer { border-top: 3px double var(--rule); padding: 1.5rem 0 2rem; font-size: 0.92rem; }
.disclaimer { max-width: 46rem; font-style: italic; }
.footer-links { list-style: none; padding: 0; margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { font-weight: 600; }
.copyright { margin: 0; color: var(--ink-soft); }

@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .masthead-top { justify-content: center; }
  h2 { font-size: 1.4rem; }
  .formula-eq { font-size: 1.15rem; }
}

@media print {
  .mainnav, .skip-link, .related { display: none; }
  body { background: #fff; }
}
