/*
Theme Name: excessᴍᴀᴄʜɪɴᴀ
Theme URI: https://excessmachina.com/
Author: excessᴍᴀᴄʜɪɴᴀ
Description: Circuit, an original ruled editorial theme with native WordPress publishing, responsive photography, and light and dark reading modes.
Version: 1.2.2
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: excessmachina
Tags: blog, photography, news, custom-menu, featured-images, editor-style, wide-blocks, block-styles
*/

/* Circuit palettes. The system preference remains usable without JavaScript. */
:root {
  color-scheme: light;
  --paper: #f8f9fc;
  --ink: #10131a;
  --muted: #555f71;
  --line: #b7bfcd;
  --accent: #1447c9;
  --panel: #eaf0fa;
  --action-ink: #f8f9fc;
  --sans: Inter, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  --measure: 64rem;
  --gutter: clamp(1.25rem, 4vw, 4rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #10141c;
    --ink: #f4f6fc;
    --muted: #b6c0d3;
    --line: #495365;
    --accent: #9ebaff;
    --panel: #1b2535;
    --action-ink: #10141c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #10141c;
  --ink: #f4f6fc;
  --muted: #b6c0d3;
  --line: #495365;
  --accent: #9ebaff;
  --panel: #1b2535;
  --action-ink: #10141c;
}

/* Document, focus, and native controls. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
/* Semantic block presets follow the reading palette; explicit custom colors remain authored. */
body {
  --wp--preset--color--paper: var(--paper);
  --wp--preset--color--ink: var(--ink);
  --wp--preset--color--muted: var(--muted);
  --wp--preset--color--line: var(--line);
  --wp--preset--color--accent: var(--accent);
  --wp--preset--color--panel: var(--panel);
}
[hidden] { display: none !important; }
main { min-height: 65vh; padding-block: 0 64px; }
img { display: block; max-width: 100%; height: auto; }
figure, h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; text-underline-offset: .2em; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
button, input, select, textarea { font: inherit; border-radius: 0; }
button, summary { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 500; font-stretch: normal; line-height: 1.12; letter-spacing: 0; text-wrap: balance; overflow-wrap: break-word; }
h1 { font-size: clamp(2.55rem, 5.3vw, 5.3rem); }
h2 { font-size: clamp(1.9rem, 3.1vw, 3.1rem); }
h3 { font-size: clamp(1.5rem, 2.3vw, 2.35rem); }
.wrap { width: min(90rem, calc(100% - 2 * var(--gutter))); min-width: 0; margin-inline: auto; }
.screen-reader-text, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 1rem; left: 1rem; z-index: 1000; padding: .9rem 1.3rem; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.eyebrow { color: var(--accent); font: 700 11px/1.5 var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.wordmark-inline { font-family: "Helvetica Neue", Arial, sans-serif; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.accent { color: var(--accent); }

/* The Unicode publication mark uses a complete system glyph repertoire. */
.site-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; padding-block: 28px 24px; border-bottom: 5px solid var(--ink); }
.brand { display: inline-block; flex: 0 1 auto; max-width: 100%; font: 720 clamp(23px, 2.1vw, 31px)/1.08 "Helvetica Neue", Arial, sans-serif; letter-spacing: 0; overflow-wrap: anywhere; }
.brand span { display: inline-block; font-weight: 400; letter-spacing: 0; }
.brand:hover { text-decoration: none; }
.tagline { max-width: 32ch; color: var(--muted); font-size: 11px; line-height: 1.5; }
.primary-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 12px 26px; margin-left: auto; font: 650 13px/1.4 var(--sans); }
.menu { display: flex; align-items: center; flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 12px 26px; list-style: none; padding: 0; margin: 0; }
.menu > li { min-width: 0; max-width: 100%; }
.menu a { display: flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.menu .current-menu-item > a, .menu .current-menu-ancestor > a, .menu a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .55em; }
.menu-item-has-children { position: relative; }
.sub-menu { position: absolute; inset-inline-end: 0; top: 100%; z-index: 20; width: max-content; min-width: 12rem; max-width: min(20rem, calc(100vw - 2 * var(--gutter))); margin: 0; padding: .4rem .8rem; list-style: none; background: var(--paper); border: 1px solid var(--line); visibility: hidden; }
.menu > li:first-child > .sub-menu { inset-inline-start: 0; inset-inline-end: auto; }
.menu-item-has-children:where(:hover, :focus-within) > .sub-menu { visibility: visible; }
.mode-toggle { flex-shrink: 0; min-height: 44px; max-width: 100%; padding: .55rem .85rem; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 12px/1.4 var(--sans); white-space: normal; }
.mode-toggle:hover { border-color: var(--ink); }

/* Featured essay: an independent image panel beside its headline and introduction. */
.lead { padding-block: 20px 54px; }
.section-kicker { display: flex; justify-content: space-between; gap: 12px; padding-block: 1.3rem 17px; color: var(--muted); font: 650 11px/1.5 var(--sans); letter-spacing: .09em; text-transform: uppercase; }
.section-kicker > :first-child { color: var(--accent); }
.section-kicker > :last-child { text-align: right; }
.lead-layout { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(0, 1fr); gap: clamp(24px, 3.5vw, 56px); align-items: stretch; }
.lead-photo { display: block; min-width: 0; width: 100%; aspect-ratio: 1.12; overflow: hidden; background: var(--panel); }
.lead-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.lead-copy { min-width: 0; align-self: center; padding-block: 20px; }
.lead-copy .eyebrow { margin-bottom: 1.25rem; }
.lead-copy h1 { max-width: 20ch; margin-block: 18px 22px; font-size: clamp(36px, 3.65vw, 58px); line-height: 1.075; font-weight: 650; }
.lead-deck { max-width: 39ch; margin-top: 1.5rem; color: var(--muted); font-size: clamp(16px, 1.35vw, 19px); line-height: 1.65; }
.story-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: 1.5rem; color: var(--muted); font: 500 11px/1.65 var(--sans); }
.read-link, .text-link { display: inline-flex; align-items: center; justify-content: space-between; flex-wrap: wrap; max-width: 100%; min-height: 44px; gap: .4rem 1.4rem; }
.read-link { min-height: 46px; margin-top: 24px; padding: 10px 16px; background: var(--accent); color: var(--action-ink); font: 650 13px/1.4 var(--sans); text-decoration: none; }
.read-link:hover { text-decoration: underline; }
.text-link { color: var(--accent); font: 650 12px/1.5 var(--sans); }
.read-link span, .text-link span:not(.sr-only) { font-size: 1.3em; }

/* Shared three-column story grid; native queries determine its contents and order. */
.latest { margin-block: clamp(3rem, 6vw, 6rem); padding-block: 0 44px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px 24px; padding-block: 20px; border-top: 5px solid var(--ink); border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0; font-size: clamp(25px, 2.5vw, 36px); font-weight: 650; }
.section-heading .eyebrow { margin: 0; }
.section-heading > .text-link { margin-left: auto; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 38px 26px; padding-top: 28px; }
.story-card { display: flex; flex-direction: column; min-width: 0; padding-bottom: 24px; border-bottom: 2px solid var(--ink); }
.card-image { display: block; width: 100%; aspect-ratio: 1.5; overflow: hidden; background: var(--panel); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-copy { min-width: 0; padding-top: 20px; }
.card-copy .eyebrow { margin-bottom: .6rem; }
.card-copy h3 { margin-block: 12px 14px; font-size: clamp(22px, 2vw, 28px); line-height: 1.22; font-weight: 650; }
.card-excerpt { max-width: 52ch; margin-top: .9rem; color: var(--muted); font: 14px/1.7 var(--sans); }
.card-copy .story-meta { margin-top: 1rem; }
.card-copy .text-link { display: inline-block; margin-top: 10px; }
.image-fallback { display: flex; align-items: center; justify-content: center; min-height: 12rem; height: 100%; padding: 1rem; color: var(--muted); font: 1.3rem/1.4 "Helvetica Neue", Arial, sans-serif; overflow-wrap: anywhere; }
.image-fallback span { font-size: .9em; }
.card-image .image-fallback { min-height: 0; }

/* Native article hierarchy and the original in-flow photographs. */
.article-header { max-width: var(--measure); display: grid; grid-template-columns: minmax(0, 1fr); padding-block: 32px 48px; border-bottom: 5px solid var(--ink); }
.article-header > * { grid-column: 1; }
.back-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 2rem; font: 550 12px/1.6 var(--sans); }
.article-header .back-link { grid-column: 1 / -1; justify-self: start; margin-bottom: 32px; color: var(--muted); }
.article-header > .eyebrow { margin-bottom: 1.2rem; }
.article-header h1 { margin-block: 18px 24px; font-size: clamp(38px, 4.65vw, 70px); line-height: 1.09; font-weight: 650; }
.article-layout { max-width: var(--measure); padding-block: 44px; }
.article-body { min-width: 0; margin-inline: auto; font: clamp(18px, 1.55vw, 22px)/1.75 var(--sans); overflow-wrap: anywhere; }
.article-body > * { max-width: var(--measure); margin-inline: auto; }
.article-body :where(p, ul, ol, pre) { margin-block: 1.3em; }
.article-body > :first-child { margin-top: 0; }
.article-body :where(h1, h2, h3, h4, h5, h6) { clear: both; color: var(--ink); font-family: var(--sans); margin-block: 2em .75em; font-weight: 500; }
.article-body h1 { font-size: 2.5rem; }
.article-body h2 { font-size: 1.7em; line-height: 1.2; font-weight: 650; }
.article-body h3 { font-size: clamp(1.4rem, 2vw, 1.9rem); }
.article-body a { text-decoration: underline; text-decoration-thickness: 1px; }
.article-body li { margin-block: .4em; }
.article-body :where(ul, ol) { padding-left: 1.4em; }
.article-body > :where(figure, .wp-block-image, .tiled-gallery, .alignwide, .alignfull) { clear: both; float: none; width: 100% !important; max-width: 100%; margin-block: 2.3rem; margin-inline: auto; }
.article-body figure img { margin-inline: auto; }
.article-body img { max-width: 100%; height: auto; }
/* Preserve native auto sizes without its oversized unavailable-image placeholder. */
.article-body img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: none; }
.article-body :where(figure, .wp-block-image) img { width: 100% !important; height: auto !important; }
.article-body > .em-image-inset { width: min(44%, var(--em-image-intrinsic-width)) !important; margin-block: 0 1.5rem; }
.article-body > .em-image-inset + .em-image-inset { clear: none; }
.article-body > .em-image-inset + :where(h2, h3, h4) { clear: none; margin-top: 0; }
.article-body > .em-image-inset-left { float: left; margin-right: 2rem; margin-left: 0; }
.article-body > .em-image-inset-right { float: right; margin-left: 2rem; margin-right: 0; }
.article-body > .em-image-inset figcaption { font-size: 12px; }
.article-body .wp-block-column .em-image-inset { max-width: min(100%, var(--em-image-intrinsic-width)); margin-inline: auto; }
.article-body :where(figcaption, .wp-caption-text) { max-width: var(--measure); margin: .8rem auto 0; color: var(--muted); font: 12px/1.65 var(--sans); text-align: left; }
.article-body blockquote { margin: 2rem auto; padding-left: 24px; border-left: 5px solid var(--accent); font-size: 1.16em; }
.article-body .wp-block-pullquote { border-block: 1px solid var(--line); padding-block: 1.5rem; }
.article-body .wp-block-pullquote blockquote { border: 0; padding: 0; }
.article-body cite { font: .8rem/1.6 var(--sans); }
.article-body hr { height: 1px; background: var(--line); border: 0; margin-block: 2.5rem; }
.article-body pre { white-space: pre-wrap; overflow-x: auto; padding: 1rem; background: var(--panel); font-size: .85em; }
.article-body :where(iframe, video, audio) { max-width: 100%; }
.article-body .wp-block-table { overflow-x: auto; }
.article-body table { width: 100%; border-collapse: collapse; font: .9rem/1.6 var(--sans); }
.article-body :where(td, th) { border: 1px solid var(--line); padding: .7rem; text-align: left; }
.article-body th { background: var(--panel); }
.article-body .tiled-gallery__row { display: flex; gap: .75rem; }
.article-body .tiled-gallery__col { flex: 1 1 0; min-width: 0; }
.article-body .tiled-gallery__item { margin-bottom: .75rem; }
.article-body .alignleft:not(figure):not(.wp-block-image) { float: left; margin: .5rem 1.5rem 1rem 0; }
.article-body .alignright:not(figure):not(.wp-block-image) { float: right; margin: .5rem 0 1rem 1.5rem; }
.article-body .aligncenter { margin-inline: auto; }
.article-body::after { content: ""; display: block; clear: both; }
.article-end { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-block: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font: .75rem/1.6 var(--sans); }
.article-end > span { color: var(--accent); }
.article-navigation { margin-block: 3rem; }
.post-navigation { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.topic-navigation { margin-block: 1.5rem 2.5rem; padding-block: 1.2rem; border-block: 1px solid var(--line); }
.topic-navigation .topic-label { margin: 0 0 .65rem; color: var(--muted); font: 650 12px/1.5 var(--sans); }
.topic-navigation ul { display: flex; flex-wrap: wrap; gap: .35rem .65rem; margin: 0; padding: 0; list-style: none; }
.topic-navigation li { margin: 0; }
.topic-navigation a { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--line); color: var(--accent); font: 550 13px/1.4 var(--sans); text-decoration: none; }
.topic-navigation a:hover, .topic-navigation a[aria-current="page"] { background: var(--panel); border-color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.nav-links { display: flex; justify-content: space-between; gap: 2rem; }
.nav-links > div { max-width: 46%; min-width: 0; }
.nav-next { margin-left: auto; text-align: right; }
.nav-subtitle { display: block; margin-bottom: .5rem; color: var(--muted); font: .65rem/1.6 var(--sans); }
.nav-title { font: 1.1rem/1.4 var(--sans); overflow-wrap: anywhere; }
.is-style-em-captioned-frame { border: 1px solid var(--line); padding: 1rem; }
.is-style-em-editorial-pullquote { border-block: 1px solid var(--line); padding-block: 1.5rem; }

/* Journal, native search, category filters, and real page navigation. */
.journal { padding-block: 3rem 4rem; }
.journal-header { padding-block: 40px 32px; border-bottom: 5px solid var(--ink); }
.journal-header h1 { margin-block: 12px 18px; font-size: clamp(40px, 6vw, 84px); line-height: 1.05; font-weight: 650; }
.journal-header > p:last-child, .archive-description { max-width: 46rem; color: var(--muted); font: 1.1rem/1.6 var(--sans); }
.archive-description p + p { margin-top: 1rem; }
.journal-introduction { margin-block: 2rem; }
.search-form { max-width: 48rem; margin-block: 28px 20px; scroll-margin-top: 2rem; }
.search-form > label { display: block; margin-bottom: .65rem; font: .8rem/1.5 var(--sans); }
.search-input { display: flex; border: 1px solid var(--ink); }
.search-input input[type="search"] { min-width: 0; width: 100%; min-height: 54px; padding: .8rem 1rem; border: 0; background: var(--paper); color: var(--ink); font: .9rem/1.5 var(--sans); }
.search-input input::placeholder { color: var(--muted); }
.search-input button { flex-shrink: 0; border: 0; padding: .8rem 1.4rem; background: var(--ink); color: var(--paper); font: .8rem/1.5 var(--sans); }
.category-filters { display: flex; flex-wrap: wrap; gap: .25rem 1.6rem; margin-top: 1.5rem; padding-bottom: 20px; border-bottom: 1px solid var(--line); font: .75rem/1.6 var(--sans); }
.category-filters a { display: inline-flex; align-items: center; min-height: 44px; }
.category-filters a[aria-current] { color: var(--accent); text-decoration: underline; text-underline-offset: .5em; }
.result-count { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 1.5rem 2rem; color: var(--muted); font: .75rem/1.6 var(--sans); }
.pagination, .page-links { border-top: 2px solid var(--ink); padding-top: 24px; }
.pagination { margin-top: 3rem; }
.pagination .nav-links { justify-content: center; flex-wrap: wrap; gap: .65rem; }
.page-numbers, .page-links > a, .page-links > span:not(.page-links-title) { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: .5rem .8rem; border: 1px solid var(--line); font: .8rem/1.5 var(--sans); }
.page-numbers.current, .page-links .current { background: var(--ink); color: var(--paper); }
.page-links { margin-block: 2rem; font-family: var(--sans); }
.empty-state { max-width: 60rem; min-height: 40vh; padding-block: 4rem; }
.empty-state :where(h1, h2) { margin-bottom: 1.5rem; }
.empty-state > p { max-width: 45ch; font: 1.2rem/1.6 var(--sans); }

/* Editable footer menus. */
.site-footer { display: flex; justify-content: space-between; align-items: start; gap: 2rem; margin-top: 3rem; padding-block: 28px; border-top: 5px solid var(--ink); font: 12px/1.7 var(--sans); }
.site-footer .brand { font-size: 1.7rem; }
.site-footer p { margin-top: .8rem; color: var(--muted); font: .7rem/1.6 var(--sans); }
.site-footer nav { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.4rem; min-width: 0; font: .75rem/1.5 var(--sans); }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }

.bypostauthor { border-left: 2px solid var(--accent); padding-left: 1rem; }

/* Menus remain fully available to touch and keyboard users without JavaScript. */
@media (hover: none) {
  .sub-menu { position: static; width: auto; min-width: 0; max-width: 100%; padding: 0 0 0 .8rem; border: 0; visibility: visible; }
}
@media (max-width: 70rem) {
  .tagline { display: none; }
}
@media (max-width: 980px) {
  .lead-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; }
  .lead-copy h1 { font-size: clamp(32px, 4.5vw, 45px); }
  .lead-photo { aspect-ratio: auto; min-height: 420px; }
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-header { grid-template-columns: minmax(0, 1fr); }
  .article-header > *, .article-header .back-link { grid-column: 1; grid-row: auto; }
  .article-header .back-link { margin-bottom: 24px; }
  .sub-menu { position: static; width: auto; min-width: 0; max-width: 100%; padding: 0 0 0 .8rem; border: 0; visibility: visible; }
}
@media (max-width: 48rem) {
  .site-header { gap: .75rem 1rem; }
  .primary-nav { width: 100%; justify-content: space-between; margin-left: 0; gap: .3rem 1.2rem; }
  .menu { gap: .3rem 1.2rem; }
  .article-body > :where(.alignleft, .alignright, .em-image-inset) { float: none; width: 100% !important; margin-inline: auto; }
  .article-body > .em-image-inset { float: none; width: 100% !important; max-width: min(100%, var(--em-image-intrinsic-width)); margin-inline: auto; }
  .article-body .tiled-gallery__row { gap: .45rem; }
  .article-body > :where(figure, .wp-block-image, .tiled-gallery, .alignwide, .alignfull) { margin-block: 1.6rem; }
  .site-footer { display: block; }
  .site-footer nav { margin-top: 1.5rem; }
  .journal { padding-top: 2rem; }
  .search-input button { padding-inline: 1rem; }
}
@media (max-width: 640px) {
  .site-header { gap: 10px 20px; padding-block: 20px 14px; border-bottom-width: 4px; }
  .primary-nav { justify-content: flex-start; gap: 8px 22px; }
  .menu { gap: 8px 22px; }
  .mode-toggle { padding-inline: .6rem; }
  .section-kicker { font-size: 10px; letter-spacing: .05em; }
  .section-kicker > :last-child { max-width: 48%; }
  .lead-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lead-photo { aspect-ratio: 1.38; min-height: 0; }
  .lead-copy { padding-block: 26px 0; }
  .lead-copy h1 { margin-block: 14px 18px; font-size: clamp(32px, 8.6vw, 48px); line-height: 1.12; }
  .lead-deck { font-size: 16px; }
  .read-link { margin-top: 18px; }
  .lead { padding-bottom: 40px; }
  .section-heading { gap: 10px 18px; }
  .section-heading .eyebrow { width: 100%; }
  .story-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .card-copy h3 { font-size: 26px; }
  .article-header { padding-block: 24px 30px; }
  .article-header h1 { font-size: clamp(33px, 8.6vw, 48px); line-height: 1.12; }
  .article-layout { padding-block: 28px; }
  .article-body { font-size: 18px; line-height: 1.8; }
  .journal-header h1 { font-size: 48px; }
}
@media (max-width: 34rem) {
  .article-body .tiled-gallery__row { flex-wrap: wrap; }
  .article-body .tiled-gallery__col { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root, :root[data-theme] { --paper: #fff; --ink: #000; --muted: #444; --line: #aaa; --accent: #000; --panel: #fff; color-scheme: light; }
  body { background: #fff; color: #000; }
  main { min-height: 0; padding: 0; }
  .site-header, .site-footer, .back-link, .latest, .post-navigation, .mode-toggle, .article-end, .topic-navigation { display: none !important; }
  .wrap { width: 100%; max-width: none; }
  .article-header { display: block; padding: 0 0 1rem; border-bottom: 1px solid #aaa; }
  .article-header h1 { max-width: none; margin: 0 0 .6rem; font-size: 28pt; }
  .article-layout { max-width: none; padding: 0; }
  .article-body { max-width: none; font-size: 11pt; line-height: 1.55; }
  .article-body > * { max-width: none; }
  .read-link { background: transparent; color: #000; border: 1px solid #000; }
  .article-body figure { break-inside: avoid; }
  .article-body :where(h2, h3) { break-after: avoid; }
}

/* Chapter controls retain native disclosure, links, and keyboard behavior. */
.em-chapter-bar { position: sticky; top: 0; z-index: 12; margin-block: 0 2.2rem; border-block: 2px solid var(--accent); background: var(--paper); box-shadow: 0 4px 12px rgb(0 0 0 / .06); font: 500 14px/1.5 var(--sans); }
.em-chapter-bar > summary { min-height: 52px; padding: .85rem 1rem; cursor: pointer; color: var(--ink); font-weight: 650; }
.em-chapter-count { margin-left: 1rem; color: var(--muted); font-size: 12px; font-weight: 450; }
.em-chapter-bar nav { max-height: 55vh; max-height: 55dvh; overflow: auto; overscroll-behavior: contain; padding: .35rem 1rem 1rem; }
.em-chapter-bar ol { margin: 0; padding: 0; list-style: none; }
.em-chapter-bar li { margin: 0; }
.em-chapter-bar a { display: block; padding: .65rem .5rem; min-height: 44px; color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
.em-chapter-bar a:hover, .em-chapter-bar a[aria-current="page"] { background: var(--panel); text-decoration: underline; text-underline-offset: .2em; }
.em-chapter-bar .em-part-link { font-weight: 750; color: var(--ink); }
.em-chapter-part ol { padding-left: .8rem; }
.em-chapter-part + .em-chapter-part { margin-top: .7rem; }
.em-chapter-subsection a { padding-left: 1.4rem; font-size: 13px; }
.article-body .em-reading-paths { margin-block: 3rem; padding: 1.4rem; border-block: 2px solid var(--line); background: var(--panel); }
.article-body .em-reading-paths h3 { margin: 0 0 1rem; font-size: 1.2rem; }
.article-body .em-reading-paths ul { margin: 0; padding-left: 1.2rem; font: 500 15px/1.6 var(--sans); }
.article-body .em-reading-paths li + li { margin-top: .65rem; }
.article-body :where(h2,h3)[id] { scroll-margin-top: 5rem; }
.article-body:has(.em-chapter-bar[open]) :where(h2,h3)[id] { scroll-margin-top: 70vh; }
.admin-bar .em-chapter-bar { top: 32px; }
@media (max-width: 782px) { .admin-bar .em-chapter-bar { top: 46px; } }
@media (max-width: 600px) { .admin-bar .em-chapter-bar { top: 0; } }
@media print { .em-chapter-bar { display: none !important; } }
