/* Help Page Styles */

html {
    scroll-behavior: smooth;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Page container ─────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

/* ── Help Header ─────────────────────────────────────────── */
.help-header {
    margin-bottom: 32px;
}

.help-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

h1 {
    color: var(--text);
    margin-top: 0;
    margin-bottom: 0;
    font-size: 2rem;
}

.help-version {
    display: inline-block;
    background: var(--accent-contrast);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.help-subtitle {
    color: #374151;
    margin: 8px 0 16px;
    line-height: 1.5;
}

/* ── Search ──────────────────────────────────────────────── */
.help-search-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.help-search-input {
    flex: 1;
    min-width: 200px;
    max-width: 480px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s;
}

.help-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.18);
}

.help-search-status {
    font-size: 0.8125rem;
    color: #374151;
}

mark.help-highlight {
    background: rgba(245, 158, 11, 0.35);
    color: inherit;
    border-radius: 2px;
}

/* ── Two-column layout ───────────────────────────────────── */
.help-layout {
    display: block;
}

@media (min-width: 1025px) {
    .help-layout {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 40px;
        align-items: start;
    }

    .help-sidebar {
        display: block;
    }

    .mobile-toc {
        display: none;
    }
}

@media (max-width: 1024px) {
    .help-sidebar {
        display: none;
    }

    .mobile-toc {
        display: block;
    }
}

/* ── Sticky Sidebar TOC ──────────────────────────────────── */
.help-sidebar {
    display: none; /* shown via media query above */
}

.sticky-toc {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
}

/* ── Headings ────────────────────────────────────────────── */
h2 {
    color: var(--text);
    margin-top: 40px;
    margin-bottom: 16px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
}

h3 {
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 12px;
    font-size: 1.125rem;
}

p,
li {
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.7;
}

ul,
ol {
    margin-left: 24px;
    margin-bottom: 20px;
}

/* ── Feature Boxes ───────────────────────────────────────── */
.feature-box {
    background: rgba(14, 165, 164, 0.1);
    border-left: 4px solid var(--accent);
    padding: 16px;
    border-radius: 6px;
    margin: 20px 0;
}

.feature-box h3 {
    margin-top: 0;
    color: var(--accent);
}

.tip-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 4px solid var(--warning);
    padding: 16px;
    border-radius: 6px;
    margin: 20px 0;
}

.tip-box strong {
    color: var(--warning);
}

.warning-box {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--danger);
    padding: 16px;
    border-radius: 6px;
    margin: 20px 0;
}

.warning-box strong {
    color: var(--danger);
}

/* ── Code Blocks ─────────────────────────────────────────── */
code {
    background: rgba(14, 165, 164, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "Courier New", monospace;
    font-size: 0.875rem;
    color: var(--accent);
}

.help-code-block {
    display: block;
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 16px;
    border-radius: 8px;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.8125rem;
    overflow-x: auto;
    margin: 16px 0;
}

/* ── Links ───────────────────────────────────────────────── */
a {
    color: var(--accent-contrast);
    text-decoration: none;
    font-weight: 500;
}

a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Table of Contents ───────────────────────────────────── */
.toc {
    background: var(--input-bg);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 32px;
}

.toc h2 {
    margin-top: 0;
    border-bottom: none;
    font-size: 1rem;
    color: var(--text);
}

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

.toc li {
    margin-bottom: 4px;
}

.toc-link {
    display: block;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-muted);
    transition:
        background 0.12s,
        color 0.12s;
}

.toc-link.toc-active {
    background: rgba(14, 165, 164, 0.12);
    color: var(--accent);
    font-weight: 600;
}

/* ── Screenshots ─────────────────────────────────────────── */
.screenshot {
    max-width: 100%;
    border-radius: 8px;
    border: 2px solid var(--border);
    margin: 16px 0;
}

/* ── Keyboard Shortcuts ──────────────────────────────────── */
.keyboard-shortcut {
    display: inline-block;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8125rem;
    margin: 0 2px;
}

/* ── CTA Box (bottom of page) ────────────────────────────── */
.help-cta-box {
    margin-top: 48px;
    padding: 28px;
    background: linear-gradient(135deg, rgba(14, 165, 164, 0.12) 0%, rgba(14, 165, 164, 0.04) 100%);
    border: 1px solid rgba(14, 165, 164, 0.3);
    border-radius: 12px;
    text-align: center;
}

.help-cta-box p {
    font-size: 1.0625rem;
    color: var(--text);
    margin-bottom: 16px;
}

.help-cta-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.help-cta-btn {
    display: inline-block;
    padding: 11px 24px;
    border-radius: 8px;
    background: var(--accent-contrast);
    color: #fff;
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    transition:
        background 0.15s,
        transform 0.1s;
}

.help-cta-btn--secondary {
    background: var(--input-bg);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ── Back-to-top button ──────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 20px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition:
        background 0.15s,
        transform 0.15s,
        opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.back-to-top[hidden] {
    display: none;
}

/* ── Misc ────────────────────────────────────────────────── */
.hr-wide {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

.center-muted {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Hover-Effekte nur für echte Zeigegeräte: auf Touch bleibt der
   Hover-Zustand nach dem Tap kleben, bis woanders hingetippt wird. */
@media (hover: hover) and (pointer: fine) {
    a:hover {
        text-decoration: underline;
    }

    .toc-link:hover {
        background: rgba(14, 165, 164, 0.08);
        color: var(--accent);
        text-decoration: none;
    }

    .help-cta-btn:hover {
        background: var(--accent-dark);
        text-decoration: none;
        transform: translateY(-1px);
    }

    .help-cta-btn--secondary:hover {
        background: var(--border);
    }

    .back-to-top:hover {
        background: var(--accent-hover, #0a9999);
        transform: translateY(-2px);
    }
}
