/**
 * mod_article_toc — Table of Contents card styles
 *
 * @copyright  (C) New Line Web Design. All rights reserved.
 * @license    GNU General Public License version 2 or later
 */

/* ============================================================
   Utility
   ============================================================ */

.toc-hidden {
    display: none;
}

/* ============================================================
   Sticky sidebar — applied to the module's parent wrapper
   ============================================================ */

.sidebar-content:has(.guide-toc) {
    position: sticky;
    top: 100px;
}

/* ============================================================
   Card container
   ============================================================ */

.guide-sidebar-card {
    background: var(--brand-bg-card, #fff);
    border: 1px solid var(--brand-border, #e5e7eb);
    border-radius: var(--radius-sm, var(--brand-radius-sm, 0.5rem));
    overflow: hidden;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

/* ============================================================
   Card header
   ============================================================ */

.guide-sidebar-card-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-family: var(--font-heading, system-ui, -apple-system, sans-serif);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--brand-text, #1f2937);
    padding: 1rem 1.25rem;
    background: var(--brand-bg-alt, #f9fafb);
    border-bottom: 1px solid var(--brand-divider, #e5e7eb);
}

.guide-sidebar-card-header i {
    color: var(--brand-secondary, #6b7280);
    font-size: 0.875rem;
}

/* ============================================================
   TOC list
   ============================================================ */

.guide-toc-list {
    list-style: none;
    padding: 0.75rem 1.25rem;
    margin: 0;
}

.guide-toc-item {
    border-bottom: 1px solid var(--brand-divider, #e5e7eb);
}

.guide-toc-item:last-child {
    border-bottom: none;
}

/* ============================================================
   TOC links
   ============================================================ */

.guide-toc-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
    font-family: var(--font-body, system-ui, -apple-system, sans-serif);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--brand-text-body, #4b5563);
    text-decoration: none;
    transition: color var(--transition-fast, 0.15s ease);
    line-height: 1.4;
}

.guide-toc-link:hover,
.guide-toc-link.active {
    color: var(--brand-primary, #2563eb);
}

.guide-toc-link.active {
    font-weight: 600;
}

/* ============================================================
   Numbered badge
   ============================================================ */

.guide-toc-num {
    width: 22px;
    height: 22px;
    background: var(--brand-glass, #eff6ff);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, system-ui, -apple-system, sans-serif);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--brand-primary, #2563eb);
    flex-shrink: 0;
    transition: background var(--transition-fast, 0.15s ease);
}

.guide-toc-link.active .guide-toc-num {
    background: var(--brand-primary, #2563eb);
    color: #fff;
}
