/* ============================================================
   guide.css — 가이드 페이지 공통 스타일
   layouts/guide.blade.php 에서 로드
   ============================================================ */

/* --- 섹션 제목 (TOC 자동 수집 대상) --- */
.ds-guide-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ds-color-fg);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ds-color-primary);
}

/* --- 소제목 --- */
.ds-guide-sub-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ds-color-fg);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* --- 본문 텍스트 --- */
.ds-guide-text {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--ds-color-fg);
    margin-bottom: 1rem;
}

/* --- 배지(태그) --- */
.ds-guide-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2em 0.55em;
    border-radius: 0.25rem;
    line-height: 1;
}
.ds-guide-badge-required {
    background-color: var(--ds-color-danger-subtle);
    color: var(--ds-color-danger);
}
.ds-guide-badge-optional {
    background-color: var(--ds-color-success-subtle);
    color: var(--ds-color-success);
}
[data-bs-theme="dark"] .ds-guide-badge-required {
    background-color: var(--ds-color-danger-subtle);
}
[data-bs-theme="dark"] .ds-guide-badge-optional {
    background-color: var(--ds-color-success-subtle);
}
.ds-guide-badge-primary {
    background-color: var(--ds-color-info-subtle);
    color: var(--ds-color-info);
}
.ds-guide-badge-secondary {
    background-color: var(--ds-color-bg-muted);
    color: var(--ds-color-fg-muted);
}
.ds-guide-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.5rem 0;
}
[data-bs-theme="dark"] .ds-guide-badge-primary {
    background-color: var(--ds-color-info-subtle);
    color: var(--ds-color-on-primary-muted);
}
[data-bs-theme="dark"] .ds-guide-badge-secondary {
    background-color: var(--ds-color-white-alpha-08);
    color: var(--ds-color-on-primary-muted);
}

/* --- 구분선 --- */
.ds-guide-divider {
    border: none;
    border-top: 1px solid var(--ds-color-border);
    margin: 2rem 0;
}

/* ============================================================
   가이드 레이아웃 좌측 메뉴 너비
   ============================================================ */
.ds-guide-layout .ds-guide-sidebar {
    width: clamp(11rem, 15.5%, 12.75rem);
}

/* ============================================================
   본문 + 오른쪽 목차 (TOC) — flex + sticky 방식
   ============================================================ */
.ds-guide-content-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.ds-guide-content-main {
    flex: 1;
    min-width: 0;
    max-width: 1200px;
    min-height: 1000px;
    margin-inline: auto;
    background: var(--ds-color-card);
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-lg);
    padding: clamp(1.75rem, 3vw, 3rem);
    box-shadow: var(--ds-shadow-md);
}

.ds-guide-content-toc {
    flex-shrink: 0;
    width: 220px;
    position: sticky;
    top: 6.5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    padding-left: 1rem;
    transform: none;
}

.ds-guide-toc-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ds-color-fg-muted);
    margin-bottom: 0.75rem;
}

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

.ds-guide-toc-item {
    margin-bottom: 0.25rem;
}

.ds-guide-toc-link {
    display: block;
    padding: 0.3rem 0 0.3rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--ds-color-fg-muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -1rem;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.ds-guide-toc-link:hover {
    color: var(--ds-color-primary);
}

.ds-guide-toc-link.active {
    color: var(--ds-color-primary);
    border-left-color: var(--ds-color-primary);
    font-weight: 600;
}

/* 스크롤바 커스텀 */
.ds-guide-content-toc::-webkit-scrollbar {
    width: 3px;
}
.ds-guide-content-toc::-webkit-scrollbar-thumb {
    background-color: var(--ds-color-border);
    border-radius: 3px;
}

/* 다크모드 TOC */
[data-bs-theme="dark"] .ds-guide-content-toc {
    border-left-color: var(--ds-color-white-alpha-25) !important;
}
[data-bs-theme="dark"] .ds-guide-toc-title {
    color: var(--ds-color-on-primary-muted) !important;
}
[data-bs-theme="dark"] .ds-guide-toc-link {
    color: var(--ds-color-on-primary-muted) !important;
}
[data-bs-theme="dark"] .ds-guide-toc-link:hover {
    color: var(--ds-color-primary) !important;
}
[data-bs-theme="dark"] .ds-guide-toc-link.active {
    color: var(--ds-color-primary) !important;
    font-weight: 600;
}
[data-bs-theme="dark"] .ds-guide-content-toc::-webkit-scrollbar-thumb {
    background-color: var(--ds-color-white-alpha-25);
}

/* 1200px 이상: TOC 항상 자리 차지 (JS의 inline display:none 무력화) */
@media (min-width: 1200px) {
    .ds-guide-content-toc {
        display: block !important;
    }
}

/* 1200px 이하: TOC 숨김 */
@media (max-width: 1199.98px) {
    .ds-guide-content-toc {
        display: none;
    }
    .ds-guide-content-wrapper {
        display: block;
    }
}

/* ============================================================
   히어로 배너
   ============================================================ */
.ds-guide-hero {
    margin-bottom: 2rem;
}
.ds-guide-hero > h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.ds-guide-hero-body {
    background: var(--ds-color-card);
    border: 1px solid var(--ds-color-border-strong);
    border-left: 4px solid var(--ds-color-chestnut);
    border-radius: 0.5rem;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.ds-guide-hero-icon {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    background-color: var(--ds-color-chestnut);
    color: var(--ds-color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.ds-guide-hero-body p {
    font-size: 0.95rem;
    color: var(--ds-color-fg);
    margin-bottom: 0;
}

/* ============================================================
   섹션 래퍼
   ============================================================ */
.ds-guide-section {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--ds-color-border);
}
.ds-guide-section:last-child {
    border-bottom: none;
}

/* ============================================================
   스크린샷 영역
   ============================================================ */
.ds-guide-screenshot {
    background-color: var(--ds-color-bg-muted);
    border: 1px solid var(--ds-color-border);
    border-radius: 0.75rem;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    margin-bottom: 1.25rem;
    color: var(--ds-color-fg-muted);
    font-size: 0.85rem;
    position: relative;
}
.ds-guide-screenshot img {
    max-width: 100%;
    border-radius: 0.5rem;
}
.ds-guide-screenshot.ds-guide-screenshot-filled {
    padding: 0;
    min-height: unset;
}
.ds-guide-screenshot.ds-guide-screenshot-filled img {
    width: 100%;
    border-radius: 0.75rem;
    display: block;
}
.ds-guide-screenshot.ds-guide-screenshot-w-10 { --ds-guide-screenshot-width: 10%; }
.ds-guide-screenshot.ds-guide-screenshot-w-20 { --ds-guide-screenshot-width: 20%; }
.ds-guide-screenshot.ds-guide-screenshot-w-30 { --ds-guide-screenshot-width: 30%; }
.ds-guide-screenshot.ds-guide-screenshot-w-40 { --ds-guide-screenshot-width: 40%; }
.ds-guide-screenshot.ds-guide-screenshot-w-50 { --ds-guide-screenshot-width: 50%; }
.ds-guide-screenshot.ds-guide-screenshot-w-60 { --ds-guide-screenshot-width: 60%; }
.ds-guide-screenshot.ds-guide-screenshot-w-70 { --ds-guide-screenshot-width: 70%; }
.ds-guide-screenshot.ds-guide-screenshot-w-80 { --ds-guide-screenshot-width: 80%; }
.ds-guide-screenshot.ds-guide-screenshot-w-90 { --ds-guide-screenshot-width: 90%; }
.ds-guide-screenshot.ds-guide-screenshot- { --ds-guide-screenshot-width: 100%; }
.ds-guide-screenshot[class*="ds-guide-screenshot-w-"] {
    box-sizing: border-box;
    width: var(--ds-guide-screenshot-width);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.ds-guide-screenshot[class*="ds-guide-screenshot-w-"] img {
    width: 100%;
    max-width: 100%;
    display: block;
}
[data-bs-theme="dark"] .ds-guide-screenshot {
    background-color: var(--ds-color-bg-footer);
}

/* ============================================================
   콜아웃 번호 리스트 (스크린샷 아래 설명)
   ============================================================ */
.ds-guide-callout-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}
.ds-guide-callout-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--ds-color-border);
    font-size: 0.9rem;
}
.ds-guide-callout-item:last-child {
    border-bottom: none;
}
.ds-guide-callout-item .ds-guide-badge {
    align-self: center;
    flex-shrink: 0;
}
.ds-guide-callout-num {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--ds-color-primary);
    color: var(--ds-color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    margin-top: 0.1rem;
}
.ds-guide-callout-text {
    flex: 1;
    line-height: 1.6;
}
.ds-guide-callout-text strong {
    color: var(--ds-color-fg);
}

/* ============================================================
   접이식 상세 (details/summary)
   ============================================================ */
.ds-guide-details {
    border: 1px solid var(--ds-color-border);
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.ds-guide-details summary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--ds-color-bg-muted);
    color: var(--ds-color-fg);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ds-guide-details summary::-webkit-details-marker {
    display: none;
}
.ds-guide-details summary::before {
    content: "\25B6";
    font-size: 0.6rem;
    transition: transform 0.2s ease;
    color: var(--ds-color-fg-muted);
}
.ds-guide-details[open] summary::before {
    transform: rotate(90deg);
}
.ds-guide-details .ds-guide-details-body {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    border-top: 1px solid var(--ds-color-border);
}
[data-bs-theme="dark"] .ds-guide-details summary {
    background-color: var(--ds-color-bg-footer);
}
.ds-guide-details-title {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: var(--ds-color-bg-muted);
    color: var(--ds-color-fg);
}
[data-bs-theme="dark"] .ds-guide-details-title {
    background-color: var(--ds-color-bg-footer);
}

/* ============================================================
   필드 리스트 (테이블 대체)
   ============================================================ */
.ds-guide-field-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.ds-guide-field-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background-color: var(--ds-color-bg-muted);
    border-radius: 0.375rem;
    font-size: 0.88rem;
}
.ds-guide-field-item .ds-guide-field-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 170px;
    min-width: 170px;
    color: var(--ds-color-fg);
}
.ds-guide-field-item .ds-guide-field-desc {
    flex: 1;
    color: var(--ds-color-fg-muted);
    line-height: 1.5;
}
[data-bs-theme="dark"] .ds-guide-field-item {
    background-color: var(--ds-color-bg-footer);
}

/* ============================================================
   인라인 팁/경고
   ============================================================ */
.ds-guide-tip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    background-color: var(--ds-color-card);
    border: 1px solid var(--ds-color-border);
    border-left: 3px solid var(--ds-color-fg-muted);
    color: var(--ds-color-fg);
}
.ds-guide-tip-warn {
    border-left-color: var(--ds-color-warning);
}
.ds-guide-tip-info,
.ds-guide-info {
    border-left-color: var(--ds-color-info);
}
.ds-guide-tip-icon {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}

/* ============================================================
   퀵 카드 그리드
   ============================================================ */
.ds-guide-quick-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.ds-guide-quick-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--ds-color-border);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.ds-guide-quick-card:hover {
    border-color: var(--ds-color-primary);
    box-shadow: var(--ds-shadow-sm);
    color: inherit;
    text-decoration: none;
}
.ds-guide-quick-card .ds-guide-quick-card-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}
.ds-guide-quick-card .ds-guide-quick-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.ds-guide-quick-card .ds-guide-quick-card-desc {
    font-size: 0.8rem;
    color: var(--ds-color-fg-muted);
    margin-bottom: 0;
}

/* ============================================================
   FAQ 아코디언
   ============================================================ */
.ds-guide-faq-item {
    border: 1px solid var(--ds-color-border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.ds-guide-faq-item summary {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ds-color-fg);
}
.ds-guide-faq-item summary::-webkit-details-marker {
    display: none;
}
.ds-guide-faq-item summary::before {
    content: "Q.";
    color: var(--ds-color-primary);
    font-weight: 700;
}
.ds-guide-faq-item .faq-answer {
    padding: 0 1rem 0.85rem 1rem;
    font-size: 0.88rem;
    color: var(--ds-color-fg-muted);
    line-height: 1.7;
}
