/* TikTak User Guide — styles */

/* ── Layout ──────────────────────────── */
.guide-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    max-width: 1120px;
    margin: 0 auto;
    min-height: calc(100vh - 64px - 160px); /* navbar + footer */
}

/* ── Sidebar ─────────────────────────── */
.guide-sidebar {
    position: sticky;
    top: 64px; /* below navbar */
    height: fit-content;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 2rem 1.5rem 2rem 0;
    border-right: 1px solid var(--tt-border);
}

.guide-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tt-text-secondary);
    margin: 0 0 0.75rem;
    padding: 0 0.75rem;
}

.guide-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-nav li {
    margin: 0;
}

.guide-nav a {
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    color: var(--tt-text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s;
    line-height: 1.4;
}

.guide-nav a:hover {
    color: var(--tt-text);
    background: rgba(43, 87, 151, 0.05);
}

.guide-nav a.active {
    color: var(--tt-accent);
    background: rgba(43, 87, 151, 0.08);
    font-weight: 600;
}

/* Section nav (within a page) */
.guide-nav-section {
    list-style: none;
    padding: 0 0 0 0.75rem;
    margin: 0;
}

.guide-nav-section a {
    font-size: 0.82rem;
    padding: 0.3rem 0.75rem;
    color: var(--tt-text-secondary);
}

/* Mobile sidebar toggle */
.guide-sidebar-toggle {
    display: none;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--tt-surface);
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    font-family: var(--tt-font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tt-text);
    cursor: pointer;
    margin-bottom: 1rem;
    text-align: left;
}

.guide-sidebar-toggle i {
    margin-right: 0.5rem;
}

/* ── Content ─────────────────────────── */
.guide-content {
    padding: 2rem 0 3rem 2.5rem;
    max-width: 780px;
}

.guide-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.guide-content .guide-subtitle {
    font-size: 1.1rem;
    color: var(--tt-text-secondary);
    margin: 0 0 2rem;
    line-height: 1.5;
}

.guide-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--tt-border);
}

.guide-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.guide-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
}

.guide-content p {
    color: var(--tt-text);
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0 0 1rem;
}

.guide-content ol,
.guide-content ul {
    padding-left: 1.5rem;
    margin: 0 0 1rem;
}

.guide-content li {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.25rem;
}

/* ── Screenshot Figures ──────────────── */
.guide-step {
    position: relative;
    margin: 1.25rem 0 1.75rem;
}

.guide-step-badge {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 28px;
    height: 28px;
    background: var(--tt-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.guide-img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--tt-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.guide-img:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.guide-step figcaption {
    font-size: 0.85rem;
    color: var(--tt-text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ── Video ───────────────────────────── */
.guide-video {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--tt-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* ── Tip / Note Boxes ────────────────── */
.guide-tip {
    background: rgba(43, 87, 151, 0.05);
    border-left: 3px solid var(--tt-accent);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.guide-tip-icon {
    font-weight: 700;
    color: var(--tt-accent);
    margin-right: 0.5rem;
}

.guide-tip p {
    margin: 0;
    font-size: 0.9rem;
}

.guide-note {
    background: rgba(22, 163, 74, 0.05);
    border-left: 3px solid var(--tt-success);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
}

.guide-note p {
    margin: 0;
    font-size: 0.9rem;
}

/* ── Prev / Next Navigation ──────────── */
.guide-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0 0;
    margin-top: 3rem;
    border-top: 1px solid var(--tt-border);
    gap: 1rem;
}

.guide-pager a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--tt-border);
    border-radius: 8px;
    color: var(--tt-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.guide-pager a:hover {
    border-color: var(--tt-accent);
    color: var(--tt-accent);
    background: rgba(43, 87, 151, 0.03);
}

.guide-pager-spacer {
    flex: 1;
}

/* ── Lightbox (dialog) ───────────────── */
#lightbox {
    border: none;
    background: transparent;
    padding: 0;
    max-width: 95vw;
    max-height: 95vh;
    cursor: zoom-out;
}

#lightbox::backdrop {
    background: rgba(0, 0, 0, 0.85);
    cursor: zoom-out;
}

#lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* ── TOC Cards (index page) ──────────── */
.guide-toc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.guide-toc-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--tt-surface);
    border: 1px solid var(--tt-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--tt-text);
    transition: all 0.2s;
}

.guide-toc-card:hover {
    border-color: var(--tt-accent);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.guide-toc-icon {
    width: 44px;
    height: 44px;
    background: rgba(43, 87, 151, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--tt-accent);
    flex-shrink: 0;
}

.guide-toc-text h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.guide-toc-text p {
    font-size: 0.85rem;
    color: var(--tt-text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* ── Responsive ──────────────────────── */
@media (max-width: 900px) {
    .guide-layout {
        grid-template-columns: 1fr;
    }

    .guide-sidebar {
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--tt-border);
        padding: 1rem;
        max-height: none;
        display: none;
    }

    .guide-sidebar.open {
        display: block;
    }

    .guide-sidebar-toggle {
        display: flex;
        align-items: center;
    }

    .guide-content {
        padding: 1.5rem 1rem 2rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .guide-content h1 {
        font-size: 1.6rem;
    }

    .guide-toc {
        grid-template-columns: 1fr;
    }

    .guide-pager {
        flex-direction: column;
    }

    .guide-pager a {
        width: 100%;
        justify-content: center;
    }
}
