/**
 * public/css/modules/guides.css
 * Giao diện tài liệu (docs) 3 cột cho module Hướng dẫn sử dụng.
 * Tham khảo bố cục: sidebar điều hướng | nội dung | mục lục.
 */

:root {
    --guides-primary: #4f46e5;
    --guides-primary-soft: #eef2ff;
    --guides-text: #1f2933;
    --guides-muted: #6b7280;
    --guides-border: #e5e7eb;
    --guides-bg: #ffffff;
    --guides-sidebar-bg: #f8fafc;
    --guides-topbar-h: 70px;
    --guides-sidebar-w: 290px;
    --guides-toc-w: 250px;
    --guides-max: 1440px;
}

* { box-sizing: border-box; }

.guides-body {
    margin: 0;
    color: var(--guides-text);
    background: var(--guides-bg);
    -webkit-font-smoothing: antialiased;
}

/* ===== Mobile Bar ===== */
.guides-mobile-bar {
    position: sticky;
    top: 65px;
    z-index: 1020;
}
.guides-nav-toggle {
    cursor: pointer;
    font-size: 0.88rem;
}

/* ===== Shell 3 cột ===== */
.guides-shell {
    max-width: var(--guides-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--guides-sidebar-w) minmax(0, 1fr) var(--guides-toc-w);
    align-items: start;
}

/* ===== Cột trái: điều hướng ===== */
.guides-sidebar {
    position: sticky;
    top: var(--guides-topbar-h);
    height: calc(100vh - var(--guides-topbar-h));
    overflow-y: auto;
    padding: 20px 12px 40px;
    border-right: 1px solid var(--guides-border);
    background: var(--guides-sidebar-bg);
}
.guides-nav-group { margin-bottom: 18px; }
.guides-nav-group-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--guides-muted);
    padding: 6px 12px;
}
.guides-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.guides-nav-link {
    display: block;
    padding: 7px 12px;
    margin: 1px 0;
    border-radius: 7px;
    font-size: .9rem;
    color: #374151;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: background .12s, color .12s;
}
.guides-nav-link:hover {
    background: #eef0f4;
    color: var(--guides-text);
}
.guides-nav-link.active {
    background: var(--guides-primary-soft);
    color: var(--guides-primary);
    font-weight: 600;
    border-left-color: var(--guides-primary);
}
.guides-nav-link.d-none-search { display: none; }

/* ===== Cột giữa: nội dung ===== */
.guides-content-wrap {
    min-width: 0;
    padding: 32px 48px 80px;
}
.guides-article { max-width: 780px; }

.guides-breadcrumb {
    font-size: .82rem;
    color: var(--guides-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.guides-breadcrumb a {
    color: var(--guides-muted);
    text-decoration: none;
}
.guides-breadcrumb a:hover { color: var(--guides-primary); }
.guides-breadcrumb i { font-size: .65rem; }

.guides-article-head { margin-bottom: 28px; }
.guides-article-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 12px;
    letter-spacing: -.01em;
}
.guides-article-lead {
    font-size: 1.05rem;
    color: var(--guides-muted);
    margin: 0 0 12px;
}
.guides-article-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: .82rem;
    color: var(--guides-muted);
    padding-bottom: 18px;
    border-bottom: 1px solid var(--guides-border);
}

/* ===== Typography nội dung ===== */
.guide-content { font-size: 1rem; line-height: 1.75; color: #24292f; }
.guide-content h2 {
    font-size: 1.55rem;
    font-weight: 700;
    margin: 2em 0 .6em;
    padding-top: .3em;
    scroll-margin-top: calc(var(--guides-topbar-h) + 16px);
}
.guide-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.6em 0 .5em;
    scroll-margin-top: calc(var(--guides-topbar-h) + 16px);
}
.guide-content h4 { font-size: 1.05rem; font-weight: 700; margin: 1.4em 0 .5em; }
.guide-content p { margin: 0 0 1.1em; }
.guide-content ul, .guide-content ol { margin: 0 0 1.1em; padding-left: 1.6em; }
.guide-content li { margin: .3em 0; }
.guide-content a { color: var(--guides-primary); text-decoration: none; }
.guide-content a:hover { text-decoration: underline; }
.guide-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid var(--guides-border);
    margin: 1em 0;
}
.guide-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px 18px;
    border-radius: 10px;
    overflow-x: auto;
    font-size: .88rem;
    margin: 0 0 1.2em;
}
.guide-content code {
    background: #f1f5f9;
    color: #b91c1c;
    padding: .15em .4em;
    border-radius: 5px;
    font-size: .88em;
}
.guide-content pre code { background: none; color: inherit; padding: 0; }
.guide-content blockquote {
    border-left: 4px solid var(--guides-primary);
    background: var(--guides-primary-soft);
    margin: 0 0 1.2em;
    padding: 12px 18px;
    border-radius: 0 8px 8px 0;
    color: #3730a3;
}
.guide-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.2em;
    font-size: .92rem;
}
.guide-content th, .guide-content td {
    border: 1px solid var(--guides-border);
    padding: 8px 12px;
    text-align: left;
}
.guide-content th { background: var(--guides-sidebar-bg); font-weight: 700; }

/* ===== Trang trống ===== */
.guides-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--guides-muted);
}
.guides-empty i { font-size: 3rem; color: var(--guides-border); margin-bottom: 16px; }
.guides-empty h1 { font-size: 1.5rem; color: var(--guides-text); }

/* ===== Điều hướng Trước/Tiếp ===== */
.guides-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--guides-border);
}
.guides-pager-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    border: 1px solid var(--guides-border);
    border-radius: 10px;
    text-decoration: none;
    max-width: 48%;
    transition: border-color .12s, background .12s;
}
.guides-pager-item:hover { border-color: var(--guides-primary); background: var(--guides-primary-soft); }
.guides-pager-item.next { text-align: right; align-items: flex-end; }
.guides-pager-label { font-size: .78rem; color: var(--guides-muted); }
.guides-pager-title { font-weight: 600; color: var(--guides-text); }

/* ===== Cột phải: TOC ===== */
.guides-toc-wrap { padding: 32px 16px; }
.guides-toc-sticky {
    position: sticky;
    top: calc(var(--guides-topbar-h) + 24px);
    max-height: calc(100vh - var(--guides-topbar-h) - 48px);
    overflow-y: auto;
}
.guides-toc-title {
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--guides-muted);
    margin-bottom: 10px;
}
.guides-toc a {
    display: block;
    padding: 4px 10px;
    font-size: .84rem;
    color: var(--guides-muted);
    text-decoration: none;
    border-left: 2px solid var(--guides-border);
    line-height: 1.4;
    transition: color .12s, border-color .12s;
}
.guides-toc a:hover { color: var(--guides-text); }
.guides-toc a.active {
    color: var(--guides-primary);
    border-left-color: var(--guides-primary);
    font-weight: 600;
}
.guides-toc a.toc-h3 { padding-left: 22px; font-size: .8rem; }
.guides-toc-empty { font-size: .82rem; color: var(--guides-muted); }

/* ===== Backdrop cho sidebar mobile ===== */
.guides-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1035;
}
.guides-sidebar-backdrop.show { display: block; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .guides-shell { grid-template-columns: var(--guides-sidebar-w) minmax(0, 1fr); }
    .guides-toc-wrap { display: none; }
    .guides-content-wrap { padding: 32px 40px 80px; }
}
@media (max-width: 992px) {
    .guides-shell { grid-template-columns: minmax(0, 1fr); }
    .guides-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 82%;
        max-width: 320px;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform .25s ease;
        padding-top: 20px;
    }
    .guides-sidebar.open { transform: translateX(0); }
    .guides-content-wrap { padding: 24px 20px 60px; }
    .guides-article-title { font-size: 1.7rem; }
}
