/* Public site styles.

   The page designs are shared by both collectives; each one's look
   comes from a theme file (static/css/themes/<theme>.css) that sets
   the variables below, chosen by Organisation.theme. Without a theme
   (the combined host) the neutral values here apply. */

:root {
    --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: var(--font-body);
    --display-weight: 600;
    --display-end: "";           /* OJC's headings end with a full stop */

    --ink: #212129;
    --ink-muted: #4f535b;
    --page: #f1f2f4;
    --paper: #ffffff;
    --paper-2: #f5f6f8;
    --rule: #d9dce1;
    --link: #0b57d0;

    --hero-bg: #212129;
    --hero-ink: #ffffff;
    --panel: #dde1e6;            /* the designs' light panels */
    --panel-ink: var(--ink);
    --strong: #212129;           /* the designs' dark boxes */
    --strong-ink: #ffffff;
    --pill: #212129;
    --pill-ink: #ffffff;
    --phase: #1d4ed8;
    --footer-bg: #212129;
    --footer-ink: #ffffff;
    --stat-rule: none;           /* OJC rules its figures on the left */

    --radius: 14px;
    --container: 73rem;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--ink);
    background: var(--page);
}

img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--phase); outline-offset: 2px; }
.hero :focus-visible, .panel-strong :focus-visible, .site-footer :focus-visible { outline-color: currentColor; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }
.display { font-family: var(--font-display); font-weight: var(--display-weight); }
.display::after { content: var(--display-end); }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: 0; background: var(--paper); color: var(--ink); padding: 0.75rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; }

/* Header */
.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; min-height: 4.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.site-brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; }
.site-logo { height: 2.75rem; width: auto; display: block; }
.site-brand-name { display: none; font-family: var(--font-display); font-weight: 700; font-size: 0.75rem; line-height: 1.2; max-width: 6rem; }
.site-brand-text { font-weight: 700; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-size: 0.9rem; font-weight: 500; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 0.6rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: currentColor; }

.site-main { display: block; }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 3rem; }
.site-footer a { color: var(--footer-ink); }
.site-footer-inner { display: flex; flex-wrap: wrap; gap: 2rem 4rem; padding-top: 3rem; padding-bottom: 2rem; }
.site-footer-brand { flex: 1 1 16rem; }
.site-footer-logo { height: 4rem; width: auto; }
.site-footer-name { font-weight: 700; font-size: 1.25rem; }
.site-footer-tagline { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.2; margin: 1.25rem 0 0; max-width: 16ch; }
.site-footer-column { flex: 0 1 11rem; }
.site-footer-column h2 { font-size: 1rem; margin: 0 0 0.6rem; }
.site-footer-column ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.9rem; }
.site-footer-column a { text-decoration: none; }
.site-footer-column a:hover { text-decoration: underline; }
.site-footer-small { font-size: 0.8rem; padding-bottom: 1.5rem; margin: 0 auto; opacity: 0.9; }

/* Pills: the designs' rounded buttons */
.pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    min-height: 2.5rem; padding: 0 1.25rem;
    border-radius: 999px; border: 1px solid var(--pill);
    background: var(--pill); color: var(--pill-ink);
    font: inherit; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    text-decoration: none; cursor: pointer;
}
.pill-small { min-height: 2.25rem; padding: 0 1rem; font-size: 0.68rem; }
.pill-outline { background: transparent; color: var(--panel-ink); border-color: currentColor; }
.pill-later { cursor: default; }
.phase-badge {
    display: inline-block; padding: 0.05rem 0.5rem;
    border: 1px dashed var(--phase); border-radius: 999px;
    color: var(--phase); background: var(--paper);
    font: 500 0.7rem/1.5 var(--mono); letter-spacing: 0;
}

/* Panels */
.page-stack { display: flex; flex-direction: column; gap: 1.25rem; padding-top: 1.5rem; padding-bottom: 1rem; }
.breadcrumbs { padding-top: 1rem; font-size: 0.875rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: flex; align-items: center; gap: 0.5rem; color: var(--ink-muted); }
.breadcrumbs li:not(:last-child)::after { content: "›"; content: "›" / ""; color: var(--ink-muted); }
.breadcrumbs a { color: var(--link); }
.breadcrumbs [aria-current="page"] { color: var(--ink); }
.breadcrumbs + .page-stack { padding-top: 0.75rem; }
.panel { background: var(--panel); color: var(--panel-ink); border-radius: var(--radius); padding: 1.75rem; }
.panel-strong { background: var(--strong); color: var(--strong-ink); }
.panel-title { font-size: 1.4rem; line-height: 1.25; margin: 0; }
.panel-intro { margin: 0.5rem 0 0; font-size: 0.9rem; max-width: 34rem; }
.panel-empty { margin: 0; }

/* Hero */
.hero { position: relative; isolation: isolate; background: var(--hero-bg); color: var(--hero-ink); }
.hero-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2rem; padding-top: 3rem; padding-bottom: 2.5rem; }
.hero-text { flex: 1 1 28rem; min-width: 0; }
.hero-title { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.1; margin: 0; }
.hero-lead { font-size: 1.3rem; margin: 1.25rem 0 0.25rem; }
.hero-copy { font-size: 0.9rem; max-width: 26rem; margin: 0; }
.hero-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.5rem; }
.hero-art { flex: 0 1 20rem; min-height: 12rem; background: none center / contain no-repeat; }

/* The dashboard switch */
.dashboard-switch { display: inline-flex; border: 1px solid currentColor; border-radius: 999px; overflow: hidden; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; }
.dashboard-switch a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 1.1rem; color: inherit; text-decoration: none; }
.dashboard-switch a[aria-current="page"] { background: var(--hero-ink); color: var(--hero-bg); }
/* The designs' notch: a ^ cut into the hero's bottom edge under the
   current dashboard. Positioned against the hero, it keeps the
   link's centre as its static position (the link centres its one
   absolutely positioned child), so it needs no measurements. */
.dashboard-switch a[aria-current="page"] { justify-content: center; }
.hero .dashboard-switch a[aria-current="page"]::before { content: ""; position: absolute; bottom: -1px; width: 2rem; height: 1rem; background: var(--page); clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* The year filter */
.year-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.year-filter select { min-height: 2.25rem; padding: 0 0.5rem; border: 1px solid var(--ink-muted); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.hero .year-filter .pill { background: var(--hero-ink); color: var(--hero-bg); border-color: var(--hero-ink); }

/* Headline figures */
.intro-row { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.intro-panel { flex: 1 1 15rem; }
.intro-panel p { font-size: 0.9rem; margin: 0.9rem 0 0; }
.intro-copy a, .about-data-copy a { color: inherit; text-decoration: underline; }
.intro-copy ul, .intro-copy ol { font-size: 0.9rem; margin: 0.9rem 0 0; padding-left: 1.25rem; }
.stats-panel { flex: 3 1 34rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 1.75rem 1.5rem; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; border-left: var(--stat-rule); padding-left: var(--stat-indent, 0); }
.stat-value { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 3.25rem); line-height: 1; font-weight: var(--stat-weight, 600); font-variant-numeric: tabular-nums; }
.stat-later .stat-value { opacity: 0.45; }
.stats-panel .stat-long .stat-value { font-size: clamp(1.6rem, 3vw, 2.6rem); min-height: clamp(1.9rem, 4vw, 3.25rem); display: flex; align-items: flex-end; }
.stat-label { font-size: 0.9rem; line-height: 1.3; }
.stat-note { font-size: 0.8rem; opacity: 0.85; }
.stat-soon { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.8; }

/* Explore panel */
.explore-panel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; }
.explore-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.home-search { flex: 1 1 22rem; max-width: 34rem; }
.home-search label { flex-basis: 100%; font-weight: 700; }
.home-search .search-box { flex: 1 1 14rem; }
.suggestions-grouped { padding: 0.25rem 0; }
.suggestions-grouped ul { list-style: none; margin: 0; padding: 0; }
.suggestions-heading { margin: 0.4rem 0 0; padding: 0 0.75rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-muted); }
.suggestions-all { margin: 0.4rem 0 0; padding: 0.35rem 0.75rem 0; border-top: 1px solid var(--rule); font-size: 0.8rem; }
.search-group { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.search-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.search-results span { font-size: 0.8rem; opacity: 0.75; margin-left: 0.4rem; }

/* Map panel */
.map-panel { padding: 0; overflow: hidden; }
.map-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; padding: 1.75rem 1.75rem 1.25rem; border-bottom: 1px solid currentColor; }
.map-tabs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.map-tabs .phase-badge { margin-left: 0.25rem; }
.map-measure[aria-pressed="false"] { background: transparent; color: var(--panel-ink); }
/* The same notch on the panel's rule: the line rises to a ^ under the
   measure shown, and moves with it as the buttons are pressed. */
.map-panel-head { position: relative; }
.map-measure[aria-pressed="true"], .map-tabs [aria-current] { justify-content: center; }
.map-measure[aria-pressed="true"]::before, .map-measure[aria-pressed="true"]::after,
.map-tabs [aria-current]::before, .map-tabs [aria-current]::after { content: ""; position: absolute; bottom: -1px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.map-measure[aria-pressed="true"]::before, .map-tabs [aria-current]::before { width: 24px; height: 12px; background: var(--panel-ink); }
.map-measure[aria-pressed="true"]::after, .map-tabs [aria-current]::after { width: 21px; height: 10.5px; background: var(--panel); }
.country-list thead th { font-size: 0.75rem; padding-bottom: 0.4rem; }
.country-list thead th::before { content: none; }
.country-list td + td { padding-left: 1rem; }
.map-panel-body { display: flex; flex-wrap: wrap; gap: 1.5rem; padding: 1.5rem 1.75rem 1.75rem; }
.country-list { border-collapse: collapse; font-size: 0.9rem; flex: 0 1 16rem; align-self: flex-start; }
.country-list th { text-align: left; font-weight: 700; padding: 0.2rem 1.25rem 0.2rem 0; }
.country-list th::before { content: "•"; margin-right: 0.5rem; }
.country-list td { text-align: right; font-variant-numeric: tabular-nums; }
.all-countries { flex-basis: 100%; font-size: 0.85rem; }
.map-notes { flex-basis: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
.map-notes .all-countries { width: 100%; }
.all-countries summary { cursor: pointer; font-weight: 700; text-decoration: underline; width: fit-content; }
.all-countries .table-scroll { max-height: 20rem; overflow-y: auto; margin-top: 0.5rem; }

.map-canvas { position: relative; flex: 1 1 28rem; min-width: 0; min-height: 20rem; cursor: grab; }
.map-zoom { position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; display: flex; flex-direction: column; gap: 0.25rem; }
.map-zoom button { width: 2rem; height: 2rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; }

/* Institution view */
.page-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; }
.inline-search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.inline-search input { min-height: 2.25rem; width: 15rem; max-width: 100%; padding: 0 0.6rem; border: 1px solid var(--ink-muted); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.search-box { position: relative; display: flex; flex: 1 1 auto; min-width: 0; }
.search-box input { flex: 1 1 auto; min-width: 0; }
.suggestions-box { position: absolute; top: 100%; left: 0; z-index: 5; width: min(26rem, 90vw); }
.suggestions-box:empty { display: none; }
.suggestions { list-style: none; margin: 0.25rem 0 0; padding: 0.4rem 0; background: var(--paper); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px; max-width: 26rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.suggestions li { padding: 0.35rem 0.75rem; display: flex; flex-direction: column; }
.suggestions a { color: var(--ink); font-weight: 600; }
.suggestions span { font-size: 0.75rem; color: var(--ink-muted); }
.suggestions-empty { margin: 0.25rem 0 0; font-size: 0.8rem; }
.stats-panel-grid { flex: 2 1 30rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 40rem) { .stats-panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.top-panel { flex: 1 1 16rem; }
.top-list { list-style: none; margin: 1rem 0 0; padding: 0; max-height: 15rem; overflow-y: auto; }
.top-list li { padding: 0.75rem 0; border-top: 1px solid currentColor; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.25rem; }
.top-list a { color: var(--strong-ink); font-weight: 700; }
.funders-panel .top-list { max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); column-gap: 2rem; margin-bottom: 1rem; }
.funders-panel .top-list a { color: inherit; }
.data-table-narrow { min-width: 32rem; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) { .page-tools { align-items: flex-start; } }

/* Geographic view */
.stats-panel-compact { flex: none; width: 100%; max-width: 40rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 40rem) { .stats-panel-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-value { overflow-wrap: anywhere; } }
.map-filters { flex: 0 1 13rem; display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.8rem; }
.map-filter { display: flex; flex-direction: column; gap: 0.25rem; }
.map-filter label { font-weight: 700; }
.map-filter select, .map-filter input { min-height: 2.25rem; padding: 0 0.5rem; border: 0; border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; }
.map-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.geography .country-list { flex-basis: 19rem; }

/* Publisher and journal views */
.page-kind { margin: 0 0 0.25rem; font-size: 0.85rem; font-weight: 700; }
.title-summary { display: flex; flex-wrap: wrap; gap: 1.25rem; padding: 1.25rem; border-radius: var(--radius); background: var(--paper-2); }
.title-image { flex: 1 1 13rem; max-width: 16rem; }
.title-image img { display: block; width: 100%; box-shadow: 10px 10px 0 var(--strong); }
.title-image-framed img { aspect-ratio: 3 / 4; object-fit: contain; background: var(--paper); }
.title-description { max-width: 46rem; margin: 0.75rem 0 0; }
.title-description p { margin: 0 0 0.6rem; }
.about-publisher { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.5rem; }
.about-publisher > div { flex: 1 1 20rem; max-width: 46rem; }
.about-publisher p { margin: 0.75rem 0 0; }
.about-publisher-logo { flex: none; max-width: 12rem; max-height: 8rem; object-fit: contain; }
.title-facts { flex: 1 1 15rem; }
.title-facts dl { margin: 1rem 0 0; display: flex; flex-direction: column; gap: 0.75rem; font-size: 0.85rem; }
.title-facts dt { font-weight: 700; }
.title-facts dd { margin: 0; }
.title-facts a { color: var(--strong-ink); }
.title-figures { flex: 1 1 13rem; display: flex; flex-direction: column; gap: 1.25rem; }

.page-subtitle { margin: 0.3rem 0 0; font-size: 1.2rem; }
.abstract { margin-top: 0.75rem; max-width: 46rem; font-size: 0.95rem; }
.abstract p { margin: 0 0 0.75rem; }
.chapters-table { margin-top: 1rem; }

/* Trend chart */
.trend-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.trend-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; }
.trend-legend li { display: flex; align-items: center; gap: 0.5rem; }
.legend-line { width: 1.25rem; border-top: 2.5px solid currentColor; }
.legend-dashed { border-top-style: dashed; border-top-width: 2px; }
.legend-dotted { border-top-style: dotted; border-top-width: 2px; }
.trend-canvas { height: 16rem; margin-top: 0.75rem; }

/* Page heads and lists */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.page-title { font-size: clamp(1.9rem, 3.5vw, 2.4rem); line-height: 1.15; margin: 0; }
.page-summary { margin: 0.4rem 0 0; font-size: 0.95rem; }
.filter-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-chip { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.4rem 0.3rem 0.9rem; border-radius: 999px; background: var(--strong); color: var(--strong-ink); font-size: 0.85rem; }
.filter-chip a { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--strong-ink); color: var(--strong); text-decoration: none; font-weight: 700; }
.table-scroll { overflow-x: auto; border-radius: 12px; }
.data-table { width: 100%; min-width: 56rem; border-collapse: collapse; font-size: 0.82rem; background: var(--paper); }
.data-table th { text-align: left; background: var(--panel); color: var(--panel-ink); padding: 0.75rem 0.9rem; font-weight: 700; }
.data-table td { padding: 0.65rem 0.9rem; vertical-align: top; }
.data-table tbody tr:nth-child(even) td { background: var(--paper-2); }
.data-table a { color: var(--ink); }
.data-table .nowrap { white-space: nowrap; }
@media (max-width: 40rem) {
    .data-table, .data-table-narrow { min-width: 0; font-size: 0.85rem; }
    .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; }
    .data-table tr { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--panel); }
    .data-table tbody tr:nth-child(even) { background: var(--paper-2); }
    .data-table tbody tr:nth-child(even) td { background: none; }
    .data-table td { display: grid; grid-template-columns: minmax(6.5rem, 38%) 1fr; gap: 0.75rem; padding: 0; text-align: left; }
    .data-table td::before { content: attr(data-label); font-weight: 700; color: var(--ink-muted); }
    .data-table td.cell-primary { order: -1; display: block; font-size: 0.95rem; font-weight: 600; }
    .data-table td.cell-primary::before { content: none; }
    .data-table td[data-empty] { display: none; }
    .data-table .numeric { text-align: left; }
    .data-table .nowrap { white-space: normal; overflow-wrap: anywhere; }
}
.list-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.round-button { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--pill); color: var(--pill-ink); }
.pagination { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; font-size: 0.9rem; }
.pagination-go { display: flex; align-items: center; gap: 0.4rem; }
.pagination-go input { width: 4.5rem; min-height: 2rem; padding: 0 0.4rem; border: 1px solid var(--ink-muted); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.pagination a { color: var(--ink); }

/* About this data */
.about-data { font-size: 0.9rem; }
.about-data summary { cursor: pointer; font-weight: 700; text-decoration: underline; width: fit-content; padding: 0.4rem 0; }
.about-data-body { max-width: 46rem; }
.about-data-body p { margin: 0.4rem 0; }
.about-table { border-collapse: collapse; margin: 0.75rem 1.5rem 0.5rem 0; display: inline-table; vertical-align: top; font-size: 0.85rem; }
.about-table caption { text-align: left; font-weight: 700; padding-bottom: 0.3rem; }
.about-table th, .about-table td { text-align: left; padding: 0.25rem 1rem 0.25rem 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
.about-table thead th { font-weight: 700; }

/* Content pages (CMS pages and boards) */
.page { max-width: 46rem; margin: 2.5rem auto 4rem; padding: 0 1.25rem; }
.preview-banner { background: #FFDE59; padding: 0.5rem 1rem; font-weight: 600; }
.page > h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 2.25rem; line-height: 1.15; margin: 0 0 1.5rem; letter-spacing: -0.01em; }

/* Prose: everything inside an editor-supplied body */
.page-body { overflow-wrap: anywhere; }
.page-body > :first-child { margin-top: 0; }
.page-body > :last-child { margin-bottom: 0; }

.page-body h2, .page-body h3, .page-body h4, .page-body h5, .page-body h6 {
    line-height: 1.25;
    margin: 2rem 0 0.75rem;
    font-weight: 700;
}
.page-body h2 { font-size: 1.6rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--rule); }
.page-body h3 { font-size: 1.3rem; }
.page-body h4 { font-size: 1.1rem; }
.page-body h5 { font-size: 1rem; }
.page-body h6 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }

.page-body p { margin: 0 0 1.1rem; }
.page-body a { color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; }
.page-body a:hover { color: var(--ink); }
.page-body abbr[title] { text-decoration: underline dotted; cursor: help; }
.page-body mark { background: #FFDE59; padding: 0 0.15em; }
.page-body small { font-size: 0.85em; color: var(--ink-muted); }
.page-body del { color: var(--ink-muted); }
.page-body ins { text-decoration: underline; }
.page-body dfn { font-style: italic; }
.page-body address { font-style: normal; margin: 0 0 1.1rem; }

.page-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.page-body ul, .page-body ol { margin: 0 0 1.1rem; padding-left: 1.5rem; }
.page-body li { margin-bottom: 0.35rem; }
.page-body li > ul, .page-body li > ol { margin: 0.35rem 0 0; }
.page-body ul { list-style: disc; }
.page-body ul ul { list-style: circle; }
.page-body ul ul ul { list-style: square; }
.page-body ol ol { list-style: lower-alpha; }

.page-body dl { margin: 0 0 1.1rem; }
.page-body dt { font-weight: 700; margin-top: 0.75rem; }
.page-body dd { margin: 0.2rem 0 0 1.5rem; color: var(--ink-muted); }

.page-body blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 4px solid var(--ink);
    color: var(--ink-muted);
    font-size: 1.05em;
}
.page-body blockquote p:last-child { margin-bottom: 0; }
.page-body blockquote blockquote { margin: 0.75rem 0 0; border-left-color: var(--rule); }
.page-body q { quotes: "\201C" "\201D" "\2018" "\2019"; }

.page-body code, .page-body kbd, .page-body samp, .page-body var {
    font-family: var(--mono);
    font-size: 0.9em;
}
.page-body code { background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 4px; }
.page-body kbd { background: var(--paper-2); border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.4em; }
.page-body pre {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--paper-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    overflow-x: auto;
    line-height: 1.5;
    font-family: var(--mono);
    font-size: 0.9rem;
}
.page-body pre code { background: none; padding: 0; font-size: inherit; }

.page-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
    display: block;
    overflow-x: auto;
}
.page-body caption { caption-side: top; text-align: left; font-weight: 600; padding: 0 0 0.5rem; color: var(--ink-muted); }
.page-body th, .page-body td { padding: 0.6rem 0.75rem; border: 1px solid var(--rule); text-align: left; vertical-align: top; }
.page-body thead th { background: var(--paper-2); border-bottom: 2px solid var(--ink); }
.page-body tbody tr:nth-child(even) td { background: #fafbfc; }
.page-body th[scope="row"] { background: var(--paper-2); font-weight: 600; }
.page-body tfoot td { background: var(--paper-2); font-weight: 600; }

.page-body img { max-width: 100%; height: auto; border-radius: 4px; }
.page-body figure { margin: 1.5rem 0; }
.page-body figcaption { margin-top: 0.5rem; font-size: 0.9rem; color: var(--ink-muted); }

.page-body details { margin: 0 0 1.1rem; padding: 0.75rem 1rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-2); }
.page-body summary { cursor: pointer; font-weight: 600; }
.page-body aside { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--paper-2); border-left: 4px solid var(--rule); }

@media (max-width: 600px) {
    body { font-size: 1rem; }
    .page > h1 { font-size: 1.8rem; }
    .site-header { padding: 0.75rem 1rem; }
    .site-nav { gap: 1rem; }
}

/* The widget configurator (#94) */
.widget-search { margin-top: 1rem; }
.widget-matches { margin: 1rem 0 0; padding-left: 1.2rem; }
.widget-matches li { margin: 0.3rem 0; }
.widget-matches [aria-current] { font-weight: 700; }
.widget-count { opacity: 0.8; font-size: 0.85rem; }
.widget-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2rem; margin-top: 1rem; }
.widget-options fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.widget-options legend { font-weight: 700; margin-bottom: 0.35rem; }
.widget-preview { margin-top: 1rem; padding: 1.25rem; max-width: 42rem; background: #ffffff; border-radius: var(--radius); }
.widget-code { display: block; width: 100%; margin: 1rem 0 0.5rem; font-family: ui-monospace, monospace; font-size: 0.8rem; padding: 0.6rem; border-radius: 6px; border: 1px solid currentColor; }
.widget-help { margin: 1rem 0 0; padding-left: 1.2rem; font-size: 0.9rem; }
.widget-help li { margin: 0.4rem 0; }
.widget-kinds { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.widget-chosen { margin: 1rem 0 0; }
.embed-link { margin: 0; font-size: 0.9rem; }
