/* In-app user guides (/help). Loaded globally from App.razor; every rule is under .vh-layout. */

.vh-layout {
    --vh-primary: var(--mud-palette-primary, #14505c);
    --vh-text: var(--mud-palette-text-primary, #1f2a2d);
    --vh-muted: var(--mud-palette-text-secondary, #5f7f86);
    --vh-line: var(--mud-palette-lines-default, #dfe7e9);
    --vh-surface: var(--mud-palette-surface, #fff);
    --vh-soft: #f2f7f8;
    --vh-accent-soft: #e6f0f1;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 220px;
    gap: 32px;
    align-items: start;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 24px 64px;
    color: var(--vh-text);
}

.vh-layout--index {
    grid-template-columns: 260px minmax(0, 1fr);
}

.vh-layout a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Left sidebar ---------- */

.vh-sidebar {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding-right: 4px;
}

.vh-sidebar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--vh-primary) !important;
    margin: 4px 8px 14px;
}

.vh-search {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--vh-line);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 14px;
    background: var(--vh-surface);
    color: var(--vh-muted);
}

.vh-search:focus-within {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px var(--vh-accent-soft);
}

.vh-search input {
    border: 0;
    outline: 0;
    flex: 1;
    min-width: 0;
    font: inherit;
    font-size: 0.92rem;
    background: transparent;
    color: var(--vh-text);
}

.vh-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vh-nav-link {
    display: block;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.93rem;
    line-height: 1.3;
}

.vh-nav-link:hover {
    background: var(--vh-soft);
}

.vh-nav-link.is-active {
    background: var(--vh-accent-soft);
    color: var(--vh-primary);
    font-weight: 600;
}

.vh-nav-sections {
    display: flex;
    flex-direction: column;
    margin: 4px 0 8px 14px;
    padding-left: 8px;
    border-left: 2px solid var(--vh-line);
}

.vh-nav-sections a {
    padding: 4px 8px;
    font-size: 0.84rem;
    color: var(--vh-muted);
    border-radius: 6px;
}

.vh-nav-sections a:hover {
    color: var(--vh-primary);
    background: var(--vh-soft);
}

.vh-empty {
    padding: 8px 12px;
    color: var(--vh-muted);
    font-size: 0.9rem;
}

/* ---------- Main column ---------- */

.vh-main {
    min-width: 0;
}

.vh-crumbs {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--vh-muted);
    margin: 4px 0 12px;
}

.vh-crumbs a:hover {
    color: var(--vh-primary);
    text-decoration: underline;
}

.vh-article {
    background: var(--vh-surface);
    border: 1px solid var(--vh-line);
    border-radius: 16px;
    padding: 40px 48px 48px;
    max-width: 920px;
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* Guide content (generated HTML) */

.vh-article h1 {
    font-size: 2.1rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--vh-primary);
    margin: 0 0 14px;
    letter-spacing: -0.01em;
}

/* The intro paragraph right under the title reads as a lead. */
.vh-article h1 + p {
    font-size: 1.1rem;
    color: var(--vh-muted);
    margin-bottom: 28px;
}

.vh-article h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--vh-primary);
    margin: 48px 0 14px;
    padding-top: 24px;
    border-top: 1px solid var(--vh-line);
    scroll-margin-top: 84px;
}

.vh-article h3 {
    font-size: 1.12rem;
    font-weight: 650;
    margin: 30px 0 10px;
    scroll-margin-top: 84px;
}

.vh-article h4 {
    font-size: 1rem;
    font-weight: 650;
    margin: 22px 0 8px;
}

.vh-article p {
    margin: 0 0 14px;
}

.vh-article ul,
.vh-article ol {
    margin: 0 0 18px;
    padding-left: 26px;
}

.vh-article li {
    margin: 6px 0;
    padding-left: 4px;
}

.vh-article li::marker {
    color: var(--vh-primary);
    font-weight: 600;
}

.vh-article li > ul,
.vh-article li > ol {
    margin: 6px 0 6px;
}

.vh-article strong {
    font-weight: 650;
}

.vh-article a {
    color: var(--vh-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.vh-article code {
    font-size: 0.86em;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--vh-soft);
    border: 1px solid var(--vh-line);
    overflow-wrap: anywhere;
}

.vh-article hr {
    border: 0;
    border-top: 1px solid var(--vh-line);
    margin: 28px 0;
}

/* Screenshots */

.vh-article figure {
    margin: 22px 0 28px;
}

.vh-article figure a {
    display: block;
    text-decoration: none;
    cursor: zoom-in;
}

.vh-article figure img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--vh-line);
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(20, 80, 92, 0.08);
    transition: box-shadow 0.15s ease;
}

.vh-article figure a:hover img {
    box-shadow: 0 8px 30px rgba(20, 80, 92, 0.18);
}

.vh-article figcaption {
    margin-top: 10px;
    font-size: 0.86rem;
    color: var(--vh-muted);
    text-align: center;
}

/* Tables */

.vh-article table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: separate;
    border-spacing: 0;
    margin: 12px 0 24px;
    font-size: 0.92rem;
    line-height: 1.5;
    border: 1px solid var(--vh-line);
    border-radius: 12px;
}

.vh-article thead th {
    background: var(--vh-accent-soft);
    color: var(--vh-primary);
    font-weight: 650;
    text-align: left;
}

.vh-article th,
.vh-article td {
    padding: 10px 14px;
    vertical-align: top;
    border-bottom: 1px solid var(--vh-line);
    min-width: 120px;
}

.vh-article tbody tr:nth-child(even) td {
    background: #fafcfc;
}

.vh-article tbody tr:last-child td {
    border-bottom: 0;
}

/* Notes (Markdown "> ...") */

.vh-article blockquote {
    margin: 18px 0 22px;
    padding: 14px 18px;
    border-left: 4px solid var(--vh-primary);
    background: var(--vh-soft);
    border-radius: 0 10px 10px 0;
    color: var(--vh-text);
}

.vh-article blockquote p:last-child {
    margin-bottom: 0;
}

/* ---------- Index page ---------- */

.vh-hero {
    background: linear-gradient(135deg, var(--vh-accent-soft), var(--vh-surface));
    border: 1px solid var(--vh-line);
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 24px;
}

.vh-hero-eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--vh-muted);
}

.vh-hero h1 {
    margin: 6px 0 8px;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--vh-primary);
}

.vh-hero p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--vh-muted);
}

.vh-inline-icon {
    vertical-align: -4px;
}

.vh-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.vh-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 22px;
    background: var(--vh-surface);
    border: 1px solid var(--vh-line);
    border-radius: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.vh-card:hover {
    border-color: var(--vh-primary);
    box-shadow: 0 8px 24px rgba(20, 80, 92, 0.1);
    transform: translateY(-1px);
}

.vh-card-title {
    font-size: 1.12rem;
    font-weight: 650;
    color: var(--vh-primary);
}

.vh-card-summary {
    font-size: 0.92rem;
    color: var(--vh-muted);
    line-height: 1.5;
    flex: 1;
}

.vh-card-more {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vh-primary);
}

/* ---------- Right "On this page" ---------- */

.vh-toc {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 12px;
    border-left: 2px solid var(--vh-line);
}

.vh-toc-title {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--vh-muted);
    margin: 4px 0 8px;
}

.vh-toc a {
    font-size: 0.84rem;
    line-height: 1.35;
    padding: 4px 0;
    color: var(--vh-muted);
}

.vh-toc a:hover {
    color: var(--vh-primary);
}

/* ---------- Back to top ---------- */

.vh-top {
    position: fixed;
    right: 28px;
    bottom: 64px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--vh-primary);
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    z-index: 5;
    opacity: 0.9;
}

.vh-top:hover {
    opacity: 1;
}

/* ---------- Responsive ---------- */

.vh-hide-wide {
    display: none;
}

@media (max-width: 1400px) {
    .vh-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .vh-toc {
        display: none;
    }

    .vh-hide-wide {
        display: flex;
    }
}

@media (max-width: 900px) {
    .vh-layout,
    .vh-layout--index {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
        gap: 16px;
    }

    .vh-sidebar {
        position: static;
        max-height: none;
    }

    .vh-nav-sections {
        display: none;
    }

    .vh-article {
        padding: 24px 20px 32px;
    }
}

/* ---------- Search results ---------- */

.vh-results-head h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--vh-primary);
    margin: 4px 0 6px;
}

.vh-results-head p {
    color: var(--vh-muted);
    margin: 0 0 18px;
}

.vh-clear {
    margin-left: 10px;
    border: 1px solid var(--vh-line);
    background: var(--vh-surface);
    border-radius: 999px;
    padding: 2px 12px;
    font: inherit;
    font-size: 0.85rem;
    color: var(--vh-primary);
    cursor: pointer;
}

.vh-clear:hover {
    border-color: var(--vh-primary);
}

.vh-noresults {
    padding: 18px 20px;
    border: 1px dashed var(--vh-line);
    border-radius: 12px;
    color: var(--vh-muted);
}

.vh-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 920px;
}

.vh-result {
    display: block;
    padding: 16px 20px;
    background: var(--vh-surface);
    border: 1px solid var(--vh-line);
    border-radius: 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vh-result:hover {
    border-color: var(--vh-primary);
    box-shadow: 0 6px 18px rgba(20, 80, 92, 0.08);
}

.vh-result-path {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--vh-muted);
}

.vh-result-title {
    font-size: 1.08rem;
    font-weight: 650;
    color: var(--vh-primary);
    margin: 2px 0 6px;
}

.vh-result-snippet {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--vh-text);
}

.vh-layout mark {
    background: #fff1b8;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
}

/* ---------- Top-bar help button (MainLayout) ---------- */

.appbar-help-button.mud-icon-button {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    border-width: 1.5px;
}

.appbar-help-button.mud-icon-button .mud-icon-root {
    font-size: 0.95rem;
}

.appbar-help-button.mud-icon-button:hover {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}
