/* Margin Master Handbook reader (Components/Public/Documents.razor) */
:root { --rs-brand: #2d6e3f; }

/* Rendered page body */
.doc-content h1 { font-size: 1.75rem; font-weight: 700; margin-top: 0; }
.doc-content h2 { font-size: 1.4rem; font-weight: 600; margin-top: 2rem; padding-bottom: 0.3rem; border-bottom: 1px solid #e9ecef; }
.doc-content h3 { font-size: 1.15rem; font-weight: 600; margin-top: 1.5rem; }
.doc-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.doc-content th, .doc-content td { border: 1px solid #dee2e6; padding: 0.5rem 0.75rem; }
.doc-content th { background-color: #f8f9fa; font-weight: 600; }
.doc-content code { background-color: #f8f9fa; padding: 0.2em 0.4em; border-radius: 3px; font-size: 0.875em; }
.doc-content pre { background-color: #f8f9fa; padding: 1rem; border-radius: 6px; overflow-x: auto; }
.doc-content pre code { background: none; padding: 0; }
.doc-content blockquote { border-left: 4px solid var(--rs-brand); padding: 0.5rem 1rem; margin: 1rem 0; background: #f8f9fa; }
.doc-content ul, .doc-content ol { padding-left: 1.5rem; }
.doc-content li { margin-bottom: 0.25rem; }
.doc-content img { max-width: 100%; height: auto; border: 1px solid #dee2e6; border-radius: 4px; }
/* Markdown attribute classes for doc screenshots: ![alt](x.png){.right width=320} */
.doc-content img.right { float: right; margin: 0 0 1rem 1.25rem; max-width: 48%; }
.doc-content img.left { float: left; margin: 0 1.25rem 1rem 0; max-width: 48%; }
.doc-content img.plain { border: none; border-radius: 0; }
.doc-content h2, .doc-content h3, .doc-content hr { clear: both; }
.doc-toc a:hover { color: var(--rs-brand) !important; }

/* Contents (cover page and reader sidebar) */
.doc-handbook-list { padding-left: 1.25rem; }
.doc-handbook-list li { margin-bottom: .35rem; }
.doc-handbook-list a { color: inherit; font-weight: 500; }
.doc-handbook-list a:hover { color: var(--rs-brand); }
.doc-pager .card:hover { box-shadow: 0 .25rem .75rem rgba(0,0,0,.1) !important; }

.doc-tree { font-size: .875rem; }
.doc-tree-part { font-weight: 700; margin: .75rem 0 .25rem; color: #343a40; }
.doc-tree-part:first-child { margin-top: 0; }
.doc-tree-chapter {
    display: flex; align-items: center; width: 100%;
    background: none; border: 0; padding: .2rem 0; text-align: left;
    color: #495057; font-weight: 600; cursor: pointer;
}
.doc-tree-chapter:hover { color: var(--rs-brand); }
.doc-tree-chapter .chev { width: 1rem; font-size: .7rem; color: #adb5bd; transition: transform .15s ease; }
.doc-tree-chapter[aria-expanded="true"] .chev { transform: rotate(90deg); }
.doc-tree-chapter.current { color: var(--rs-brand); }
.doc-tree-pages { list-style: none; margin: 0 0 .25rem 1rem; padding: 0; border-left: 2px solid #e9ecef; }
.doc-tree-pages li a {
    display: block; padding: .15rem .5rem; color: #495057; text-decoration: none;
    border-left: 2px solid transparent; margin-left: -2px;
}
.doc-tree-pages li a:hover { color: var(--rs-brand); }
.doc-tree-pages li a.active { color: var(--rs-brand); font-weight: 600; border-left-color: var(--rs-brand); background: #f0faf3; }
.doc-tree-scroll { max-height: calc(100vh - 220px); overflow-y: auto; }

/* Section headings scroll clear of the sticky site header; sidebar anchors get scroll-spy state. */
.doc-cat-heading { scroll-margin-top: 90px; }
.doc-cat-link { display: flex; align-items: center; }

/* Search-this-page highlights */
mark.doc-hit { background-color: #fff176; color: inherit; padding: 0 0.1em; border-radius: 2px; }
mark.doc-hit-current { background-color: #ffd54f; outline: 2px solid #f9a825; }

/* Support-only region card — visible only to support/admin users */
.support-region {
    background-color: #f8f9fa; border: 1px solid #dee2e6; border-radius: 0.5rem;
    padding: 1.25rem 1.5rem 1rem; margin: 1.5rem 0; position: relative;
}
.support-region-label {
    display: inline-block; background-color: #6c757d; color: #fff; font-size: 0.75rem; font-weight: 600;
    padding: 0.2rem 0.6rem; border-radius: 0.25rem; margin-bottom: 0.75rem; letter-spacing: 0.03em;
}
.support-region-label i { margin-right: 0.3rem; }

/* Copy-to-clipboard button on rendered code blocks (wired up by js/docs-copy.js) */
.doc-code-wrap { position: relative; }
.doc-code-wrap > pre { margin-bottom: 1rem; }
.doc-copy-btn {
    position: absolute; top: 0.4rem; right: 0.4rem; background-color: #fff; border: 1px solid #ced4da;
    border-radius: 0.25rem; color: #495057; font-size: 0.75rem; line-height: 1; padding: 0.3rem 0.55rem;
    cursor: pointer; opacity: 0; transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.doc-code-wrap:hover .doc-copy-btn, .doc-copy-btn:focus { opacity: 1; }
.doc-copy-btn:hover { background-color: var(--rs-brand); border-color: var(--rs-brand); color: #fff; }
.doc-copy-btn.copied { background-color: var(--rs-brand); border-color: var(--rs-brand); color: #fff; opacity: 1; }
.doc-copy-btn i { margin-right: 0.25rem; }
@media (hover: none) { .doc-copy-btn { opacity: 1; } }
