/*
 * Theme controls for the standalone public/static pages.
 * This file is intentionally not loaded by dashboard templates.
 */

html[data-theme="light"] {
    --ink: #f7f9fc;
    --surface: #ffffff;
    --surface-2: #eef3f8;
    --text: #111827;
    --muted: #4b5563;
    --border: rgba(15, 23, 42, 0.12);
    --teal: #087f70;
    --teal-dim: rgba(8, 127, 112, 0.12);
    --gold: #a16207;
    --gold-dim: rgba(161, 98, 7, 0.13);
}

html[data-theme="light"] body {
    background: var(--ink);
    color: var(--text);
}

html[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: var(--border);
}

html[data-theme="light"] .auth-input {
    background: #ffffff;
    color: var(--text);
}

html[data-theme="light"] .btn-google:hover {
    background: var(--surface-2);
}

html[data-theme="light"] .nav-links a {
    color: var(--muted);
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a[style*="color:var(--text)"],
html[data-theme="light"] .nav-links a.active {
    color: var(--text);
}

html[data-theme="light"] .btn-ghost {
    color: var(--text);
    border-color: var(--border);
}

html[data-theme="light"] .btn-ghost:hover {
    border-color: var(--muted);
}

html[data-theme="light"] .prose h3,
html[data-theme="light"] .prose strong,
html[data-theme="light"] .breadcrumb .current,
html[data-theme="light"] td.feat {
    color: var(--text);
}

html[data-theme="light"] .prose p,
html[data-theme="light"] .prose ul,
html[data-theme="light"] .icon-list li,
html[data-theme="light"] .section-head p,
html[data-theme="light"] .simple-hero p.lede {
    color: var(--muted);
}

html[data-theme="light"] .theme-toggle {
    color: var(--text);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--text);
}

.theme-toggle-label {
    opacity: 0.72;
}

.theme-toggle-label.active {
    opacity: 1;
    font-weight: 600;
}

.theme-toggle-button {
    position: relative;
    width: 42px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-2);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-button::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.theme-toggle-button[aria-checked="true"] {
    background: var(--teal-dim);
    border-color: var(--teal);
}

.theme-toggle-button[aria-checked="true"]::after {
    transform: translateX(18px);
    background: var(--teal);
}

.theme-toggle-button:focus-visible {
    outline: 3px solid rgba(8, 127, 112, 0.28);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .theme-toggle {
        margin-top: 8px;
    }

    .nav-cta .theme-toggle {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 600px) {
    .theme-toggle-label {
        display: none;
    }
}

/* Shared public navigation */
header nav .nav-links,
.site-header nav .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
}

header nav .nav-links a,
.site-header nav .nav-links a {
    white-space: nowrap;
    font-size: clamp(11px, .9vw, 12px);
}

header nav .nav-cta .btn,
.site-header nav .nav-cta .btn {
    white-space: nowrap;
}

.nav-links a.active {
    color: var(--text);
}

.nav-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: 600 13px "IBM Plex Sans", sans-serif;
    cursor: pointer;
}

.nav-menu-toggle:hover,
.nav-menu-toggle:focus-visible {
    border-color: var(--teal);
}

.nav-menu-toggle:focus-visible {
    outline: 3px solid var(--teal-dim);
    outline-offset: 2px;
}

.nav-menu-icon {
    display: grid;
    gap: 3px;
    width: 16px;
}

.nav-menu-icon span {
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

@media (max-width: 1100px) {
    nav:has(> .nav-menu-toggle) {
        position: relative;
        flex-wrap: wrap;
        row-gap: 10px;
    }

    nav:has(> .nav-menu-toggle) > .nav-cta {
        margin-left: auto;
    }

    nav > .nav-menu-toggle {
        display: inline-flex;
        flex-shrink: 0;
    }

    nav > .nav-links {
        display: none !important;
        position: absolute;
        z-index: 100;
        top: calc(100% + 6px);
        left: 12px;
        right: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
        padding: 10px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface);
        box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
    }

    nav > .nav-links.is-open {
        display: grid !important;
    }

    nav > .nav-links a {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: 12px 14px;
        border-radius: 7px;
        white-space: normal;
    }

    nav > .nav-links a:hover,
    nav > .nav-links a:focus-visible,
    nav > .nav-links a.active {
        background: var(--teal-dim);
        color: var(--text);
    }
}

@media (max-width: 480px) {
    nav > .nav-menu-toggle {
        min-height: 38px;
        padding: 7px 9px;
    }
}

/* The current-page links duplicate the primary navigation on public pages. */
.breadcrumb {
    display: none !important;
}