/* Kurato documentation. Always day print, the theme's light colors, so the screenshots sit on a matching page. */

/* The @font-face rules are in fonts.css, which the build writes. */

:root {
  color-scheme: light;
  --bg: #F3F0EA;
  --panel: #EDEAE2;
  --card: #F8F6F1;
  --line: #CEC8BB;
  --text: #15161A;
  --muted: #585B60;
  --red: #BE2D17;
  --mark: #E5381F;
  --note: #E7EEF0;
  --warn: #F6E7D9;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --body: "Crimson Pro", Georgia, "Times New Roman", serif;
  --mono: "Kreon", ui-monospace, Menlo, monospace;
  --code: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 19px/1.6 var(--body);
  font-variant-numeric: lining-nums;
}
img { max-width: 100%; height: auto; }
a { overflow-wrap: anywhere; color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* The theme's scrollbar (base.css): a slim square bar on a bare track. It is a light gray at rest (--line), darkens under the pointer and goes red while it is dragged, like a playhead. The page and every box that scrolls inside it (tables, the page list) have it. */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); background-clip: padding-box; border: 4px solid transparent; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
::-webkit-scrollbar-thumb:active { background-color: var(--red); }
@supports not selector(::-webkit-scrollbar) { html { scrollbar-width: thin; scrollbar-color: var(--line) transparent; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; z-index: 10; background: var(--bg); padding: 6px 10px; }

/* Header bar. */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  height: 64px; padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand img { height: 22px; width: auto; display: block; }
.brand-label {
  font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding-left: 12px; border-left: 1px solid var(--line);
}
.top-links { margin-left: auto; display: flex; gap: 18px; font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.top-links a { color: var(--text); text-decoration: none; }
.top-links a:hover { color: var(--red); }
.top-links .version { color: var(--muted); }

/* Page layout: navigation, content, and the page's own contents. */
.layout { display: block; max-width: 1360px; margin: 0 auto; }
.nav { padding: 12px var(--gutter) 0; }
.nav details { border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.nav summary {
  cursor: pointer; padding: 12px 14px; list-style: none;
  font: 500 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: "+"; float: right; color: var(--red); }
.nav details[open] summary::after { content: "\2212"; }
.nav-groups { padding: 0 14px 12px; }
.nav h2 {
  margin: 18px 0 6px; font: 500 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.nav h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li a {
  display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px;
  color: var(--text); text-decoration: none; font-size: 17px; line-height: 1.35;
}
.nav li a:hover { background: var(--panel); }
.nav li a[aria-current="page"] { background: var(--panel); color: var(--red); box-shadow: inset 2px 0 0 var(--red); }

main { padding: 8px var(--gutter) 64px; min-width: 0; }
.toc { display: none; }

@media (min-width: 900px) {
  :root { --gutter: 32px; }
  .layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; }
  .nav { padding: 24px 0 24px var(--gutter); position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow: auto; }
  .nav details { border: 0; background: none; }
  .nav summary { display: none; }
  .nav-groups { padding: 0; }
  main { padding: 32px var(--gutter) 96px 8px; }
}
@media (min-width: 1240px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr) 220px; }
  .toc {
    display: block; position: sticky; top: 64px; align-self: start; padding: 40px var(--gutter) 24px 0;
    max-height: calc(100vh - 64px); overflow: auto;
  }
  .toc h2 { margin: 0 0 8px; font: 500 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
  .toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
  .toc a { display: block; padding: 4px 0 4px 12px; color: var(--muted); text-decoration: none; font-size: 16px; line-height: 1.3; }
  .toc a:hover { color: var(--red); }
}

/* Content. */
.content { max-width: 760px; }
.kicker { margin: 16px 0 0; font: 500 12px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
h1 {
  margin: 6px 0 12px; font: 300 clamp(40px, 6vw, 60px)/1.05 var(--serif); letter-spacing: -.01em; text-wrap: balance;
}
h1 em, h2 em { font-style: italic; }
.lede { margin: 0 0 28px; font-size: 22px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
h2 {
  margin: 56px 0 12px; padding-top: 20px; border-top: 1px solid var(--line);
  font: 400 clamp(28px, 3.4vw, 36px)/1.15 var(--serif); text-wrap: balance;
}
h3 { margin: 32px 0 8px; font: 600 20px/1.3 var(--body); }
h2 a.anchor, h3 a.anchor { margin-left: 8px; color: var(--line); text-decoration: none; font-size: .7em; visibility: hidden; }
h2:hover a.anchor, h3:hover a.anchor, a.anchor:focus { visibility: visible; }
p, li { text-wrap: pretty; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 24px; }
li { margin: 4px 0; }
li > ul, li > ol { margin: 4px 0; }
strong { font-weight: 600; }

/* A label exactly as WordPress or Kurato prints it on screen. */
.ui { font-weight: 600; }
.path { font-weight: 600; white-space: nowrap; }
code, kbd, pre { font-family: var(--code); font-size: 14px; font-weight: 500; }
code { padding: 1px 5px; border-radius: 4px; background: var(--panel); border: 1px solid var(--line); overflow-wrap: anywhere; }
pre { margin: 0 0 20px; padding: 14px 16px; overflow: auto; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); line-height: 1.55; }
pre code { padding: 0; border: 0; background: none; }

/* Numbered steps. */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 20px 0 24px; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 14px 48px; margin: 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; font: 500 14px/1 var(--mono); color: var(--red); background: var(--card);
}

/* Screenshots and the numbered list that explains their marks. */
figure.shot { margin: 24px 0 8px; }
figure.shot a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--card); }
figure.shot img { display: block; width: 100%; }
figure.shot.narrow { max-width: 320px; }
figure.shot.medium { max-width: 560px; }
figcaption { margin-top: 8px; font-size: 16px; color: var(--muted); }
ol.marks { list-style: none; counter-reset: mark; padding: 0; margin: 12px 0 28px; }
ol.marks > li { counter-increment: mark; position: relative; padding-left: 36px; margin: 6px 0; }
ol.marks > li::before {
  content: counter(mark); position: absolute; left: 0; top: 2px;
  min-width: 24px; height: 24px; border-radius: 12px; background: var(--mark); color: #fff;
  font: 700 13px/24px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; text-align: center;
}
ol.marks[start="2"] { counter-reset: mark 1; }
ol.marks[start="3"] { counter-reset: mark 2; }
ol.marks[start="4"] { counter-reset: mark 3; }
ol.marks[start="5"] { counter-reset: mark 4; }
.pair { display: grid; gap: 20px; align-items: start; }
@media (min-width: 720px) { .pair { grid-template-columns: 300px minmax(0, 1fr); } .pair figure.shot { margin-top: 4px; } }

/* Notes. */
.note, .warn, .tip {
  margin: 20px 0; padding: 14px 16px 14px 18px; border-radius: 8px; border-left: 3px solid var(--muted); background: var(--note);
}
.warn { border-left-color: var(--red); background: var(--warn); }
.tip { border-left-color: var(--line); background: var(--panel); }
.note p:last-child, .warn p:last-child, .tip p:last-child, .note ul:last-child, .warn ul:last-child { margin-bottom: 0; }
.note > strong:first-child, .warn > strong:first-child, .tip > strong:first-child,
.note > p:first-child > strong:first-child, .warn > p:first-child > strong:first-child {
  font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: 6px;
}

/* Tables. */
.table { margin: 16px 0 24px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 17px; line-height: 1.45; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font: 500 12px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; }
table.plain td:first-child { font-weight: 400; }

/* Cards on the home page. */
.cards { display: grid; gap: 12px; margin: 20px 0 28px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.cards a {
  display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--text); text-decoration: none;
}
.cards a:hover { border-color: var(--red); }
.cards b { display: block; font: 400 24px/1.2 var(--serif); margin-bottom: 4px; }
.cards span { color: var(--muted); font-size: 17px; }

/* Previous and next. */
.pager { display: grid; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--red); }
.pager small { display: block; font: 500 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pager .next { text-align: right; }
.pager .next:only-child { grid-column: 2; }

.foot { margin-top: 40px; font-size: 15px; color: var(--muted); }

@media print {
  .top, .nav, .toc, .pager { display: none; }
  .layout { display: block; }
  main { padding: 0; }
}
ol.steps[start="2"] { counter-reset: step 1; }
ol.steps[start="3"] { counter-reset: step 2; }
ol.steps[start="4"] { counter-reset: step 3; }

/* Phones: a lighter header, and long menu paths may wrap. */
@media (max-width: 599px) {
  .top-links .version { display: none; }
  .top-links { white-space: nowrap; }
  .brand-label { display: none; }
  .path { white-space: normal; }
}
