/*! Sappar Studio — Copyright (c) 2026 Carrier Nation LLC. All rights reserved. */
/* ══════════════════════════════════════════════════════════
   Sappar Studio — Help Section Styles
   ══════════════════════════════════════════════════════════ */

/* ── Skip-to-content (a11y) ── */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 16px;
    z-index: 10000;
    padding: 8px 16px;
    background: #C8A882;
    color: #1A1A1A;
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #1A1A1A;
    --bg-deep: #141414;
    --surface: #242424;
    --surface-raised: #2E2E2E;
    --text: #F0EDE8;
    --text-secondary: #9A9590;
    --text-tertiary: #5E5A55;
    --border: #333330;
    --border-subtle: rgba(200, 168, 130, 0.08);
    --accent: #C8A882;
    --accent-hover: #D4B896;
    --accent-muted: rgba(200, 168, 130, 0.12);
    --accent-glow: rgba(200, 168, 130, 0.06);
    --font-display: 'Cormorant Garamond', 'Garamond', 'Georgia', serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-ui: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --sidebar-width: 260px;
    --content-max: 720px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    animation: pageFadeIn 0.4s ease;
}

/* ── Grain texture overlay ── */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 512px 512px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* ══════════════════════════════════════════════════════════
   Layout: Sidebar + Content
   ══════════════════════════════════════════════════════════ */

.help-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */

.help-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--bg-deep);
    border-right: 1px solid var(--border);
    padding: 40px 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.help-sidebar::-webkit-scrollbar {
    width: 4px;
}

.help-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.help-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 28px 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    text-decoration: none;
}

.sidebar-logo img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.sidebar-logo span {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    letter-spacing: 0.02em;
}

.sidebar-logo .logo-help {
    color: var(--text-tertiary);
    font-weight: 300;
    margin-left: 2px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-category {
    margin-bottom: 4px;
}

.sidebar-category-label {
    display: block;
    padding: 8px 28px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: default;
}

.sidebar-category-label.clickable {
    cursor: pointer;
    transition: color 0.3s ease;
}

.sidebar-category-label.clickable:hover {
    color: var(--accent);
}

.sidebar-category-label.active {
    color: var(--accent);
}

.sidebar-children {
    list-style: none;
    margin-bottom: 8px;
}

.sidebar-link {
    display: block;
    padding: 6px 28px 6px 44px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s ease, border-color 0.3s ease;
    border-left: 2px solid transparent;
    line-height: 1.5;
}

.sidebar-link:hover {
    color: var(--text-secondary);
}

.sidebar-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-muted);
}

/* Direct category links (single-article categories) */
.sidebar-direct-link {
    display: block;
    padding: 8px 28px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s ease, border-color 0.3s ease;
    border-left: 2px solid transparent;
    margin-bottom: 4px;
}

.sidebar-direct-link:hover {
    color: var(--accent);
}

.sidebar-direct-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

/* ── Mobile sidebar toggle ── */

.help-mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    align-items: center;
    justify-content: space-between;
}

.help-mobile-header a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.help-mobile-header img {
    width: 24px;
    height: 24px;
    border-radius: 5px;
}

.help-mobile-header span {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.help-menu-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 14px;
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-menu-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.help-menu-btn svg {
    width: 14px;
    height: 14px;
}

/* ── Main Content ── */

.help-content {
    flex: 1;
    min-width: 0;
    padding: 56px 64px 80px;
}

.help-article {
    max-width: var(--content-max);
}

/* ── Breadcrumb ── */

.help-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    font-family: var(--font-ui);
    font-size: 13px;
    letter-spacing: 0.02em;
}

.help-breadcrumb a {
    color: var(--text-tertiary);
}

.help-breadcrumb a:hover {
    color: var(--accent);
}

.help-breadcrumb .sep {
    color: var(--text-tertiary);
    opacity: 0.5;
    font-size: 10px;
}

.help-breadcrumb .current {
    color: var(--text-secondary);
}

/* ── Article Header ── */

.help-article h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 400;
    color: var(--text);
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.help-article .article-subtitle {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ── Article Body ── */

.help-article h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 26px);
    font-weight: 500;
    color: var(--text);
    margin-top: 56px;
    margin-bottom: 20px;
    line-height: 1.3;
    letter-spacing: -0.005em;
}

.help-article h3 {
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-top: 36px;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
}

.help-article p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.help-article ul,
.help-article ol {
    margin-bottom: 20px;
    padding-left: 24px;
    color: var(--text-secondary);
}

.help-article li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.help-article li::marker {
    color: var(--accent);
}

.help-article strong {
    color: var(--text);
    font-weight: 600;
}

.help-article code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    color: var(--accent);
}

.help-article pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.help-article pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Callout boxes ── */

.help-callout {
    border-left: 3px solid var(--accent);
    background: var(--accent-muted);
    border-radius: 0 8px 8px 0;
    padding: 20px 24px;
    margin: 28px 0;
}

.help-callout p {
    margin-bottom: 0;
    font-size: 16px;
}

.help-callout .callout-label {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 8px;
    display: block;
}

.help-callout.warning {
    border-left-color: #D4956A;
    background: rgba(212, 149, 106, 0.08);
}

.help-callout.warning .callout-label {
    color: #D4956A;
}

/* ── Score table ── */

.score-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-family: var(--font-ui);
    font-size: 14px;
}

.score-table th {
    text-align: left;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.score-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.score-table tr:last-child td {
    border-bottom: none;
}

.score-table .score-range {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
}

.score-tier {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.score-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.score-dot.excellent { background: #7ECE8A; }
.score-dot.good { background: #A8C97E; }
.score-dot.fair { background: #D4B86A; }
.score-dot.attention { background: #D4806A; }

/* ── Pipeline flow ── */

.pipeline-flow {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin: 24px 0;
    padding: 20px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
}

.pipeline-step {
    font-family: var(--font-ui);
    font-size: 12px;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.pipeline-arrow {
    color: var(--accent);
    opacity: 0.4;
    font-size: 14px;
    padding: 0 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .pipeline-flow {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .pipeline-arrow {
        text-align: center;
        padding: 4px 0;
        transform: rotate(90deg);
    }

    .pipeline-step {
        text-align: center;
    }
}

/* ── Images ── */

.help-article img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 24px 0;
}

/* ── Prev / Next navigation ── */

.help-prev-next {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 24px;
    margin-top: 72px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.help-prev-next a {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.3s ease, background 0.3s ease;
    min-width: 0;
    flex: 1;
    max-width: 48%;
}

.help-prev-next a:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.help-prev-next .nav-direction {
    font-family: var(--font-ui);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
}

.help-prev-next .nav-title {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.help-prev-next .next {
    text-align: right;
    margin-left: auto;
}

/* ── Help page footer ── */

.help-footer {
    margin-top: 80px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.help-footer p {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 0;
    letter-spacing: 0.02em;
}

.help-footer a {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

.help-footer a:hover {
    color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════
   Index Page — Category Cards
   ══════════════════════════════════════════════════════════ */

.help-index-intro {
    margin-bottom: 56px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border-subtle);
}

.help-index-intro h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4.5vw, 42px);
    font-weight: 400;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.help-index-intro p {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.help-category-section {
    margin-bottom: 48px;
}

.help-category-section h2 {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.help-category-list {
    list-style: none;
}

.help-category-list li {
    border-bottom: 1px solid var(--border-subtle);
}

.help-category-list a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 14px 0;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 16px;
}

.help-category-list a:hover {
    padding-left: 8px;
}

.help-category-list .article-name {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--text);
    transition: color 0.3s ease;
}

.help-category-list a:hover .article-name {
    color: var(--accent);
}

.help-category-list .article-desc {
    font-family: var(--font-ui);
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

.coming-soon-badge {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    margin-left: 12px;
    flex-shrink: 0;
}

/* ── Placeholder page ── */

.help-placeholder {
    text-align: center;
    padding: 80px 0;
}

.help-placeholder .placeholder-icon {
    font-size: 48px;
    margin-bottom: 24px;
    opacity: 0.3;
}

.help-placeholder h1 {
    margin-bottom: 16px;
}

.help-placeholder p {
    color: var(--text-tertiary);
    font-size: 17px;
}

/* ══════════════════════════════════════════════════════════
   Responsive — Mobile
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .help-mobile-header {
        display: flex;
    }

    .help-sidebar {
        display: none;
        position: fixed;
        top: 53px;
        left: 0;
        right: 0;
        width: 100%;
        height: calc(100vh - 53px);
        z-index: 99;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-top: 20px;
    }

    .help-sidebar.open {
        display: block;
    }

    .sidebar-logo {
        display: none;
    }

    .help-content {
        padding: 32px 20px 60px;
    }

    .help-article h1 {
        font-size: 26px;
    }

    .help-article .article-subtitle {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }

    .help-article h2 {
        margin-top: 40px;
    }

    .help-prev-next {
        flex-direction: column;
        gap: 12px;
    }

    .help-prev-next a {
        max-width: 100%;
    }

    .help-prev-next .next {
        text-align: left;
    }

    .help-footer {
        flex-direction: column;
        text-align: center;
    }

    .help-index-intro h1 {
        font-size: 28px;
    }

    .help-category-list .article-desc {
        display: none;
    }
}

@media (max-width: 480px) {
    .help-content {
        padding: 24px 16px 48px;
    }

    .help-breadcrumb {
        margin-bottom: 24px;
    }
}

/* ── Help search ── */
.help-search-wrap {
    margin-bottom: 32px;
}
.help-search {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 15px;
    color: #F0EDE8;
    background: #242424;
    border: 1px solid #333330;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}
.help-search:focus {
    border-color: #C8A882;
    outline: 2px solid #C8A882;
    outline-offset: 2px;
}
.help-search::placeholder {
    color: #948F8A;
}
.help-no-results {
    display: none;
    text-align: center;
    color: #948F8A;
    font-family: 'Outfit', -apple-system, sans-serif;
    font-size: 15px;
    padding: 40px 0;
}
