/* SimpleMed+ Encyclopaedia (/concepts). Loaded only on staticPublicPage pages, after brand.css.
   One modern sans throughout (Plus Jakarta Sans, self-hosted, OFL, latin subset, swap): heavy tight
   headings over a calm reading weight, so the pages look the same on every device. Owner, 24 Oct: keep
   the A to Z letters; 25 Oct: no icons, a better font, a more modern hub. Five type steps only:
   0.875rem labels and meta, 1rem UI, 1.0625rem reading text, 1.25rem lead and memory aid,
   1.375rem section headings, plus the h1 clamps; 1.125rem only for the memory aid and the phone-width lead.
   Green for orientation (remember, memory aid), the brand red only for exam traps. */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/css/fonts/plus-jakarta-sans-v12-latin-7660bd9909fb097989b19471a75f1b7a.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;
}
.kc {
  --kc-font: "Plus Jakarta Sans", var(--smg-sans);
  --kc-measure: 40rem;
  --kc-rule: #e4dccd;
  --kc-aid: #f8efd9;
  --kc-aid-line: #dcc58a;
  --kc-trap: #9a4a42;
  --kc-trap-line: #e9cdc6;
  color: var(--smg-copy);
  font-family: var(--kc-font);
  word-spacing: 0.03em;
}
.kc-wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; display: grid; gap: clamp(1.75rem, 4vw, 2.75rem); }
.kc-column { width: min(100% - 2rem, var(--kc-measure)); margin-inline: auto; display: grid; gap: 2rem; }

/* Orientation */
.kc-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.5rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; color: var(--smg-muted); }
.kc-crumbs a { display: inline-block; padding-block: 0.7rem; color: var(--smg-green-mid); font-weight: 600; text-decoration: none; }
.kc-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.kc :is(h1, h2, h3) { font-family: var(--kc-font); font-weight: 750; letter-spacing: -0.02em; word-spacing: 0.06em; color: var(--smg-ink); text-wrap: balance; }
.kc h1 { margin: 0; font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.025em; }
.kc-lead { margin: 0.75rem 0 0; color: var(--smg-ink); font-size: 1.25rem; line-height: 1.5; text-wrap: pretty; }
.kc h2 { margin: 0 0 0.75rem; font-size: 1.375rem; line-height: 1.3; }
.kc h2.kc-label, .kc-label { margin: 0 0 0.5rem; font-family: var(--kc-font); line-height: 1.3; color: var(--smg-green-mid); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Search: the same field on every Encyclopaedia page */
.kc-search { position: relative; display: grid; gap: 0.5rem; }
.kc-search[hidden] { display: none; }
.kc-search label { color: var(--smg-ink); font-weight: 600; }
.kc .kc-search input[type="search"]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  width: 100%; min-height: 3rem; padding: 0.75rem 1rem 0.75rem 2.75rem; font: inherit; font-size: 1.0625rem; color: var(--smg-ink);
  background: var(--smg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2355635c' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 0.9rem 50%;
  border: 1px solid var(--smg-muted); border-radius: 0.75rem;
}
.kc .kc-search input[type="search"]::placeholder { color: #6b7570; opacity: 1; }
.kc .kc-search input[type="search"]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus { outline: 2px solid transparent; border-color: var(--smg-green-mid); box-shadow: 0 0 0 3px rgba(31, 107, 79, 0.18); }
.kc-search--wide { max-width: 46rem; }
.kc-results { margin: 0; padding: 0; list-style: none; display: grid; background: var(--smg-card); border: 1px solid var(--smg-line); border-radius: 0.75rem; overflow: hidden; }
.kc-results:empty { display: none; }
.kc-results li + li { border-top: 1px solid var(--kc-rule); }
.kc-results a { display: grid; gap: 0.15rem; padding: 0.75rem 1rem; color: inherit; text-decoration: none; }
.kc-results a:hover, .kc-results a:focus-visible { background: var(--smg-green-pale); }
.kc-results a:focus-visible { outline: 2px solid var(--smg-green-mid); outline-offset: -2px; }
.kc-results .kc-r-title { color: var(--smg-ink); font-weight: 600; }
.kc-results .kc-r-meta { color: var(--smg-green-mid); font-size: 0.875rem; font-weight: 600; }
.kc-results .kc-r-line { color: var(--smg-copy); font-size: 0.875rem; line-height: 1.45; }
.kc-results .kc-r-none { padding: 0.75rem 1rem; color: var(--smg-muted); }
.kc-results mark { background: #f3e3b3; color: inherit; border-radius: 2px; }

/* Entry: the page sits inside .page-content (already a card), so inner blocks use fills, not more cards */
.kc-remember { padding: 1.25rem 1.5rem; background: var(--smg-green-pale); border-radius: 0.875rem; }
.kc-remember p:last-child { margin: 0; color: var(--smg-ink); font-size: 1.0625rem; font-weight: 500; line-height: 1.55; }

.kc-mnemonic { display: grid; gap: 0.5rem; padding: 1.25rem 1.5rem; background: var(--kc-aid); border: 1px solid var(--kc-aid-line); border-radius: 0.875rem; }
.kc-mnemonic h2.kc-label { margin: 0; color: #7a5a14; }
.kc-mn-text { margin: 0; color: var(--smg-ink); font-size: 1.125rem; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em; }
.kc-mn-text::first-letter { text-transform: uppercase; }
.kc-mn-letters { margin: 0.25rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
.kc-mn-letters li { display: grid; grid-template-columns: 2rem 1fr; align-items: baseline; }
.kc-mn-letters b { color: var(--smg-green); font-size: 1.25rem; font-weight: 800; }
.kc-mn-explain { margin: 0; color: var(--smg-copy); }

.kc-body { font-size: 1.0625rem; line-height: 1.6; }
.kc-body > * { margin: 0 0 0.9em; }
.kc-body > *:last-child { margin-bottom: 0; }
.kc-body strong { color: var(--smg-ink); }
.kc-body ul, .kc-body ol { padding-left: 1.3rem; }
.kc-body li + li { margin-top: 0.35em; }
.kc-body ul { list-style: disc; }
.kc-body ol { list-style: decimal; }
.kc-body a { color: var(--smg-green); text-decoration: underline; text-underline-offset: 3px; }
.kc-body h3 { margin-top: 1.4em; font-size: 1.0625rem; }

.kc-facts dl { margin: 0; border-top: 1px solid var(--kc-rule); }
.kc-fact { display: grid; grid-template-columns: minmax(8rem, 34%) 1fr; gap: 0.35rem 1.25rem; padding: 0.75rem 0; border-bottom: 1px solid var(--kc-rule); }
.kc-fact dt { color: var(--smg-ink); font-weight: 600; }
.kc-fact dd { margin: 0; }

/* Traps: one ruled list under a red heading, not a stack of tinted boxes */
.kc-traps h2 { color: var(--kc-trap); }
.kc-traps ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--kc-trap-line); }
.kc-traps li { padding: 0.75rem 0 0.75rem 1.1rem; border-bottom: 1px solid var(--kc-trap-line); position: relative; }
.kc-traps li::before { content: ""; position: absolute; left: 0; top: 1.35rem; width: 0.4rem; height: 0.4rem; background: var(--kc-trap); border-radius: 50%; }

.kc-notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.kc-notes a { display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 3rem; padding: 0.875rem 1.125rem; color: var(--smg-ink); font-weight: 600; text-decoration: none; background: var(--smg-card); border: 1px solid var(--smg-line); border-radius: 0.875rem; }
.kc-notes a:hover { border-color: var(--smg-green-mid); }
.kc-notes .kc-note-go { flex: none; color: var(--smg-green-mid); font-size: 0.875rem; font-weight: 600; }
.kc-notes .kc-primary-note { font-size: 0.875rem; color: var(--smg-muted); font-weight: 400; display: block; margin-top: 0.15rem; }

.kc-practise { display: grid; gap: 0.75rem; justify-items: start; padding: 1.25rem 1.5rem; background: var(--smg-green-pale); border-radius: 0.875rem; }
.kc-practise h2 { margin: 0; }
.kc-practise p { margin: 0; }

.kc-related ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.kc-related a { display: inline-block; padding: 0.65rem 1rem; color: var(--smg-green); font-size: 1rem; font-weight: 600; text-decoration: none; background: var(--smg-green-pale); border-radius: 999px; }
.kc-related a:hover { background: #d4e7dd; }

.kc-foot { display: grid; gap: 0.25rem; padding-top: 1.25rem; border-top: 1px solid var(--kc-rule); color: var(--smg-muted); font-size: 0.875rem; }
.kc-foot p { margin: 0; }

/* Hub and subject lists */
/* The hub is a landing page, not a document: it sits on the page ground with no surrounding card. */
.smp-public .page-content.kc-hub { padding-block: clamp(1.5rem, 4vw, 3rem); background: none; border: 0; box-shadow: none; }
.kc-hub-head { display: grid; gap: 0; max-width: 44rem; }
.kc-hub h1 { font-size: clamp(2.5rem, 6vw, 3.75rem); line-height: 1.04; letter-spacing: -0.035em; }
.kc-hub .kc-lead { margin-top: 1rem; color: var(--smg-copy); max-width: 38rem; }
.kc-hub-meta { margin: 1rem 0 0; color: var(--smg-green-mid); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.kc-hub .kc-search label { font-size: 0.875rem; }
.kc-hub .kc-search input[type="search"]:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  min-height: 3.5rem; font-size: 1.125rem; background-color: #fff; border-color: #87928b; border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(28, 42, 34, 0.06), 0 0.5rem 1.5rem rgba(28, 42, 34, 0.06);
}
.kc-hub section > h2 { font-size: 1.25rem; }
.kc-subjects { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.875rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.kc-subjects a { position: relative; display: grid; align-content: start; gap: 0.35rem; height: 100%; min-height: 6.5rem; padding: 1.25rem 3.25rem 1.25rem 1.375rem; color: inherit; text-decoration: none; background: #fff; border: 1px solid var(--smg-line); border-radius: 1rem; box-shadow: 0 1px 2px rgba(28, 42, 34, 0.04); }
.kc-subjects a::after { content: "\2192"; content: "\2192" / ""; position: absolute; right: 1.25rem; top: 1.2rem; color: var(--smg-green-mid); font-size: 1.125rem; font-weight: 700; }
.kc-subjects a:hover { border-color: var(--smg-green-mid); box-shadow: 0 0.5rem 1.5rem rgba(28, 42, 34, 0.08); }
.kc-notes a:focus-visible, .kc-related a:focus-visible, .kc-subjects a:focus-visible, .kc-az a:focus-visible, .kc-crumbs a:focus-visible { outline: 2px solid var(--smg-green-mid); outline-offset: 2px; }
.kc-subjects b { color: var(--smg-ink); font-size: 1.125rem; font-weight: 750; line-height: 1.3; letter-spacing: -0.015em; }
.kc-subjects span { color: var(--smg-muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

/* A to Z: the whole row is the link target */
.kc-az { margin: 0; padding: 0; list-style: none; display: grid; border-top: 1px solid var(--kc-rule); }
.kc-az li { position: relative; display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 1rem; padding: 0.875rem 0; border-bottom: 1px solid var(--kc-rule); }
.kc-initial { color: var(--smg-green-mid); font-size: 1.375rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.02em; }
.kc-az a { color: var(--smg-ink); font-weight: 600; text-decoration: none; }
.kc-az a::after { content: ""; position: absolute; inset: 0; }
.kc-az a:hover, .kc-az a:focus-visible { color: var(--smg-green); text-decoration: underline; text-underline-offset: 3px; }
.kc-az p { margin: 0.2rem 0 0; font-size: 1rem; line-height: 1.5; }
.kc-aside-link { margin: 0; font-weight: 600; }

@media (max-width: 640px) {
  .kc-fact { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .kc-az li { grid-template-columns: 1.75rem 1fr; gap: 0 0.6rem; }
  .kc-lead { font-size: 1.125rem; }
  .kc-remember, .kc-mnemonic, .kc-practise { padding: 1.1rem 1.2rem; }
  .kc-note-go-text { display: none; }
  .kc-subjects a { min-height: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .kc-search input, .kc-notes a, .kc-subjects a { transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease; }
  .kc-subjects a:hover { transform: translateY(-2px); }
}
