/* medical-readiness knowledge base — styles */
/* v1.0.0 — 2026-04-28 */

:root {
    --bg: #f7f8fb;
    --bg-card: #ffffff;
    --bg-card-hover: #fbfcfe;
    --border: #e3e6ee;
    --border-strong: #c8cee0;
    --text: #1a1f2c;
    --text-muted: #5a6478;
    --text-soft: #8a93a6;
    --accent: #1f4eaa;
    --accent-soft: #e8eef8;
    --accent-strong: #163b80;
    --green: #2a8c5a;
    --green-soft: #def0e6;
    --blue: #1f4eaa;
    --blue-soft: #e8eef8;
    --amber: #b56a00;
    --amber-soft: #fcefd6;
    --red: #b3261e;
    --red-soft: #fbe5e3;
    --shadow-sm: 0 1px 2px rgba(20, 30, 60, 0.04);
    --shadow-md: 0 2px 8px rgba(20, 30, 60, 0.06);
    --radius: 10px;
    --radius-sm: 6px;
    --max-width: 1200px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #11141c;
        --bg-card: #1a1e2a;
        --bg-card-hover: #1f2433;
        --border: #2a2f3e;
        --border-strong: #3a4055;
        --text: #e7eaf2;
        --text-muted: #aab2c4;
        --text-soft: #7a829a;
        --accent: #6a93e8;
        --accent-soft: #1e2742;
        --accent-strong: #8eb0f0;
        --green: #6dcc94;
        --green-soft: #1a3225;
        --blue: #6a93e8;
        --blue-soft: #1e2742;
        --amber: #e0a866;
        --amber-soft: #3a2b14;
        --red: #e88d83;
        --red-soft: #3a1f1d;
    }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* skip link */
.skip-link {
    position: absolute; top: -40px; left: 12px;
    background: var(--accent); color: #fff;
    padding: 8px 16px; border-radius: 4px;
    z-index: 100;
}
.skip-link:focus { top: 12px; }

/* header */
header.site {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
    backdrop-filter: saturate(180%) blur(10px);
}
.site-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }
.brand small { font-weight: 400; color: var(--text-muted); margin-left: 8px; }
nav.primary { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
nav.primary a {
    padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px;
    color: var(--text-muted);
}
nav.primary a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }

/* main layout */
main { max-width: var(--max-width); margin: 0 auto; padding: 32px 24px 80px; }

/* hero */
.hero {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.hero h1 {
    font-size: 36px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--text);
}
.hero p.lead {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 70ch;
    margin: 0 0 24px;
}
.hero-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-soft);
}
.hero-meta strong { color: var(--text-muted); font-weight: 600; }

/* legend */
.legend {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}
.legend h2 { font-size: 16px; margin: 0 0 12px; color: var(--text); font-weight: 600; }
.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}
.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.legend-item .marker { flex-shrink: 0; }
.legend-item .desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.legend-item .desc strong { color: var(--text); }

/* marker badge */
.marker {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
    border: 1px solid;
    line-height: 1.4;
}
.marker-green { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.marker-blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }
.marker-amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }

/* section */
section.cards {
    margin-bottom: 56px;
}
section.cards header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
section.cards header h2 {
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
    color: var(--text);
}
section.cards header p.intro {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 75ch;
    margin: 0;
}

/* card grid */
.card-grid { display: grid; gap: 16px; }

/* card */
details.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 150ms, box-shadow 150ms;
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 96px;
}
details.card[open] {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}
details.card summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-radius: var(--radius);
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary:hover { background: var(--bg-card-hover); }
details.card summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.summary-chevron {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 4px;
    color: var(--text-soft);
    transition: transform 150ms;
}
details.card[open] .summary-chevron { transform: rotate(90deg); color: var(--accent); }

.summary-body { flex: 1; min-width: 0; }
.summary-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.summary-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}
.summary-short {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* card body */
.card-body {
    padding: 0 22px 22px;
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding-top: 20px;
}
.card-body h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    font-weight: 600;
    margin: 20px 0 8px;
}
.card-body h4:first-child { margin-top: 0; }
.card-body p {
    margin: 0 0 12px;
    color: var(--text);
    line-height: 1.65;
}
.card-body p:last-child { margin-bottom: 0; }
.card-body ul {
    margin: 0 0 12px;
    padding-left: 20px;
    color: var(--text);
}
.card-body ul li { margin-bottom: 6px; line-height: 1.55; }
.card-body ul li::marker { color: var(--accent); }

/* sub-cards (children) */
.children {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}
.children-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    font-weight: 600;
    margin: 0 0 12px;
}
.children .card-grid { gap: 10px; }
.children details.card {
    background: var(--bg);
}
.children details.card summary { padding: 14px 18px; }
.children .summary-title { font-size: 15px; }
.children .summary-short { font-size: 13px; }
.children .card-body { padding: 16px 18px; padding-top: 16px; }

/* utility row above cards */
.section-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.section-tools button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 150ms, color 150ms, border-color 150ms;
}
.section-tools button:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.section-tools button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* search */
.search-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    padding: 4px 0;
}
.search-bar input::placeholder { color: var(--text-soft); }
.search-bar svg { flex-shrink: 0; color: var(--text-soft); }
.search-bar kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* hidden cards from filter */
details.card.filtered-out { display: none; }

/* footer */
footer.site {
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 32px 0;
    background: var(--bg-card);
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
}
.footer-inner p { margin: 0 0 8px; }
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--accent); }
.footer-strong { color: var(--text); font-weight: 600; }

/* warning callout */
.callout {
    background: var(--amber-soft);
    border: 1px solid var(--amber);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 24px 0 32px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}
.callout strong { color: var(--amber); }

/* anchor link */
.anchor-link {
    color: var(--text-soft);
    margin-left: 6px;
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
    transition: opacity 150ms;
}
details.card summary:hover .anchor-link { opacity: 1; }
.anchor-link:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }

/* mobile */
@media (max-width: 640px) {
    .site-inner { padding: 12px 16px; }
    .brand { font-size: 16px; }
    nav.primary { width: 100%; margin-left: 0; }
    nav.primary a { font-size: 13px; padding: 6px 10px; }
    main { padding: 20px 16px 60px; }
    .hero { padding: 24px 0 20px; }
    .hero h1 { font-size: 26px; }
    .hero p.lead { font-size: 15px; }
    section.cards { margin-bottom: 40px; }
    section.cards header h2 { font-size: 20px; }
    details.card summary { padding: 14px 16px; }
    .card-body { padding: 0 16px 18px; padding-top: 16px; }
    .summary-title { font-size: 15px; }
}

/* print */
@media print {
    header.site, .skip-link, .search-bar, .section-tools, footer.site { display: none; }
    body { background: #fff; color: #000; }
    main { max-width: 100%; padding: 0; }
    details.card { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
    details.card[open] { box-shadow: none; }
    details.card summary { background: #f5f5f5; }
    details > summary::-webkit-details-marker { display: revert; }
    details:not([open]) > * { display: none; }
    details > summary { list-style: revert; }
    details:not([open]) > summary { display: revert; }
    .card-body { display: revert; }
}
