/* =============================================================
   Executive Table of Contents — toc-style.css
   Theme: Blue (#3B82F6) & Green (#10B981)
   ============================================================= */

.toc-wrapper {
    --toc-accent:        #3B82F6;      /* Theme Blue */
    --toc-accent-soft:   #eff6ff;
    --toc-bg:            #ffffff;
    --toc-border:        #e2e8f0;
    --toc-header-bg:     #0F172A;      /* Theme Dark Navy */
    --toc-header-text:   #ffffff;
    --toc-text:          #334155;
    --toc-text-muted:    #64748b;
    --toc-hover-bg:      #f8fafc;
    --toc-num-bg:        #f1f5f9;
    --toc-num-text:      #475569;
    --toc-shadow:        0 10px 30px rgba(15, 23, 42, 0.05);
    --toc-radius:        12px;
    --toc-radius-sm:     8px;
    --toc-font:          'Inter', sans-serif;
    --toc-font-heading:  'Plus Jakarta Sans', sans-serif;
    --toc-transition:    200ms cubic-bezier(.4,0,.2,1);
    contain: layout style;
}

.toc-wrapper {
    font-family:    var(--toc-font);
    margin:         2rem 0 2.25rem;
    border-radius:  var(--toc-radius);
    background:     var(--toc-bg);
    box-shadow:     var(--toc-shadow);
    border:         1px solid var(--toc-border);
    overflow:       hidden;
    max-width:      100%;
    width:          100%;
}

.toc-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    width:           100%;
    padding:         16px 20px;
    background:      var(--toc-header-bg);
    color:           var(--toc-header-text);
    border:          none;
    cursor:          pointer;
    gap:             10px;
    text-align:      left;
    -webkit-tap-highlight-color: transparent;
}

.toc-header:focus-visible {
    outline: 3px solid var(--toc-accent);
    outline-offset: -3px;
}

.toc-header-left {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}

.toc-icon {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: rgba(255,255,255,.1);
    border-radius: var(--toc-radius-sm);
    flex-shrink: 0; color: var(--toc-accent);
}

.toc-title {
    font-family: var(--toc-font-heading);
    font-size: 1rem; font-weight: 800; letter-spacing: 0.5px;
    color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.toc-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 22px; padding: 0 7px;
    background: var(--toc-accent); color: #fff;
    font-size: .75rem; font-weight: 700; border-radius: 20px; flex-shrink: 0;
}

.toc-chevron {
    display: flex; align-items: center; color: rgba(255,255,255,.7);
    flex-shrink: 0; will-change: transform; transition: transform var(--toc-transition);
}

.toc-wrapper.is-open .toc-chevron { transform: rotate(180deg); }

/* Blue to Green Gradient Line */
.toc-wrapper::before {
    content: ''; display: block; height: 3px;
    background: linear-gradient(90deg, #3B82F6 0%, #10B981 100%);
    transform: scaleX(0); transform-origin: left; transition: transform var(--toc-transition);
}
.toc-wrapper.is-open::before { transform: scaleX(1); }

.toc-body {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows 260ms cubic-bezier(.4,0,.2,1);
}
.toc-body[hidden] { display: grid !important; grid-template-rows: 0fr; }
.toc-wrapper.is-open .toc-body { grid-template-rows: 1fr; }

.toc-list { overflow: hidden; margin: 0; padding: 10px 0; list-style: none; }

.toc-item {
    border-bottom: 1px solid var(--toc-border); position: relative;
    opacity: 0; transform: translateX(-8px);
    transition: opacity 200ms ease, transform 200ms ease;
}
.toc-wrapper.is-open .toc-item { opacity: 1; transform: translateX(0); }

.toc-wrapper.is-open .toc-item:nth-child(1)  { transition-delay: .04s; }
.toc-wrapper.is-open .toc-item:nth-child(2)  { transition-delay: .07s; }
.toc-wrapper.is-open .toc-item:nth-child(3)  { transition-delay: .10s; }
.toc-wrapper.is-open .toc-item:nth-child(4)  { transition-delay: .13s; }
.toc-wrapper.is-open .toc-item:nth-child(5)  { transition-delay: .16s; }
.toc-wrapper.is-open .toc-item:nth-child(n+6) { transition-delay: .18s; }

.toc-item:last-child { border-bottom: none; }

.toc-link {
    display: flex; align-items: center; gap: 12px; padding: 12px 20px;
    color: var(--toc-text); text-decoration: none;
    transition: background var(--toc-transition), color var(--toc-transition), padding-left var(--toc-transition);
    position: relative;
}

.toc-link::before {
    content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 3px;
    background: var(--toc-accent); border-radius: 0 3px 3px 0;
    transform: scaleY(0); transition: transform var(--toc-transition);
}

.toc-link:hover, .toc-link:focus-visible {
    background: var(--toc-hover-bg); color: var(--toc-accent); padding-left: 24px; outline: none;
}
.toc-link:hover::before, .toc-link:focus-visible::before { transform: scaleY(1); }

.toc-item.is-active .toc-link { color: var(--toc-accent); background: var(--toc-accent-soft); font-weight: 600; }
.toc-item.is-active .toc-link::before { transform: scaleY(1); }

.toc-num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; height: 26px; background: var(--toc-num-bg); color: var(--toc-num-text);
    border-radius: var(--toc-radius-sm); font-size: .75rem; font-weight: 700; flex-shrink: 0;
    transition: background var(--toc-transition), color var(--toc-transition);
}

.toc-link:hover .toc-num, .toc-item.is-active .toc-num { background: var(--toc-accent); color: #fff; }

.toc-text { font-size: .9rem; line-height: 1.5; flex: 1; font-weight: 500; }

.toc-arrow {
    display: inline-block; width: 6px; height: 6px;
    border-right: 2px solid currentColor; border-top: 2px solid currentColor;
    transform: rotate(45deg); opacity: 0; flex-shrink: 0; transition: opacity var(--toc-transition);
}
.toc-link:hover .toc-arrow { opacity: .6; }

@media (max-width: 600px) {
    .toc-header { padding: 14px 16px; }
    .toc-link { padding: 12px 16px; gap: 10px; }
    .toc-title { font-size: .9rem; }
    .toc-text { font-size: .85rem; }
}