/* IEPC Accessibility Suite v2.0 — Navigation CSS: TOC, focus map, breadcrumbs, cheat-sheet */

.a11y-toc {
    position: fixed;
    top: 80px;
    right: 1.5rem;
    width: 280px;
    max-height: 70vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    z-index: 9995;
    display: none;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
    font-size: .85rem;
    border: 1px solid #e2e8f0;
    resize: horizontal;
    overflow: hidden;
}
.a11y-toc.open { display: flex; }
.a11y-toc.pinned { resize: both; min-width: 220px; }
.a11y-toc-header {
    background: linear-gradient(135deg, #4f46e5, #3730a3);
    color: #fff;
    padding: .6rem .8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.a11y-toc-header h3 { margin: 0; font-size: .9rem; font-weight: 600; display: flex; align-items: center; gap: .35rem; }
.a11y-toc-actions { display: flex; gap: .2rem; }
.a11y-toc-btn {
    background: transparent; border: 0; color: #fff; cursor: pointer;
    padding: .2rem .4rem; border-radius: 4px; font-size: .8rem;
}
.a11y-toc-btn:hover { background: rgba(255, 255, 255, 0.15); }
.a11y-toc-body { padding: .5rem; overflow-y: auto; flex-grow: 1; }
.a11y-toc-list { list-style: none; padding: 0; margin: 0; }
.a11y-toc-list li { margin: 0; }
.a11y-toc-list a {
    display: block;
    padding: .35rem .55rem;
    color: #1e293b;
    text-decoration: none;
    border-radius: 4px;
    border-left: 3px solid transparent;
    line-height: 1.35;
}
.a11y-toc-list a:hover { background: #f1f5f9; }
.a11y-toc-list a.current {
    background: #eef2ff;
    border-left-color: #4f46e5;
    color: #4f46e5;
    font-weight: 600;
}
.a11y-toc-h1 a { font-weight: 700; font-size: .9rem; }
.a11y-toc-h2 a { padding-left: .85rem; }
.a11y-toc-h3 a { padding-left: 1.15rem; font-size: .8rem; }
.a11y-toc-h4 a { padding-left: 1.45rem; font-size: .8rem; }
.a11y-toc-h5 a, .a11y-toc-h6 a { padding-left: 1.75rem; font-size: .78rem; opacity: 0.85; }
.a11y-toc-empty { padding: 1rem; color: #64748b; font-size: .85rem; }
.a11y-toc-footer { padding: .4rem; border-top: 1px solid #e2e8f0; text-align: center; }
.a11y-toc-toggle {
    background: transparent; border: 0; color: #64748b; cursor: pointer;
    font-size: .75rem; padding: .25rem .55rem; border-radius: 4px;
}
.a11y-toc-toggle:hover { background: #f1f5f9; }
.a11y-toc.pinned .a11y-toc-toggle { color: #4f46e5; font-weight: 600; }

body.a11y-skin-dark .a11y-toc { background: #1e293b; color: #f1f5f9; border-color: #334155; }
body.a11y-skin-dark .a11y-toc-list a { color: #f1f5f9; }
body.a11y-skin-dark .a11y-toc-list a:hover { background: #334155; }
body.a11y-skin-dark .a11y-toc-list a.current { background: #312e81; border-left-color: #818cf8; color: #c7d2fe; }
body.a11y-skin-dark .a11y-toc-footer { border-top-color: #334155; }

/* ── Focus map ────────────────────────────────────────────────── */
.a11y-focus-map-item { outline: 2px dashed #4f46e5 !important; outline-offset: 4px; }
.a11y-focus-map-num {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #4f46e5;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
    z-index: 10000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    font-family: 'SF Mono', monospace;
}

/* ── Breadcrumb position ──────────────────────────────────────── */
.a11y-breadcrumb {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #475569;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    z-index: 9996;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    opacity: 0.85;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.a11y-skin-dark .a11y-breadcrumb { background: rgba(30, 41, 59, 0.95); color: #cbd5e1; }
@media print { .a11y-breadcrumb { display: none !important; } }

/* ── Cheat-sheet overlay ──────────────────────────────────────── */
.a11y-cheatsheet {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    font-family: 'Inter', sans-serif;
}
.a11y-cheatsheet.open { display: flex; }
.a11y-cheatsheet-box {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.a11y-cheatsheet-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent; border: 0; color: #64748b; cursor: pointer;
    font-size: 1.4rem;
    width: 36px; height: 36px;
    border-radius: 8px;
}
.a11y-cheatsheet-close:hover { background: #f1f5f9; color: #1e293b; }
.a11y-cheatsheet-box h2 {
    margin: 0 0 .25rem 0;
    color: #4f46e5;
    display: flex; align-items: center; gap: .5rem;
}
.a11y-cheatsheet-intro { color: #64748b; font-size: .85rem; margin: 0 0 1.5rem 0; }
.a11y-cheatsheet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}
.a11y-cheatsheet-group h3 {
    margin: 0 0 .65rem 0;
    color: #1e293b;
    font-size: 1rem;
    border-bottom: 2px solid #eef2ff;
    padding-bottom: .35rem;
}
.a11y-cheatsheet-group dl { margin: 0; }
.a11y-cheatsheet-group dt {
    display: inline-block;
    margin-right: .65rem;
    min-width: 80px;
    vertical-align: top;
}
.a11y-cheatsheet-group dd {
    display: inline;
    margin: 0;
    color: #475569;
    font-size: .88rem;
}
.a11y-cheatsheet-group dl > div { margin-bottom: .4rem; }
body.a11y-skin-dark .a11y-cheatsheet-box { background: #1e293b; color: #f1f5f9; }
body.a11y-skin-dark .a11y-cheatsheet-box h2 { color: #818cf8; }
body.a11y-skin-dark .a11y-cheatsheet-group h3 { color: #f1f5f9; border-bottom-color: #334155; }
body.a11y-skin-dark .a11y-cheatsheet-group dd { color: #cbd5e1; }
body.a11y-skin-dark .a11y-cheatsheet-close { color: #94a3b8; }
body.a11y-skin-dark .a11y-cheatsheet-close:hover { background: #334155; color: #f1f5f9; }
