/**
 * WS40 Forecast template styles
 *
 * @package WS40
 * @author  Pasqualino De Marco <info@weatherstation40.live>
 */

/* ------------------------------------------------------------------ */
/* Grid                                                                 */
/* ------------------------------------------------------------------ */

.ws40-forecast {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

.ws40-forecast__title {
    font-size: 1.1em;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 14px;
}

.ws40-forecast__grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: visible;
    gap: 12px;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    scrollbar-width: thin;
    scrollbar-color: var(--ws40con-blue, #1D9E75) #e0e0e0;
}

.ws40-forecast__grid::-webkit-scrollbar {
    height: 6px;
}

.ws40-forecast__grid::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 3px;
}

.ws40-forecast__grid::-webkit-scrollbar-thumb {
    background: var(--ws40con-blue, #1D9E75);
    border-radius: 3px;
}

.ws40-forecast__grid::-webkit-scrollbar-button {
    display: none;
}



.ws40-forecast__card {
    flex: 0 0 168px;
    min-width: 168px;
    max-width: 168px;
    scroll-snap-align: start;
}

/* ------------------------------------------------------------------ */
/* Card                                                                 */
/* ------------------------------------------------------------------ */

.ws40-forecast__card {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-top: 3px solid #1D9E75;
    border-radius: 8px;
    padding: 14px 12px 12px;
    text-align: center;
    transition: box-shadow 0.15s ease;
}

.ws40-forecast__card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Day & date */
.ws40-forecast__day {
    font-size: 13px;
    font-weight: 700;
    color: #1d2327;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ws40-forecast__date {
    font-size: 11px;
    color: #8c8f94;
    margin-bottom: 8px;
}

/* Icon */
.ws40-forecast__icon {
    margin-bottom: 4px;
    line-height: 1;
}

.ws40-forecast__icon-img {
    width: 56px;
    height: 56px;
    display: inline-block;
}

.ws40-forecast__icon-svg {
    width: 64px;
    height: 64px;
}

.ws40-forecast__icon-emoji {
    font-size: 40px;
    display: inline-block;
    line-height: 1.1;
}

/* Description */
.ws40-forecast__desc {
    font-size: 11px;
    color: #646970;
    margin-bottom: 10px;
    min-height: 16px;
    line-height: 1.3;
}

/* Temps */
.ws40-forecast__temps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: visible;
}

.ws40-forecast__max {
    font-size: 15px;
    font-weight: 700;
    color: #c0392b;
}

.ws40-forecast__sep {
    font-size: 11px;
    color: #c3c4c7;
}

.ws40-forecast__min {
    font-size: 15px;
    font-weight: 700;
    color: #2271b1;
}

/* Extras row */
.ws40-forecast__extras {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 8px;
}

.ws40-forecast__extra {
    font-size: 11px;
    color: #50575e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ws40-forecast__extra-icon {
    font-size: 12px;
}

/* Moon phase */
.ws40-forecast__moon {
    border-top: 1px solid #f0f0f1;
    padding-top: 8px;
    margin-top: 4px;
}

.ws40-forecast__moon-emoji {
    font-size: 18px;
    display: block;
    line-height: 1.2;
}

.ws40-forecast__moon-name {
    font-size: 10px;
    color: #8c8f94;
    display: block;
    margin-top: 2px;
}

/* ------------------------------------------------------------------ */
/* Skeleton loader                                                      */
/* ------------------------------------------------------------------ */

.ws40-forecast__loading .ws40-forecast__skeleton {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-top: 3px solid #dcdcde;
    border-radius: 8px;
    min-height: 200px;
    animation: ws40fc-pulse 1.4s ease-in-out infinite;
}

@keyframes ws40fc-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}



/* Error */
.ws40-forecast__error {
    color: #b32d2e;
    font-size: 13px;
    background: #fef2f2;
    border: 1px solid #f7bdbd;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */

@media (max-width: 480px) {
    .ws40-forecast__icon-img {
        width: 44px;
        height: 44px;
    }
    .ws40-forecast__icon-emoji {
        font-size: 32px;
    }
    .ws40-forecast__max,
    .ws40-forecast__min {
        font-size: 14px;
    }
}
