/*
 * Weather page (templates/weather.html.twig). Loaded only on /weather.
 * Builds on Bulma and the colour variables defined in custom.css.
 *
 * The conditions markup comes from the Here Weather plugin (h2, article.weather-info,
 * img, AccuWeather link), so every rule below targets those tags inside .weather-card.
 *
 * The plugin's article.weather-info holds, in this order: img, p (conditions),
 * p (<strong>Temperature:</strong> text), p (<strong>Winds:</strong> text).
 */

.weather-page {
    overflow-x: hidden;
}

.weather-container {
    min-width: 0;
}

.weather-page .section {
    padding-top: clamp(1.5rem, 4vw, 3rem);
    padding-bottom: clamp(1.5rem, 4vw, 3rem);
}

/* Current conditions card */
.weather-card {
    max-width: 40rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid var(--jacobson-border);
    border-radius: 12px;
    background: var(--jacobson-surface);
    color: var(--jacobson-ink);
    overflow-wrap: anywhere;
}

.weather-card h2 {
    margin: 0 0 0.75rem;
    color: var(--jacobson-ink);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
}

.weather-card article {
    font-size: 1.25rem;
    line-height: 1.5;
}

.weather-card img {
    display: inline-block;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.weather-card p {
    margin: 0 0 0.75rem;
}

/*
 * Icon on the left; temperature (largest), then conditions, then wind on the right.
 * Only the visual order changes. The text still reads conditions, temperature, wind.
 */
.weather-card .weather-info {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 1rem;
    align-items: center;
}

.weather-card .weather-info img {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: clamp(3.5rem, 18vw, 5rem);
}

.weather-card .weather-info p {
    grid-column: 2;
}

.weather-card .weather-info p:nth-of-type(1) {
    grid-row: 2;
    font-size: 1.25rem;
    font-weight: 500;
}

.weather-card .weather-info p:nth-of-type(2) {
    grid-row: 1;
    font-size: clamp(1.75rem, 8vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
}

.weather-card .weather-info p:nth-of-type(2) strong {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
}

.weather-card .weather-info p:nth-of-type(3) {
    grid-row: 3;
    font-size: 1.125rem;
}

/* If the plugin's markup changes, the card still reads in a plain column. */
.weather-card .weather-info:not(:has(img)) {
    display: block;
}

.weather-card a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--jacobson-blue);
    font-weight: 500;
    text-decoration: underline;
}

.weather-card a:hover {
    color: var(--jacobson-blue-dark);
}

.weather-card-fallback p:last-child,
.weather-card-body > :last-child {
    margin-bottom: 0;
}

/* Map */
.weather-map {
    margin: 0;
}

#map.weather-map-canvas {
    height: clamp(18rem, 50vh, 28rem);
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--jacobson-border);
    border-radius: 12px;
    background: #e9edf2;
}

.weather-map-caption {
    margin-top: 0.5rem;
    color: var(--jacobson-ink);
    font-size: 0.95rem;
}

/* Tiles, content and CTAs sit inside the same container as the rest */
.weather-page .tiles-container,
.weather-page .cta-rows-container,
.weather-page .content {
    min-width: 0;
}

.weather-page .cta-rows-container {
    margin-top: 0;
    margin-bottom: 0;
}

.weather-page .content img,
.weather-page .tile-image img,
.weather-page .cta-image img {
    max-width: 100%;
    height: auto;
}

/* Touch targets: buttons and tile links at least 44px tall */
.weather-page .button {
    min-height: 44px;
    white-space: normal;
    height: auto;
}

.weather-page .tile-card-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* Phones: one column, same order, no sideways scroll */
@media screen and (max-width: 768px) {
    .weather-page .section {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .weather-card {
        max-width: none;
    }

    #map.weather-map-canvas {
        height: 18rem;
    }

    .weather-page .cta-row .button {
        display: flex;
        width: 100%;
    }
}
