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

.svwRain {
    position: relative;
    --svw-fullscreen-max-width: 100%;
    --svw-rain-ring-track: #1ab2ce;
    --svw-rain-ring-fill: #126dff;
    --svw-rain-row-a: rgba(21, 128, 116, 0.62);
    --svw-rain-row-b: rgba(11, 99, 91, 0.72);
    box-sizing: border-box;
    container-type: inline-size;
    width: 100%;
    max-width: none;
    padding: 10px 10px 9px;
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: clip;
}

.svwRain__body {
    position: relative;
}

.svwRain__top {
    text-align: center;
}

.svwRain__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 44px;
    margin: 0 auto 5px;
    color: #ffffff;
}

.svwRain__icon svg {
    display: block;
    width: 60px;
    height: 44px;
}

.svwRain__indicators {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(8px, 4cqw, 24px);
    align-items: start;
    width: 100%;
}

.svwRain__indicator {
    min-width: 0;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.svwRain__ring {
    display: grid;
    place-items: center;
    width: 76px;
    aspect-ratio: 1;
    margin: 0 auto 7px;
    border-radius: 50%;
    background: conic-gradient(var(--svw-rain-ring-fill) 0deg var(--svw-rain-progress, 0deg), var(--svw-rain-ring-track) var(--svw-rain-progress, 0deg) 360deg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.svwRain__ring::before {
    content: "";
    grid-area: 1 / 1;
    width: 58px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--svw-background, #0b5a52);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.18);
}

.svwRain__ringValue {
    grid-area: 1 / 1;
    position: relative;
    z-index: 1;
    max-width: 54px;
    color: #ffffff;
    font-size: 0.96rem;
    line-height: 1;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.svwRain__indicatorLabel {
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.18;
    font-weight: 700;
}

.svwRain__indicatorRain {
    margin-top: 3px;
    color: #ffffff;
    font-size: 1.02rem;
    line-height: 1.1;
    font-weight: 700;
    white-space: nowrap;
}

.svwRain__indicatorRain span {
    margin-left: 1px;
    font-size: 0.7em;
}

.svwRain__indicatorAverage {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.66rem;
    line-height: 1.16;
    font-weight: 600;
    white-space: nowrap;
}

.svwRain__toggle {
    display: block;
    margin: 13px auto 0;
    padding: 2px 9px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-size: 0.76rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0;
    cursor: pointer;
}

.svwRain__toggle:hover,
.svwRain__toggle:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    outline: 2px solid rgba(255, 255, 255, 0.56);
    outline-offset: 2px;
}

.svwRain__details {
    margin-top: 9px;
    width: 100%;
}

.svwRain__details[hidden] {
    display: none;
}

.svwRain__lastRain,
.svwRain__row {
    display: grid;
    grid-template-columns: minmax(8rem, 34%) minmax(0, 66%);
    align-items: center;
    min-height: 34px;
    padding: 5px clamp(8px, 2cqw, 14px);
    color: #ffffff;
}

.svwRain__lastRain {
    background: var(--svw-rain-row-b);
}

.svwRain__row:nth-child(odd) {
    background: var(--svw-rain-row-a);
}

.svwRain__row:nth-child(even) {
    background: var(--svw-rain-row-b);
}

.svwRain__rowLabel {
    min-width: 0;
    color: #ffffff;
    font-size: 0.85rem;
    line-height: 1.15;
    font-weight: 700;
}

.svwRain__lastRainValue,
.svwRain__rowValue {
    min-width: 0;
    color: #ffffff;
    font-size: 0.85rem;
    line-height: 1.16;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.svwRain__rowPrimary,
.svwRain__rowSecondary {
    display: block;
}

.svwRain__rowPrimary {
    font-weight: 700;
}

.svwRain__rowSecondary {
    min-height: 0;
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.68rem;
    line-height: 1.14;
}

.svwRain__rowSecondary:empty {
    display: none;
}

.svwRain__status {
    min-height: 0;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8rem;
    line-height: 1.2;
    text-align: center;
}

.svwRain__status:empty {
    display: none;
}

.svwRain__status:not(:empty) {
    margin-top: 6px;
}

.svwRain[data-svw-rain-refreshing="true"] .svwRain__body {
    opacity: 0.66;
}

.svwRain .svwBlockFooterRow {
    margin-top: 4px;
    padding-top: 0;
}

.svwRain .svwBlockFooterRow__updated {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 400;
    line-height: 1.15;
}

.svwRain .svwBlockFooterRow .svwBlockControls {
    gap: 4px;
}

.svwRain .svwBlockControls__button {
    opacity: 0.84;
}

@container (max-width: 360px) {
    .svwRain {
        padding: 9px 6px 8px;
    }

    .svwRain__icon,
    .svwRain__icon svg {
        width: 54px;
        height: 40px;
    }

    .svwRain__icon {
        margin-bottom: 4px;
    }

    .svwRain__indicators {
        gap: 5px;
    }

    .svwRain__ring {
        width: 62px;
    }

    .svwRain__ring::before {
        width: 47px;
    }

    .svwRain__ringValue {
        max-width: 44px;
        font-size: 0.78rem;
    }

    .svwRain__indicatorLabel {
        font-size: 0.63rem;
        line-height: 1.2;
    }

    .svwRain__indicatorRain {
        font-size: 0.82rem;
    }

    .svwRain__indicatorAverage {
        font-size: 0.58rem;
        line-height: 1.18;
    }

    .svwRain__lastRain,
    .svwRain__row {
        grid-template-columns: minmax(0, 40%) minmax(0, 60%);
        padding: 5px 6px;
    }

    .svwRain__rowLabel,
    .svwRain__lastRainValue,
    .svwRain__rowValue {
        font-size: 0.76rem;
    }

    .svwRain__rowSecondary {
        font-size: 0.6rem;
    }
}
