/* Dispel Documentation Site Styles
   Brand: Purple owl + dark navy from dispel.com */

:root {
    /* Dispel brand palette */
    --dispel-navy: #1e2a3a;
    --dispel-purple: #6d5acd;
    --dispel-purple-light: #8b7bd4;
    --dispel-purple-dark: #5645a8;
    --dispel-lavender: #ece8f9;

    /* Semantic colors */
    --primary-color: var(--dispel-navy);
    --secondary-color: var(--dispel-purple);
    --accent-color: var(--dispel-purple-light);
    --text-color: #2d3748;
    --text-muted: #718096;
    --bg-color: #ffffff;
    --bg-secondary: #f8f7fc;
    --border-color: #e2e0ef;
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --error-color: #e53e3e;

    --sidebar-width: 280px;
    --header-height: 64px;
    --content-max-width: 900px;

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #151d29;
        --secondary-color: #8b7bd4;
        --accent-color: #a99de0;
        --text-color: #e2e0ef;
        --text-muted: #a0a0b8;
        --bg-color: #1a1e2e;
        --bg-secondary: #232838;
        --border-color: #3a3f52;
    }
}

/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--dispel-navy);
    color: white;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.logo:hover {
    color: white;
    text-decoration: none;
}

.logo img {
    height: 28px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.main-nav a:hover,
.main-nav a.active {
    color: white;
    text-decoration: none;
    border-bottom-color: var(--dispel-purple-light);
}

/* Search */
.search-container {
    max-width: 300px;
}

.pagefind-ui {
    --pagefind-ui-scale: 0.8;
    --pagefind-ui-primary: var(--dispel-purple);
    --pagefind-ui-text: var(--text-color);
    --pagefind-ui-background: var(--bg-color);
    --pagefind-ui-border: var(--border-color);
    --pagefind-ui-border-radius: 6px;
}

/* Main content area */
.main-content {
    display: flex;
    margin-top: var(--header-height);
    flex: 1;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 1.5rem;
}

.sidebar-nav h3 {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dispel-purple);
}

.sidebar-nav h3 a {
    color: inherit;
}

.sidebar-nav h3 a:hover {
    text-decoration: none;
    color: var(--dispel-purple-dark);
}

.sidebar-nav ul {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.sidebar-nav ul ul {
    margin: 0.25rem 0 0 0.75rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--dispel-lavender);
}

.sidebar-nav li {
    margin: 0.15rem 0;
}

.sidebar-nav li a {
    display: block;
    padding: 0.3rem 0.5rem;
    color: var(--text-color);
    font-size: 0.875rem;
    border-radius: 4px;
    transition: background 0.1s, color 0.1s;
}

.sidebar-nav li a:hover {
    background: var(--dispel-lavender);
    color: var(--dispel-purple-dark);
    text-decoration: none;
}

.sidebar-nav li.active > a,
.sidebar-nav li.current > a {
    color: var(--dispel-purple);
    font-weight: 600;
    background: var(--dispel-lavender);
}

/* Main content */
.content {
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    max-width: calc(var(--content-max-width) + var(--sidebar-width));
    width: 100%;
}

/* Home page */
.home .lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.quick-link-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.quick-link-card:hover {
    border-color: var(--dispel-purple-light);
    box-shadow: 0 2px 8px rgba(109, 90, 205, 0.08);
}

.quick-link-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.quick-link-card h2 a {
    color: var(--dispel-navy);
}

.quick-link-card p {
    color: var(--text-muted);
    margin: 0 0 1rem;
    font-size: 0.9rem;
}

.quick-link-card ul {
    margin: 0;
    padding-left: 1.25rem;
}

.recent-updates h2 {
    margin-bottom: 1rem;
}

.recent-updates ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-updates li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.recent-updates .meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Section list pages */
.section-list h1 {
    margin-bottom: 0.5rem;
}

.section-list > p,
.section-list .section-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.page-list {
    margin-top: 1.5rem;
}

.page-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.page-item:first-child {
    padding-top: 0;
}

.page-item h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.page-item h2 a {
    color: var(--text-color);
}

.page-item h2 a:hover {
    color: var(--dispel-purple);
}

.page-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-item .summary {
    margin: 0.75rem 0 0;
    color: var(--text-muted);
}

.subsections {
    margin-top: 2rem;
}

.subsections h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.subsections ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.subsections li {
    margin: 0;
}

.subsections li a {
    display: block;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.subsections li a:hover {
    border-color: var(--dispel-purple-light);
    color: var(--dispel-purple);
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(109, 90, 205, 0.1);
}

.subsections .count {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

/* Article/Memo/Policy styling */
.memo {
    max-width: var(--content-max-width);
}

.memo-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--dispel-lavender);
}

.memo-header h1 {
    margin: 0 0 1rem;
    font-size: 2rem;
    line-height: 1.25;
    color: var(--dispel-navy);
}

.memo-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.memo-meta span {
    display: block;
}

.memo-content {
    line-height: 1.75;
}

.memo-content h1,
.memo-content h2,
.memo-content h3,
.memo-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--dispel-navy);
}

.memo-content h1 { font-size: 1.75rem; }
.memo-content h2 { font-size: 1.5rem; }
.memo-content h3 { font-size: 1.25rem; }
.memo-content h4 { font-size: 1.1rem; }

.memo-content p {
    margin: 1rem 0;
}

.memo-content ul,
.memo-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.memo-content li {
    margin: 0.5rem 0;
}

.memo-content code {
    font-family: var(--font-mono);
    background: var(--dispel-lavender);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.memo-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
}

.memo-content pre code {
    background: none;
    padding: 0;
}

.memo-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--dispel-purple);
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.memo-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.memo-content th,
.memo-content td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
}

.memo-content th {
    background: var(--dispel-lavender);
    font-weight: 600;
    color: var(--dispel-navy);
}

.memo-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.memo-tags {
    margin-top: 1rem;
}

.memo-tags .tag {
    display: inline-block;
    background: var(--dispel-lavender);
    color: var(--dispel-purple-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    font-size: 0.85rem;
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding: 2rem;
    background: var(--dispel-navy);
    text-align: center;
    margin-left: var(--sidebar-width);
}

.site-footer p {
    margin: 0.5rem 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
}

.site-footer a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .content,
    .site-footer {
        margin-left: 0;
    }

    .content {
        padding: 1.5rem;
    }

    .main-nav {
        display: none;
    }
}

/* Print */
@media print {
    .site-header,
    .sidebar,
    .site-footer,
    .search-container {
        display: none !important;
    }

    .content {
        margin-left: 0;
        padding: 0;
        max-width: 100%;
    }

    .memo-content a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
