/*
Theme Name: IT Medium News
Theme URI: https://itmedium.com
Author: IT Medium News
Description: Editorial theme for IT Medium News — serif typography, hairline structure, and a reading-first article layout.
Version: 3.0.0
License: GNU General Public License v2 or later
Text Domain: netmag
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  /* Colour */
  --paper: #faf9f6;
  --surface: #ffffff;
  --ink: #16181d;
  --ink-2: #33373f;
  --muted: #5f6672;
  --rule: #e5e2db;
  --rule-strong: #16181d;
  --accent: #1f4fd1;
  --accent-ink: #163a9e;
  --accent-wash: #eef2fc;
  --band: #12151b;

  /* Type */
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: clamp(1.25rem, 1.1rem + .5vw, 1.5rem);
  --fs-xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  --fs-2xl: clamp(2rem, 1.5rem + 2vw, 3.25rem);

  /* Space & layout */
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 40px);
  --measure: 680px;
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 56px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.15; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #d9e2fb; color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link, .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; margin: 0; z-index: 1000;
  top: 12px; left: 12px; padding: 10px 16px;
  background: var(--ink); color: var(--paper); font-size: var(--fs-sm); font-weight: 500;
}

/* ==========================================================================
   3. Shared atoms
   ========================================================================== */
.kicker {
  display: inline-block;
  font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
a.kicker:hover { color: var(--accent-ink); }

.meta {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--sans); font-size: var(--fs-sm); color: var(--muted);
}
.meta-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px;
  font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .01em;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: var(--radius);
  cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--light:hover { background: #fff; border-color: #fff; color: var(--ink); }
.btn--ghost-light { background: transparent; color: var(--paper); border-color: rgba(250,249,246,.35); }
.btn--ghost-light:hover { background: transparent; border-color: var(--paper); color: #fff; }

.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.chip-list li a {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface);
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2);
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.chip-list li a:hover { border-color: var(--ink); color: var(--ink); }
.chip-list li.current-cat a { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ==========================================================================
   4. Masthead & navigation
   ========================================================================== */
.masthead { background: var(--paper); }
.masthead-inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding-block: 28px 22px;
}
.masthead-date, .masthead-tagline {
  font-size: var(--fs-xs); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.masthead-tagline { text-align: right; }
.site-logo { display: inline-flex; justify-content: center; }
.site-logo img { max-height: 52px; width: auto; }
.wordmark {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
  letter-spacing: -.02em; line-height: 1; color: var(--ink);
  font-variation-settings: 'opsz' 72;
}

.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 249, 246, .94);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  transition: box-shadow .25s var(--ease);
}
.navbar.scrolled { box-shadow: 0 1px 0 var(--rule), 0 8px 24px -16px rgba(22, 24, 29, .25); }
.navbar-inner { display: flex; align-items: center; gap: 16px; height: var(--nav-h); }

.navbar-logo {
  font-family: var(--serif); font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em;
  white-space: nowrap; opacity: 0; width: 0; overflow: hidden; pointer-events: none;
  transition: opacity .2s var(--ease);
}
.navbar.scrolled .navbar-logo { opacity: 1; width: auto; pointer-events: auto; margin-right: 8px; }

.main-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: var(--nav-h); padding: 0 12px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); white-space: nowrap;
  transition: color .15s var(--ease);
}
.main-nav > ul > li > a::before {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a { color: var(--ink); }
.main-nav > ul > li > a:hover::before,
.main-nav > ul > .current-menu-item > a::before,
.main-nav > ul > .current-menu-ancestor > a::before { transform: scaleX(1); }
.main-nav .menu-item-has-children > a::after {
  content: ''; width: 5px; height: 5px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: .7;
}
.main-nav .sub-menu {
  position: absolute; top: 100%; left: 0; z-index: 50;
  min-width: 240px; padding: 8px 0;
  list-style: none; display: none; flex-direction: column; align-items: stretch;
  background: var(--surface); border: 1px solid var(--rule); border-top: 2px solid var(--ink);
  box-shadow: 0 18px 40px -20px rgba(22, 24, 29, .3);
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { display: flex; }
.main-nav .sub-menu a { height: auto; width: 100%; padding: 9px 18px; font-weight: 400; }
.main-nav .sub-menu a:hover { background: var(--paper); }

.search-toggle, .nav-toggle {
  flex: 0 0 auto; width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--ink);
  transition: background .15s var(--ease);
}
.search-toggle:hover, .nav-toggle:hover { background: rgba(22, 24, 29, .06); }
.search-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); }

.nav-toggle { display: none; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ''; display: block; position: relative; width: 20px; height: 1.5px; background: currentColor;
  transition: transform .25s var(--ease), background .2s var(--ease), top .25s var(--ease);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }
.submenu-toggle { display: none; }

.header-search { display: none; border-top: 1px solid var(--rule); background: var(--paper); }
.header-search.open { display: block; }
.header-search form, .inline-search { display: flex; gap: 0; max-width: 720px; margin-inline: auto; padding-block: 20px; }
.inline-search { margin: 28px 0 0; padding: 0; max-width: 560px; }
.header-search input, .inline-search input {
  flex: 1; min-width: 0; height: 52px; padding: 0 4px;
  background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0;
  font-family: var(--serif); font-size: 1.35rem; outline: none;
}
.header-search input::placeholder, .inline-search input::placeholder { color: #9a9fa8; }
.header-search button, .inline-search button {
  height: 52px; padding: 0 22px; border: 0; border-bottom: 1.5px solid var(--ink);
  background: transparent; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.header-search button:hover, .inline-search button:hover { color: var(--accent); }

/* ==========================================================================
   5. Cards
   ========================================================================== */
.card { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-media { display: block; overflow: hidden; background: #eceae4; }
.card-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .8s var(--ease), opacity .3s; }
.card:hover .card-media img { transform: scale(1.025); }
.card-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-title { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.card-title a {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size .35s var(--ease);
}
.card-title a:hover { background-size: 100% 1px; }
.card-title a::after { content: ''; position: absolute; inset: 0; } /* whole card clickable */
.card .kicker { position: relative; z-index: 1; }
.card-excerpt { color: var(--ink-2); font-size: .975rem; line-height: 1.55; }

.thumb-placeholder {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 3 / 2;
  font-family: var(--serif); font-size: 1.1rem; color: var(--muted); background: #eceae4;
}

/* Lead */
.card--lead { gap: 20px; }
.card--lead .card-media img { aspect-ratio: 16 / 9; }
.card--lead .card-title { font-size: var(--fs-2xl); line-height: 1.06; letter-spacing: -.02em; font-variation-settings: 'opsz' 72; }
.card--lead .card-excerpt { font-family: var(--serif); font-size: 1.25rem; line-height: 1.45; color: var(--ink-2); max-width: 46ch; }
.card--lead .card-body { gap: 12px; }

/* Feature */
.card--feature .card-title { font-size: var(--fs-xl); line-height: 1.12; }
.card--feature .card-excerpt { max-width: 52ch; }

/* Grid */
.card--grid .card-title { font-size: 1.3rem; line-height: 1.22; }

/* Compact (thumb right) */
.card--compact { flex-direction: row-reverse; align-items: flex-start; gap: 20px; }
.card--compact .card-media { flex: 0 0 132px; }
.card--compact .card-media img, .card--compact .thumb-placeholder { aspect-ratio: 1 / 1; }
.card--compact .card-body { flex: 1; }
.card--compact .card-title { font-size: 1.2rem; line-height: 1.25; }

/* Rank (numbered, no image) */
.card--rank { flex-direction: row; gap: 16px; }
.card-rank {
  flex: 0 0 auto; width: 28px;
  font-family: var(--serif); font-size: 2rem; line-height: .9; font-weight: 400; color: var(--accent);
  font-variant-numeric: lining-nums;
}
.card--rank .card-title { font-size: 1.15rem; line-height: 1.25; }

/* ==========================================================================
   6. Homepage
   ========================================================================== */
.front-lead {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px;
  padding-block: 36px 56px;
}
.front-lead-side { border-left: 1px solid var(--rule); padding-left: 40px; }
.rail-title, .section-title {
  font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink);
}
.rail-title { padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--rule-strong); }
.rank-list { list-style: none; }
.rank-list li { padding-block: 20px; border-bottom: 1px solid var(--rule); }
.rank-list li:last-child { border-bottom: 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-top: 14px; margin-bottom: 28px; border-top: 1px solid var(--rule-strong);
}
.section-title a:hover { color: var(--accent); }
.section-more {
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.section-more::after { content: '→'; transition: transform .2s var(--ease); }
.section-more:hover { color: var(--accent); }
.section-more:hover::after { transform: translateX(3px); }

.front-section { padding-block: 8px 64px; }
.section-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; }
.front-section--flip .section-feature { order: 2; }
.section-list { display: flex; flex-direction: column; }
.section-list .card { padding-block: 22px; border-bottom: 1px solid var(--rule); }
.section-list .card:first-child { padding-top: 0; }
.section-list .card:last-child { border-bottom: 0; }

.editorial-band { background: var(--band); color: var(--paper); margin-block: 16px 72px; }
.editorial-band-inner { padding-block: 72px; max-width: 960px; text-align: center; }
.editorial-band-eyebrow {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #a9b4c8;
}
.editorial-band-statement {
  margin: 18px auto 32px; max-width: 30ch;
  font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.25; font-weight: 400; letter-spacing: -.01em;
}
.editorial-band-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.front-latest { padding-block: 0 72px; }
.grid-4, .grid-3 { display: grid; gap: 48px 32px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ==========================================================================
   7. Article
   ========================================================================== */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

.article { padding-block: 48px 24px; }
.article-head { max-width: 780px; margin-inline: auto; padding-inline: var(--gutter); text-align: center; }
.article-title {
  margin-top: 16px;
  font-family: var(--serif); font-size: var(--fs-2xl); line-height: 1.08; letter-spacing: -.02em; font-weight: 500;
  font-variation-settings: 'opsz' 72; text-wrap: balance;
}
.article-standfirst {
  margin: 20px auto 0; max-width: 60ch;
  font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; color: var(--ink-2); text-wrap: pretty;
}
.article-byline {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 32px; padding-block: 16px; border-block: 1px solid var(--rule); text-align: left;
}
.byline-text { display: flex; flex-direction: column; gap: 2px; }
.byline-author { font-size: var(--fs-sm); font-weight: 600; }
.share { display: flex; gap: 6px; }
.share-btn {
  position: relative; width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: 50%; background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease);
}
.share-btn:hover { border-color: var(--ink); color: var(--ink); }
.share-copied {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; background: var(--ink); color: var(--paper); font-size: var(--fs-xs); white-space: nowrap;
  border-radius: var(--radius); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.share-copied:not(:empty) { opacity: 1; }

.article-figure { max-width: 1080px; margin: 40px auto 0; padding-inline: var(--gutter); }
.article-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-figure figcaption {
  max-width: var(--measure); margin: 12px auto 0;
  font-size: var(--fs-xs); line-height: 1.5; color: var(--muted);
}
.article-figure figcaption a { text-decoration: underline; text-underline-offset: 2px; }

.prose {
  max-width: calc(var(--measure) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter);
  font-family: var(--serif); font-size: 1.1875rem; line-height: 1.7; color: #1e2127;
  font-variation-settings: 'opsz' 16;
}
.article-body { margin-top: 48px; }
.prose > * + * { margin-top: 1.15em; }
.prose h2, .prose h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.prose h2 { margin-top: 2em; font-size: 1.6rem; line-height: 1.2; }
.prose h3 { margin-top: 1.7em; font-size: 1.3rem; line-height: 1.3; }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose blockquote {
  margin-inline: 0; padding-left: 24px; border-left: 2px solid var(--ink);
  font-size: 1.35rem; line-height: 1.45; font-style: italic; color: var(--ink);
}
.prose img, .prose figure { margin-inline: auto; }
.prose figcaption { font-family: var(--sans); font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.4em; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .95rem; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
.prose .editorial-note {
  padding: 16px 20px; background: var(--accent-wash); border-left: 2px solid var(--accent);
  font-family: var(--sans); font-size: .95rem; line-height: 1.55; color: var(--ink-2);
}
.article-body > p:first-child { font-size: 1.3rem; line-height: 1.55; color: var(--ink); }
.article-body > p:first-child strong { font-weight: 500; }
.article-body > p:first-child::first-letter {
  float: left; margin: .06em .12em 0 0;
  font-size: 3.4em; line-height: .8; font-weight: 600; color: var(--ink);
}

.article-foot { max-width: calc(var(--measure) + var(--gutter) * 2); margin: 48px auto 0; padding-inline: var(--gutter); }
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a {
  display: inline-flex; min-height: 32px; align-items: center; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 999px; font-size: var(--fs-sm); color: var(--ink-2);
}
.tag-list a:hover { border-color: var(--ink); color: var(--ink); }

.about-box { margin-top: 40px; padding: 24px 0; border-block: 1px solid var(--rule); font-size: .95rem; color: var(--ink-2); }
.about-box-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.about-box a { display: inline-block; margin-top: 10px; font-weight: 600; font-size: var(--fs-sm); color: var(--accent); }
.about-box a:hover { color: var(--accent-ink); }

.post-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.post-pager-link { display: flex; flex-direction: column; gap: 6px; padding: 20px 0; border-top: 2px solid var(--ink); }
.post-pager-link--next { text-align: right; grid-column: 2; }
.post-pager-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.post-pager-title { font-family: var(--serif); font-size: 1.15rem; line-height: 1.3; }
.post-pager-link:hover .post-pager-title { color: var(--accent); }

.related { padding-block: 56px 72px; margin-top: 56px; background: var(--surface); border-top: 1px solid var(--rule); }

/* ==========================================================================
   8. Listings, pages, empty states
   ========================================================================== */
.page-head { padding-block: 56px 40px; max-width: 820px; }
.page-eyebrow { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.page-title {
  font-family: var(--serif); font-size: var(--fs-2xl); line-height: 1.08; letter-spacing: -.02em; font-weight: 500;
  font-variation-settings: 'opsz' 72; text-wrap: balance;
}
.page-intro { margin-top: 16px; max-width: 62ch; font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); }
.page-intro p + p { margin-top: .8em; }
.listing { padding-top: 32px; border-top: 1px solid var(--rule-strong); padding-bottom: 24px; }

.pagination, .navigation.pagination { padding-block: 32px 80px; }
.pagination .nav-links { display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap; }
.pagination .page-numbers {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); border-radius: var(--radius);
}
.pagination a.page-numbers:hover { background: rgba(22, 24, 29, .06); color: var(--ink); }
.pagination .page-numbers.current { background: var(--ink); color: var(--paper); }

.page-article { padding-block: 56px 88px; }
.page-article-head { max-width: calc(var(--measure) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.page-body { margin-top: 36px; font-size: 1.125rem; }

.empty-state { padding-block: 64px 96px; max-width: 560px; }
.empty-state h2 { font-family: var(--serif); font-size: var(--fs-xl); }
.empty-state p { margin-top: 12px; color: var(--ink-2); }
.empty-state .btn { margin-top: 24px; }

.not-found { padding-block: 72px 64px; max-width: 760px; }

/* Contact form (shortcode) */
.contact-form { display: grid; gap: 8px; max-width: 560px; font-family: var(--sans); font-size: var(--fs-base); }
.contact-form label { margin-top: 12px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.contact-form input, .contact-form select, .contact-form textarea {
  width: 100%; padding: 12px 14px;
  background: var(--surface); border: 1px solid #d6d3cc; border-radius: var(--radius);
  font-size: 1rem; line-height: 1.5; transition: border-color .15s, box-shadow .15s;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(31, 79, 209, .15);
}
.contact-form button {
  justify-self: start; margin-top: 16px; min-height: 46px; padding: 0 26px;
  background: var(--ink); color: var(--paper); border: 0; border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background .2s var(--ease);
}
.contact-form button:hover { background: var(--accent); }
.contact-form .hp { position: absolute; left: -9999px; }
.contact-notice { padding: 12px 16px; font-family: var(--sans); font-size: .95rem; border-left: 2px solid; }
.contact-notice.success { background: #ecf7ef; border-color: #1f7a3d; color: #155c2d; }
.contact-notice.error { background: #fdf0ef; border-color: #b42318; color: #8a1c13; }

/* ==========================================================================
   9. Footer
   ========================================================================== */
.site-footer { background: var(--band); color: #b9c0cc; margin-top: 0; }
.footer-top {
  display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 48px;
  padding-block: 64px 40px; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer-logo { font-family: var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: -.02em; color: var(--paper); line-height: 1; }
.footer-mission { max-width: 56ch; justify-self: end; font-family: var(--serif); font-size: 1.1rem; line-height: 1.5; color: #d6dbe3; }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; padding-block: 40px 48px; }
.footer-heading { font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8892a2; margin-bottom: 16px; }
.footer-list { list-style: none; display: grid; gap: 10px; }
.footer-list a, .footer-legal a { font-size: .95rem; color: #d6dbe3; transition: color .15s; }
.footer-list a:hover, .footer-legal a:hover { color: #fff; }
.footer-note { font-size: .95rem; line-height: 1.55; max-width: 34ch; }
.footer-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--paper);
  border-bottom: 1px solid rgba(250, 249, 246, .4); padding-bottom: 2px;
}
.footer-cta::after { content: '→'; transition: transform .2s var(--ease); }
.footer-cta:hover { color: #fff; border-color: #fff; }
.footer-cta:hover::after { transform: translateX(3px); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-block: 22px 28px; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: var(--fs-sm); color: #8892a2;
}
.footer-legal { display: flex; gap: 24px; }
.footer-legal a { font-size: var(--fs-sm); color: #8892a2; }

/* ==========================================================================
   10. Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .front-lead { grid-template-columns: 1fr; gap: 40px; }
  .front-lead-side { border-left: 0; padding-left: 0; }
  .rank-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .rank-list li:nth-last-child(2) { border-bottom: 0; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --nav-h: 52px; }
  .masthead-inner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 8px; padding-block: 20px 16px; }
  .masthead-tagline { display: none; }

  .nav-toggle { display: inline-flex; }
  .navbar-logo { opacity: 1; width: auto; pointer-events: auto; flex: 1; text-align: center; }
  .navbar:not(.scrolled) .navbar-logo { opacity: 0; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; justify-content: stretch;
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain;
    padding: 8px var(--gutter) 24px; background: var(--paper); border-bottom: 1px solid var(--rule);
    box-shadow: 0 24px 40px -24px rgba(22, 24, 29, .35);
  }
  .main-nav.open { display: block; }
  body.nav-open { overflow: hidden; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav li { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--rule); }
  .main-nav li:last-child { border-bottom: 0; }
  .main-nav a { flex: 1 1 auto; height: auto; padding: 14px 0; font-family: var(--serif); font-size: 1.2rem; font-weight: 500; color: var(--ink); }
  .main-nav > ul > li > a::before, .main-nav .menu-item-has-children > a::after { display: none; }
  .submenu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 0; background: none; cursor: pointer; color: var(--ink);
  }
  .submenu-toggle::before {
    content: ''; width: 7px; height: 7px; margin-top: -4px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg); transition: transform .2s var(--ease), margin .2s;
  }
  .submenu-open > .submenu-toggle::before { transform: rotate(-135deg); margin-top: 4px; }
  .main-nav .sub-menu,
  .main-nav li:hover > .sub-menu,
  .main-nav li:focus-within > .sub-menu {
    position: static; flex-basis: 100%; display: none; min-width: 0;
    padding: 0 0 10px 14px; background: none; border: 0; box-shadow: none;
  }
  .main-nav .submenu-open > .sub-menu { display: flex; }
  .main-nav .sub-menu li { border: 0; }
  .main-nav .sub-menu a { padding: 8px 0; font-family: var(--sans); font-size: .95rem; color: var(--ink-2); }

  .section-grid { grid-template-columns: 1fr; gap: 32px; }
  .front-section--flip .section-feature { order: 0; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-top { grid-template-columns: 1fr; gap: 16px; }
  .footer-mission { justify-self: start; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .front-lead { padding-block: 24px 40px; }
  .rank-list { grid-template-columns: 1fr; }
  .rank-list li:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
  .grid-4, .grid-3 { grid-template-columns: 1fr; gap: 36px; }
  .card--compact .card-media { flex-basis: 96px; }
  .card--compact .card-title { font-size: 1.08rem; }
  .card--lead .card-excerpt { font-size: 1.1rem; }
  .front-section { padding-bottom: 48px; }
  .editorial-band-inner { padding-block: 56px; }
  .article { padding-top: 32px; }
  .article-head { text-align: left; }
  .article-standfirst { font-size: 1.15rem; }
  .article-figure { padding-inline: 0; }
  .article-figure figcaption { padding-inline: var(--gutter); }
  .prose { font-size: 1.0938rem; }
  .post-pager { grid-template-columns: 1fr; }
  .post-pager-link--next { grid-column: 1; text-align: left; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .page-head { padding-block: 40px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .masthead, .navbar, .share, .related, .site-footer, .read-progress, .post-pager, .about-box { display: none !important; }
  body { background: #fff; }
  .prose { max-width: none; font-size: 12pt; }
}
