/*
 * Værstasjon – tillegg: historikk. Lastes sammen med weather-station-history.js, etter weather-station.css.
 */

.wx-history { margin-top: var(--wx-l); }
.wx-history > .h4 { margin-bottom: var(--wx-s); }

/* Samme utseende som SkiGeilo sine widget-tabs (citybreak_widget.css), også der den fila ikke er lastet */
.wx-weather .widget-tabs {
    display: flex;
    gap: var(--wx-xs);
    overflow-x: auto;
    padding: 0 0 var(--wx-s);
}
.wx-weather .widget-tabs .widget-tab {
    align-items: center;
    background: var(--wx-white);
    border: none;
    border-bottom: 2px solid transparent;
    box-shadow: var(--wx-shadow);
    color: var(--wx-ink);
    cursor: pointer;
    display: flex;
    flex: 1 1 25%;
    font-family: "Avenir", sans-serif;
    font-size: .875rem;
    font-weight: 550;
    justify-content: center;
    padding: var(--wx-xs);
    position: relative;
    text-align: center;
    white-space: nowrap;
}
.wx-weather .widget-tabs .widget-tab:hover { background-color: var(--wx-cta-hover); color: #FFF; }
.wx-weather .widget-tabs .widget-tab:active { background-color: var(--wx-cta-active); }
.wx-weather .widget-tabs .widget-tab.active,
.wx-weather .widget-tabs .widget-tab.active:hover {
    background: var(--wx-white);
    border-bottom-color: var(--wx-cta-hover);
    color: var(--wx-cta-hover);
}
.wx-weather .widget-tabs .widget-tab.active::after {
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--wx-cta-hover);
    bottom: -10px;
    content: "";
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
}
.wx-weather .widget-tabs .widget-tab:focus-visible { outline: 2px solid var(--wx-blue); outline-offset: 2px; }
@media (min-width: 768px) {
    .wx-weather .widget-tabs .widget-tab { font-size: 1rem; padding: var(--wx-s); }
}

.wx-custom-range {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: var(--wx-s);
    margin: var(--wx-s) 0 0;
}
.wx-custom-range[hidden] { display: none; }
.wx-custom-range label { font-weight: 550; margin: 0; }
.wx-custom-range .form-control { border-radius: 0; margin-top: 4px; min-width: 11rem; }

.wx-history-status { color: var(--wx-muted); font-weight: 550; margin: var(--wx-s) 0; min-height: 1.25em; }

.wx-chart-head { align-items: baseline; display: flex; flex-wrap: wrap; gap: var(--wx-xs) var(--wx-m); justify-content: space-between; }
.wx-chart-head .card-title { margin-bottom: var(--wx-xs); }
.wx-chart-unit { color: var(--wx-muted); font-weight: 550; text-transform: none; }

.wx-legend { display: flex; gap: var(--wx-s); list-style: none; margin: 0 0 var(--wx-xs); padding: 0; font-size: .875rem; color: var(--wx-muted); }
.wx-legend li { align-items: center; display: flex; gap: 6px; }
.wx-key { display: inline-block; height: 10px; width: 18px; }
.wx-key--line { background: var(--wx-blue); height: 2px; }
.wx-key--band { background: var(--wx-lightblue); opacity: .5; }

.wx-chart { position: relative; min-height: 200px; }
.wx-card--primary .wx-chart { min-height: 260px; }
.wx-chart-svg { display: block; max-width: 100%; height: auto; }
.wx-empty { color: var(--wx-muted); margin: var(--wx-l) 0; text-align: center; }

.wx-grid line { stroke: var(--wx-grid); stroke-width: 1; }
.wx-grid line.wx-zero { stroke: var(--wx-lightblue); }
.wx-grid text { fill: var(--wx-muted); font-size: 11px; font-family: "Avenir", sans-serif; }
.wx-band { fill: var(--wx-lightblue); fill-opacity: .4; }
.wx-line { fill: none; stroke: var(--wx-blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wx-dot { fill: var(--wx-blue); stroke: var(--wx-white); stroke-width: 2; }
.wx-cross { stroke: var(--wx-muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }

.wx-tooltip {
    background: var(--wx-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    font-size: .875rem;
    line-height: 1.35;
    padding: var(--wx-xs) 12px;
    pointer-events: none;
    position: absolute;
    top: 0;
    white-space: nowrap;
    z-index: 2;
}
.wx-tooltip-when { color: var(--wx-muted); font-size: .75rem; text-transform: capitalize; }
.wx-tooltip-range { color: var(--wx-muted); }

.wx-table { margin-top: var(--wx-s); font-size: .875rem; }
.wx-table summary { color: var(--wx-link); cursor: pointer; font-weight: 550; }
.wx-table > div { max-height: 280px; overflow: auto; margin-top: var(--wx-xs); }
.wx-table table { margin: 0; width: 100%; }
.wx-table th[scope="row"] { font-weight: 450; text-transform: capitalize; }
