/* Styles that only the public topic pages need. Tokens, header, footer, buttons, chips, page labels,
   the skip link and the theme toggle all come from /site.css (linked first). */

a { color: var(--accent); }
main.topic { line-height: 1.65; }

.crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 1.25rem; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 0.2rem; }

main.topic h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 1rem; }
main.topic h1 em { font-style: italic; color: var(--accent); }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 1.5rem; max-width: 600px; }
.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.badges .chip { white-space: normal; }
.byline { font-size: 0.88rem; color: var(--muted); margin: 0 0 1.5rem; }

.toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 2rem; font-size: 0.9rem; }
.toc ul { list-style: none; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }

/* scroll-margin keeps a jumped-to heading clear of the sticky header */
.summary h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.5rem; margin: 2rem 0 0.6rem; scroll-margin-top: 5.5rem; }
.summary p, .summary li { font-size: 1.02rem; }
.summary p { margin-bottom: 1rem; }
.summary ul, .summary ol { padding-left: 1.25rem; margin-bottom: 1rem; }
.summary li { margin-bottom: 0.5rem; }
.summary ol.sources { font-size: 0.92rem; color: var(--muted); }
.summary ol.sources li { font-size: 0.92rem; }

.cta { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin: 2.5rem 0; }
.cta h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.4rem; margin: 0 0 0.4rem; }
.cta p { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }
.cta-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cta-form input { flex: 1 1 220px; padding: 0.8rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }

.small-h { font-family: var(--font-serif); font-weight: 400; font-size: 1.3rem; margin: 0 0 0.8rem; }
.rel-grid, .topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.9rem; }
.rel-card, .topic-card { display: flex; flex-direction: column; gap: 0.35rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; text-decoration: none; color: var(--ink); transition: border-color 0.15s; }
.rel-card:hover, .topic-card:hover { border-color: var(--accent); }
.rel-cat { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.rel-title, .card-title { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.25; }
.card-snip { font-size: 0.86rem; color: var(--muted); }
.card-meta { font-size: 0.75rem; color: var(--muted); margin-top: auto; }

.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.5rem; }
.pill { padding: 0.4rem 0.95rem; background: transparent; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; font: inherit; font-size: 0.85rem; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.search-row { position: relative; margin: 0 0 1rem; }
.search-row input { width: 100%; padding: 0.8rem 2.6rem 0.8rem 1rem; font: inherit; font-size: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--ink); }
.search-row input:focus { border-color: var(--accent); }
.search-clear { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: transparent; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; }
.search-clear:hover { color: var(--accent); }
.result-count { font-size: 0.85rem; color: var(--muted); margin: -0.5rem 0 1rem; }
.no-results { padding: 1.25rem 1.5rem; border: 1px dashed var(--border); border-radius: var(--radius); margin-bottom: 1rem; }
.no-results p { margin: 0.3rem 0; }
.topic-card[hidden], .no-results[hidden] { display: none; }
