/**
 * 파일명: guide.css
 * 파일경로: /home/testitkr/public_html/assets/css/pages/
 * 기능: 이용 방법(guide.php) 전용 스타일 — doc 레이아웃 + 매뉴얼 컴포넌트
 * 작성일: 2026-05-31
 */

/* ============================================================================
 * Doc Layout — 2-column (sidebar + content)
 * ========================================================================= */

.doc-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0 var(--space-8);
    align-items: start;
}

.doc-sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-5));
    max-height: calc(100vh - var(--header-height) - var(--space-8));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.doc-sidebar::-webkit-scrollbar { width: 4px; }
.doc-sidebar::-webkit-scrollbar-track { background: transparent; }
.doc-sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

/* ============================================================================
 * Sidebar Nav
 * ========================================================================= */

.doc-nav-group {
    margin-bottom: var(--space-5);
}

.doc-nav-label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--color-text-strong);
    padding: 0 var(--space-3);
    margin-bottom: var(--space-2);
}

.doc-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    color: var(--color-text-sub);
    text-decoration: none;
    transition: color var(--transition), background var(--transition);
    line-height: 1.35;
}

.doc-nav-link:hover {
    color: var(--color-primary);
    background: var(--color-primary-soft);
}

.doc-nav-link.is-active {
    color: var(--color-primary);
    background: var(--color-primary-soft);
    font-weight: 600;
}

.doc-nav-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity var(--transition);
}

.doc-nav-link:hover svg,
.doc-nav-link.is-active svg {
    opacity: 1;
}

/* Mobile toggle button */
.doc-sidebar-toggle {
    display: none;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--fs-base);
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    margin-bottom: var(--space-3);
    align-items: center;
    justify-content: space-between;
}

.doc-sidebar-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition);
}

.doc-sidebar-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* ============================================================================
 * Doc Content
 * ========================================================================= */

.doc-content {
    min-width: 0;
}

.doc-header {
    margin-bottom: var(--space-7);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.doc-eyebrow {
    display: inline-block;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: var(--space-3);
}

.doc-title {
    font-size: var(--fs-3xl);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: var(--space-3);
    line-height: 1.2;
}

.doc-desc {
    font-size: var(--fs-md);
    color: var(--color-text-sub);
    line-height: 1.7;
    margin: 0;
}

/* ============================================================================
 * Manual Sections
 * ========================================================================= */

.manual-section {
    scroll-margin-top: calc(var(--header-height) + 24px);
    margin-top: var(--space-7);
}

.manual-section:first-child {
    margin-top: 0;
}

.manual-section > h2 {
    font-size: var(--fs-xl);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-4);
}

.manual-lead {
    color: var(--color-text-sub);
    line-height: 1.7;
    margin: 0 0 var(--space-4);
}

/* ============================================================================
 * Guide Steps
 * ========================================================================= */

.guide-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: gstep;
}

.guide-steps > li {
    position: relative;
    padding: 0 0 var(--space-5) 48px;
}

.guide-steps > li::before {
    counter-increment: gstep;
    content: counter(gstep);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-steps > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 15px;
    top: 36px;
    bottom: 4px;
    width: 2px;
    background: var(--color-border);
}

.guide-steps h3 { margin: 0 0 var(--space-2); font-size: 17px; }
.guide-steps p,
.guide-steps ul { margin: 0 0 var(--space-2); line-height: 1.7; }
.guide-steps ul { padding-left: 1.2em; color: var(--color-text-sub); }

/* ============================================================================
 * Guide Misc Components
 * ========================================================================= */

.guide-role {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-2);
}

.guide-role.req    { background: var(--color-lavender-strong); color: var(--color-primary); }
.guide-role.tester { background: #e3f2ec; color: #1a7f4b; }

.guide-note {
    background: var(--color-lavender);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) 0;
    font-size: var(--fs-base);
    line-height: 1.7;
}

.guide-note strong { color: var(--color-primary); }

.term-list dt { font-weight: 700; margin-top: var(--space-3); }
.term-list dd { margin: 2px 0 0; color: var(--color-text-sub); line-height: 1.7; }

/* ============================================================================
 * Table Scroll
 * ========================================================================= */

.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-4) 0;
}

.table-scroll table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.table-scroll th,
.table-scroll td {
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}

.table-scroll th { background: var(--color-surface-alt); font-weight: 700; }

@media (max-width: 576px) {
    .table-scroll::after {
        content: "\2190 좌우로 스크롤 →";
        display: block;
        text-align: center;
        font-size: 12px;
        color: var(--color-text-muted);
        padding: var(--space-2) 0;
    }
}

/* ============================================================================
 * Responsive — Mobile
 * ========================================================================= */

@media (max-width: 768px) {
    .doc-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .doc-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        margin-bottom: var(--space-5);
    }

    .doc-sidebar-toggle {
        display: flex;
    }

    .doc-nav {
        display: none;
        padding-top: var(--space-2);
    }

    .doc-nav.is-open {
        display: block;
    }

    .doc-title {
        font-size: var(--fs-2xl);
    }
}
