/* otwatch documentation – builds on /style.css (colours, fonts, buttons) */
body { background: var(--bg-dark); }

/* main site navbar (fixed) is reused; mark the active Docs entry */
.nav-links a.nav-active { color: #fff; }
.nav-links a.nav-active::after { width: 100%; }

.docs-layout {
    max-width: 78rem; margin: 0 auto; padding: 8rem 1.5rem 5rem;
    display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem;
}
.docs-nav { position: sticky; top: 7rem; align-self: start; }
.docs-nav p { font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 0.6rem; }
.docs-nav ul { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.15rem; }
.docs-nav a { display: block; padding: 0.4rem 0.7rem; border-radius: 8px; color: #cbd5e1; text-decoration: none; font-size: 0.95rem; }
.docs-nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.docs-nav a[aria-current="page"] { background: rgba(0, 240, 255, 0.1); color: var(--primary); font-weight: 600; }

.doc { min-width: 0; max-width: 52rem; }
.doc section { padding: 0; }
.doc h1 { font-family: var(--font-heading); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.1; margin: 0 0 1rem; }
.doc .lead { font-size: 1.12rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 2rem; }
.doc h2 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; margin: 3rem 0 0.75rem; scroll-margin-top: 7rem; }
.doc h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.5rem; scroll-margin-top: 7rem; }
.doc p, .doc li { line-height: 1.65; color: #cbd5e1; }
.doc p { margin: 0 0 1rem; }
.doc ul, .doc ol { padding-left: 1.3rem; display: grid; gap: 0.4rem; margin: 0 0 1.2rem; }
.doc a { color: var(--primary); }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; color: #7dd3fc; background: rgba(125, 211, 252, 0.08); padding: 0.1em 0.35em; border-radius: 4px; }
.doc pre { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--glass-border); border-radius: 12px; padding: 1rem 1.2rem; overflow-x: auto; margin: 0 0 1.2rem; }
.doc pre code { background: none; padding: 0; color: #e2e8f0; }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--glass-border); margin: 0 0 1.5rem; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--glass-border); }
.doc th { font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); background: rgba(255, 255, 255, 0.03); }
.doc tr:last-child td { border-bottom: 0; }
.doc td.id { white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #7dd3fc; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.5rem 0 2rem; }
.card { display: block; padding: 1.1rem 1.2rem; border-radius: 14px; border: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.03); text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.doc a.card { color: inherit; }
a.card:hover { border-color: rgba(0, 240, 255, 0.5); background: rgba(0, 240, 255, 0.05); }
.card strong { display: block; font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 0.3rem; color: #fff; }
.card span { color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; }

.note { border-left: 3px solid var(--primary); background: rgba(0, 240, 255, 0.05); border-radius: 0 10px 10px 0; padding: 0.9rem 1.1rem; margin: 0 0 1.5rem; }
.note p:last-child { margin-bottom: 0; }

.doc-foot { margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--glass-border); color: var(--text-muted); font-size: 0.85rem; }

@media (max-width: 860px) {
    .docs-layout { grid-template-columns: 1fr; gap: 1.5rem; }
    .docs-nav { position: static; }
    .docs-nav ul { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
}

/* diagrams (inline SVG, generated) */
.diagram { margin: 0.5rem 0 2.5rem; overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 720px; height: auto; font-family: var(--font-body, 'Inter', sans-serif); }
.diagram figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--text-muted); }
.dia-box { fill: rgba(255, 255, 255, 0.04); stroke: rgba(148, 163, 184, 0.35); stroke-width: 1.2; }
.dia-core { fill: rgba(0, 240, 255, 0.08); stroke: rgba(0, 240, 255, 0.7); }
.dia-group { fill: rgba(255, 255, 255, 0.015); stroke: rgba(148, 163, 184, 0.25); stroke-dasharray: 5 5; }
.dia-t { fill: #e2e8f0; font-size: 15px; font-weight: 600; }
.dia-s { fill: #94a3b8; font-size: 12.5px; }
.dia-g { fill: #94a3b8; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.dia-l { fill: #94a3b8; font-size: 12.5px; }
.dia-line { stroke: #64748b; stroke-width: 1.6; fill: none; }
.dia-soft { stroke-opacity: 0.45; }
.dia-head { fill: #94a3b8; }

/* external documentation links */
.ext-links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.6rem; }
.ext-links li a { display: block; padding: 0.7rem 1rem; border: 1px solid var(--glass-border); border-radius: 10px; background: rgba(255, 255, 255, 0.03); text-decoration: none; color: #e2e8f0; }
.ext-links li a::after { content: " \2197"; color: var(--primary); }
.ext-links li a:hover { border-color: rgba(0, 240, 255, 0.5); }

/* language switch in the docs header */
.docs-lang { display: flex; gap: 0.25rem; }
.docs-lang a { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.55rem; border-radius: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.docs-lang a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.docs-lang a[aria-current="true"] { color: var(--primary); background: rgba(0, 240, 255, 0.1); }
.docs-lang img { width: 16px; height: 12px; border-radius: 2px; }
@media (max-width: 1100px) { .docs-lang a { padding: 0.3rem 0.4rem; } .docs-lang img { display: none; } }
