/*
System Name: Samford Valley Weather - Weather station system for South East Queensland, Australia
Component Name: SVW History CSS
Description: Native History public presentation styles.
Module Version: 1.2.0
Author: Steve Parry steve.z.parry@gmail.com
*/

.svwHistory {
    --svw-fullscreen-max-width: 30rem;
    background: var(--svw-public-surface-gradient, radial-gradient(circle at center, #0d665d 0%, #0b5a52 62%, #084d46 100%));
    border-radius: 8px;
    color: #ffffff;
    container-type: inline-size;
    overflow: hidden;
    padding: 0.75rem 0.9rem 0;
}

.svwHistory__header {
    text-align: center;
}

.svwHistory__title {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.55rem;
}

.svwHistory__advisory {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.72rem;
    line-height: 1.05;
    margin: -0.35rem 0 0.45rem;
    text-align: center;
}

.svwHistory__selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin: 0 0 0.7rem;
}

.svwHistory__selectorButton {
    align-items: center;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    height: 2.1rem;
    justify-content: center;
    padding: 0;
    width: 2.1rem;
}

.svwHistory__selectorButton:hover,
.svwHistory__selectorButton:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.svwHistory__selectorButton.is-active {
    background: rgba(255, 255, 255, 0.26);
    border-color: rgba(255, 255, 255, 0.72);
}

.svwHistory__icon {
    display: block;
    filter: brightness(0) invert(1);
    height: 25px;
    max-height: 1.6rem;
    max-width: 1.6rem;
    opacity: 0.9;
    width: 25px;
}

.svwHistory__selectorButton:hover .svwHistory__icon,
.svwHistory__selectorButton:focus-visible .svwHistory__icon,
.svwHistory__selectorButton.is-active .svwHistory__icon {
    opacity: 1;
}

.svwHistory__body {
    display: grid;
    justify-items: center;
    margin-top: 0.2rem;
    width: 100%;
}

.svwHistory__body[hidden],
.svwHistory__table[hidden],
.svwHistory__loading[hidden] {
    display: none;
}

.svwHistory__table {
    border-collapse: collapse;
    font-size: 0.88rem;
    justify-self: center;
    line-height: 1.25;
    margin: 0 auto;
    max-width: 24rem;
    table-layout: fixed;
    width: min(98%, 24rem);
}

.svwHistory__periodColumn {
    width: 62%;
}

.svwHistory__valueColumn {
    width: 38%;
}

.svwHistory__caption {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    text-align: center;
}

.svwHistory__table th,
.svwHistory__table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    padding: 0.34rem 0.45rem;
    vertical-align: middle;
}

.svwHistory__table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.svwHistory__table thead th:first-child {
    text-align: left;
}

.svwHistory__table thead th:nth-child(2) {
    text-align: center;
}

.svwHistory__table tbody th {
    font-weight: 600;
    text-align: left;
}

.svwHistory__table td {
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.svwHistory__table tr.is-empty td {
    opacity: 0.78;
}

.svwHistory__loading {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 5px;
    display: flex;
    font-weight: 700;
    justify-content: center;
    margin: 0 auto;
    max-width: 22rem;
    min-height: 4rem;
    text-align: center;
}

.svwHistory__actions {
    display: flex;
    justify-content: center;
    margin: 0.6rem 0 0.45rem;
}

.svwHistory__close {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.1;
    min-width: 4.5rem;
    padding: 0.45rem 0.75rem;
}

.svwHistory__close:hover,
.svwHistory__close:focus-visible {
    background: rgba(255, 255, 255, 0.24);
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.svwHistory__status {
    font-size: 0.78rem;
    margin: 0;
    min-height: 0;
    text-align: center;
}

.svwHistory__status:empty {
    display: none;
}

.svwHistory__status:not(:empty) {
    margin: 0.2rem 0 0.4rem;
}

@container (max-width: 22rem) {
    .svwHistory {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
    }

    .svwHistory__selectorButton {
        height: 1.95rem;
        width: 1.95rem;
    }

    .svwHistory__table {
        font-size: 0.82rem;
    }

    .svwHistory__table th,
    .svwHistory__table td {
        padding-left: 0.3rem;
        padding-right: 0.3rem;
    }
}
