/* Match the active Cactus classic palette and blog's self-hosted font. */
@font-face {
  font-family: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/lib/roboto-slab/RobotoSlab-Vietnamese.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/lib/roboto-slab/RobotoSlab-Variable.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02DD-02FF, U+0304, U+0308, U+0329, 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: "Roboto Slab";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/lib/roboto-slab/RobotoSlab-Latin.woff2") format("woff2");
  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;
}

:root {
  color-scheme: light;
  --sap-bg: #fafafa;
  --sap-text: #22272a;
  --sap-accent: #cc2a41;
  --sap-muted: #666;
  --sap-line: #dedede;
  --sap-tint: rgba(204, 42, 65, .055);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; border-top: 2px solid var(--sap-text); }
body {
  margin: 0;
  background: var(--sap-bg);
  color: var(--sap-text);
  font: 16px/1.7 "Roboto Slab", Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--sap-accent); }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button, input, select {
  border: 1px solid var(--sap-line);
  border-radius: 5px;
  background: var(--sap-bg);
}
button { padding: .35rem .7rem; }
button:hover { border-color: var(--sap-accent); color: var(--sap-accent); }
:focus-visible { outline: 2px solid var(--sap-accent); outline-offset: 3px; }
.sap-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sap-skip {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 5;
  padding: .6rem 1rem;
  background: var(--sap-bg);
}
.sap-skip:focus { top: .5rem; }
.sap-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 78px;
  padding: .85rem 1.5rem;
  border-bottom: 1px solid var(--sap-line);
}
.sap-brand { display: flex; align-items: baseline; gap: 1rem; text-decoration: none; }
.sap-brand strong { color: var(--sap-accent); font-size: 1.35rem; }
.sap-brand span { font-size: .85rem; color: var(--sap-muted); }
.sap-topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; font-size: .85rem; }
#sap-random { min-height: 44px; white-space: nowrap; }
.sap-topbar nav a { white-space: nowrap; }
.sap-workspace { display: grid; grid-template-columns: 350px minmax(0, 1fr); }
.sap-sidebar { min-width: 0; border-right: 1px solid var(--sap-line); }
.sap-filters { padding: 1.2rem 1.2rem .7rem; border-bottom: 1px solid var(--sap-line); }
.sap-filters h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .8rem; font-size: 1rem; }
.sap-total { color: var(--sap-accent); background: var(--sap-tint); padding: 0 .5rem; border-radius: 4px; font-size: .8rem; }
.sap-filters label:not(.sap-sr-only) { display: block; color: var(--sap-muted); font-size: .75rem; margin-bottom: .35rem; }
.sap-filters input, .sap-filters select { display: block; width: 100%; padding: .6rem .65rem; font-size: .85rem; }
.sap-filters select { margin-top: .6rem; }
.sap-filter-status { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-height: 2.25rem; }
.sap-filter-status p { margin: .4rem 0 0; font-size: .73rem; color: var(--sap-muted); }
.sap-filter-status button { margin-top: .3rem; padding: .15rem .35rem; font-size: .73rem; }
.sap-list-pane { min-height: 0; }
#sap-list { list-style: none; padding: 0; margin: 0; }
.sap-lesson-link {
  display: block;
  padding: .9rem 1.15rem .95rem;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--sap-line);
  text-decoration: none;
}
.sap-lesson-link:hover { background: rgba(0, 0, 0, .025); color: inherit; }
.sap-lesson-link[aria-current="page"] { border-left-color: var(--sap-accent); background: var(--sap-tint); }
.sap-lesson-link[aria-current="page"] .sap-list-title { color: var(--sap-accent); }
.sap-list-meta { display: flex; align-items: baseline; gap: .55rem; margin-bottom: .3rem; color: var(--sap-muted); font-size: .68rem; line-height: 1.5; }
.sap-id { font: 600 .8rem/1.6 "Menlo", "Meslo LG", monospace; color: var(--sap-accent); }
.sap-list-title { display: block; font-size: .9rem; line-height: 1.55; font-weight: 600; }
.sap-sidebar-note { margin: 0; border-top: 1px solid var(--sap-line); padding: .65rem 1.2rem; font-size: .67rem; color: var(--sap-muted); }
.sap-empty { margin: 1.2rem; font-size: .9rem; }
.sap-reading-pane { min-width: 0; }
.sap-reading-tools {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: .65rem 2rem;
  border-bottom: 1px solid var(--sap-line);
  background: var(--sap-bg);
  font-size: .75rem;
  color: var(--sap-muted);
}
#sap-show-list { display: none; }
.sap-stepper { display: inline-flex; align-items: center; gap: .55rem; flex-shrink: 0; }
.sap-stepper a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; text-decoration: none; border: 1px solid var(--sap-line); border-radius: 4px; }
.sap-stepper a[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.sap-lessons { max-width: 1080px; margin: 0 auto; padding: 2rem clamp(1.3rem, 3vw, 3.5rem) 4rem; }
.sap-lesson { overflow-wrap: anywhere; scroll-margin-top: 5rem; }
.sap-lesson + .sap-lesson { margin-top: 4rem; }
.sap-ready .sap-lesson { margin-top: 0; }
.sap-lesson-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem; font-size: .8rem; color: var(--sap-muted); }
.sap-copy-tools { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.sap-copy-status { max-width: 16rem; font-size: .75rem; }
.sap-copy { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex-shrink: 0; }
.sap-copy:disabled { opacity: .5; cursor: wait; }
.sap-lesson h1 { font-size: clamp(1.5rem, 2.3vw, 2.2rem); line-height: 1.35; letter-spacing: -.025em; margin: .75rem 0 2rem; font-weight: 700; }
.sap-lesson h2 { margin: 2rem 0 .85rem; font-size: 1.25rem; line-height: 1.45; color: var(--sap-accent); }
.sap-lesson p, .sap-lesson ul, .sap-lesson ol { margin: 0 0 1.2rem; color: #363737; font-size: 19px; line-height: 1.6; }
.sap-lesson strong { font-weight: 700; }
.sap-lesson code { font: .85em "Menlo", "Meslo LG", monospace; background: var(--sap-tint); padding: .1em .25em; border-radius: 3px; }
.sap-lesson blockquote { margin: 1.2rem 0; padding: .9rem 1.2rem; background: var(--sap-tint); border-left: 3px solid var(--sap-accent); }
.sap-lesson blockquote p { margin: 0; font-size: .95rem; }
.sap-table { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid rgba(204, 42, 65, .25); border-radius: 5px; }
.sap-table table { width: 100%; min-width: 660px; table-layout: fixed; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.sap-table th, .sap-table td { padding: .8rem .9rem; vertical-align: top; text-align: left; border-bottom: 1px solid rgba(204, 42, 65, .15); }
.sap-table th { color: var(--sap-accent); background: rgba(204, 42, 65, .08); font-weight: 700; }
.sap-table td:first-child { font-weight: 600; }
.sap-table tbody tr:last-child td { border-bottom: 0; background: var(--sap-tint); }
.sap-lesson .sap-services { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--sap-line); font-size: .8rem; color: var(--sap-muted); }
.sap-lesson .sap-disclaimer { margin: 0; font-size: .75rem; color: var(--sap-muted); }
.sap-noscript { padding: .8rem 1.5rem; background: var(--sap-tint); }
.sap-ready { height: calc(100vh - 2px); height: calc(100dvh - 2px); display: flex; flex-direction: column; overflow: hidden; }
.sap-ready .sap-topbar { flex-shrink: 0; }
.sap-ready .sap-workspace { flex: 1; min-height: 0; }
.sap-ready .sap-sidebar { display: flex; flex-direction: column; min-height: 0; }
.sap-ready .sap-filters, .sap-ready .sap-sidebar-note { flex-shrink: 0; }
.sap-ready .sap-list-pane { overflow-y: auto; flex: 1; }
.sap-ready .sap-reading-pane { overflow-y: auto; }

@media (max-width: 1050px) {
  .sap-workspace { grid-template-columns: 300px minmax(0, 1fr); }
  .sap-brand span { display: none; }
  .sap-reading-tools { padding-left: 1.3rem; padding-right: 1.3rem; }
}

@media (max-width: 760px) {
  .sap-topbar { min-height: 65px; padding: .75rem 1rem; }
  .sap-topbar nav { gap: .8rem; font-size: .8rem; }
  .sap-workspace { grid-template-columns: minmax(0, 1fr); }
  .sap-sidebar { border-right: 0; }
  .sap-ready .sap-sidebar { display: none; }
  .sap-ready.sap-list-open .sap-sidebar { display: flex; }
  .sap-ready.sap-list-open .sap-reading-pane { display: none; }
  .sap-reading-tools { padding: .55rem 1rem; gap: .5rem; }
  #sap-show-list { display: inline-block; flex-shrink: 0; }
  #sap-current-group { display: none; }
  .sap-lessons { padding: 1.4rem 1rem 3rem; }
  .sap-lesson p, .sap-lesson ul, .sap-lesson ol { font-size: 17px; }
  .sap-lesson h1 { margin-bottom: 1.5rem; }
  .sap-lesson h2 { font-size: 1.1rem; }
  .sap-stepper a { min-width: 40px; min-height: 40px; }
}

@media print {
  html { height: auto; border: 0; }
  body.sap-ready { display: block; height: auto; overflow: visible; }
  .sap-topbar, .sap-sidebar, .sap-reading-tools, .sap-skip, .sap-copy-tools { display: none !important; }
  .sap-workspace { display: block; }
  .sap-ready .sap-reading-pane { overflow: visible; }
  .sap-lessons { padding: 0; max-width: none; }
  .sap-table { overflow: visible; }
  .sap-table table { min-width: 0; font-size: 10pt; }
}
