﻿/* Root and base */

:root {
    --moo-site-header-height: 72px;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
    scrollbar-gutter: stable;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Shared site layout */

.moo-site-shell,
.moo-docs-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Shared header */

.moo-site-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    background-color: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.moo-header-nav-link {
    font-size: 1rem;
    line-height: 1.2;
    color: #212529;
    text-decoration: none;
}

    .moo-header-nav-link:hover {
        text-decoration: underline;
    }

    .moo-header-nav-link.is-active {
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 0.18em;
    }

.moo-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1;
    font-weight: 600;
    color: #374151;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
}

.moo-site-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.moo-site-header-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 767.98px) {
    .moo-site-header-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .moo-site-header-links {
        width: 100%;
        justify-content: flex-start;
        gap: 0.8rem;
    }

    .moo-header-nav-link {
        font-size: 0.95rem;
    }
}

/* Shared footer */

.moo-footer-meta {
    font-size: 0.8rem;
    color: #6b7280;
    text-align: center;
}

/* Docs layout */

@media (min-width: 768px) {
    .docs-sidebar {
        position: sticky;
        top: calc(var(--moo-site-header-height) + 1rem);
        align-self: start;
        max-height: calc(100vh - var(--moo-site-header-height) - 1rem);
        overflow-y: auto;
    }
}

.docs-main-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.docs-content {
    max-width: 960px;
}

.moo-docs-sidebar {
    padding-right: 1.25rem;
}

.moo-docs-content {
    margin-left: 0.5rem;
}

/* Docs navigation */

.docs-sidebar details summary {
    list-style: none;
    cursor: pointer;
}

    .docs-sidebar details summary::-webkit-details-marker {
        display: none;
    }

.docs-sidebar details[open] summary {
    color: var(--bs-primary);
}

.moo-doc-nav-items {
    padding-left: 0.75rem;
    margin-left: 0.25rem;
    border-left: 1px solid #adb5bd;
}

    .moo-doc-nav-items a {
        font-size: 0.95rem;
    }

        .moo-doc-nav-items a:hover {
            text-decoration: none;
        }

        .moo-doc-nav-items a.fw-semibold.text-primary {
            display: block;
            margin-left: -0.5rem;
            padding-left: 0.5rem;
            border-radius: 0.375rem;
            background-color: rgba(13, 110, 253, 0.08);
        }

.sidebar-group-toggle {
    position: relative;
    width: 100%;
    padding-right: 1rem;
    font-size: inherit;
    color: inherit;
}

    .sidebar-group-toggle:hover,
    .sidebar-group-toggle:focus {
        text-decoration: none;
    }

    .sidebar-group-toggle::after {
        content: "▸";
        position: absolute;
        right: 0;
        top: 0;
        transition: transform 180ms ease;
    }

    .sidebar-group-toggle[aria-expanded="true"]::after {
        transform: rotate(90deg);
    }

.sidebar-group-panel {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 180ms ease;
}

    .sidebar-group-panel > nav {
        min-height: 0;
    }

    .sidebar-group-panel.is-expanded {
        grid-template-rows: 1fr;
    }

/* Docs page header and breadcrumb */

.moo-doc-page-header {
    padding-top: 0;
    padding-bottom: 0.5rem;
}

.moo-doc-breadcrumb {
    margin-bottom: 0.75rem;
}

/* Markdown content */

.moo-doc-markdown h1,
.moo-doc-markdown h2,
.moo-doc-markdown h3,
.moo-doc-markdown h4,
.moo-doc-markdown h5,
.moo-doc-markdown h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
}

.moo-doc-markdown h1 {
    font-size: 2rem;
}

.moo-doc-markdown h2 {
    font-size: 1.5rem;
}

.moo-doc-markdown h3 {
    font-size: 1.25rem;
}

.moo-doc-markdown p,
.moo-doc-markdown ul,
.moo-doc-markdown ol,
.moo-doc-markdown blockquote,
.moo-doc-markdown table {
    margin-bottom: 1rem;
}

.moo-doc-markdown ul,
.moo-doc-markdown ol {
    padding-left: 1.5rem;
}

.moo-doc-markdown a {
    text-decoration: none;
}

    .moo-doc-markdown a:hover {
        text-decoration: underline;
    }

.moo-heading-anchor {
    margin-left: 0.5rem;
    font-size: 0.9em;
    color: #6c757d;
    opacity: 0;
    transition: opacity 180ms ease;
}

    .moo-doc-markdown h2:hover .moo-heading-anchor,
    .moo-doc-markdown h3:hover .moo-heading-anchor,
    .moo-doc-markdown h4:hover .moo-heading-anchor,
    .moo-doc-markdown h5:hover .moo-heading-anchor,
    .moo-doc-markdown h6:hover .moo-heading-anchor,
    .moo-heading-anchor:focus {
        opacity: 1;
    }

    .moo-heading-anchor:hover {
        text-decoration: none;
    }

/* Code blocks */

.moo-code-block {
    position: relative;
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f5f5f5;
    border: 1px solid #d6d6d6;
    border-radius: 0.75rem;
    overflow: hidden;
    overflow-x: auto;
}

    .moo-code-block pre {
        margin: 0;
        padding-top: 0.7rem;
        background: transparent;
        color: #1f1f1f;
        font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
        font-size: 0.95rem;
    }

    .moo-code-block code {
        background: none;
        padding: 0;
        border-radius: 0;
        font-family: inherit;
        font-size: inherit;
        color: inherit;
    }

.moo-code-block-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 2.35rem;
    margin-bottom: 0.5rem;
    padding: 0 0.875rem;
    background-color: #f8fafc;
}

.moo-code-language {
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
    letter-spacing: 0.01em;
}

.moo-code-copy-button {
    border: 1px solid #d7dde5;
    background-color: #ffffff;
    color: #4b5563;
    border-radius: 0.5rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.85rem;
    line-height: 1;
    margin: 0;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

    .moo-code-copy-button:hover {
        background-color: #f8f9fa;
        border-color: #adb5bd;
    }

    .moo-code-copy-button:focus-visible {
        outline: 2px solid #cfe2ff;
        outline-offset: 2px;
    }

    .moo-code-copy-button.is-copied {
        background-color: #f3f8ff;
        border-color: #c7dbf7;
        color: #2f5f9f;
    }

    .moo-code-copy-button.is-error {
        background-color: #fff5f5;
        border-color: #f1c0c0;
        color: #a04444;
    }

/* Docs search */

.moo-docs-search {
    max-width: 56rem;
}

.moo-docs-search-meta {
    margin: 0 0 1rem 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.moo-docs-search-results {
    list-style: none;
    padding: 0;
    margin: 0;
}

.moo-docs-search-result-item {
    padding: 0.9rem 0;
    border-top: 1px solid #eef2f7;
}

    .moo-docs-search-result-item:first-child {
        border-top: 0;
    }

.moo-docs-search-result-link {
    display: block;
    padding: 0.9rem 0;
    text-decoration: none;
}

.moo-docs-search-result-title {
    font-weight: 600;
    color: #111827;
}

.moo-docs-search-result-link:hover .moo-docs-search-result-title {
    text-decoration: underline;
}

.moo-docs-search-snippet {
    margin-top: 0.35rem;
    color: #4b5563;
    line-height: 1.55;
}

    .moo-docs-search-snippet mark {
        background-color: #fff3bf;
        color: inherit;
        padding: 0 0.12rem;
        border-radius: 0.2rem;
    }

.moo-docs-sidebar-search-form {
    margin-bottom: 1rem;
}

.moo-docs-sidebar-search-input {
    width: 100%;
    padding: 0.7rem 0.85rem 0.7rem 2.2rem;
    border: 1px solid #d7dde5;
    border-radius: 0.65rem;
    background-color: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.2;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'><path fill-rule='evenodd' d='M12.9 14.32a8 8 0 111.414-1.414l4.387 4.387a1 1 0 01-1.414 1.414l-4.387-4.387zM14 8a6 6 0 11-12 0 6 6 0 0112 0z' clip-rule='evenodd'/></svg>");
    background-repeat: no-repeat;
    background-position: 0.7rem center;
    background-size: 1rem;
}

    .moo-docs-sidebar-search-input::placeholder {
        color: #6b7280;
    }

    .moo-docs-sidebar-search-input:focus {
        outline: none;
        border-color: #b8c7db;
        box-shadow: 0 0 0 3px rgba(184, 199, 219, 0.22);
    }

.moo-docs-sidebar-search-active {
    margin: 0 0 0.75rem 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    line-height: 1.4;
}

/* Docs previous / next */

.moo-doc-prev-next-link {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    color: inherit;
    background-color: #fff;
    transition: background-color 180ms ease, border-color 180ms ease;
}

    .moo-doc-prev-next-link:hover {
        background-color: #f8f9fa;
        border-color: #adb5bd;
        text-decoration: none;
    }

.moo-doc-prev-next-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.moo-doc-prev-next-title {
    font-weight: 600;
    color: #212529;
}

/* Home page */

.moo-home-hero {
    margin: -1.5rem -1.5rem 2rem -1.5rem;
}

    .moo-home-hero img {
        width: 100%;
        height: auto;
        display: block;
    }

.moo-home-intro {
    padding-top: 0.5rem;
    padding-bottom: 3rem;
}

.moo-home-note {
    margin: 1rem 0 1.5rem 0;
    color: #4b5563;
    font-weight: 500;
}

.moo-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (max-width: 767.98px) {
    .moo-home-actions {
        flex-direction: column;
        align-items: stretch;
    }

        .moo-home-actions .btn {
            width: 100%;
        }
}

/* Author page */

.moo-author-page {
    padding-top: 0.5rem;
}

.moo-author-content {
    line-height: 1.7;
    color: #212529;
}

.moo-author-photo-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid #d7dde5;
    border-radius: 1rem;
    overflow: hidden;
    background-color: #f8fafc;
}

.moo-author-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.moo-author-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.moo-author-emphasis {
    margin-top: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid #d7dde5;
    font-weight: 500;
    line-height: 1.7;
}

.moo-author-contact {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #eef2f7;
}

    .moo-author-contact h2 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }

.moo-author-contact-list {
    margin: 0;
    padding-left: 1.25rem;
}

    .moo-author-contact-list li {
        margin-bottom: 0.5rem;
    }

.moo-author-contact-note {
    margin-top: 1rem;
    color: #4b5563;
}

/* Changelog page */

.moo-changelog {
    margin-top: 1.5rem;
}

.moo-changelog-entry {
    margin-bottom: 2rem;
}

.moo-changelog-version {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
}

.moo-changelog-date {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.moo-changelog-list {
    margin: 0;
    padding-left: 1.25rem;
}

    .moo-changelog-list li {
        margin-bottom: 0.4rem;
    }

/* Licensing page */

.moo-licensing-page {
    width: 100%;
}

.moo-licensing-text {
    padding: 1.25rem;
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    white-space: pre-line;
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #1f2937;
}
