/*
  The shared pieces drawn inside pages: headings, labels, cards, actions, messages, journal
  entries, disclosures, filters, pagers and the Settings form. Colours come from tokens.css.

  This file follows OAP Lizzard's components.css (copied 2026-11-13 and adapted), so the
  pieces look the same across the family. Still Questing's own pieces are at the end.
*/

/* Headings and reading width (about 60-70 characters a line). */
h1, h2, h3 { line-height: 1.25; font-weight: 700; }
h1 { color: var(--heading); font-size: 1.9rem; margin: 0 0 12px; overflow-wrap: anywhere; }
h2 { color: var(--heading-section); font-size: 1.35rem; margin: 32px 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }
p { max-width: 70ch; }
.page-head { margin: 28px 0 24px; max-width: 75ch; }
.lead { color: var(--text-2); font-size: 1.05rem; font-weight: 400; margin: 0; }  /* Bootstrap's .lead is light (300) */
.prose { max-width: 70ch; }
.prose li { margin-bottom: 8px; }

/* Small capitals: the context above a heading, labels and the edition line. */
.eyebrow, .small-label { font-size: .7rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow { color: var(--eyebrow); margin: 0 0 12px; }
.small-label { color: var(--heading-section); }
.small-note { color: var(--text-2); font-size: .8rem; margin: 16px 0; }
/* A quiet label in a box: status, kind of entry, how a picture was made. */
.badge-label {
    display: inline-block; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 5px; padding: 2px 8px; font-size: .72rem; line-height: 1.5; text-decoration: none;
}
a.badge-label:hover { color: var(--accent); border-color: var(--accent); }
/* A row of plain links (the Progress pages, an entry's links, a stage's links). */
.section-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 24px 0; font-size: .875rem; }
.progress-navigation a[aria-current="page"] { color: var(--heading); font-weight: 700; text-decoration-thickness: 2px; }

/* Actions: Bootstrap's buttons (btn, btn-primary, btn-outline-secondary) in the site's colours. */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 44px; padding: 10px 18px;
    border-radius: 7px; font-size: .875rem; font-weight: 600;
}
.btn-primary {
    --bs-btn-bg: var(--accent); --bs-btn-color: var(--on-accent); --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-strong); --bs-btn-hover-color: var(--on-accent); --bs-btn-hover-border-color: var(--accent-strong);
    --bs-btn-active-bg: var(--accent-strong); --bs-btn-active-color: var(--on-accent); --bs-btn-active-border-color: var(--accent-strong);
}
.btn-outline-secondary { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.btn-outline-secondary:hover, .btn-outline-secondary:active { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }

/* Cards in a grid that collapses to one column without overflowing. */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 16px; margin: 16px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.card h3 { color: var(--heading-section); }
.card p { margin: 0; }
.reading-card { padding: 24px; margin: 24px 0; }
.reading-card p { color: var(--text-2); }

/* Messages: the kind is written as a word as well as a colour. */
.status-message { border: 1px solid var(--border); border-left: 3px solid; border-radius: 8px; padding: 12px 16px; margin: 16px 0; max-width: 70ch; background: var(--surface); }
.status-information { border-left-color: var(--info-line); }
.status-success { border-left-color: var(--success-line); }
.status-warning { border-left-color: var(--warning-line); }
.status-error { border-left-color: var(--error-line); }
.callout { background: var(--warning-bg); border-left: 4px solid var(--warning-line); border-radius: 8px; padding: 4px 20px; margin: 24px 0; max-width: 75ch; }
.callout h2 { margin-top: 12px; font-size: 1.1rem; color: var(--text); }
.problems { background: var(--error-bg); border-left: 4px solid var(--error-line); border-radius: 8px; padding: 4px 20px; margin: 16px 0; }
.empty { color: var(--text-2); }

/* Disclosures: a native <details>, its body set in on a thin line. */
summary { color: var(--accent); cursor: pointer; padding: 8px 0; min-height: 44px; width: fit-content; max-width: 100%; display: list-item; }
.disclosure-body { padding: 8px 0 4px 16px; border-left: 2px solid var(--border); margin-top: 8px; max-width: 80ch; }
.disclosure-body p { margin: 0 0 12px; }
.disclosure-body li { margin-block: 8px; }

/* Journal entries: a list divided by fine rules, not boxes. */
.project-journal { margin: 32px 0; }
.journal-entry { padding: 24px 0; border-top: 1px solid var(--border); }
.journal-entry:target { border-top-color: var(--accent); box-shadow: 0 -2px 0 var(--accent); }
.journal-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 12px; color: var(--text-2); font-size: .8rem; }
/* The write-up time stays on one line ("7 Nov 2026, 14:15:32 UTC"); the notes beside it sit in the row, not as paragraphs. */
.journal-meta .journal-time { white-space: nowrap; color: var(--text); }
.journal-meta .small-note { margin: 0; }
.journal-update strong { color: var(--heading); }
.meta-link { color: var(--text-2); }
.meta-link:hover { color: var(--accent); }
.journal-entry h3 { color: var(--heading); font-size: 1.2rem; }
.journal-summary { color: var(--text-2); margin: 0 0 4px; }
.journal-entry { container-type: inline-size; }
.journal-illustrated { display: grid; gap: 12px; align-items: start; margin-bottom: 12px; }
.journal-picture { margin: 0; max-width: 32rem; }
.journal-picture a { display: block; width: fit-content; max-width: 100%; }
.journal-picture img { display: block; max-width: min(100%, 18rem); max-height: 14rem; width: auto; height: auto; }
.journal-picture figcaption { color: var(--text-2); font-size: .875rem; margin-top: 6px; }
@container (min-width: 38rem) {
    .journal-illustrated { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
}
.journal-permalink { display: inline-block; padding: 8px 0; font-size: .8rem; }

/* A list's filter, its count and its pages. */
.list-widget { margin: 32px 0; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { margin: 0; }
.section-heading p { color: var(--text-2); margin: 8px 0 0; }
.filter-bar {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 20px; margin: 0 0 12px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.filter-field { flex: 1; min-width: min(240px, 100%); max-width: 32rem; }
.filter-field label { display: block; margin-bottom: 8px; font-size: .8rem; font-weight: 650; }
/* Bootstrap's form fields (form-control, form-select) in the site's colours. */
.form-control, .form-select {
    min-height: 44px; border-radius: 7px; color: var(--text); background-color: var(--surface);
    border: 1px solid var(--control-border); font-size: .875rem;
}
.form-select { background-image: none; appearance: auto; padding-right: 12px; }  /* the browser's own arrow, as on Skylark's site */
.form-control:focus, .form-select:focus { color: var(--text); background-color: var(--surface); border-color: var(--accent); box-shadow: none; }
.form-control::placeholder { color: var(--text-2); }
.field-hint { font-weight: 400; color: var(--text-2); }
/* A list's own status line: "Loading", or what went wrong and how to retry (list.js). Empty takes no room. */
.list-status:empty { display: none; }
.list-status { margin: 8px 0; font-size: .875rem; }
/* Entries merged into another (journal notes), each kept whole with its own date. */
.notes-heading { font-size: 1rem; margin: 24px 0 8px; color: var(--heading); }
.journal-note { padding: 16px 0 8px; border-top: 1px solid var(--border); }
.journal-note h3, .journal-note h5 { font-size: 1rem; margin: 0 0 6px; color: var(--heading); }
.entry-title-link { color: inherit; text-decoration: none; }
.entry-title-link:hover, .entry-title-link:focus-visible { text-decoration: underline; }
.entry-page .journal-entry { border-top: 0; padding-top: 8px; }
.entry-page .journal-entry h1 { margin: 0 0 12px; }
code.hash { font-size: .8rem; overflow-wrap: anywhere; }
.results-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin: 16px 0; }
.result-summary { margin: 12px 0; color: var(--text-2); font-size: .875rem; }
.result-summary strong { color: var(--text); }
.pager { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.page-label { color: var(--text-2); font-size: .8rem; white-space: nowrap; }
.pager-links { display: flex; gap: 4px; }
.page-link {
    display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px;
    background: var(--surface); color: var(--accent); font-size: .8rem; text-decoration: none;
}
.page-link:hover { background: var(--accent-soft); border-color: var(--accent); }
.page-link.disabled { color: var(--text-2); background: var(--surface-2); opacity: .7; }

/* Documentation's local section links. */
.local-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 8px; padding: 0; list-style: none; }

/* Settings. */
.settings-form fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin: 0 0 16px; background: var(--surface); max-width: 44rem; }
/* Bootstrap's legend floats full width at heading size; keep it a small label on the box's edge. */
.settings-form legend { float: none; width: auto; margin: 0; font-size: 1rem; line-height: inherit; font-weight: 700; padding: 0 8px; }
.choice { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: start; padding: 8px 0; }
.choice input { width: 20px; height: 20px; margin: 4px 0 0; accent-color: var(--accent); }
.choice-help { grid-column: 2; color: var(--text-2); font-size: .9rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 575.98px) {
    h1 { font-size: 1.5rem; }
    .card, .reading-card, .filter-bar { padding: 16px; }
    .filter-bar > .btn { width: 100%; }
    .pager { gap: 8px; }
    .pager-links { width: 100%; }
    .page-link { flex: 1; justify-content: center; padding: 8px 6px; }
    .results-heading > .pager { width: 100%; }
}

/* The filter's phone disclosure: a "Find ..." line on phones; on wider
   screens the summary is hidden and the form always shows (the details stays
   open: list.js only closes it on phones). */
.filter-disclosure > summary { margin: 0 0 8px; font-weight: 650; }
@media (min-width: 768px) {
    .filter-disclosure > summary { display: none; }
}
.list-status.is-error { background: var(--error-bg); border-left: 3px solid var(--error-line); padding: 8px 12px; border-radius: 6px; }
.list-retry { margin-left: 8px; min-height: 36px; }
.example-records { list-style: none; padding: 0; margin: 0; }
.example-records > li { padding: 12px 0; border-top: 1px solid var(--border); }

/* ---------- Still Questing's own pieces ---------- */

.muted { color: var(--text-2); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* An entry's headline where the page's heading level varies (role="heading"). */
.entry-heading { color: var(--heading); font-size: 1.2rem; font-weight: 700; line-height: 1.25; margin: 0 0 8px; overflow-wrap: anywhere; }
.journal-meta time { white-space: nowrap; }
.project-journal > .journal-entry:first-child { border-top: 0; padding-top: 8px; }
.sources { color: var(--text-2); font-size: .85rem; }

/* What a record is about: the addons and tools, as quiet links. */
.subjects { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.tag { color: var(--text-2); }
a.tag:hover { color: var(--accent); }

/* A state is always said in words; the coloured edge is an extra. */
.badge-label.state-done, .badge-label.state-released, .badge-label.state-in-use, .badge-label.state-plugin,
.badge-label.state-proved-in-game, .badge-label.state-measured { border-color: var(--success-line); }
.badge-label.state-in-progress, .badge-label.state-next, .badge-label.state-in-development,
.badge-label.state-candidate, .badge-label.state-open, .badge-label.state-not-verified { border-color: var(--warning-line); }
.badge-label.state-disproved { border-color: var(--error-line); }

/* "Showing X only - Show all", above a list filtered to one addon or tool. */
.subject-bar {
    display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; max-width: none;
    background: var(--accent-soft); border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px; margin: 0 0 20px;
}

.back { margin: 0; }
.back a { display: inline-block; padding-block: 12px; font-size: .875rem; }
.list-results[aria-busy="true"] { opacity: .6; }
.list-status { max-width: none; }
details.explain { margin: 24px 0; }
.table-scroll { overflow-x: auto; margin: 0 0 20px; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { margin-bottom: 12px; }
.demo-row { padding: 8px 16px; margin-bottom: 8px; }
.settings-form .small-note { max-width: 44rem; }

/*
  Settings: each appearance as a card with a small picture of it (the form of Skylark's
  Settings page). The pictures must show every appearance whatever the current one is, so
  these are the only literal colours outside tokens.css. Keep them in step with it: the
  surface, border, a muted line and the heading colour of each appearance.
*/
.settings-card { padding: 24px; margin: 24px 0; }
.settings-card > p { color: var(--text-2); }
.settings-card h2 { margin-top: 0; }
.settings-card fieldset { border: 0; padding: 0; margin: 0; }
.theme-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 16px 0 24px; max-width: 800px; }
.theme-option { padding: 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.theme-option:has(input:checked) { outline: 2px solid var(--accent); }
.theme-option input, .remember-label input { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: middle; margin-right: 4px; }
.theme-name { display: block; font-size: .875rem; margin-top: 12px; }
.theme-meaning { display: block; color: var(--text-2); font-size: .75rem; margin-top: 4px; }
.remember-label { display: block; padding: 10px 0; }
.theme-swatch { height: 80px; border-radius: 6px; padding: 16px; display: grid; gap: 6px; background: #f8f0dd; border: 1px solid #c9b183; }
.theme-swatch span { border-radius: 2px; height: 5px; width: 75%; background: #c9b183; }
.theme-swatch span:first-child { width: 45%; background: #6e4a08; }
.swatch-dark { background: #1f1b16; border-color: #5c4a30; }
.swatch-dark span { background: #5c4a30; }
.swatch-dark span:first-child { background: #f0c860; }
.swatch-bluedark { background: #122036; border-color: #3b5078; }
.swatch-bluedark span { background: #3b5078; }
.swatch-bluedark span:first-child { background: #e6bb78; }
.swatch-system { background: linear-gradient(90deg, #f8f0dd 50%, #1f1b16 50%); border-color: #7d6642; }
.swatch-system span { background: #9a8258; }
.swatch-system span:first-child { background: #b8860b; }
@media (max-width: 767.98px) { .theme-options { grid-template-columns: repeat(2, 1fr); } }
.settings-card .list-status { margin-top: 16px; color: var(--text-2); }
