/* Britain Daily: a calm broadsheet page. Bone paper, restrained inks, hairline rules. */

:root {
  --bone: #F7F4EE;
  --ink: #25221E;
  --ink-soft: #57524A;
  --hairline: #E5E0D5;

  --politics: #33475B;
  --business: #B5654A;
  --entertainment: #6B4E63;

  /* Terracotta darkened slightly for small text so it stays readable on bone. */
  --business-text: #A15A40;

  --wm-navy: #05263C;
  --wm-gold: #B4802A;

  --font-head: 'PT Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --column: 40rem;
  --gutter: 20px;
  --nav-height: 46px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.page {
  max-width: var(--column);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Masthead (rebuilt from logo.png; 1 unit = 1 logo pixel) ---------- */

.masthead {
  padding: 26px var(--gutter) 18px;
  display: flex;
  justify-content: center;
}

.wordmark {
  --u: calc(min(100vw - 2 * var(--gutter), 400px) / 1170);
  position: relative;
  margin: 0;
  width: calc(1170 * var(--u));
  height: calc(290 * var(--u));
  font-weight: 400;
  line-height: 1;
}

.wm-britain, .wm-daily, .wm-bar, .wm-b, .wm-ritain { position: absolute; display: block; }

.wm-b {
  left: 0;
  top: 0;
  width: calc(160 * var(--u));
  height: calc(217 * var(--u));
  overflow: visible;
}
.wm-navy { fill: var(--wm-navy); }

.wm-ritain {
  left: calc(151 * var(--u));
  top: calc(-11 * var(--u));
  font-family: 'Urbanist', var(--font-body);
  font-weight: 900;
  font-size: calc(264 * var(--u));
  letter-spacing: calc(-8 * var(--u));
  color: var(--wm-navy);
  white-space: nowrap;
  transform: scaleX(0.87);
  transform-origin: 0 0;
}

.wm-daily {
  left: calc(663 * var(--u));
  top: calc(-62 * var(--u));
  /* Padding keeps the gradient painting behind the tall l and the swashed y tail. */
  padding: 0.12em 0.12em 0.3em 0;
  font-family: 'Playfair Display', 'Bodoni MT', Didot, serif;
  font-weight: 900;
  font-size: calc(270 * var(--u));
  letter-spacing: calc(-3 * var(--u));
  color: var(--wm-gold);
  background: linear-gradient(100deg, #C5892C 0%, #A9741E 55%, #9C6A18 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  transform: scaleX(0.735);
  transform-origin: 0 0;
}

.wm-bar {
  top: calc(239 * var(--u));
  height: calc(15 * var(--u));
  transform: skewX(-27deg);
}
.wm-bar-navy { left: calc(106 * var(--u)); width: calc(556 * var(--u)); background: var(--wm-navy); }
.wm-bar-gold { left: calc(679 * var(--u)); width: calc(330 * var(--u)); background: linear-gradient(90deg, #C5892C, #A26D1C); }

/* ---------- Section navigation ---------- */

.sections-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 6vw, 40px);
  min-height: var(--nav-height);
  padding: 0 var(--gutter);
  background: rgba(247, 244, 238, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.nav-item {
  position: relative;
  padding: 0 2px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  font-variant-caps: small-caps;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  transition: color 160ms ease;
}
.nav-item::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms ease;
}
.nav-item.is-active { color: var(--accent-text, var(--accent)); }
.nav-item.is-active::after { transform: scaleX(1); }
.nav-item:hover { color: var(--accent-text, var(--accent)); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

/* ---------- Sections and stories ---------- */

.section { padding-top: 40px; scroll-margin-top: var(--nav-height); }
.section:last-child { padding-bottom: 72px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 700;
  font-variant-caps: small-caps;
  letter-spacing: 0.14em;
  color: var(--accent-text, var(--accent));
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.story { border-top: 1px solid var(--hairline); }
.story:first-of-type { border-top: 0; }

.story-link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
  padding: 26px 0 28px;
  text-align: left;
  border-radius: 2px;
}
.story-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.story-title {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.27;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
  transition: color 160ms ease;
}
.story-link:hover .story-title,
.story-link:active .story-title { color: var(--accent); }

.story-preview {
  margin: 0;
  max-width: 34rem;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink-soft);
}

.story.is-lead .story-title { font-size: 27px; line-height: 1.2; }
.story.is-lead .story-link { padding-top: 20px; }

.story-figure {
  margin: 0 0 18px;
  background: var(--hairline);
  border-radius: 2px;
  overflow: hidden;
}
.story-figure img { display: block; width: 100%; height: auto; }
/* Supporting pictures share one frame so the column keeps a steady rhythm; the lead keeps its natural shape. */
.story:not(.is-lead) .story-figure img { aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Reader ---------- */

.reader-page { padding-top: 18px; padding-bottom: 80px; }

.back-link {
  display: inline-block;
  padding: 10px 0;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  font-variant-caps: small-caps;
  letter-spacing: 0.1em;
  color: var(--accent-text, var(--accent));
}
.back-link::before { content: '\2039\00a0'; }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.back-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.has-tg-back .back-link { display: none; }

.article-kicker {
  margin: 14px 0 12px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  font-variant-caps: small-caps;
  letter-spacing: 0.14em;
  color: var(--accent-text, var(--accent));
}

.article-title {
  margin: 0 0 22px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(27px, 7.4vw, 34px);
  line-height: 1.17;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
.article-title:focus { outline: none; }

.article-figure { margin: 0 0 28px; border-radius: 2px; overflow: hidden; background: var(--hairline); }
.article-figure img { display: block; width: 100%; height: auto; }

.article-body { max-width: 34rem; }
.article-body p {
  margin: 0 0 1.15em;
  font-size: 17px;
  line-height: 1.74;
  color: #2E2B26;
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
}

/* The one quiet flourish: a soft, two-line drop cap. */
.article-body p:first-child::first-letter {
  float: left;
  margin: 0.04em 0.1em -0.02em 0;
  padding: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 3.15em;
  line-height: 0.86;
  color: var(--accent);
}

.article-end {
  margin-top: 36px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}

/* ---------- Motion ---------- */

.view:not([hidden]) { animation: page-in 260ms ease both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .view:not([hidden]) { animation: none; }
  .nav-item::after, .nav-item, .story-title { transition: none; }
}

@media (min-width: 640px) {
  .story-title { font-size: 23px; }
  .story.is-lead .story-title { font-size: 31px; }
  .article-body p { font-size: 18px; }
}
