/* ==========================================================================
   turingpharma.com — Editorial broadsheet stylesheet
   Three-column newspaper layout · Serif typography · Crimson accent
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Custom Properties
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces */
  --color-bg: #f7f7f5;
  --color-surface: #ffffff;
  --color-surface-alt: #f0eeeb;

  /* Text */
  --color-text: #141414;
  --color-text-secondary: #5a5a5a;
  --color-text-muted: #888888;

  /* Accent — deep crimson */
  --color-accent: #8b1a1a;
  --color-accent-hover: #6d1414;
  --color-accent-light: #f5e8e8;

  /* Header — near-black masthead */
  --color-header-bg: #141414;
  --color-header-text: #f7f7f5;

  /* Borders */
  --color-border: #d8d5d0;
  --color-border-strong: #999390;

  /* Fact box / stat accent — dark gold/amber */
  --color-stat: #7a5c1a;
  --color-stat-bg: #fdf6e3;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.5rem;
  --text-4xl: 3.25rem;

  /* Leading */
  --leading-tight: 1.2;
  --leading-body: 1.7;
  --leading-heading: 1.25;

  /* Layout — three-column newspaper */
  --sidebar-left: 220px;
  --content-col: 560px;
  --sidebar-right: 200px;
  --layout-gap: 2rem;
  --gutter: 1.5rem;
}


/* --------------------------------------------------------------------------
   2. Reset / Base
   -------------------------------------------------------------------------- */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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


/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-heading);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 900;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-2xl);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-left: 0.875rem;
  border-left: 3px solid var(--color-accent);
}

h3 {
  font-family: var(--font-ui);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-accent-hover);
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

li > ul, li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface-alt);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface-alt);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border: 1px solid var(--color-border);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}


/* --------------------------------------------------------------------------
   4. Layout — Masthead, Three-Column Grid, Footer
   -------------------------------------------------------------------------- */

/* --- Masthead — full-bleed broadsheet header ----------------------------- */

.masthead {
  background: var(--color-header-bg);
  border-bottom: 3px solid var(--color-accent);
  text-align: center;
  padding: 2rem var(--gutter) 1.75rem;
}

.masthead-inner {
  max-width: 1040px;
  margin: 0 auto;
  position: relative;
}

.masthead-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--color-header-text);
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.15;
  display: block;
}

.masthead-title:hover {
  color: #ffffff;
}

.masthead-rule {
  display: block;
  width: 60px;
  height: 1px;
  background: var(--color-accent);
  margin: 0.75rem auto;
}

.masthead-tagline {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-border-strong);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* --- Mobile nav toggle (in masthead) ------------------------------------- */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-header-text);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* --- Three-column grid --------------------------------------------------- */

.layout {
  max-width: calc(var(--sidebar-left) + var(--content-col) + var(--sidebar-right) + var(--layout-gap) * 2);
  margin: 0 auto;
  padding: 2rem var(--gutter) 0;
  display: grid;
  grid-template-columns: var(--sidebar-left) var(--content-col) var(--sidebar-right);
  gap: var(--layout-gap);
  align-items: start;
}

/* --- Main (centre column) ------------------------------------------------ */

.main {
  min-width: 0;
  padding-bottom: 4rem;
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  background: var(--color-header-bg);
  color: var(--color-text-muted);
  border-top: 3px solid var(--color-accent);
}

.footer-inner {
  max-width: calc(var(--sidebar-left) + var(--content-col) + var(--sidebar-right) + var(--layout-gap) * 2);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 3rem;
}

.footer-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-header-text);
  margin-bottom: 0.75rem;
}

.footer-disclaimer {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-border-strong);
  margin-bottom: 1.5rem;
  max-width: 560px;
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: #c8c5c0;
  text-decoration: none;
}

.footer-nav a:hover {
  color: #ffffff;
}


/* --------------------------------------------------------------------------
   5. Article Styles
   -------------------------------------------------------------------------- */

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.article-title {
  font-size: var(--text-4xl);
  font-weight: 900;
  line-height: var(--leading-tight);
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.article-dek {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-text-secondary);
  line-height: 1.55;
}

.article-body {
  font-size: var(--text-base);
  line-height: var(--leading-body);
}


/* --------------------------------------------------------------------------
   6. Components
   -------------------------------------------------------------------------- */

/* --- Tables ------------------------------------------------------------- */

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: var(--text-sm);
  font-family: var(--font-ui);
}

.article-body thead {
  border-bottom: 2px solid var(--color-text);
}

.article-body th {
  font-weight: 600;
  text-align: left;
  padding: 0.625rem 0.75rem;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
}

.article-body td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.article-body tbody tr:last-child td {
  border-bottom: 2px solid var(--color-border-strong);
}

/* --- Blockquotes -------------------------------------------------------- */

.article-body blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  font-style: italic;
  color: var(--color-text-secondary);
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* --- Pull quote --------------------------------------------------------- */

.pull-quote {
  border-left: 4px solid var(--color-accent);
  margin: 2.5rem 0;
  padding: 1.5rem 1.5rem 1.5rem 1.75rem;
  background: var(--color-accent-light);
}

.pull-quote p {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: 1.45;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.pull-quote cite {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-muted);
  display: block;
}

/* --- Fact box ----------------------------------------------------------- */

.fact-box {
  background: var(--color-stat-bg);
  border: 1px solid #e8dfc5;
  border-left: 4px solid var(--color-stat);
  padding: 1.5rem;
  margin: 2rem 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
}

.fact-item {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.fact-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-stat);
  margin-bottom: 0.25rem;
}

.fact-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

/* --- Timeline ----------------------------------------------------------- */

.timeline {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--color-border-strong);
}

.timeline-entry {
  position: relative;
  padding-bottom: 1.75rem;
}

.timeline-entry:last-child {
  padding-bottom: 0;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: var(--color-accent);
  border-radius: 50%;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
  font-weight: 400;
}

.timeline-content {
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.timeline-content p:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   7. Left Sidebar — Grouped Navigation
   -------------------------------------------------------------------------- */

.sidebar-nav {
  position: sticky;
  top: 2rem;
  padding-top: 0.25rem;
}

.nav-group {
  margin-bottom: 1.75rem;
}

.nav-group-label {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

.nav-group a {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.3rem 0 0.3rem 0.75rem;
  border-left: 3px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
  line-height: 1.4;
}

.nav-group a:hover {
  color: var(--color-text);
  border-left-color: var(--color-border-strong);
}

.nav-group a[aria-current="page"] {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  font-weight: 500;
}


/* --------------------------------------------------------------------------
   8. Right Sidebar — News Rail
   -------------------------------------------------------------------------- */

.sidebar-rail {
  position: sticky;
  top: 2rem;
  padding-top: 0.25rem;
}

.rail-box {
  margin-bottom: 2rem;
}

.rail-heading {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border);
}

/* Key Facts box */
.rail-facts {
  background: var(--color-stat-bg);
  border: 1px solid #e8dfc5;
  padding: 1rem;
}

.rail-facts .rail-heading {
  color: var(--color-stat);
  border-bottom-color: #e8dfc5;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
}

.rail-facts-list {
  list-style: none;
}

.rail-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid #ede7d4;
}

.rail-fact:last-child {
  border-bottom: none;
}

.rail-fact dt {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
}

.rail-fact dd {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text);
  text-align: right;
}

/* In the News list */
.rail-news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rail-news-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
}

.rail-news-list li:last-child {
  border-bottom: none;
}

.rail-news-list a {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.45;
  display: block;
}

.rail-news-list a:hover {
  color: var(--color-accent);
}


/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */

/* Tablet — collapse to two columns, hide right rail */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: var(--sidebar-left) 1fr;
    max-width: 800px;
  }

  .sidebar-rail {
    display: none;
  }
}

/* Mobile — single column, hamburger nav */
@media (max-width: 768px) {
  :root {
    --text-4xl: 2.25rem;
    --text-3xl: 1.875rem;
    --text-2xl: 1.5rem;
    --text-xl: 1.25rem;
  }

  .masthead {
    padding: 1.5rem var(--gutter) 1.25rem;
  }

  .masthead-title {
    font-size: 2rem;
  }

  .nav-toggle {
    display: flex;
  }

  .layout {
    display: block;
    max-width: 640px;
    padding-top: 0;
  }

  /* Left sidebar becomes collapsible mobile nav */
  .sidebar-nav {
    position: static;
    display: none;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    padding: 1.25rem var(--gutter) 1rem;
  }

  .sidebar-nav.is-open {
    display: block;
  }

  .nav-group {
    margin-bottom: 1.25rem;
  }

  .nav-group:last-child {
    margin-bottom: 0;
  }

  .nav-group a {
    padding: 0.4rem 0 0.4rem 0.75rem;
  }

  /* Right rail shows below content on mobile */
  .sidebar-rail {
    display: block;
    position: static;
    padding: 0 var(--gutter) 2rem;
    max-width: 640px;
    margin: 0 auto;
    border-top: 1px solid var(--color-border);
    padding-top: 2rem;
  }

  .main {
    padding: 2rem var(--gutter) 2rem;
  }

  .article-title {
    font-size: var(--text-3xl);
  }

  .article-dek {
    font-size: var(--text-base);
  }

  h2 {
    font-size: var(--text-xl);
  }

  .fact-box {
    gap: 1rem 1.5rem;
  }

  .fact-value {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  :root {
    --text-4xl: 1.875rem;
    --text-3xl: 1.5rem;
    --gutter: 1rem;
  }

  .masthead-title {
    font-size: 1.625rem;
  }

  .fact-box {
    flex-direction: column;
    gap: 1rem;
  }

  .rail-box {
    margin-bottom: 1.5rem;
  }
}

/* Hero and article figures */
.hero-figure {
  margin: 0 0 2rem;
}

.hero-figure img,
.article-figure img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.hero-figure figcaption,
.article-figure figcaption {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-top: 0.5rem;
  text-align: center;
}
