/* Public reference pages (2026-11-22): /donate-trains, /railroads, /societies, /resources.
   Linked after clubs.css and shows.css. Uses only existing theme custom properties (no hard-coded colors),
   so light and dark themes both follow the site. Works at 960px and on a 375px phone. */

/* text-only page header (no background photo): compact height instead of shows.css's 20rem photo frame */
.ks-head.kr-head { min-height: 0; }
.kr-head .kc-actions { margin: .85rem 0 0; }

/* closed or inactive society notice */
.kr-notice { margin: 0 0 1.25rem; padding: .75rem 1rem; border-radius: var(--radius); border: 1px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, var(--kc-card)); color: var(--text); overflow-wrap: anywhere; }

/* two-column facts list on railroad and society pages */
.kr-facts { margin: 0 0 1.25rem; padding: .9rem 1.15rem; border-radius: var(--radius); background: var(--kc-card);
  border: 1px solid var(--kc-edge); box-shadow: var(--kc-shadow); }
.kr-facts > div { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: .25rem 1rem; padding: .55rem 0;
  border-top: 1px solid var(--kc-edge); }
.kr-facts > div:first-child { border-top: 0; padding-top: 0; }
.kr-facts > div:last-child { padding-bottom: 0; }
.kr-facts dt { color: var(--muted); font-weight: 600; }
.kr-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* narrative copy and section lists */
.kr-prose p { margin: 0 0 .9rem; max-width: 48rem; line-height: 1.65; }
.kr-prose p:last-child { margin-bottom: 0; }
.kr-list { margin: 0 0 .5rem; padding-left: 1.2rem; }
.kr-list li { margin: 0 0 .45rem; max-width: 48rem; line-height: 1.55; overflow-wrap: anywhere; }

/* sources list: small text, wraps long URLs cleanly on a phone */
.kr-sources { margin: 0 0 .85rem; padding-left: 1.35rem; font-size: .9rem; color: var(--muted); }
.kr-sources li { margin: 0 0 .35rem; overflow-wrap: anywhere; word-break: break-word; }
.kr-sources a { color: var(--accent); }

/* status tags on /societies */
.kc-tag.kr-tag-closed { border-color: var(--bad); color: var(--bad); }
.kc-tag.kr-tag-unclear { border-color: var(--warn); color: var(--warn); }

/* /resources topics line and CSS-only filter (:has) */
.kr-topics { margin: .15rem 0 0; }
.kx-page:has(#kr-free:checked) .kr-row:not(.kr-free),
.kx-page:has(#kr-beg:checked) .kr-row:not(.kr-beg) { display: none; }
.kx-page:has(#kr-free:checked) .kr-sec:not(.kr-has-free),
.kx-page:has(#kr-beg:checked) .kr-sec:not(.kr-has-beg),
.kx-page:has(#kr-free:checked):has(#kr-beg:checked) .kr-sec:not(.kr-has-both) { display: none; }

@media (max-width: 600px) {
  .kr-facts { padding: .75rem .9rem; }
  .kr-facts > div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
}

/* /makers (2026-11-23): identification clues */
.km-ids { list-style: none; margin: 0; padding: 0; }
.km-id { margin: 0 0 .75rem; padding: .8rem 1rem; border-radius: var(--radius); background: var(--kc-card);
  border: 1px solid var(--kc-edge); max-width: 52rem; overflow-wrap: anywhere; }
.km-id p { margin: 0 0 .4rem; line-height: 1.55; }
.km-id p:last-child { margin-bottom: 0; }
.km-clue { font-weight: 700; }
.km-check { color: var(--text); }

/* /glossary (2026-11-23) */
.kg-jump { display: flex; flex-wrap: wrap; gap: .35rem .6rem; margin: 0 0 1.25rem; font-weight: 600; }
.kg-list { margin: 0; }
.kg-term { padding: .7rem 0; border-top: 1px solid var(--kc-edge); max-width: 52rem; scroll-margin-top: 5rem; }
.kg-term:first-child { border-top: 0; }
.kg-term dt { font-weight: 700; }
.kg-term dd { margin: .25rem 0 0; overflow-wrap: anywhere; }
.kg-term dd p { margin: 0 0 .35rem; line-height: 1.6; }
.kg-term:target { background: var(--kc-card); outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
/* /glossary search and assistant-badge clearance (2026-11-23) */
.kg-find { max-width: 32rem; margin: 0 0 1rem; }
.kg-find label { display: block; font-weight: 700; margin: 0 0 .35rem; }
.kg-find input { width: 100%; box-sizing: border-box; padding: .6rem .8rem; font: inherit; color: inherit; background: var(--kc-card); border: 1px solid var(--kc-edge); border-radius: var(--radius); }
.kg-find input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kg-find .kc-where { margin: .35rem 0 0; min-height: 1.2em; }
.kg-none { margin: 1rem 0 2rem; }

/* /glossary: keep the floating Ask Casey button off the definitions (2026-11-23). Below 1240px the button shows
   as the round face only (as it already does on phones), and every word gets a 60px right gutter for it to sit in;
   from 1240px the page column ends well left of the full "Ask Casey" pill, so no gutter is needed. */
@media (max-width: 1239px) {
  body:has(.kg-find) .ask-launch { padding: 4px; }
  body:has(.kg-find) .ask-launch-label { display: none; }
  body:has(.kg-find) .ask-launch img { width: 48px; height: 48px; }
  body:has(.kg-find) .kg-term { padding-right: 60px; }
}

/* /train-places link grids (PlacePages, 2026-11-23) */
.kp-grid { columns: 3 14rem; list-style: none; padding: 0; }
.kp-grid li { break-inside: avoid; margin: .2rem 0; }
