:root {
  color-scheme: light;
  --accent: #bd3c3c;
  --accent-hover: #8d2424;
  --accent-line: #f56a6a;
  --accent-soft: #fbecec;
  --accent-tint: rgb(189 60 60 / .08);
  --ink: #30363a;
  --text: #555e64;
  --muted: #657178;
  --lead: #444f56;
  --tag-text: #4f5a61;
  --page: #fff;
  --surface: #fff;
  --subtle: #f5f6f7;
  --border: #dfe3e5;
  --field-border: #c9ced1;
  --primary-text: #fff;
  --success-bg: #eef6ef;
  --success-text: #244a2d;
  --success-border: #357746;
  --selected-bg: #eff8f1;
  --selected-border: #278342;
  --selected-mark: #20753a;
  --error: #a32626;
  --image-outline: rgb(0 0 0 / .1);
  --top-nav-offset: 6rem;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent: #f19a93;
  --accent-hover: #ffc0b9;
  --accent-line: #d87b76;
  --accent-soft: #3c292e;
  --accent-tint: rgb(241 154 147 / .12);
  --ink: #edf1f5;
  --text: #c2cbd3;
  --muted: #9eacb8;
  --lead: #d3dce4;
  --tag-text: #c2cbd3;
  --page: #171c22;
  --surface: #1e252d;
  --subtle: #222b34;
  --border: #3a4653;
  --field-border: #617182;
  --primary-text: #21191a;
  --success-bg: #21362b;
  --success-text: #c3e8cd;
  --success-border: #78bf8b;
  --selected-bg: #21362b;
  --selected-border: #78bf8b;
  --selected-mark: #9bd5ab;
  --error: #ffaaa3;
  --image-outline: rgb(255 255 255 / .1);
}
/* Theme the inherited Editorial elements alongside the blog components. */
body { background: var(--page); }
:where(html[data-theme="dark"]) :is(h1, h2, h3, h4, h5, h6, strong, b, th, select option) { color: var(--ink); }
:where(html[data-theme="dark"]) input:is([type="text"], [type="password"], [type="email"], [type="tel"], [type="search"], [type="url"], [type="datetime-local"]),
:where(html[data-theme="dark"]) :is(select, textarea, select option) { background-color: var(--surface); border-color: var(--field-border); }
:where(html[data-theme="dark"]) ::placeholder { color: var(--muted) !important; }
:where(html[data-theme="dark"]) :is(blockquote, code, hr, .box, table tbody tr, table thead, table tfoot, table.alt tbody tr td) { border-color: var(--border); }
:where(html[data-theme="dark"]) code,
:where(html[data-theme="dark"]) table tbody tr:nth-child(2n + 1) { background-color: var(--subtle); }
:where(html[data-theme="dark"]) .posts article::before,
:where(html[data-theme="dark"]) .posts article::after { background: var(--border); }
:where(html[data-theme="dark"]) #sidebar > .inner > * { border-color: var(--border); }
:where(html[data-theme="dark"]) header.major > :last-child { border-bottom-color: var(--accent-line); }
:where(html[data-theme="dark"]) #footer .copyright { color: var(--muted); }
body, input, select, textarea { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); font-size: 16px; }
h1, h2, h3, h4, h5, h6, #header .logo { font-family: Georgia, "Times New Roman", serif; }
h1 { text-wrap: balance; font-size: clamp(2rem, 4vw, 3.3rem); }
h2 { font-size: 1.5rem; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover) !important; }
:focus-visible { outline: 1px solid var(--accent) !important; outline-offset: -1px; }
input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):focus,
select:focus, textarea:focus { border-color: var(--accent); box-shadow: none; }
input[type="checkbox"]:focus + label::before,
input[type="radio"]:focus + label::before { border-color: var(--accent); box-shadow: none; }
button.primary:focus-visible, .button.primary:focus-visible { outline-offset: 2px; }
@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight !important; }
  input[type="checkbox"]:focus + label::before,
  input[type="radio"]:focus + label::before { border-color: Highlight; }
}
#main > .inner { padding-inline: clamp(1.25rem, 5vw, 5rem); max-width: 1440px; }
#header { position: sticky; top: 0; z-index: 100; display: block; padding: 0; background: var(--surface); border-bottom: 4px solid var(--accent-line); }
.top-nav { display: flex; align-items: center; gap: 2rem; min-height: 5rem; max-width: 1680px; margin-inline: auto; padding: .9rem clamp(1.25rem, 3vw, 3rem); }
#header .logo { display: inline-flex; align-items: baseline; flex: 0 0 auto; border: 0; font-size: 1.1rem; white-space: nowrap; }
#header .logo strong { font-family: system-ui, sans-serif; font-size: 1.65rem; letter-spacing: -.06em; }
#header .logo > span { margin-left: .65rem; font-family: system-ui, sans-serif; font-size: .85rem; }
.accent { color: var(--accent); }
#sidebar { --sidebar-padding: 1.75rem; --sidebar-top-padding: 3.5rem; width: 19rem; min-width: 19rem; font-size: .9rem; background: var(--subtle); }
#sidebar > .inner { padding: var(--sidebar-top-padding) var(--sidebar-padding); width: 100%; position: static; }
#sidebar section, #sidebar nav { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--border); }
#search { flex: 0 1 26rem; min-width: 12rem; }
#search form { margin: 0; }
#search form::before { content: none; }
#search input[type="search"] { height: 2.75rem; margin: 0; padding-right: 2.75rem; }
#search button { position: absolute; top: 0; right: 0; width: 2.75rem; height: 2.75rem; min-height: 0; padding: 0; border: 0; border-radius: 0 .375rem .375rem 0; box-shadow: none; background: transparent; color: var(--muted) !important; }
#search button:hover { background: transparent; color: var(--ink) !important; }
#search button svg { transform: scaleX(-1); }
.user-panel { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; margin-inline-start: auto; }
.user-signin { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 44px; padding-inline: .8rem; border: 1px solid var(--border); border-radius: .375rem; color: var(--ink); font-size: .9rem; }
.user-menu { position: relative; }
.user-menu > summary { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .25rem .5rem; list-style: none; border-radius: .375rem; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--subtle); }
.user-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.user-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.user-chevron { flex-shrink: 0; }
.user-menu[open] .user-chevron { transform: rotate(180deg); }
.user-dropdown { position: absolute; top: calc(100% + .75rem); inset-inline-end: 0; width: min(17rem, calc(100vw - 2.5rem)); padding: .5rem; border: 1px solid var(--border); border-radius: .5rem; background: var(--surface); box-shadow: 0 6px 24px rgb(0 0 0 / .1); }
.user-caption { margin: 0; padding: .7rem .75rem; overflow-wrap: anywhere; font-size: .8rem; font-weight: 700; color: var(--ink); }
.user-dropdown > a, .user-dropdown button { display: flex; align-items: center; box-sizing: border-box; width: 100%; min-height: 44px; padding: .7rem .75rem; border: 0; border-radius: .25rem; background: transparent; box-shadow: none; color: var(--ink) !important; font-family: inherit; font-size: .9rem; font-weight: 400; text-align: start; text-transform: none; letter-spacing: 0; }
.user-dropdown > a:hover, .user-dropdown button:hover { background: var(--subtle); }
.user-dropdown form { margin: .35rem 0 0; padding-top: .35rem; border-top: 1px solid var(--border); }
#content, #articles, .prose h2 { scroll-margin-block-start: calc(var(--top-nav-offset) + 1rem); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#sidebar .navigation { list-style: none; padding: 0; }
.navigation li { padding: 0; border-bottom: 1px solid var(--border); }
.navigation a { display: block; padding: .85rem 0; color: var(--ink); border: 0; }
.navigation [aria-current] { color: var(--accent); font-weight: 700; }
.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
#banner { margin-top: 0; padding-block: 4rem; gap: 2rem; }
#banner .content > p { max-width: 42rem; }
#banner .image { margin-left: 0; min-width: 30%; max-height: 23rem; }
#banner img { object-fit: cover; outline: 1px solid var(--image-outline); outline-offset: -1px; }
main > section { padding-block: 3rem; }
.posts { margin-bottom: 0; }
.posts h2 { font-size: 1.6rem; }
.posts h2 a { color: var(--ink); border: 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
.post-tags li { max-width: 100%; padding: 0; }
.post-tags a { display: inline-flex; align-items: center; min-height: 40px; max-width: 100%; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 1.5rem; background: var(--subtle); color: var(--tag-text); font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; }
.post-tags a:hover { border-color: var(--accent); }
.category-actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.category-delete-trigger, .post-delete-trigger { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; margin-inline-start: auto; border: 0; border-radius: .375rem; color: var(--accent); }
.category-delete-trigger:hover, .post-delete-trigger:hover { background: var(--accent-tint); }
.modal { box-sizing: border-box; width: min(32rem, calc(100% - 2rem)); max-width: none; max-height: calc(100dvh - 2rem); padding: 0; border: 1px solid var(--border); border-radius: .625rem; background: var(--surface); color: var(--text); box-shadow: 0 16px 48px rgb(0 0 0 / .2); overflow-y: auto; overscroll-behavior: contain; }
.modal::backdrop { background: rgb(30 36 40 / .55); }
.modal-content { padding: 2rem; }
.modal-content .eyebrow { margin-bottom: .75rem; }
.modal-content h2 { margin: 0 0 1rem; font-size: 1.6rem; }
.modal-content p { margin: 0 0 1rem; overflow-wrap: anywhere; }
.modal-content strong { color: var(--ink); }
.modal [hidden] { display: none !important; }
.modal-actions, .confirm-delete-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; }
.confirm-delete-actions { justify-content: flex-start; }
.confirm-delete-page { max-width: 55rem; }
html.has-modal { overflow: hidden; }
@media (max-width: 30rem) { .modal-content { padding: 1.25rem; } .modal-actions { flex-direction: column-reverse; } .modal-actions button { width: 100%; } }
.cookie-banner { position: sticky; bottom: 0; z-index: 90; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; border-top: 3px solid var(--accent); background: var(--surface); box-shadow: 0 -6px 24px rgb(0 0 0 / .12); }
.cookie-banner-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; max-width: 1680px; margin-inline: auto; padding: 1.1rem clamp(1.25rem, 3vw, 3rem) calc(1.1rem + env(safe-area-inset-bottom)); }
.cookie-banner-copy { max-width: 45rem; }
.cookie-banner-copy h2 { margin: 0 0 .4rem; font-size: 1.2rem; }
.cookie-banner-copy p { margin: 0; font-size: .9rem; line-height: 1.5; }
.cookie-banner-copy p + p { margin-top: .5rem; }
.cookie-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin: 0; }
.cookie-actions button { min-height: 44px; padding: .75rem 1rem; }
.cookie-settings .cookie-actions button[aria-pressed="true"] { background-color: var(--selected-bg); box-shadow: inset 0 0 0 2px var(--selected-border); }
.cookie-settings .cookie-actions button[aria-pressed="true"]::before { content: '✓'; color: var(--selected-mark); font-size: 1.1rem; line-height: 1; margin-right: .5rem; }
.cookie-actions a { display: inline-flex; align-items: center; min-height: 44px; font-size: .85rem; }
.cookie-settings { max-width: 55rem; }
.cookie-settings-group { margin: 2rem 0; }
.cookie-settings-group h2 { margin-bottom: .5rem; }
.cookie-error { color: var(--error); }
.cookie-error[hidden] { display: none; }
@media (max-width: 65rem) { .cookie-banner-inner { display: block; } .cookie-banner-copy { margin-bottom: 1rem; } }
.meta { font-size: .8rem; color: var(--muted); }
.article-footer, .section-heading, .form-actions, .pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-heading { margin-bottom: 2rem; }
.section-heading h1 { margin-bottom: 0; }
.article-footer { margin-top: 2rem; }
.button, button, input[type="submit"] { font-family: system-ui, sans-serif; font-size: .7rem; min-height: 44px; line-height: 1.4; padding: .9rem 1.3rem; display: inline-flex; align-items: center; justify-content: center; white-space: normal; height: auto; color: var(--accent) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.button.primary, button.primary { background-color: var(--accent); color: var(--primary-text) !important; }
.button.primary:hover, button.primary:hover, .button.primary:active, button.primary:active { background-color: var(--accent-hover); color: var(--primary-text) !important; }
.theme-toggle { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: .375rem; background: transparent; box-shadow: none; color: var(--ink) !important; }
.theme-toggle:hover, .theme-toggle:active { background: var(--subtle); }
.theme-toggle:focus-visible { outline-width: 2px !important; outline-offset: 2px; }
.theme-toggle[hidden], .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }
.button.big { font-size: .72rem; }
.search-row { display: flex; align-items: center; gap: .5rem; }
.search-row input, .search-row select { min-width: 0; margin-bottom: 0; }
.search-row button { padding: .65rem; }
input, select, textarea { margin-bottom: 1.1rem; }
input[type="datetime-local"] { width: 100%; padding: .65rem; border: 1px solid var(--field-border); border-radius: .35rem; }
label { color: var(--ink); margin-bottom: .5rem; font-family: inherit; }
.login { max-width: 32rem; padding-bottom: 5rem; }
.login input[type="password"], .login input[type="email"] { width: 100%; }
.post-detail { max-width: 52rem; padding-block: 3rem; }
.lead { font-size: 1.15rem; color: var(--lead); }
.prose { max-width: 72ch; overflow-wrap: anywhere; }
.prose h2 { margin-top: 2rem; }
.prose img { max-width: 100%; height: auto; }
.prose pre { max-width: 100%; overflow-x: auto; }
.prose code { font-family: ui-monospace, monospace; }
.notice { margin-top: 2rem; padding: 1rem; background: var(--success-bg); border-left: 4px solid var(--success-border); color: var(--success-text); }
.error-summary, .field-error { color: var(--error); }
.error-summary { padding: 1rem; border: 2px solid var(--error); margin-top: 2rem; }
.error-summary p, .error-summary ul { margin-bottom: .5rem; }
[aria-invalid="true"] { border-color: var(--error) !important; }
.editor-form { max-width: 55rem; }
.editor-form #body { font-family: ui-monospace, monospace; line-height: 1.6; }
.form-actions { justify-content: flex-start; margin-top: 2rem; }
summary { cursor: pointer; min-height: 44px; padding-block: .6rem; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 3rem; }
.stats > div { padding: 1.5rem; background: var(--subtle); border-top: 3px solid var(--accent); }
.stats strong { display: block; font-size: 2.25rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.chart { display: flex; gap: 3px; height: 12rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.chart-column { flex: 1; display: flex; align-items: flex-end; }
.chart-column span { display: block; width: 100%; background: var(--accent); border-radius: 2px 2px 0 0; }
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 2rem; margin-top: 3rem; }
td { overflow-wrap: anywhere; }
td:last-child { font-variant-numeric: tabular-nums; }
.pager { justify-content: flex-start; margin-top: 2.5rem; font-size: .85rem; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 200; background: var(--surface); padding: 1rem; }
.skip-link:focus { top: .5rem; }
.empty-state { padding-block: 1rem; width: 100%; }
@media (max-width: 80rem) { #sidebar { --sidebar-padding: 1.25rem; width: 16rem; min-width: 16rem; } }
@media (max-width: 70rem) { #header .logo > span { display: none; } .top-nav { gap: 1.5rem; } }
@media (max-width: 61rem) { #wrapper { display: flex; flex-direction: column; } #sidebar { --sidebar-top-padding: 2rem; width: 100%; min-width: 0; max-width: none; position: static; display: block; } #sidebar > .inner { width: 100%; } #sidebar .sidebar-about { display: none; } #banner .image { width: 35%; } }
@media (max-width: 42rem) { :root { --top-nav-offset: 9rem; } .top-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem 1rem; padding: .75rem 1.25rem; } #header .logo { grid-area: 1 / 1; } #search { grid-area: 2 / 1 / 3 / -1; min-width: 0; } .user-panel { grid-area: 1 / 2; } .user-name { max-width: 12ch; } }
@media (max-width: 40rem) { #banner { padding-block: 2.5rem; } #banner .image { display: none; } .posts { display: block; width: 100%; margin-inline: 0; } .posts article { width: 100%; margin-inline: 0; } .posts article::before { display: none; } .posts article::after { width: 100%; } .stats { grid-template-columns: 1fr; } .stats > div { padding: 1rem; } .section-heading { align-items: flex-start; flex-direction: column; } }
@media (max-width: 30rem) { .user-name { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
/* Keep the original sidebar in normal flow, including Editorial's tablet range. */
#main { min-width: 0; }
#sidebar { position: relative; height: auto; left: auto; top: auto; z-index: auto; box-shadow: none; }
#sidebar > .inner { height: auto; left: auto; top: auto; overflow: visible; }
#sidebar > .inner::after { display: none; }
main > section + section { border-top: 2px solid var(--border); }
@media (max-width: 61rem) { #sidebar { position: static; } }
#banner .content { max-width: 54rem; }
#banner h1 { font-size: clamp(2rem, 4.5vw, 3.7rem); line-height: 1.2; }
#banner .content > p { max-width: 40rem; }
#banner .eyebrow { margin-bottom: 1.5rem; }
