/* editorial.css: Editorial: a broadsheet front page in ink and one accent
   Self-contained. Google Fonts link: see fonts.md. Change the accent with --accent.
   Light by default, dark via prefers-color-scheme, or force with <html data-theme="light|dark">. No script needed. */

@font-face { font-family: "Noto Serif Display Fallback"; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos"); size-adjust: 95.9%; ascent-override: 111.6%; descent-override: 30.2%; line-gap-override: 0%; }
@font-face { font-family: "Literata Fallback"; src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos"); size-adjust: 120.4%; ascent-override: 98%; descent-override: 25.7%; line-gap-override: 0%; }

:root {
  --accent: oklch(0.5 0.19 27);
  --pad: 16px;
  --max: 76rem;
  --measure: 34em;
  --radius: 0;
  --f-body: "Literata", "Literata Fallback", serif;
  --f-ui: var(--f-body);
  --f-head: "Noto Serif Display", "Noto Serif Display Fallback", serif;
  --bg: oklch(0.965 0.003 250);
  --ink: oklch(0.17 0.006 250);
  --sub: oklch(0.38 0.008 250);
  --rule: oklch(0.17 0.006 250 / 0.3);
  --link: var(--accent);
  --on-accent: oklch(0.985 0.006 85);
  --field: oklch(0.45 0.02 60);
  --ok: oklch(0.5 0.13 150);
  --ok-bg: oklch(0.95 0.035 150);
  --bad: oklch(0.5 0.19 27);
  --bad-bg: oklch(0.95 0.025 27);
  --yes: oklch(0.8 0.19 147);
  --yes-ink: oklch(0.18 0.04 150);
  --yes-word: oklch(0.18 0.04 150);
  --limit: oklch(0.85 0.15 85);
  --limit-ink: oklch(0.2 0.045 70);
  --limit-word: oklch(0.2 0.045 70);
  --no: oklch(0.68 0.2 28);
  --no-ink: oklch(0.15 0.04 25);
  --no-word: oklch(0.15 0.04 25);
  --info: oklch(0.76 0.12 240);
  --info-ink: oklch(0.17 0.04 250);
  --info-word: oklch(0.17 0.04 250);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --accent: oklch(0.74 0.15 27);
  --bg: oklch(0.175 0.008 70);
  --ink: oklch(0.93 0.012 85);
  --sub: oklch(0.77 0.015 80);
  --rule: oklch(0.93 0.012 85 / 0.3);
  --link: var(--accent);
  --on-accent: oklch(0.16 0.01 60);
  --field: oklch(0.62 0.02 70);

  color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: oklch(0.74 0.15 27);
  --bg: oklch(0.175 0.008 70);
  --ink: oklch(0.93 0.012 85);
  --sub: oklch(0.77 0.015 80);
  --rule: oklch(0.93 0.012 85 / 0.3);
  --link: var(--accent);
  --on-accent: oklch(0.16 0.01 60);
  --field: oklch(0.62 0.02 70);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.5; font-kerning: normal; font-variant-numeric: lining-nums; font-optical-sizing: auto; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
main { flex: 1 0 auto; display: flow-root; padding-bottom: 24px; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
a { color: var(--link); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p, ul, ol, dl, pre { margin: 0; }
p, li, dd { text-wrap: pretty; }

header .brand { display: inline-flex; align-items: center; min-height: 48px; color: inherit; text-decoration: none; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; column-gap: .5em; font-size: 16px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs > * + *::before { content: "/"; display: inline-block; margin-right: .5em; color: var(--sub); text-decoration: none; }
.crumbs > :not(a) { color: var(--sub); }
@media (max-width: 47.99em) {
  .crumbs > :not(a), .crumbs a:not(:last-of-type) { display: none; }
  .crumbs a:last-of-type::before { content: "\2039"; display: inline-block; margin-right: .4em; color: inherit; }
}

main > h1 { margin-top: 8px; }
main > .lead { margin-top: 10px; max-width: 32em; }
mark { background: none; color: inherit; font-weight: 700; white-space: nowrap; }
main > .meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 2px 1.1em; font-size: 16px; line-height: 1.35; color: var(--sub); }
main > .meta span:first-child { color: var(--ink); font-weight: 600; }

.btns { display: flex; flex-wrap: wrap; gap: 12px; }
main > .btns { margin-top: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border: 2px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--on-accent); font: inherit; font-family: var(--f-ui); font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.alt { background: transparent; color: var(--ink); border-color: currentColor; }
.btn.alt:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

main > dl { margin-top: 32px; display: grid; grid-template-columns: minmax(0, 1fr); }
main > dl dt { color: var(--sub); }
main > dl dd { margin: 0; }

.verdict { margin-top: 12px; display: grid; gap: 2px; padding: 12px 14px; background: var(--t); color: var(--t-ink); }
.verdict strong { font-size: 1.6em; line-height: 1.1; color: var(--t-word); }
.verdict[data-tone="yes"] { --t: var(--yes); --t-ink: var(--yes-ink); --t-word: var(--yes-word); }
.verdict[data-tone="limit"] { --t: var(--limit); --t-ink: var(--limit-ink); --t-word: var(--limit-word); }
.verdict[data-tone="no"] { --t: var(--no); --t-ink: var(--no-ink); --t-word: var(--no-word); }
.verdict[data-tone="info"] { --t: var(--info); --t-ink: var(--info-ink); --t-word: var(--info-word); }

ol.steps { list-style: none; padding: 0; counter-reset: st; display: grid; gap: 28px; }
main > ol.steps { margin-top: 40px; }
ol.steps > li { counter-increment: st; position: relative; padding-left: 52px; }
ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: -4px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-family: var(--f-ui); font-weight: 700; }
ol.steps h3 { font-size: 1.1em; line-height: 1.3; margin-bottom: 4px; }
ol.steps p { max-width: var(--measure); }
dl.step-meta { margin-top: 10px; padding-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; border-top: 1px solid var(--rule); font-size: 16px; }
dl.step-meta dd + dt { margin-top: 6px; }
dl.step-meta dt { color: var(--sub); }
dl.step-meta dd { margin: 0; font-weight: 500; }
@media (min-width: 48em) { dl.step-meta { grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; } dl.step-meta dd + dt { margin-top: 0; } }
main > dl dd a { font-size: inherit; }

main > section { margin-top: 40px; }
main > section > h2, #perevirka > h2 { font-size: 1.4em; line-height: 1.2; }
main > section > * + * { margin-top: 12px; }
main > section p, main > section ul { max-width: var(--measure); }
main > section ul { padding-left: 1.2em; }
main > section li + li { margin-top: 6px; }

pre.verse { margin-top: 40px; max-width: 40em; font-family: inherit; font-size: 1.05em; line-height: 1.5; white-space: pre-wrap; hyphens: none; }
pre.verse:has(> span) { white-space: normal; }
pre.verse > span { display: block; position: relative; white-space: pre-wrap; padding-left: 1.5em; text-indent: -1.5em; }
pre.verse > span:empty { min-height: 1.5em; }
pre.verse > span[data-n]::after { content: attr(data-n); position: absolute; top: 0; right: 100%; margin-right: 10px; text-indent: 0; font-family: var(--f-ui); font-size: 15px; color: var(--sub); font-variant-numeric: tabular-nums; }

ul.index { list-style: none; padding: 0; }
main > ul.index { margin-top: 28px; }
ul.index > li > a { display: flex; flex-wrap: wrap; column-gap: 14px; align-items: baseline; min-height: 44px; padding: 10px 0; color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
ul.index :is(.key, .t, .note) { min-width: 0; white-space: normal; overflow-wrap: break-word; }
ul.index .key { flex: 0 1 auto; max-width: 100%; font-variant-numeric: tabular-nums; }
ul.index .t { flex: 1 1 min(100%, 14em); }
ul.index .t { font-weight: 600; color: var(--link); }
ul.index .note { flex: 1 1 100%; color: var(--sub); }
ul.index > li > a:hover .t { text-decoration: underline; text-decoration-thickness: 2px; }
@media (min-width: 64em) {
  ul.index:has(> li:nth-child(13)) { columns: 2; column-gap: 56px; }
  ul.index > li { break-inside: avoid; }
}

#perevirka { margin-top: 48px; }
#perevirka > p { margin-top: 8px; max-width: var(--measure); }
#perevirka form { margin-top: 20px; max-width: 30rem; display: grid; gap: 16px; }
#perevirka label:not(.chk) { display: grid; gap: 6px; font-family: var(--f-ui); font-weight: 600; }
#perevirka input:not([type="checkbox"]):not([type="radio"]), #perevirka textarea, #perevirka select { width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--field); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: inherit; font-size: max(16px, 1em); font-weight: 400; transition: border-color .15s, box-shadow .15s; }
#perevirka input:not([type="checkbox"]):not([type="radio"]):hover { border-color: var(--ink); }
#perevirka input:not([type="checkbox"]):not([type="radio"]):focus-visible, #perevirka textarea:focus-visible { outline: 2px solid transparent; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.field-error { display: none; margin-top: -8px; color: var(--bad); font-family: var(--f-ui); font-size: 16px; line-height: 1.35; font-weight: 600; }
label:has(> input[aria-invalid="true"]) + .field-error, label:has(> input:user-invalid) + .field-error { display: block; }
label:has(> input[aria-invalid="true"]) > input, label > input:user-invalid { border-color: var(--bad) !important; }
label:has(> input[aria-invalid="true"]) > input:focus-visible, label > input:user-invalid:focus-visible { box-shadow: 0 0 0 2px var(--bad) !important; }
.chk { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding-block: 8px; font-family: var(--f-ui); line-height: 1.4; cursor: pointer; }
.chk input { --box: 26px; -webkit-appearance: none; appearance: none; flex: none; display: grid; place-content: center; width: var(--box); height: var(--box); margin: max(0px, calc((1lh - var(--box)) / 2)) 0 0; border: 2px solid var(--field); border-radius: var(--chk-r, 0); background: var(--bg); color: var(--on-accent); cursor: pointer; transition: background-color .12s, border-color .12s; }
.chk input::before { content: ""; width: calc(var(--box) * .46); height: calc(var(--box) * .24); margin-top: -3px; border: solid currentColor; border-width: 0 0 3px 3px; transform: rotate(-45deg) scale(0); transition: transform .12s; }
.chk input:hover { border-color: var(--ink); }
.chk input:checked { background: var(--accent); border-color: var(--accent); }
.chk input:checked::before { transform: rotate(-45deg) scale(1); }
.chk input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.chk input[aria-invalid="true"], .chk input:user-invalid { border-color: var(--bad); }
@media (forced-colors: active) { .chk input { -webkit-appearance: auto; appearance: auto; } .chk input::before { display: none; } }
#perevirka form .btn { justify-self: start; }
#check-status { display: none; position: relative; margin: 0; padding: 11px 14px 12px 48px; border-top: 3px solid var(--st); background: var(--st-bg); color: var(--ink); font-family: var(--f-ui); font-weight: 600; line-height: 1.4; }
#check-status::before { content: ""; position: absolute; left: 12px; top: 11px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--chk-r, 0); background: var(--st); color: var(--bg); font-size: 15px; font-weight: 700; line-height: 1; }
form:is([data-state="sending"], [data-state="ok"], [data-state="error"]) #check-status { display: block; }
form[data-state="sending"] { --st: var(--accent); --st-bg: transparent; }
form[data-state="ok"] { --st: var(--ok); --st-bg: var(--ok-bg); }
form[data-state="error"] { --st: var(--bad); --st-bg: var(--bad-bg); }
form[data-state="sending"] :is(label, .field-error) { opacity: .55; pointer-events: none; }
form[data-state="sending"] .btn { background: transparent; color: var(--accent); border-color: var(--accent); cursor: progress; pointer-events: none; }
form[data-state="sending"] .btn::after { content: "\2026"; }
form[data-state="sending"] #check-status::before { background: none; border: 3px solid var(--rule); border-top-color: var(--accent); border-radius: 50%; animation: check-spin .9s linear infinite; }
@keyframes check-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { form[data-state="sending"] #check-status::before { animation: none; border-color: var(--accent); } }
form[data-state="ok"] #check-status::before { content: "\2713"; }
form[data-state="error"] #check-status::before { content: "!"; }
form[data-state="ok"] .btn { background: transparent; color: var(--ink); border-color: var(--rule); }

footer { margin-top: 48px; padding: 20px 0 40px; border-top: 1px solid var(--rule); color: var(--sub); font-size: 16px; }
footer .wrap { display: grid; gap: 8px; }
footer p { max-width: var(--measure); }
footer p:has(> a) { display: flex; flex-wrap: wrap; column-gap: 20px; }
footer a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }

@media (min-width: 48em) { :root { --pad: 32px; } main > section { margin-top: 56px; } }

/* Editorial: a broadsheet front page. Nameplate between rules, accent dateline strip, condensed headline, lede in ruled columns */
header { padding-top: 10px; }
header .brand { display: flex; justify-content: center; min-height: 0; padding: 8px 0 6px; border-top: 1px solid var(--ink); color: var(--ink); text-align: center; text-wrap: balance; font-family: var(--f-head); font-weight: 900; font-stretch: 75%; font-size: clamp(40px, 12.8vw, 104px); line-height: .95; letter-spacing: -.02em; }
main > h1, ul.index .t, main > dl dd, main > section > h2, #perevirka > h2 { font-variation-settings: "wdth" 82; }
main > dl dd:has(> a) { font-variation-settings: normal; }
header .brand { font-variation-settings: "wdth" 75; font-size: 36px; line-height: 38px; }
header .wrap::after { content: ""; display: block; height: 9px; border-top: 5px solid var(--ink); border-bottom: 1px solid var(--ink); }
main { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding-top: 6px; }
main > * { grid-column: 1 / -1; min-width: 0; }
main::before { content: ""; grid-area: 1 / 1 / 2 / -1; min-height: 44px; background: var(--accent); }

main > .crumbs { grid-area: 1 / 1; justify-self: start; align-self: center; max-width: 42%; padding-left: 12px; flex-wrap: nowrap; font-weight: 700; color: var(--on-accent); }
main > .crumbs a, main > .crumbs > :not(a), .crumbs > * + *::before { color: inherit; }
main > .crumbs a { display: block; line-height: 44px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
main > .meta { display: contents; }
main > .meta > span { font-style: italic; font-size: 16px; line-height: 22px; color: var(--sub); }
main > .meta > span:nth-child(2) { grid-area: 1 / 1; justify-self: end; align-self: center; max-width: 58%; padding: 0 12px; text-align: end; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--on-accent); font-weight: 400; }
main > .meta > span:first-child { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--ink); }
main > .meta > span:first-child a { color: var(--link); }
main > h1 { margin-top: 10px; font-family: var(--f-head); font-weight: 800; font-stretch: 82%; font-size: 25px; line-height: 27px; letter-spacing: -.005em; }
main > .lead { margin-top: 8px; padding-top: 8px; max-width: none; border-top: 1px solid var(--ink); font-size: 19px; line-height: 25px; font-weight: 500; text-align: start; }
main > .lead mark { white-space: normal; }
mark { font-weight: 700; color: var(--accent); }
body:has(ul.index) main > .lead { columns: auto; text-align: start; -webkit-hyphens: manual; hyphens: manual; font-size: 20px; line-height: 27px; }
main > .btns { margin-top: 18px; }
.btn { font-weight: 700; }
main > dl { margin-top: 28px; border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink); }
main > dl dt { padding-top: 10px; font-weight: 700; font-variant-caps: all-small-caps; letter-spacing: .06em; font-size: 18px; line-height: 20px; color: var(--accent); }
main > dl dd { padding: 2px 0 10px; border-bottom: 1px solid var(--rule); font-family: var(--f-head); font-weight: 800; font-stretch: 82%; font-size: 26px; line-height: 28px; }
main > dl dd:last-child { border-bottom: 0; }
main > dl dd:has(> a) { font-family: var(--f-body); font-weight: 400; font-stretch: 100%; font-size: 17px; line-height: 24px; }
main > section > h2, #perevirka > h2 { padding-top: 8px; border-top: 5px double var(--ink); font-family: var(--f-head); font-weight: 800; font-stretch: 82%; font-size: 30px; line-height: 31px; }
main > ul.index { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 4px solid var(--ink); border-bottom: 1px solid var(--ink); }
ul.index > li { display: flex; }
ul.index > li > a { flex: 1; display: flex; flex-direction: column; flex-wrap: nowrap; gap: 1px; padding: 10px 0 12px; border-bottom: 1px solid var(--rule); border-left: 1px solid var(--ink); }
ul.index > li > a { padding-left: 0; border-left: 0; }
ul.index .t, ul.index .note { flex: none; }
ul.index .key { font-weight: 700; font-variant-caps: all-small-caps; letter-spacing: .06em; font-size: 18px; line-height: 20px; color: var(--accent); }
ul.index .t { font-family: var(--f-head); font-weight: 800; font-stretch: 82%; font-size: 23px; line-height: 24px; color: var(--ink); }
ul.index .note { font-style: italic; font-size: 16px; line-height: 21px; text-align: start; }
#perevirka input:not([type="checkbox"]):not([type="radio"]) { border-color: var(--ink); }
footer { border-top: 5px double var(--ink); }
@media (min-width: 48em) {
  header { padding-top: 18px; }
  header .brand { font-size: clamp(64px, 10vw, 112px); line-height: 1; padding: 12px 0 10px; }
  main > .crumbs { padding-left: 16px; }
  main > .meta > span:nth-child(2) { padding: 0 16px; }
  main > h1 { margin-top: 22px; font-size: 58px; line-height: 56px; max-width: 18em; }
  main > .lead { margin-top: 18px; padding-top: 14px; font-size: 20px; line-height: 28px; columns: 2; column-gap: 32px; column-rule: 1px solid var(--ink); }
  main > .lead::first-line { font-weight: 700; }
  body:has(ul.index) main > .lead { font-size: 24px; line-height: 33px; max-width: 34em; }
  main > dl { grid-template-columns: none; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  main > dl dt, main > dl dd { padding-inline: 16px; border-left: 1px solid var(--ink); }
  main > dl dt:first-child, main > dl dd:nth-child(2) { padding-left: 0; border-left: 0; }
  main > dl dd { padding-bottom: 14px; border-bottom: 0; }
  main > section:not(#perevirka) { columns: 2; column-gap: 32px; column-rule: 1px solid var(--rule); }
  main > section > h2 { column-span: all; margin-bottom: 14px; }
  main > ul.index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  ul.index > li > a { padding: 10px 12px 12px; border-left: 1px solid var(--ink); }
  ul.index > li:nth-child(2n+1) > a { padding-left: 12px; border-left: 1px solid var(--ink); }
  ul.index > li:nth-child(3n+1) > a { padding-left: 0; border-left: 0; }
}
@media (min-width: 64em) {
  main > h1 { font-size: 76px; line-height: 72px; }
  main > .lead { columns: 3; }
  main > ul.index { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  ul.index > li:nth-child(3n+1) > a { padding-left: 12px; border-left: 1px solid var(--ink); }
  ul.index > li:nth-child(4n+1) > a { padding-left: 0; border-left: 0; }
}

body:has(ul.index) main > .crumbs { max-width: 100%; }
main:not(:has(> .crumbs, > .meta > span:nth-child(2)))::before { display: none; }

:root, :root[data-theme="light"], :root[data-theme="dark"]{--accent:#dd5524;--on-accent:#000000}
