/* Daily Market Memo — monochrome editorial shell, with market direction in
   red and green. The arrow glyphs stay so direction survives colour blindness
   and greyscale printing. */

:root {
  --ink: #000000;
  --paper: #ffffff;
  --wash: #f2f2f2;
  --rule: #c8c8c8;
  --mute: #6b6b6b;

  --rule-hair: 1px solid var(--rule);
  --rule-item: 1px solid var(--ink);
  --rule-section: 3px solid var(--ink);

  --gutter: clamp(16px, 4vw, 40px);
  --measure: 66ch;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  font-synthesis-weight: none;
}

a { color: inherit; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.021em; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 100;
}
.skip:focus { left: 0; }

/* ── Masthead ───────────────────────────────────────────── */

.masthead {
  border-bottom: var(--rule-item);
  padding: 0 var(--gutter);
}

.masthead__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0 9px;
  border-bottom: var(--rule-hair);
  flex-wrap: wrap;
}

/* A plain trade-press masthead: name and date on one line, a rule, then the
   sections. No display type, no tracked-out labels. */
.wordmark {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 15px;
}
.wordmark b {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.wordmark span { font-weight: 500; color: var(--mute); }

.masthead__meta {
  margin: 0;
  font-size: 12.5px;
  color: var(--mute);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.nav {
  display: flex;
  gap: 20px;
  padding: 8px 0 8px;
  font-size: 13px;
  font-weight: 600;
  flex-wrap: wrap;
}
.nav a {
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a:focus-visible { border-bottom-color: var(--ink); }

/* ── Layout ─────────────────────────────────────────────── */

.wrap { padding: 0 var(--gutter); max-width: 1440px; margin: 0 auto; }

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0 40px;
  align-items: start;
}

.rail { border-left: var(--rule-hair); padding-left: 24px; }

/* ── Lead story ─────────────────────────────────────────── */

.lead { padding: 32px 0 28px; border-bottom: var(--rule-item); }

.lead__title {
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.01;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 19ch;
}
.lead__title a { text-decoration: none; }
.lead__title a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }

.lead__standfirst {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 20px;
  line-height: 1.5;
  margin: 16px 0 0;
  max-width: 54ch;
}

.lead__figure { margin: 22px 0 0; }
.lead__figure img {
  width: 100%;
  height: clamp(220px, 34vw, 420px);
  object-fit: cover;
  display: block;
}

.byline {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--mute);
  margin-top: 14px;
  font-variant-numeric: tabular-nums;
}
.byline strong { color: var(--ink); font-weight: 600; }

/* ── Story grid ─────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding-bottom: 8px;
}

.story {
  padding: 22px 22px 24px;
  border-right: var(--rule-hair);
  border-bottom: var(--rule-hair);
}
.story:nth-child(3n) { border-right: 0; padding-right: 0; }
.story:nth-child(3n + 1) { padding-left: 0; }

.story__title {
  font-size: 19px;
  line-height: 1.19;
  font-weight: 700;
  letter-spacing: -0.017em;
}
.story__title a { text-decoration: none; }
.story__title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.story__summary {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 15.5px;
  line-height: 1.5;
  color: #2a2a2a;
  margin: 9px 0 0;
}

.story__figure { margin: 0 0 12px; }
.story__figure img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

/* ── Rail modules ───────────────────────────────────────── */

.module { padding: 30px 0 26px; border-bottom: var(--rule-hair); }
.module:first-child { padding-top: 32px; }

.module__head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding-bottom: 9px;
  margin-bottom: 12px;
  border-bottom: var(--rule-item);
}

.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li { padding: 11px 0; border-top: var(--rule-hair); }
.rail-list li:first-child { border-top: 0; padding-top: 0; }
.rail-list a {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.012em;
  text-decoration: none;
}
.rail-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rail-list__meta {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--mute);
  font-variant-numeric: tabular-nums;
}

/* ── Newsletter ─────────────────────────────────────────── */

.signup { background: var(--ink); color: var(--paper); padding: 24px 22px 26px; }
.signup__title { font-size: 23px; font-weight: 800; letter-spacing: -0.028em; line-height: 1.08; }
.signup__copy {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 15px;
  line-height: 1.5;
  margin: 10px 0 16px;
  color: #dcdcdc;
}
.signup form { display: flex; flex-direction: column; gap: 9px; }
.signup input {
  font: inherit;
  font-size: 15px;
  padding: 11px 12px;
  border: 1px solid var(--paper);
  background: var(--ink);
  color: var(--paper);
}
.signup input::placeholder { color: #8d8d8d; }
.signup button {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 12px;
  border: 1px solid var(--paper);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.signup button:hover { background: var(--ink); color: var(--paper); }
.signup__note { font-size: 11.5px; color: #9a9a9a; margin: 11px 0 0; line-height: 1.45; }
.signup__status { font-size: 13px; margin: 10px 0 0; min-height: 1.2em; }

/* ── Article page ───────────────────────────────────────── */

.article { padding: 34px 0 40px; max-width: var(--measure); justify-self: start; }
.article__kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: var(--rule-item);
  margin-bottom: 18px;
}
.article__title {
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.032em;
  font-weight: 800;
}
.article__figure { margin: 24px 0; }
.article__figure img { width: 100%; display: block; }
.article__body { font-family: 'Source Serif 4', Georgia, serif; font-size: 18.5px; line-height: 1.62; }
.article__body p { margin: 0 0 1.15em; }
.article__body p:first-of-type { font-size: 21px; line-height: 1.5; }

.source-link {
  display: inline-block;
  margin-top: 6px;
  padding: 11px 16px;
  border: var(--rule-item);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}
.source-link:hover, .source-link:focus-visible { background: var(--ink); color: var(--paper); }

/* ── Static pages ───────────────────────────────────────── */

.page { padding: 34px 0 48px; max-width: var(--measure); }
.page h1 { font-size: clamp(30px, 4.4vw, 44px); letter-spacing: -0.032em; line-height: 1.06; }
.page h2 { font-size: 21px; margin: 32px 0 8px; letter-spacing: -0.018em; }
.page p, .page li { font-family: 'Source Serif 4', Georgia, serif; font-size: 17.5px; line-height: 1.62; }
.page ul { padding-left: 20px; }

/* ── Footer ─────────────────────────────────────────────── */

.footer {
  border-top: var(--rule-section);
  margin-top: 16px;
  padding: 26px var(--gutter) 40px;
  font-size: 13px;
  color: var(--mute);
}
.footer__inner { max-width: 1440px; margin: 0 auto; display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.footer a { color: var(--ink); }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__addr { font-style: normal; line-height: 1.6; max-width: 34ch; }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 1080px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .rail { border-left: 0; padding-left: 0; border-top: var(--rule-item); margin-top: 8px; }
}

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story:nth-child(3n) { border-right: var(--rule-hair); padding-right: 22px; }
  .story:nth-child(3n + 1) { padding-left: 22px; }
  .story:nth-child(2n) { border-right: 0; padding-right: 0; }
  .story:nth-child(2n + 1) { padding-left: 0; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }

  /* One column of stories, edge to edge. */
  .grid { grid-template-columns: minmax(0, 1fr); }
  .story,
  .story:nth-child(2n),
  .story:nth-child(2n + 1),
  .story:nth-child(3n),
  .story:nth-child(3n + 1) {
    border-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .story__figure img { height: 200px; }

  .masthead__top { padding: 10px 0 8px; gap: 4px; }
  .masthead__meta { text-align: left; font-size: 12px; }
  .wordmark b { font-size: 23px; }
  .wordmark span { font-size: 13px; }

  /* The nav becomes a swipeable strip rather than a wrapping block, so the
     masthead keeps a predictable height. */
  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 22px;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 12px;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 6px 0 4px; }


  .lead { padding: 22px 0 20px; }
  .lead__title { max-width: none; }
  .lead__standfirst { font-size: 18px; }
  .lead__figure img { height: 220px; }

  .article { padding: 24px 0 32px; }
  .article__body { font-size: 17.5px; }
  .article__body p:first-of-type { font-size: 19px; }

  /* Comfortable thumb targets. */
  .source-link { display: block; text-align: center; padding: 15px 16px; }
  .signup button, .modal__form button { padding: 15px; }
  .signup input, .modal__form input { padding: 14px 13px; font-size: 16px; }

  .rail { padding-top: 4px; }
  .module:first-child { padding-top: 22px; }

  .footer { padding-top: 22px; }
  .footer__inner { flex-direction: column; gap: 18px; }

  .modal { padding: 12px; align-items: end; }
  .modal__panel { padding: 26px 20px 22px; max-height: calc(100dvh - 24px); }
  .modal__title { font-size: 25px; }
  .modal__copy { font-size: 16px; margin-bottom: 16px; }
  .modal__close { top: 4px; right: 6px; padding: 8px 12px; }
}

@media (max-width: 380px) {
  .wordmark b { font-size: 21px; }
  .lead__title { font-size: 30px; }
  .story__figure img { height: 170px; }
}

/* ── Subscribe modal ────────────────────────────────────── */

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  padding: 34px 34px 28px;
  animation: panel-in 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .modal__panel { animation: none; }
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: 0;
  font-size: 30px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--ink);
}
.modal__close:hover { background: var(--ink); color: var(--paper); }

.modal__eyebrow {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding-bottom: 10px;
  border-bottom: var(--rule-item);
}

.modal__title {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.06;
  letter-spacing: -0.032em;
  font-weight: 800;
}

.modal__copy {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  line-height: 1.5;
  margin: 12px 0 20px;
}

.modal__form { display: flex; flex-direction: column; gap: 9px; }

.modal__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal__form input {
  font: inherit;
  font-size: 16px;
  padding: 13px 13px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.modal__form input::placeholder { color: #8d8d8d; }

.modal__form button {
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  padding: 14px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.modal__form button:hover { background: var(--paper); color: var(--ink); }
.modal__form button[disabled] { opacity: 0.55; cursor: default; }

.modal__status { font-size: 14px; margin: 12px 0 0; min-height: 1.2em; font-weight: 600; }

.modal__note {
  font-size: 12px;
  color: var(--mute);
  line-height: 1.5;
  margin: 14px 0 0;
}
.modal__note a { color: var(--ink); }

@media (max-width: 520px) {
  .modal__panel { padding: 28px 22px 24px; }
}

#subscribe { scroll-margin-top: 90px; }

/* A prose page with no rail beside it reads better centred than flush-left
   against a wide empty margin. */
.page--solo { margin: 0 auto; }
