/* SwiftMiner Help Center - Apple Support (KBASE) Style Sheet */

:root {
    color-scheme: light;
    --page: #f5f5f7;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-solid: #ffffff;
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --line: rgba(29, 29, 31, 0.12);
    --blue: #0071e3;
    --blue-hover: #0077ed;
    --blue-soft: #e8f2ff;
    --green-soft: #eaf7ee;
    --orange-soft: #fff4e4;
    --red-soft: #fff0f0;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --page: #0b1020;
        --surface: rgba(19, 25, 43, 0.86);
        --surface-solid: #12192a;
        --ink: rgba(255, 255, 255, 0.94);
        --muted: rgba(226, 232, 240, 0.68);
        --line: rgba(255, 255, 255, 0.12);
        --blue-soft: rgba(88, 101, 242, 0.18);
        --green-soft: rgba(83, 209, 140, 0.14);
        --orange-soft: rgba(255, 180, 80, 0.14);
        --red-soft: rgba(255, 120, 120, 0.14);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
    body {
        background: radial-gradient(circle at 20% 0%, rgba(88, 101, 242, 0.16), transparent 34%), var(--page);
    }
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

/* Nav Styling */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 245, 247, 0.76);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
}

@media (prefers-color-scheme: dark) {
    .nav {
        background: rgba(11, 16, 32, 0.78);
    }
}

.nav-inner {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand,
.nav-link,
.breadcrumbs a,
.toc-link,
.card-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
}

.brand img {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-link:hover {
    color: var(--blue);
}

/* Breadcrumbs */
.breadcrumbs {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 550;
}

.breadcrumbs a:hover {
    color: var(--blue);
}

.breadcrumbs .sep {
    margin: 0 0.4rem;
    opacity: 0.5;
}

.breadcrumbs .current {
    color: var(--ink);
}

/* Article Hero & Headers */
h1, h2, h3, h4 {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    letter-spacing: -0.015em;
    font-weight: 700;
    margin-top: 0;
}

h1 {
    font-size: clamp(2.1rem, 5.5vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 0.8rem;
    font-weight: 800;
}

.article-header {
    padding: 2.25rem 0 1.5rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 2rem;
}

.article-intro {
    font-size: 1.25rem;
    line-height: 1.45;
    color: var(--muted);
    max-width: 760px;
    margin: 0;
}

/* Responsive KBASE Article Layout */
.kb-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 3.5rem;
    align-items: start;
    margin-bottom: 5rem;
}

.kb-content {
    font-size: 1.05rem;
    line-height: 1.6;
}

.kb-content p {
    margin: 0.8rem 0 1.5rem;
}

.kb-content h2 {
    font-size: 1.65rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.4rem;
    margin-top: 2.8rem;
    margin-bottom: 1rem;
}

.kb-content h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.6rem;
}

/* Styled Lists */
.kb-content ul,
.kb-content ol {
    margin: 1rem 0 1.5rem;
    padding-left: 1.5rem;
}

.kb-content li {
    margin-bottom: 0.5rem;
}

.kb-content li p {
    margin: 0;
}

/* Steps List styling (Apple style) */
.steps-list {
    list-style: none;
    padding-left: 0;
    counter-reset: step-counter;
}

.steps-list > li {
    position: relative;
    padding-left: 2.8rem;
    margin-bottom: 1.8rem;
}

.steps-list > li::before {
    content: counter(step-counter);
    counter-increment: step-counter;
    position: absolute;
    top: 2px;
    left: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 700;
}

/* Callouts */
.callout {
    margin: 1.8rem 0;
    padding: 1.2rem 1.4rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
}

.callout.info {
    border-left: 4px solid var(--blue);
    background: var(--blue-soft);
}

.callout.warning {
    border-left: 4px solid #f59e0b;
    background: var(--orange-soft);
}

.callout strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ink);
}

.callout p {
    margin: 0;
    font-size: 0.98rem;
    color: var(--muted);
}

/* Code and keyboard shortcuts */
code, kbd {
    border-radius: 6px;
    background: rgba(29, 29, 31, 0.08);
    padding: 0.15rem 0.35rem;
    font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.88em;
}

kbd {
    border: 1px solid var(--line);
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    background: var(--surface-solid);
}

@media (prefers-color-scheme: dark) {
    code {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Tables */
.kb-table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0 2rem;
    border: 1px solid var(--line);
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th, td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--line);
}

th {
    background: rgba(29, 29, 31, 0.03);
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    th {
        background: rgba(255, 255, 255, 0.03);
    }
}

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

/* Screenshot Wrapper */
.screenshot-wrap {
    margin: 2rem 0;
    text-align: center;
}

.screenshot-wrap picture,
.screenshot-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--line);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.06);
}

.light-only {
    display: inline-block;
}
.dark-only {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .light-only {
        display: none !important;
    }
    .dark-only {
        display: inline-block !important;
    }
}

.screenshot-caption {
    font-size: 0.88rem;
    color: var(--muted);
    margin-top: 0.6rem;
}

/* Sidebar */
.kb-sidebar {
    position: sticky;
    top: 80px;
    padding-left: 1rem;
    border-left: 1px solid var(--line);
}

.sidebar-section {
    margin-bottom: 2.25rem;
}

.sidebar-title {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.55rem;
}

.toc-link {
    font-size: 0.92rem;
    color: var(--muted);
    font-weight: 500;
}

.toc-link:hover {
    color: var(--blue);
}

.toc-link.active {
    color: var(--blue);
    font-weight: 600;
}

.related-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-links li {
    margin-bottom: 0.65rem;
}

.related-links a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.92rem;
    color: var(--blue);
    text-decoration: none;
    font-weight: 550;
}

.related-links a:hover {
    color: var(--blue-hover);
    text-decoration: underline;
}

/* Search Dropdown styling */
.search-wrap {
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    text-align: left;
}

.search-results-list {
    list-style: none;
    padding: 0.5rem;
    margin: 0;
}

.search-result-item {
    border-radius: 8px;
}

.search-result-link {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--ink);
    border-radius: 8px;
    transition: background 0.15s ease;
}

.search-result-item:hover .search-result-link,
.search-result-item.highlighted .search-result-link {
    background: var(--blue-soft);
    color: var(--blue);
}

.search-result-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.15rem;
}

.search-result-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.search-result-snippet {
    font-size: 0.84rem;
    color: var(--muted);
}

.search-result-item:hover .search-result-category,
.search-result-item.highlighted .search-result-category,
.search-result-item:hover .search-result-snippet,
.search-result-item.highlighted .search-result-snippet {
    color: inherit;
    opacity: 0.85;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Footer styling */
.footer {
    margin-top: 5rem;
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
}

.footer .shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Responsiveness overrides */
@media (max-width: 820px) {
    .kb-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .kb-sidebar {
        position: static;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--line);
        padding-top: 2rem;
    }

    .nav-actions {
        gap: 0.8rem;
        font-size: 0.82rem;
    }

    .nav-actions .optional {
        display: none;
    }

    .footer .shell {
        flex-direction: column;
        align-items: flex-start;
    }
}
