/*
  The shared pieces drawn inside pages: headings, labels, cards, actions,
  messages, journal entries, disclosures, filters, pagers and the Settings
  form. Colours come from theme.css. The Progress pages' own pieces (stage
  cards, the gallery, the About page's sections) are in progress.css.
  Proportions follow Skylark's site, which was built from the same guide.
*/

/* 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 Lizzard'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-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 Lizzard'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); }
