/* Literata variable (SIL OFL 1.1) — see fonts/Literata-OFL.txt */
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/literata-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/literata-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/literata-latin-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/literata-latin-ext-wght-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cyrillic (Russian) and Vietnamese: loaded only by pages that contain these characters. */
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/literata-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/literata-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/literata-vietnamese-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Metric-matched local fallbacks (measured against Literata) so the webfont swap does not reflow text. */
@font-face {
  font-family: "Literata Fallback";
  src: local("Georgia");
  size-adjust: 106.1%;
  ascent-override: 111.22%;
  descent-override: 29.22%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Literata Fallback Times";
  src: local("Times New Roman"), local("Times"), local("Liberation Serif"), local("Noto Serif");
  size-adjust: 115.06%;
  ascent-override: 102.56%;
  descent-override: 26.94%;
  line-gap-override: 0%;
}

/* ---------- Tokens: Auto follows the OS. Light, Sand, and Dark are explicit choices. ---------- */
:root {
  color-scheme: light dark;
  --bg: light-dark(#fbf9f5, #161514);
  --surface: light-dark(#ffffff, #1f1e1c);
  --text: light-dark(#1d1b18, #e8e3d9);
  --muted: light-dark(#5f5a52, #a39d92);
  --accent: light-dark(#8e3a28, #e3a47a);
  --accent-text: light-dark(#ffffff, #161514);
  --rule: light-dark(#e6e1d7, #302e2a);
  --notice: light-dark(#f3eee4, #24221f);
  --selection: light-dark(#f0dccf, #4a3525);

  --font-serif: "Literata", "Literata Fallback", "Literata Fallback Times", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --measure: 36rem;
  --radius: 0.625rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="sand"] {
  color-scheme: light;
  --bg: #e4d3b3;
  --surface: #ecdfc5;
  --text: #33271a;
  --muted: #5f4d37;
  --accent: #7f3d15;
  --accent-text: #f7efe0;
  --rule: #cdb68c;
  --notice: #d9c49c;
  --selection: #d6b98a;
}

/* Re-declared on every [lang] element so fallback content (for example, English inside an Arabic page) gets its own script's fonts. */
[lang] { --font-serif: "Literata", "Literata Fallback", "Literata Fallback Times", serif; }
[lang|="zh"] { --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif; }
[lang|="ar"] { --font-serif: "Noto Naskh Arabic", "Amiri", "Geeza Pro", "Traditional Arabic", serif; }
/* Scripts without a Literata version: the best serif that each system ships (Windows, macOS/iOS, Android). */
[lang|="ur"] { --font-serif: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Noto Naskh Arabic", "Geeza Pro", serif; }
[lang|="hi"], [lang|="mr"] { --font-serif: "Noto Serif Devanagari", "Kohinoor Devanagari", "Nirmala UI", "Mangal", serif; }
[lang|="bn"] { --font-serif: "Noto Serif Bengali", "Kohinoor Bangla", "Nirmala UI", "Vrinda", serif; }
[lang|="te"] { --font-serif: "Noto Serif Telugu", "Kohinoor Telugu", "Nirmala UI", "Gautami", serif; }
[lang|="ja"] { --font-serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "MS PMincho", serif; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* Keep content clear of notches and rounded corners in landscape. */
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}
::selection { background: var(--selection); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  z-index: 10;
}
.skip-link:focus { inset-block-start: 1rem; }

.site-header, main { width: min(100% - 2.5rem, var(--measure)); margin-inline: auto; }
.site-header { width: min(100% - 2.5rem, 56rem); }

/* ---------- Header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  padding-block: 1.5rem 1.25rem;
}
.site-header .brand { margin-inline-end: auto; }
/* Keeps the open theme menu above the content (the drop cap creates its own layer). */
.site-header { position: relative; z-index: 10; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}
.brand-mark { flex: none; width: 2.4rem; height: 2.4rem; color: var(--accent); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  /* A Latin wordmark: always Literata, whatever the page language. */
  font-family: "Literata", "Literata Fallback", "Literata Fallback Times", serif;
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.025em;
}
.brand-sub {
  margin-block-start: 0.2rem;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
:lang(zh) .brand-sub, :lang(ja) .brand-sub, :lang(ar) .brand-sub, :lang(ur) .brand-sub, :lang(hi) .brand-sub, :lang(mr) .brand-sub, :lang(bn) .brand-sub, :lang(te) .brand-sub { letter-spacing: 0; text-transform: none; }
.brand:hover .brand-name { color: var(--accent); }

/* Search: a full field without JS. With JS, it collapses to an icon until the reader opens it. */
.site-search { position: relative; display: flex; align-items: center; }
.site-search input {
  width: 13rem;
  min-height: 2.25rem;
  padding: 0.375rem 2.5rem 0.375rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
[dir="rtl"] .site-search input { padding: 0.375rem 0.9rem 0.375rem 2.5rem; }
.site-search input::placeholder { color: var(--muted); }
.site-search input::-webkit-search-cancel-button { display: none; }
.search-toggle {
  position: absolute;
  inset-inline-end: 0.125rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}
.search-toggle:hover { color: var(--accent); }
.search-toggle svg { width: 1.125rem; height: 1.125rem; }
.js .site-search:not(.open) input {
  width: 2.25rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: transparent;
  cursor: pointer;
  pointer-events: none;
}
.js .site-search:not(.open) input::placeholder { color: transparent; }
/* Collapsed: the icon covers the whole field, so there is one full-size tap target. Keyboard focus on the field still opens it. */
.js .site-search:not(.open) .search-toggle { inset: 0; width: auto; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .site-search input { transition: width 0.25s ease, background-color 0.2s, border-color 0.2s; }
}
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; font-size: 0.875rem; }

/* Theme menu: a small swatch of the current theme. It opens a compact list of the four themes. */
.theme-menu { position: relative; }
.theme-menu[hidden] { display: none; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.theme-toggle[aria-expanded="true"] { background: var(--notice); }
@media (hover: hover) {
  .theme-toggle:hover, }
.swatch {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06);
}
.swatch-light { background: #fbf9f5; }
.swatch-sand { background: #e4d3b3; }
.swatch-dark { background: #161514; }
.swatch-auto, .swatch-current { background: linear-gradient(135deg, #fbf9f5 50%, #161514 50%); }
:root[data-theme="light"] .swatch-current { background: #fbf9f5; }
:root[data-theme="sand"] .swatch-current { background: #e4d3b3; }
:root[data-theme="dark"] .swatch-current { background: #161514; }

.theme-panel {
  position: absolute;
  inset-block-start: calc(100% + 0.375rem);
  inset-inline-end: 0;
  z-index: 20;
  display: grid;
  min-width: 9.5rem;
  margin: 0;
  padding: 0.3rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.35);
}
.theme-panel[hidden] { display: none; }
.theme-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: calc(var(--radius) - 0.25rem);
  color: var(--text);
  cursor: pointer;
}
.theme-choice:hover { background: var(--notice); }
.theme-choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.theme-choice-name { flex: 1; }
.theme-choice:has(input:checked) .theme-choice-name::after { content: "\2713"; float: inline-end; color: var(--accent); }
.theme-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (prefers-reduced-motion: no-preference) {
  .theme-panel:not([hidden]) { animation: panel-in 0.14s ease-out; }
  @keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } }
}

.language-form { display: flex; align-items: center; gap: 0.5rem; }
.language-form label { color: var(--muted); }
select, button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.375rem 0.75rem;
  min-height: 2.25rem;
}
button { cursor: pointer; }
select:hover, button:hover { border-color: var(--muted); }

/* ---------- Reading ---------- */
main { flex: 1; padding-block: clamp(2rem, 6vw, 4rem) 3rem; }
main:focus { outline: none; }

.eyebrow {
  margin: 0 0 0.875rem;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
:lang(zh) .eyebrow, :lang(ja) .eyebrow, :lang(ar) .eyebrow, :lang(ur) .eyebrow, :lang(hi) .eyebrow, :lang(mr) .eyebrow, :lang(bn) .eyebrow, :lang(te) .eyebrow { letter-spacing: 0; }

h1 {
  margin: 0 0 2rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 1.5rem + 2.4vw, 2.875rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.message-body {
  font-family: var(--font-serif);
  font-size: clamp(1.125rem, 1.04rem + 0.4vw, 1.3125rem);
  line-height: 1.72;
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums proportional-nums;
  hyphens: auto;
  overflow-wrap: break-word;
}
.message-body p { margin: 0 0 1.3em; text-wrap: pretty; }
.message-body em { font-style: italic; }
.message-body[lang|="ar"] { line-height: 1.95; }
/* Nastaliq and the Indic scripts have tall stacked letters and need more space between lines. */
.message-body[lang|="ur"] { line-height: 2.3; }
.message-body[lang|="hi"], .message-body[lang|="mr"], .message-body[lang|="bn"], .message-body[lang|="te"] { line-height: 1.9; }

@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
  .message-body:lang(en) > p:first-child::first-letter,
  .message-body:lang(es) > p:first-child::first-letter,
  .message-body:lang(pt) > p:first-child::first-letter,
  .message-body:lang(fr) > p:first-child::first-letter,
  .message-body:lang(de) > p:first-child::first-letter {
    -webkit-initial-letter: 3;
    initial-letter: 3;
    margin-inline-end: 0.5rem;
    color: var(--accent);
    font-weight: 600;
  }
}

.notice {
  margin: 0 0 2rem;
  padding: 0.875rem 1.125rem;
  border-inline-start: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--notice);
  color: var(--text);
  font-size: 0.9375rem;
}
[dir="rtl"] .notice { border-radius: var(--radius) 0 0 var(--radius); }

.series {
  margin: 2.5rem 0 0;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  font-family: var(--font-serif);
}

.share { display: flex; align-items: center; gap: 1rem; min-height: 2.5rem; margin-block-start: 1.25rem; }
.share-button { background: transparent; color: var(--accent); border-color: var(--rule); }
.share-status { margin: 0; color: var(--muted); font-size: 0.875rem; }

.message-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin-block-start: 3rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.message-nav a { text-decoration: none; }
.message-nav a:hover { text-decoration: underline; }
.message-nav [rel="next"] { margin-inline-start: auto; }
.message-nav [rel="prev"]::before { content: "← "; }
.message-nav [rel="next"]::after { content: " →"; }
[dir="rtl"] .message-nav [rel="prev"]::before { content: "→ "; }
[dir="rtl"] .message-nav [rel="next"]::after { content: " ←"; }

/* ---------- Archive ---------- */
.archive-list { list-style: none; margin: 0; padding: 0; border-block-start: 1px solid var(--rule); }
.archive-list li { border-block-end: 1px solid var(--rule); }
.archive-list a {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding-block: 1rem;
  color: var(--text);
  text-decoration: none;
}
.archive-day { flex: none; min-width: 5.5rem; color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.archive-title { font-family: var(--font-serif); font-size: 1.1875rem; }
.archive-list a:hover .archive-title { color: var(--accent); }

/* ---------- Search page ---------- */
.search-page-form { display: flex; gap: 0.5rem; margin-block-end: 1rem; }
.search-page-form input {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.0625rem;
}
.search-status { color: var(--muted); font-size: 0.9375rem; }
.search-results { list-style: none; margin: 1.5rem 0 0; padding: 0; border-block-start: 1px solid var(--rule); }
.search-results li { padding-block: 1rem; border-block-end: 1px solid var(--rule); }
.search-results a { display: flex; align-items: baseline; gap: 1.25rem; color: var(--text); text-decoration: none; }
.search-results a:hover .search-title { color: var(--accent); }
.search-title { font-family: var(--font-serif); font-size: 1.1875rem; }
.search-snippet { overflow-wrap: anywhere; margin: 0.4rem 0 0; color: var(--muted); font-family: var(--font-serif); font-size: 1rem; line-height: 1.6; }
mark { padding: 0 0.1em; border-radius: 0.2em; background: var(--selection); color: var(--text); }

@media (prefers-reduced-motion: no-preference) {
  body { transition: background-color 0.25s ease, color 0.25s ease; }
  a, button, select { transition: color 0.15s, border-color 0.15s; }
}

/* Language menu. Touch screens use the native select (the phone's own picker: it fits the screen and scrolls).
   field-sizing: the closed select is as wide as the selected label; the limit keeps phone headers at two rows. */
.language-form select { field-sizing: content; max-width: 15rem; text-overflow: ellipsis; }
@media (max-width: 30rem) { .language-form select { max-width: 13rem; } }

/* With a mouse or trackpad, language-menu.js replaces the select with this list, the same in every browser:
   limited height, scrolling, and typing letters jumps to a language. */
.lang-menu { position: relative; }
.lang-button { display: inline-flex; align-items: center; gap: 0.6rem; max-width: 15rem; white-space: nowrap; }
.lang-current { overflow: hidden; text-overflow: ellipsis; }
.lang-button::after {
  content: "";
  flex: none;
  width: 0.4em;
  height: 0.4em;
  border-inline-end: 2px solid var(--muted);
  border-block-end: 2px solid var(--muted);
  transform: translateY(-25%) rotate(45deg);
}
.lang-button[aria-expanded="true"]::after { transform: translateY(25%) rotate(-135deg); }
.lang-list {
  position: absolute;
  z-index: 20;
  inset-block-start: calc(100% + 0.25rem);
  inset-inline-end: 0;
  min-width: 100%;
  max-height: min(22rem, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.18);
}
.lang-list li { padding: 0.4rem 0.75rem; border-radius: calc(var(--radius) - 2px); white-space: nowrap; cursor: pointer; }
.lang-list li.active { background: var(--selection); }
.lang-list li[aria-selected="true"] { font-weight: 600; }
.lang-list li[aria-selected="true"]::after { content: "\2713"; float: inline-end; margin-inline-start: 1rem; }
@media (forced-colors: active) {
  .lang-list li.active { outline: 2px solid Highlight; }
}

.language-submit svg { display: none; width: 1.125rem; height: 1.125rem; }
/* With JS, a language applies as soon as the reader picks it (app.js). The button is only for readers without JS. */
.js .language-submit { display: none; }

/* ---------- Touch devices: 44px tap targets; 16px inputs stop iOS zooming on focus ---------- */
@media (pointer: coarse) {
  input, select, textarea { font-size: 1rem; }
  select, button { min-height: 2.75rem; }
  .theme-toggle { width: 2.75rem; height: 2.75rem; }
  .theme-choice { min-height: 2.75rem; }
  .search-toggle { width: 2.75rem; height: 2.75rem; }
  .site-search input { min-height: 2.75rem; }
  .js .site-search:not(.open) input { width: 2.75rem; }
  .message-nav a { display: inline-flex; align-items: center; min-width: 2.75rem; min-height: 2.75rem; }
  .site-header .brand { min-height: 2.75rem; }
}

/* ---------- Phones: two-row header, stacked lists ---------- */
@media (max-width: 40rem) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand search" "controls controls";
    gap: 0.75rem;
    padding-block: 1rem 0.75rem;
    border-block-end: 1px solid var(--rule);
  }
  .site-header .brand { grid-area: brand; margin: 0; }
  /* The theme toggle is at the start of the second row here, so the menu opens toward the end. */
  .theme-panel { inset-inline-end: auto; inset-inline-start: 0; }
  .site-search { grid-area: search; justify-self: end; }
  .controls { grid-area: controls; justify-content: space-between; }
  .brand-mark { width: 2.1rem; height: 2.1rem; }
  .brand-name { font-size: 1.125rem; }

  /* Open search takes the whole first row. Without JS it is always a full-width row. */
  .site-header:has(.site-search.open) .brand { display: none; }
  .site-header:has(.site-search.open) .site-search,
  html:not(.js) .site-search { grid-column: 1 / -1; justify-self: stretch; }
  .site-search.open input, html:not(.js) .site-search input { width: 100%; }
  html:not(.js) .site-header { grid-template-areas: "brand brand" "search search" "controls controls"; }

  .language-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .language-submit { display: grid; place-items: center; width: 2.75rem; padding: 0; }
  .language-submit svg { display: block; }
  [dir="rtl"] .language-submit svg { transform: scaleX(-1); }
  .language-submit-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

  main { padding-block: 1.75rem 2.5rem; }
  .archive-list a, .search-results a { flex-direction: column; gap: 0.15rem; }
  .archive-day { min-width: 0; }
  .search-page-form button { flex: none; }
  .share { margin-block-start: 1rem; }
}

/* Very narrow phones (320px): keep the header at two rows. */
@media (max-width: 22.5rem) and (pointer: coarse) {
  .controls { gap: 0.5rem; }
  .language-form select { padding-inline: 0.5rem; }
}

@media print {
  .site-header, .message-nav, .share, .skip-link { display: none; }
  :root { color-scheme: light; --bg: #fff; --text: #000; }
  .message-body { font-size: 12pt; }
}
