/* ClassMata docs — built entirely from tokens.css (--brand-primary, --brand-secondary,
   --neutral-*, --font-heading, --font-body, --radius, --shadow). No new palette. */

/* ---------- Search box (shared by hub + article) ---------- */
.docs-search {
    position: relative;
    max-width: 560px;
}
.docs-hub-search {
    display: flex;
    justify-content: center;
    margin-top: 1.75rem;
}
.docs-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-500);
    pointer-events: none;
}
.docs-search-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
}
.docs-search-input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(0, 77, 150, 0.12);
}
.docs-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.4rem);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 360px;
    overflow-y: auto;
    z-index: 20;
    text-align: left;
}
.docs-search-hit {
    display: block;
    padding: 0.65rem 1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--neutral-200);
}
.docs-search-hit:last-child { border-bottom: none; }
.docs-search-hit:hover,
.docs-search-hit:focus { background: var(--neutral-50); }
.docs-search-hit-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--brand-primary);
}
.docs-search-hit-snippet {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.15rem;
}
.docs-search-empty {
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: var(--muted);
}

/* ---------- Hub ---------- */
.docs-category-heading {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--neutral-900);
    margin: 0 0 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--neutral-200);
}
a.docs-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
a.docs-card p {
    color: var(--muted);
    font-size: 0.92rem;
    margin: 0;
}

/* ---------- Article shell: sidebar / prose / on-this-page ---------- */
.docs-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 220px;
    gap: 2.5rem;
    padding: 2.5rem 1rem 5rem;
    align-items: start;
}

.docs-sidebar {
    position: sticky;
    top: 1.5rem;
    align-self: start;
}
.docs-sidebar-cat {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neutral-500);
    margin: 1.5rem 0 0.5rem;
}
.docs-sidebar-cat:first-of-type { margin-top: 1.5rem; }
.docs-sidebar-list {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
}
.docs-sidebar-list a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.6rem;
    margin: 0 -0.6rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--neutral-700);
    font-size: 0.9rem;
}
.docs-sidebar-list a:hover { background: var(--neutral-50); color: var(--brand-primary); }
.docs-sidebar-list a.active {
    background: rgba(0, 77, 150, 0.08);
    color: var(--brand-primary);
    font-weight: 600;
}
.docs-sidebar-list a i { color: var(--brand-primary); font-size: 0.95rem; }

.docs-back {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary);
    text-decoration: none;
    margin-bottom: 1.25rem;
}
.docs-back:hover { text-decoration: underline; }

/* ---------- Rendered Markdown prose ---------- */
.docs-prose {
    min-width: 0;
    font-family: var(--font-body);
    color: var(--text);
    line-height: 1.7;
    max-width: 72ch;
}
.docs-prose h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1rem;
}
.docs-prose h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    scroll-margin-top: 1.5rem;
}
.docs-prose h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.75rem 0 0.75rem;
    scroll-margin-top: 1.5rem;
}
.docs-prose p { margin: 0 0 1rem; }
.docs-prose ul, .docs-prose ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }
.docs-prose li { margin-bottom: 0.35rem; }
.docs-prose strong { color: var(--neutral-900); }
.docs-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: 4px;
    padding: 0.1em 0.35em;
}
.docs-prose img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 0.5rem 0 1.5rem;
}

/* ---------- On-this-page rail ---------- */
.docs-toc {
    position: sticky;
    top: 1.5rem;
    align-self: start;
    font-size: 0.85rem;
}
.docs-toc-label {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neutral-500);
    margin: 0 0 0.6rem;
}
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc li { margin-bottom: 0.5rem; }
.docs-toc a {
    color: var(--neutral-700);
    text-decoration: none;
}
.docs-toc a:hover { color: var(--brand-primary); }
.docs-toc .toc-level-3 { padding-left: 0.9rem; }

@media (max-width: 992px) {
    .docs-shell { grid-template-columns: 220px minmax(0, 1fr); }
    .docs-toc { display: none; }
}

@media (max-width: 768px) {
    .docs-shell { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem 1rem 3rem; }
    .docs-sidebar { position: static; }
}

/* ---------- Lightbox (documentation screenshots) ---------- */
.docs-prose img.docs-zoomable {
    cursor: zoom-in;
    transition: box-shadow .15s ease, transform .15s ease;
}
.docs-prose img.docs-zoomable:hover,
.docs-prose img.docs-zoomable:focus-visible {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
}
.docs-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 18, 32, .88);
    cursor: zoom-out;
}
.docs-lightbox.open { display: flex; }
body.docs-lightbox-lock { overflow: hidden; }
.docs-lightbox-figure {
    margin: 0;
    max-width: 94vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.docs-lightbox-figure img {
    max-width: 94vw;
    max-height: calc(94vh - 2.4rem);
    width: auto;
    height: auto;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.docs-lightbox-figure figcaption {
    color: #e5e9f0;
    font-size: .9rem;
    margin-top: .6rem;
    text-align: center;
}
.docs-lightbox-btn {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.docs-lightbox-btn:hover, .docs-lightbox-btn:focus-visible { background: rgba(255, 255, 255, .3); }
.docs-lightbox-close { top: 1rem; right: 1rem; }
.docs-lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.docs-lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.docs-lightbox-btn[hidden] { display: none; }
.docs-lightbox.single .docs-lightbox-prev,
.docs-lightbox.single .docs-lightbox-next { display: none; }
@media (max-width: 600px) {
    .docs-lightbox-prev, .docs-lightbox-next { top: auto; bottom: 1rem; transform: none; }
}

/* ---- Video tutorial (facade: poster first, player only after a click) ---- */
.doc-video { margin: 1.25rem 0 1.75rem; }
.doc-video-frame {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: #0a2540;
    box-shadow: 0 6px 22px rgba(10, 37, 64, .22);
}
.doc-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.doc-video-play {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.doc-video-play img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .2s; }
.doc-video-play:hover img, .doc-video-play:focus-visible img { filter: brightness(.82); }
.doc-video-play:focus-visible { outline: 3px solid var(--brand-secondary, #ffb900); outline-offset: -3px; }
.doc-video-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 4.6rem;
    height: 4.6rem;
    margin: -2.3rem 0 0 -2.3rem;
    border-radius: 50%;
    background: var(--brand-secondary, #ffb900);
    color: var(--brand-primary, #004d96);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
    transition: transform .15s;
}
.doc-video-btn svg { margin-left: 4px; }
.doc-video-play:hover .doc-video-btn, .doc-video-play:focus-visible .doc-video-btn { transform: scale(1.08); }
.doc-video-badge {
    position: absolute;
    left: .75rem;
    bottom: .75rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    background: rgba(8, 24, 48, .85);
    color: #fff;
    font-size: .85rem;
}
.doc-video figcaption { margin-top: .6rem; font-size: .95rem; }
.doc-video-transcript { margin-top: .6rem; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 8px; padding: .5rem .9rem; }
.doc-video-transcript summary { cursor: pointer; font-weight: 600; }
.doc-video-transcript ol { list-style: none; padding: 0; margin: .6rem 0; }
.doc-video-transcript li { margin-bottom: .35rem; }
.doc-video-transcript time { display: inline-block; min-width: 3rem; font-variant-numeric: tabular-nums; font-weight: 600; }
