/*
 * Heatmaps (docs/adr/0123, components/heatmap.html.twig): five lanes by six
 * rows over a pitch as it's drawn (pitch.css), which isn't to scale. The
 * wide lanes reach the penalty box's sides (25% in from each touchline). The
 * half-spaces end where the six-yard box's sides would be, 45% of the box's
 * width, marked with dashes as there's no six-yard box. The rows are the
 * boxes' edges (14%), the thirds and halfway.
 */
.heatmap {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 25fr 13.75fr 22.5fr 13.75fr 25fr;
    grid-template-rows: 14% 19.333% 16.667% 16.667% 19.333% 14%;
}

/* The centre lane's sides. */
.heatmap__zone:nth-child(5n + 3) {
    border-right: 0.0625rem dashed var(--pitch-line);
    border-left: 0.0625rem dashed var(--pitch-line);
}

.heatmap__zone--sometimes {
    background-color: var(--heat-sometimes);
}

.heatmap__zone--often {
    background-color: var(--heat-often);
}

.heatmap__zone--mostly {
    background-color: var(--heat-mostly);
}

/*
 * A heatmap on a pitch of its own. Its width is set outright: .pitch is a
 * container, which has none of its own to give.
 */
.heatmap-pitch {
    display: block;
    flex: none;
}

.heatmap-pitch--large {
    max-width: 20rem;
}

.heatmap-pitch--small {
    width: 7rem;
}

.heatmap-pitch--tiny {
    width: 3.25rem;
}

/* Lines thin enough not to hide the zones on a little pitch, and no dashes on the smallest. */
.heatmap-pitch--small,
.heatmap-pitch--small > span,
.heatmap-pitch--tiny,
.heatmap-pitch--tiny > span {
    border-width: 0.0625rem;
}

.heatmap-pitch--tiny .heatmap__zone {
    border: 0;
}

.heat-legend__swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border: 0.125rem solid var(--black);
    background-color: var(--pitch);
}

.heat-legend__swatch.heatmap__zone--sometimes {
    background-color: var(--heat-sometimes);
}

.heat-legend__swatch.heatmap__zone--often {
    background-color: var(--heat-often);
}

.heat-legend__swatch.heatmap__zone--mostly {
    background-color: var(--heat-mostly);
}

/* Close under the pitch it explains. */
.heat-legend {
    margin-top: 0.5rem;
    margin-bottom: 0;
}
