/*
 * BFH Chart canvases (chart.css)
 *
 * Chart.js is told maintainAspectRatio: false so the canvas can follow the
 * widget's height control; that leaves the wrapper responsible for giving it a
 * height, because a canvas with no styled height collapses to zero.
 */

.bfh-chart-panel {
    display: flex;
    flex-direction: column;
    gap: var(--bfh-space-4);
    padding: var(--bfh-space-5);
    background-color: var(--bfh-surface);
    border: var(--bfh-border-width) solid var(--bfh-border);
    border-radius: var(--bfh-radius-lg);
}

.bfh-chart-panel__title {
    margin: 0;
    font-family: var(--bfh-font-serif);
    font-size: var(--bfh-text-lg);
    font-weight: var(--bfh-font-weight-semibold);
    color: var(--bfh-text-primary);
}

.bfh-radar-chart-wrapper {
    position: relative;
    width: 100%;
    height: var(--bfh-chart-height, 360px);
}

.bfh-radar-chart-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* The same numbers the chart plots, for anyone who will not receive it — a
   screen reader, a print stylesheet, or a browser with scripting off. */
.bfh-chart-fallback ul {
    display: grid;
    gap: var(--bfh-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bfh-chart-fallback li {
    display: flex;
    justify-content: space-between;
    gap: var(--bfh-space-3);
    padding-bottom: var(--bfh-space-2);
    border-bottom: var(--bfh-border-width) solid var(--bfh-border);
    font-size: var(--bfh-text-sm);
    color: var(--bfh-text-secondary);
}

.bfh-chart-fallback li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.bfh-chart-fallback b {
    color: var(--bfh-text-primary);
    font-weight: var(--bfh-font-weight-semibold);
}

@media (max-width: 600px) {
    .bfh-chart-panel {
        padding: var(--bfh-space-4);
    }
}
