/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: var(--bg-color);
    --card: var(--card-bg);
    --border: var(--border-color);
    --text: var(--text-color);
    --text-muted: rgba(255, 255, 255, 0.7);
    --primary: var(--accent-color);
    --accent: var(--primary);
    --muted-bg: rgba(100,116,139,.1);
    --radius: .5rem;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

/* ── Layout ── */
section { padding: 4rem 1rem; }
/*.container { max-width: 1100px; margin: 0 auto; }*/

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

h3.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.category-block { margin-bottom: 3rem; }

/* ── Accordion wrapper ── */
.accordion { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 2rem; }

/* ── Accordion item ── */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    transition: border-color .2s;
}
.accordion-item.open { border-color: rgba(100,255,218,0.5); }
.accordion-item.legend-item { background: linear-gradient(to right, rgba(99,102,241,.05), rgba(139,92,246,.05)); }
.accordion-item.legend-item.open { border-color: rgba(99,102,241,.5); }

/* ── Trigger (header row) ── */
.accordion-trigger {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text);
    text-align: left;
    transition: background .2s;
}
.accordion-trigger:hover { background: var(--muted-bg); }

.trigger-inner { flex: 1; min-width: 0; }

/* desktop grid */
.trigger-grid {
    display: none;
    grid-template-columns: 5fr 2fr 5fr;
    gap: 1rem;
    align-items: center;
    width: 100%;
}
@media (min-width: 768px) { .trigger-grid { display: grid; } }

.trigger-grid .tp-name {
    font-size: .9375rem;
    font-weight: 600;
    transition: color .2s;
}
.accordion-trigger:hover .tp-name { color: var(--primary); }

.trigger-grid .tp-dates {
    font-size: .75rem;
    color: var(--text-muted);
}

/* mobile layout */
.trigger-mobile { display: block; }
@media (min-width: 768px) { .trigger-mobile { display: none; } }

.trigger-mobile .tp-name {
    font-size: .9375rem;
    font-weight: 600;
    margin-bottom: .375rem;
}
.trigger-mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}
.trigger-mobile-row .tp-dates {
    font-size: .75rem;
    color: var(--text-muted);
}

/* ── Competency badges ── */
.badges { display: flex; flex-wrap: wrap; gap: .375rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .125rem .625rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
}
.badge svg { width: .625rem; height: .625rem; flex-shrink: 0; }

.badge-more {
    display: inline-flex;
    align-items: center;
    padding: .125rem .625rem;
    border-radius: 9999px;
    font-size: .75rem;
    font-weight: 500;
    background: var(--muted-bg);
    color: var(--text-muted);
}

/* ── Chevron icon ── */
.chevron {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform .2s, color .2s;
}
.accordion-item.open .chevron { transform: rotate(180deg); }
.accordion-trigger:hover .chevron { color: var(--text); }

/* ── Content panel ── */
.accordion-content {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--muted-bg);
    border-top: 1px solid var(--border);
}
.accordion-item.open .accordion-content { display: block; }

/* ── Content internals ── */
.content-section { margin-bottom: 1rem; }
.content-section h5 {
    font-weight: 600;
    margin-bottom: .5rem;
    font-size: .9375rem;
}
.content-section p {
    font-size: .875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.content-section ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-section li {
    font-size: .875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: .25rem;
}

.content-section h4, .content-section h5 {
    color: var(--text);
    margin-top: 1rem;
    margin-bottom: .5rem;
}

.content-section img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.badges-lg .badge {
    padding: .375rem .75rem;
    font-size: .75rem;
}
.badges-lg .badge svg { width: .875rem; height: .875rem; }

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    font-size: .875rem;
    padding-top: .5rem;
    border-top: 1px solid var(--border);
    margin-top: .75rem;
}
.stats-grid .label { color: var(--text-muted); margin-bottom: .125rem; }
.stats-grid .value { font-weight: 600; }

/* ── Legend grid ── */
.legend-grid {
    display: none;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .legend-grid { display: grid; } }

.legend-card {
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--border);
}
.legend-card h4 {
    font-weight: 600;
    margin-bottom: .375rem;
    font-size: .9375rem;
    display: flex;
    align-items: center;
    gap: .375rem;
}
.legend-card p { font-size: .8125rem; color: var(--text-muted); }

.legend-mobile { display: flex; flex-direction: column; gap: .75rem; }
@media (min-width: 768px) { .legend-mobile { display: none; } }

.comp-legend { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.comp-legend h4 { font-weight: 600; margin-bottom: 1rem; }
.comp-legend-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}
@media (min-width: 768px) { .comp-legend-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .comp-legend-grid { grid-template-columns: 1fr 1fr 1fr; } }

.comp-legend-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--text-muted);
}
.color-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

/* ── Legend trigger title ── */
.legend-title { font-size: 1.125rem; font-weight: 600; }
.accordion-trigger:hover .legend-title { color: var(--primary); }