/* ============================================================
   Reference section — shared styles
   Used by: reference-concept.html, reference-concept-flow.html,
            reference-concept-struct.html
   ============================================================ */

/* ── Layout ── */
.ref-concept-layout {
    display: flex;
    min-height: calc(100vh - 56px);
    margin-top: 56px;
    background: #FDFCFB;
}

/* ── Sidebar ── */
.ref-sidebar {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid #E8E4E0;
    background: #FAF8F6;
    overflow-y: auto;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    padding: 2rem 0;
}
.ref-nav { padding: 0 1rem; }
.ref-nav-section { margin-bottom: 2rem; }
.ref-nav-label {
    display: block;
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9A8F87;
    padding: 0 0.5rem;
    margin-bottom: 0.375rem;
}
.ref-nav-section ul { list-style: none; margin: 0; padding: 0; }
.ref-nav-item {
    display: block;
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #4A5568;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
}
.ref-nav-item:hover { background: #EDE9E5; color: #1B2A35; }
.ref-nav-item--active { background: #EDE9E5; color: #1B2A35; font-weight: 500; }
.ref-nav-item--active::before {
    content: '';
    display: inline-block;
    width: 2px;
    height: 12px;
    background: #E46863;
    border-radius: 1px;
    margin-right: 0.5rem;
    vertical-align: middle;
    margin-top: -2px;
}
.ref-nav-item--sub { padding-left: 1rem; font-size: 0.8125rem; color: #6B7280; }
.ref-nav-item--sub:hover { color: #1B2A35; }
.ref-nav-group { margin: 0; }
.ref-nav-group summary { list-style: none; cursor: pointer; user-select: none; }
.ref-nav-group summary::-webkit-details-marker { display: none; }
.ref-nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #4A5568;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.ref-nav-group-title:hover { background: #EDE9E5; color: #1B2A35; }
.ref-nav-chevron { width: 14px; height: 14px; color: #9A8F87; transition: transform 0.2s; flex-shrink: 0; }
.ref-nav-group[open] .ref-nav-chevron { transform: rotate(90deg); }
.ref-nav-sublist { padding-left: 0.25rem; margin-top: 0.125rem; margin-bottom: 0.25rem; }

/* ── Main content area ── */
.ref-concept-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
}

/* ── Mindmap ── */
.mindmap-container {
    padding: 2rem 3rem 0;
}
#mindmap {
    width: 100%;
    height: 60vh;
    min-height: 460px;
    background-color: #f9f7f5;
    border: 1px solid #d4d2cc;
    border-radius: 8px;
    overflow: hidden;
}

/* ── Article ── */
.article-section {
    max-width: 780px;
    margin: 0 auto;
    padding: 4rem 3rem 6rem;
    font-family: 'IBM Plex Sans Condensed', sans-serif;
}
.article-section > p:first-child {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #4a5568;
    margin: 0 0 3rem;
    border-left: 3px solid #E46863;
    padding-left: 1rem;
}
.article-section h2 {
    font-family: 'EB Garamond', 'Times New Roman', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: #0f1f34;
    margin: 3rem 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e0dfda;
}
.article-section h2:first-of-type { margin-top: 0; }
.article-section p { font-size: 0.975rem; line-height: 1.75; color: #2d3746; margin: 0.75rem 0; }
.article-section strong { font-weight: 600; color: #0f1f34; }
.article-section em { font-style: italic; }
.article-section ul { margin: 0.5rem 0 0.75rem 0; padding-left: 1.4rem; }
.article-section li { font-size: 0.975rem; line-height: 1.75; color: #2d3746; margin-bottom: 0.35rem; }
.article-section code {
    font-family: 'Fira Code', 'IBM Plex Mono', monospace;
    font-size: 0.875em;
    background: #eceae4;
    color: #0f1f34;
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
.article-section pre {
    background: #253040;
    border: 1px solid #3a4a5c;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.25rem 0;
    line-height: 1.6;
}
.article-section pre code {
    font-family: 'Fira Code', 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    background: none;
    color: #e6edf3;
    padding: 0;
    border-radius: 0;
}
.article-section hr { border: none; border-top: 1px solid #e0dfda; margin: 3rem 0; }

/* ── Table of Contents ── */
.concept-toc {
    margin: 2.5rem 0 3rem;
    padding: 1.5rem 1.75rem;
    background: #f8f7f4;
    border: 1px solid #e0ddd8;
    border-radius: 10px;
}
.concept-toc__label {
    font-family: 'Fira Code', monospace !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: #9a8f87 !important;
    margin: 0 0 1rem !important;
    padding: 0 !important;
    border: none !important;
}
.concept-toc__list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem 2rem;
}
.concept-toc__list li {
    margin: 0 !important;
    font-size: 0.875rem !important;
}
.concept-toc__list a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    color: #1b2a35;
    text-decoration: none;
    font-family: 'IBM Plex Sans Condensed', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.3rem 0;
    transition: color 0.15s;
}
.concept-toc__list a:hover { color: #E46863; }
.concept-toc__num {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #E46863;
    opacity: 0.7;
    flex-shrink: 0;
    margin-top: 1px;
}
