/* ===================================================================
   5day.info — Design System
   =================================================================== */

:root {
    --pico-font-family-sans-serif:
        Inter, system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif,
        var(--pico-font-family-emoji);
    --pico-font-size: 87.5%;
    --pico-line-height: 1.25;
    --pico-form-element-spacing-vertical: 0.5rem;
    --pico-form-element-spacing-horizontal: 1rem;
    --pico-border-radius: 0.5rem;

    /* Custom palette */
    --card-radius: 16px;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.18);
    --day-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --night-gradient: linear-gradient(135deg, #0c1445 0%, #1a237e 50%, #283593 100%);
    --card-bg-day: rgba(255, 255, 255, 0.12);
    --card-bg-night: rgba(0, 0, 0, 0.25);
    --forecast-bg: rgba(255, 255, 255, 0.06);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    --pico-font-weight: 600;
}

article {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: calc(var(--pico-border-radius) * 2);
}
article > footer {
    border-radius: calc(var(--pico-border-radius) * 2);
}

/* ===================================================================
   Navigation
   =================================================================== */
nav.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 1.5rem;
    max-width: 960px;
    margin: 0 auto;
}

nav.site-nav .brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.2s;
}
nav.site-nav .brand:hover {
    opacity: 0.85;
}
nav.site-nav .brand .brand-sub {
    font-weight: 400;
    opacity: 0.75;
}

nav.site-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav.site-nav .nav-actions button {
    background: none;
    border: 1px solid transparent;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s;
    padding: 0;
    margin: 0;
}
nav.site-nav .nav-actions button:hover {
    background: rgba(128, 128, 128, 0.15);
    border-color: rgba(128, 128, 128, 0.2);
}

nav.site-nav .nav-actions .icon-btn img {
    width: 20px;
    height: 20px;
}

.current-weather {
    border-radius: var(--card-radius);
    padding: 2rem;
    max-width: 480px;
    margin: 0.5rem auto 1rem;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.current-weather.is-day {
    background: var(--day-gradient);
    color: #fff;
}
.current-weather.is-night {
    background: var(--night-gradient);
    color: #e8eaf6;
}

.current-weather .location-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 0.25rem;
    opacity: 0.9;
    letter-spacing: 0.02em;
}
.current-weather .current-temp {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0.25rem 0;
    line-height: 1;
    letter-spacing: -0.03em;
}
.current-weather .current-condition {
    font-size: 0.95rem;
    opacity: 0.85;
    margin: 0.25rem 0 0;
    font-weight: 400;
}
.current-weather .current-icon {
    width: 90px;
    height: 90px;
    margin: 0.5rem auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}
.current-weather .current-hilo {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
}
.current-weather .current-hilo span {
    opacity: 0.85;
}
.current-weather .current-details {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    opacity: 0.75;
}
.current-weather .detail-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    filter: invert(1);
    opacity: 0.8;
}

/* Alert badge inside hero */
.alert-badge {
    margin: 0.5rem auto 0;
    max-width: 420px;
}
.alert-badge section {
    margin: 0;
}
#weather-alert {
    background: rgba(20, 10, 0, 0.75);
    border: 1px solid rgba(255, 193, 7, 0.6);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    font-size: 0.85rem;
    color: #fff;
}
#weather-alert summary {
    font-weight: 600;
    color: #ffc107;
    cursor: pointer;
}
#weather-alert p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

/* ===================================================================
   Forecast Grid
   =================================================================== */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    max-width: 560px;
    margin: 0 auto 1.5rem;
    padding: 0 0.5rem;
}

@media (max-width: 600px) {
    .forecast-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Individual forecast card */
.forecast-card {
    background: var(--forecast-bg);
    border: 1px solid rgba(128, 128, 128, 0.15);
    border-radius: 12px;
    padding: 1rem 0.75rem;
    text-align: center;
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        background 0.2s;
    cursor: default;
}
.forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: rgba(128, 128, 128, 0.1);
}

.forecast-card .fc-day {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.7;
    margin: 0 0 0.5rem;
}
.forecast-card .fc-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    display: block;
}
.forecast-card .fc-condition {
    font-size: 0.7rem;
    opacity: 0.6;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    min-height: 1.8em;
}
.forecast-card .fc-temps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.forecast-card .fc-high {
    font-weight: 600;
}
.forecast-card .fc-low {
    opacity: 0.5;
}
.forecast-card .fc-precip {
    font-size: 0.68rem;
    opacity: 0.6;
    margin: 0.2rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
}
.forecast-card .fc-precip-icon {
    width: 16px;
    height: 16px;
}

/* ===================================================================
   Location Form
   =================================================================== */
.location-form-wrap {
    max-width: 400px;
    margin: 3rem auto;
    text-align: center;
    padding: 0 1rem;
}
.location-form-wrap h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}
.location-form-wrap p {
    opacity: 0.6;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}
.location-form-wrap .form-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.location-form-wrap .form-row input {
    flex: 1;
}
.location-form-wrap .form-row button {
    white-space: nowrap;
}

/* ===================================================================
   Loading indicator
   =================================================================== */
.htmx-indicator {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
}
.htmx-indicator img {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    animation: pulse 1.5s ease-in-out infinite;
}
.htmx-indicator p {
    opacity: 0.5;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}
.htmx-indicator.htmx-request {
    display: block;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.95);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* ===================================================================
   Footer
   =================================================================== */
footer.site-footer {
    text-align: center;
    padding: 1.5rem;
    opacity: 0.4;
    font-size: 0.8rem;
    margin-top: auto;
}

/* ===================================================================
   Page layout
   =================================================================== */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main {
    flex: 1;
}

/* Transitions */
main {
    view-transition-name: main-content;
}
