/*
 * PaddySpeaks — shared platform tokens and components (P1.8).
 *
 * The site's products keep their own personalities: the journal's ink-blue,
 * the sacred texts' saffron and parchment, Interview Studio's night-sky, the
 * demos' light dashboards. This file does NOT restyle any of them. It supplies
 * the fundamentals the platform components share: focus, spacing, radius,
 * type-badges, status badges, disclosure panels, empty/loading/error states,
 * and the legal footer row.
 *
 * Components inherit colour from their context (currentColor + color-mix), so
 * one "Sources & Verification" panel looks native on a parchment Gita page and
 * on the blue journal alike. Every rule is prefixed .ps- to avoid collisions.
 */

:root {
  --ps-radius-s: 4px;
  --ps-radius-m: 8px;
  --ps-radius-l: 14px;
  --ps-space-1: 4px;
  --ps-space-2: 8px;
  --ps-space-3: 12px;
  --ps-space-4: 16px;
  --ps-space-5: 24px;
  --ps-space-6: 32px;
  --ps-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ps-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ps-font-serif: "Source Serif 4", Georgia, serif;
  --ps-focus: #2563a8;
  --ps-focus-ring: 0 0 0 3px color-mix(in srgb, var(--ps-focus) 35%, transparent);
  /* Content-type hues — used only as small accents on badges. */
  --ps-type-article: #2563a8;
  --ps-type-sacred: #a0660b;
  --ps-type-verse: #a0660b;
  --ps-type-interview: #2a7a4a;
  --ps-type-question: #2a7a4a;
  --ps-type-job: #6b3fa0;
  --ps-type-company: #6b3fa0;
  --ps-type-demo: #c44b2b;
  --ps-type-page: #556677;
  /* Status hues */
  --ps-status-ok: #2a7a4a;
  --ps-status-warn: #a0660b;
  --ps-status-info: #2563a8;
  --ps-status-muted: #6b7280;
}

/* ── Focus: one visible, consistent ring for keyboard users ───────────── */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ps-focus);
  outline-offset: 2px;
}

/* ── Skip link: pages without style.css get the same look style.css gives it ── */
.ps-skip-link:not(:focus) { position: absolute; left: -9999px; }
.ps-skip-link:focus {
  position: absolute; left: 0; top: 0; z-index: 10000;
  padding: 12px 20px; background: #1a4f8a; color: #fff;
  font: 600 12px/1.2 var(--ps-font-mono); letter-spacing: .1em; text-transform: uppercase;
}

/* ── Visually hidden, still announced ─────────────────────────────────── */
.ps-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Badges ────────────────────────────────────────────────────────────── */
.ps-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font: 600 10.5px/1.6 var(--ps-font-mono); letter-spacing: .06em; text-transform: uppercase;
  /* Text is the hue darkened toward black so 10.5px labels clear 4.5:1 on the
     light backgrounds every product uses; the tint alone carries the hue. */
  color: color-mix(in srgb, var(--ps-badge, currentColor) 60%, #000);
  background: color-mix(in srgb, var(--ps-badge, currentColor) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--ps-badge, currentColor) 28%, transparent);
  white-space: nowrap;
}
.ps-badge[data-type="article"]   { --ps-badge: var(--ps-type-article); }
.ps-badge[data-type="sacred"],
.ps-badge[data-type="verse"],
.ps-badge[data-type="name"]      { --ps-badge: var(--ps-type-sacred); }
.ps-badge[data-type="interview"],
.ps-badge[data-type="question"],
.ps-badge[data-type="topic"]     { --ps-badge: var(--ps-type-interview); }
.ps-badge[data-type="job"],
.ps-badge[data-type="company"]   { --ps-badge: var(--ps-type-job); }
.ps-badge[data-type="demo"],
.ps-badge[data-type="tool"]      { --ps-badge: var(--ps-type-demo); }
.ps-badge[data-type="page"],
.ps-badge[data-type="journey"]   { --ps-badge: var(--ps-type-page); }
.ps-badge[data-type="concept"]   { --ps-badge: #7a3e8e; }
.ps-badge[data-type="music"]     { --ps-badge: var(--ps-type-sacred); }
.ps-badge[data-status="verified"],
.ps-badge[data-status="ok"]      { --ps-badge: var(--ps-status-ok); }
.ps-badge[data-status="under-review"],
.ps-badge[data-status="source-not-recorded"],
.ps-badge[data-status="open"]    { --ps-badge: var(--ps-status-warn); }
.ps-badge[data-status="source-noted"] { --ps-badge: var(--ps-status-info); }

/* ── Disclosure panel (Sources & Verification, Data flow, …) ──────────── */
.ps-panel {
  margin: var(--ps-space-6) auto; max-width: 780px;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: var(--ps-radius-m);
  background: color-mix(in srgb, currentColor 3%, transparent);
  font: 15px/1.6 var(--ps-font-serif);
  text-align: left;
}
.ps-panel > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  font: 600 13px/1.4 var(--ps-font-ui); letter-spacing: .02em;
}
.ps-panel > summary::-webkit-details-marker { display: none; }
.ps-panel > summary::before {
  content: "▸"; display: inline-block; transition: transform .15s ease; opacity: .7;
}
.ps-panel[open] > summary::before { transform: rotate(90deg); }
.ps-panel-body { padding: 0 16px 16px; }
.ps-panel-body h3 {
  margin: 16px 0 6px; font: 700 11px/1.4 var(--ps-font-mono);
  letter-spacing: .1em; text-transform: uppercase; opacity: .75;
}
.ps-panel-body p, .ps-panel-body li { margin: 4px 0; }
.ps-panel-body ul { margin: 4px 0; padding-left: 20px; }
.ps-panel-body a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ps-panel-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 6px 0; }
.ps-panel-body dt { font: 600 12px/1.6 var(--ps-font-ui); opacity: .75; }
.ps-panel-body dd { margin: 0; }
.ps-panel-note { font-size: 13px; opacity: .8; }
@media (max-width: 520px) {
  .ps-panel { margin-left: 12px; margin-right: 12px; }
  .ps-panel-body dl { grid-template-columns: 1fr; }
  .ps-panel-body dt { margin-top: 6px; }
}

/* ── Empty / loading / error states ───────────────────────────────────── */
.ps-state {
  padding: var(--ps-space-5); text-align: center;
  font: 14px/1.6 var(--ps-font-ui); opacity: .85;
}
.ps-state[data-kind="error"] { color: #b3261e; opacity: 1; }
.ps-state[data-kind="loading"]::after {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  vertical-align: -2px; animation: ps-spin .8s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* ── Legal / platform footer row (appended to existing footers) ───────── */
.ps-footer-legal {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
  margin: 14px auto 0; padding: 10px 16px 0; max-width: 900px;
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  font: 12px/1.6 var(--ps-font-ui); letter-spacing: .02em;
}
.ps-footer-legal a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.ps-footer-legal a:hover { text-decoration: underline; }
.ps-footer-legal[data-tone="light"], .ps-footer-legal[data-tone="light"] a { color: #3a4556; }
.ps-footer-legal[data-tone="dark"], .ps-footer-legal[data-tone="dark"] a { color: #e4e9f0; }
.ps-footer-min { padding: 24px 16px 32px; text-align: center; }

/* ── Buttons (platform components only) ───────────────────────────────── */
.ps-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--ps-radius-s);
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: transparent; color: inherit; cursor: pointer;
  font: 600 12.5px/1.2 var(--ps-font-ui); text-decoration: none;
}
.ps-btn:hover { background: color-mix(in srgb, currentColor 7%, transparent); }
.ps-btn[aria-pressed="true"] {
  background: color-mix(in srgb, currentColor 12%, transparent);
  border-color: currentColor;
}

/* ── Motion (WCAG 2.3.3): when the reader asks for less motion, the whole
   page gets less motion — scroll reveals, hover lifts, fade-ins, smooth
   scrolling. Loaded site-wide via ps-platform.js, so this one rule covers the
   journal, the sacred-text apps, Interview Studio and the demos alike. ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* ── Document pages (/corrections/, legal pages, changelog, subscribe) ─── */
.ps-doc { max-width: 760px; margin: 0 auto; padding: 8px 24px 72px; font: 17px/1.75 var(--ps-font-serif); }
.ps-doc h2 { font-family: "Playfair Display", Georgia, serif; font-size: 26px; line-height: 1.25; margin: 44px 0 10px; }
.ps-doc h3 { font: 700 13px/1.4 var(--ps-font-mono); letter-spacing: .08em; text-transform: uppercase; margin: 28px 0 6px; opacity: .85; }
.ps-doc p, .ps-doc li { margin: 8px 0; }
.ps-doc ul, .ps-doc ol { padding-left: 22px; }
.ps-doc a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ps-doc code { font: 13.5px var(--ps-font-mono); background: color-mix(in srgb, currentColor 7%, transparent); padding: 1px 5px; border-radius: 3px; }
.ps-doc .ps-updated { font: 12px/1.5 var(--ps-font-mono); letter-spacing: .06em; text-transform: uppercase; opacity: .7; text-align: center; margin: 0 0 8px; }
.ps-doc table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 15px; }
.ps-doc th, .ps-doc td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.ps-doc th { font: 600 12px/1.4 var(--ps-font-ui); letter-spacing: .04em; text-transform: uppercase; opacity: .8; }
.ps-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ps-callout { margin: 20px 0; padding: 14px 18px; border-left: 3px solid var(--ps-callout, #2563a8);
  background: color-mix(in srgb, var(--ps-callout, #2563a8) 6%, transparent); border-radius: 0 var(--ps-radius-s) var(--ps-radius-s) 0; }
.ps-callout[data-kind="legal-review"] { --ps-callout: #a0660b; }
.ps-callout[data-kind="warning"] { --ps-callout: #c44b2b; }
.ps-callout > strong:first-child { display: block; font: 700 11.5px/1.4 var(--ps-font-mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.ps-toc { margin: 16px 0 8px; padding: 12px 16px; border: 1px solid color-mix(in srgb, currentColor 14%, transparent); border-radius: var(--ps-radius-m); font-size: 15px; }
.ps-toc ol { margin: 4px 0; }
.ps-entry { padding: 18px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.ps-entry-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font: 12px/1.5 var(--ps-font-mono); letter-spacing: .04em; opacity: .85; }
.ps-entry h3 { font-family: "Playfair Display", Georgia, serif; font-size: 20px; letter-spacing: 0; text-transform: none; margin: 6px 0 4px; opacity: 1; }
.ps-entry p { margin: 4px 0; }
@media (max-width: 520px) { .ps-doc { padding: 4px 16px 56px; font-size: 16px; } .ps-doc h2 { font-size: 22px; } }

/* Masthead brand on platform pages: a <p>, because the page hero owns the <h1>. */
.masthead .ps-masthead-title {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: clamp(40px, 6vw, 72px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05;
  color: var(--color-ink, #1a2332); margin: 0;
}
.masthead .ps-masthead-title a { color: inherit; text-decoration: none; }
.masthead .ps-masthead-title span { font-style: italic; font-weight: 400; color: var(--color-gold-dark, #1a4f8a); }

/* Homepage "Stay in the Conversation": honest follow links (P1.6). */
.ps-follow-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin-top: 18px; }
.ps-follow-links a {
  display: inline-block; padding: 9px 16px; border: 1px solid currentColor; border-radius: var(--ps-radius-s);
  font: 600 12px/1.2 var(--ps-font-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; color: inherit;
}
.ps-follow-links a:hover { background: color-mix(in srgb, currentColor 8%, transparent); }

/* ── PaddySpeaks Search (lib/ps-search.js) ─────────────────────────────── */
html.ps-search-open { overflow: hidden; }
.ps-search--dialog[hidden] { display: none; }
.ps-search--dialog {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; background: rgba(14, 20, 30, .55);
}
.ps-search-panel {
  width: 100%; max-width: 760px; max-height: 84vh; display: flex; flex-direction: column;
  background: #fbfaf6; color: #1a2332; border-radius: var(--ps-radius-l);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35); overflow: hidden;
  font: 15px/1.5 var(--ps-font-serif);
}
.ps-search--page .ps-search-panel { max-height: none; box-shadow: none; background: transparent; color: inherit; border-radius: 0; overflow: visible; }
.ps-search-title { font-family: "Playfair Display", Georgia, serif; font-size: 22px; margin: 0 0 10px; }
.ps-search-bar, .ps-search-chips, .ps-search-status, .ps-search-foot, .ps-search-title { flex: none; }
.ps-search-results { flex: 1 1 auto; min-height: 0; }
.ps-search-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid rgba(26, 35, 50, .12); }
.ps-search--page .ps-search-bar { border: 1px solid rgba(26, 35, 50, .22); border-radius: var(--ps-radius-m); background: #fff; }
.ps-search-bar:focus-within { box-shadow: inset 0 -2px 0 var(--ps-focus); }
.ps-search--page .ps-search-bar:focus-within { box-shadow: var(--ps-focus-ring); }
.ps-search-input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: inherit;
  font: 18px/1.4 var(--ps-font-serif); padding: 4px 0;
}
.ps-search-input:focus { outline: none; }  /* the bar carries the focus indicator */
.ps-search-input::-webkit-search-cancel-button { cursor: pointer; }
.ps-search-close {
  border: 1px solid rgba(26, 35, 50, .2); background: transparent; color: inherit; border-radius: var(--ps-radius-s);
  padding: 4px 8px; font: 600 11px/1 var(--ps-font-mono); cursor: pointer;
}
.ps-search-chips { display: flex; gap: 6px; padding: 10px 18px 4px; overflow-x: auto; scrollbar-width: none; }
.ps-search--page .ps-search-chips { padding: 12px 0 4px; flex-wrap: wrap; overflow: visible; }
.ps-chip {
  flex: none; display: inline-flex; gap: 6px; align-items: center; padding: 5px 11px; border-radius: 999px;
  border: 1px solid rgba(26, 35, 50, .2); background: transparent; color: inherit; cursor: pointer;
  font: 600 12px/1.2 var(--ps-font-ui);
}
.ps-chip[aria-pressed="true"] { background: #1a2332; color: #fff; border-color: #1a2332; }
.ps-chip-count { font: 11px var(--ps-font-mono); opacity: .8; }
.ps-chip-count:empty { display: none; }
.ps-search-status { margin: 6px 18px; font: 13px/1.5 var(--ps-font-ui); color: #4a5568; }
.ps-search--page .ps-search-status { margin: 8px 0; }
.ps-search-results { list-style: none; margin: 0; padding: 4px 8px 8px; overflow-y: auto; }
.ps-search--page .ps-search-results { padding: 0; overflow: visible; }
.ps-result > a {
  display: block; padding: 10px 12px; border-radius: var(--ps-radius-m); color: inherit; text-decoration: none;
}
.ps-result[aria-selected="true"] > a, .ps-result > a:hover { background: rgba(37, 99, 168, .08); }
.ps-result[aria-selected="true"] > a { box-shadow: inset 3px 0 0 var(--ps-focus); }
.ps-result-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ps-result-title { font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 16.5px; line-height: 1.3; }
.ps-result-sub { display: block; margin-top: 2px; font: 12.5px/1.45 var(--ps-font-ui); color: #4a5568; }
.ps-result-text { display: block; margin-top: 3px; font-size: 14px; line-height: 1.5; color: #333d4b; }
.ps-result mark { background: rgba(255, 196, 0, .35); color: inherit; padding: 0 1px; border-radius: 2px; }
.ps-search-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 18px 14px; border-top: 1px solid rgba(26, 35, 50, .1); }
.ps-search--page .ps-search-foot { padding: 14px 0; }
.ps-search-foot:empty { display: none; }
.ps-search-handoff { font: 600 12.5px/1.4 var(--ps-font-ui); color: #1a4f8a; }
@media (max-width: 600px) {
  .ps-search--dialog { padding: 0; }
  .ps-search-panel { max-height: 100vh; height: 100%; border-radius: 0; }
  .ps-search-input { font-size: 17px; }
}

/* ── Homepage orientation: "What did you come here to do?" (P1.3) ─────── */
.ps-paths { max-width: 1200px; margin: 28px auto 8px; padding: 0 24px; }
.ps-paths-h {
  font-family: "Playfair Display", Georgia, serif; font-style: italic; font-weight: 400;
  font-size: clamp(22px, 2.6vw, 30px); text-align: center; margin: 0 0 18px; color: var(--color-ink, #1a2332);
}
.ps-paths-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 2px solid var(--color-ink, #1a2332); border-bottom: 1px solid var(--color-border, #d5cfc2);
}
.ps-path { padding: 16px 16px 14px; border-right: 1px solid var(--color-border, #d5cfc2); }
.ps-path:last-child { border-right: 0; }
.ps-path-main { display: block; text-decoration: none; color: inherit; }
.ps-path-label {
  display: block; font: 700 11px/1.4 var(--ps-font-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-gold-dark, #1a4f8a);
}
.ps-path-verb { display: block; margin-top: 4px; font-family: "Playfair Display", Georgia, serif; font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--color-ink, #1a2332); }
.ps-path-main:hover .ps-path-verb { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.ps-path p { margin: 8px 0 0; font: 14px/1.55 var(--ps-font-serif); color: var(--color-muted, #3a4556); }
.ps-path-links { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.ps-path-links a { display: inline-flex; align-items: center; min-height: 24px; min-width: 24px; font: 600 11.5px/1.2 var(--ps-font-mono); letter-spacing: .02em; color: var(--color-gold-dark, #1a4f8a); text-decoration: none; }
.ps-path-links a:hover { text-decoration: underline; }
.ps-paths-foot { text-align: center; margin: 12px 0 0; font: italic 15px/1.5 var(--ps-font-serif); color: var(--color-muted, #3a4556); }
.ps-paths-foot a, .ps-linklike { color: var(--color-gold-dark, #1a4f8a); }
.ps-linklike { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 1000px) {
  .ps-paths-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-path { border-bottom: 1px solid var(--color-border, #d5cfc2); }
  .ps-path:nth-child(2n) { border-right: 0; }
  .ps-path:last-child { grid-column: 1 / -1; border-bottom: 0; }
}
@media (max-width: 560px) {
  .ps-paths { padding: 0 16px; margin-top: 18px; }
  .ps-paths-grid { grid-template-columns: 1fr; }
  .ps-path { border-right: 0; padding: 14px 4px; }
  .ps-path-verb { font-size: 18px; }
}

/* ── Continue where you left off (P1.5) ──────────────────────────────── */
.ps-continue { max-width: 1200px; margin: 18px auto 0; padding: 0 24px; }
.ps-continue-inner { border: 1px solid var(--color-border, #d5cfc2); border-radius: var(--ps-radius-m); padding: 14px 18px; background: color-mix(in srgb, var(--color-cream, #efebe2) 45%, transparent); }
.ps-continue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ps-continue h2 { margin: 0; font: 700 11px/1.4 var(--ps-font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--color-gold-dark, #1a4f8a); }
.ps-continue ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.ps-continue li a { font: 15.5px/1.5 var(--ps-font-serif); color: var(--color-ink, #1a2332); }
.ps-continue li small { display: block; font: 11.5px/1.4 var(--ps-font-mono); color: var(--color-muted, #3a4556); }
.ps-continue .ps-linklike { font: 12px var(--ps-font-ui); color: var(--color-muted, #3a4556); }
@media (max-width: 560px) { .ps-continue { padding: 0 16px; } .ps-continue ul { flex-direction: column; } }

/* ── Explore further (lib/ps-related.js, P2.2) ─────────────────────────── */
.ps-related { max-width: 780px; margin: 40px auto 8px; padding: 18px 20px; border-top: 2px solid currentColor; font: 15px/1.5 var(--ps-font-serif); text-align: left; }
.ps-related-h { margin: 0 0 10px; font: 700 12px/1.4 var(--ps-font-mono); letter-spacing: .14em; text-transform: uppercase; }
.ps-related-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 4px 24px; }
.ps-related-list li { padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.ps-related-list a { display: flex; gap: 8px; align-items: baseline; color: inherit; text-decoration: none; min-height: 24px; }
.ps-related-list a:hover .ps-related-title { text-decoration: underline; text-underline-offset: 3px; }
.ps-related-title { font-weight: 600; }
.ps-related-why { display: block; margin-top: 2px; font: 12px/1.4 var(--ps-font-ui); }
.ps-related-more { margin: 12px 0 0; font: 600 13px/1.4 var(--ps-font-ui); }
.ps-related-more a { color: inherit; }
@media (max-width: 520px) { .ps-related { margin: 28px 12px 8px; padding: 14px 4px; } }

/* ── Atlas (P2.3) ──────────────────────────────────────────────────────── */
.ps-atlas-wrap { max-width: 980px; margin: 0 auto; }
.ps-atlas-panel { margin: 18px 0; padding: 18px 20px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-left: 3px solid #7a3e8e; border-radius: var(--ps-radius-m); background: color-mix(in srgb, #7a3e8e 4%, transparent); }
.ps-atlas-panel h2 { font-family: "Playfair Display", Georgia, serif; font-size: 24px; margin: 8px 0 6px; }
.ps-atlas-panel h3 { margin: 16px 0 4px; font: 700 11.5px/1.4 var(--ps-font-mono); letter-spacing: .1em; text-transform: uppercase; }
.ps-atlas-def { font-size: 16.5px; margin: 0; }
.ps-atlas-list { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2px 20px; }
.ps-atlas-list li { padding: 5px 0; }
.ps-atlas-list a { display: inline-flex; gap: 8px; align-items: baseline; color: inherit; min-height: 24px; }
.ps-atlas-list small { display: block; font: 12px/1.4 var(--ps-font-ui); color: #4a5568; margin-left: 2px; }
.ps-atlas-concepts { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.ps-atlas-concepts a { display: inline-block; padding: 6px 12px; border: 1px solid color-mix(in srgb, #7a3e8e 40%, transparent); border-radius: 999px; color: inherit; text-decoration: none; font: 600 13px/1.3 var(--ps-font-ui); }
.ps-atlas-concepts a:hover { background: color-mix(in srgb, #7a3e8e 8%, transparent); }
