/*
 * MeteoArchidona
 * Página Actualidad
 *
 * Estilos exclusivos de:
 *
 *     pages/actualidad.html
 *
 * La cabecera general y la navegación principal pertenecen a index.html
 * y no forman parte de esta hoja de estilos.
 */


/* La paleta está en css/paleta.css, que se carga antes que esta hoja. */


* {
    box-sizing: border-box;
}


html {
    min-width: 320px;
    min-height: 100%;
}


body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background:
        radial-gradient(
            circle at top,
            #0b1b2d 0,
            var(--bg) 38%
        );
    color: var(--text);
    font-family: "Sora", sans-serif;
}


a {
    color: inherit;
    text-decoration: none;
}


button {
    font: inherit;
}


/* ==========================================================
   LLUVIA VISUAL
   ========================================================== */


.capa-lluvia,
.capa-lluvia-ficha,
.capa-gotas-cristal,
.capa-gotas-cristal-ficha {
    display: none;
    overflow: hidden;
    pointer-events: none;
}


.capa-lluvia,
.capa-lluvia-ficha {
    --factor-duracion: 1;
    --factor-longitud: 1;
    --factor-opacidad: 1;
    --ancho-gota: 1px;
    --inicio-x: 0px;
    --final-x: 0px;
    --recorrido-y: 1200px;
    --angulo-gota: 0deg;
}


.capa-lluvia {
    position: fixed;
    inset: 0;
    z-index: 100;
}


.capa-gotas-cristal {
    position: fixed;
    inset: 0;
    z-index: 101;
}


.capa-lluvia-ficha,
.capa-gotas-cristal-ficha {
    position: absolute;
    inset: 0;
    border-radius: inherit;
}


.capa-lluvia-ficha {
    z-index: 12;
}


.capa-gotas-cristal-ficha {
    z-index: 13;
}


.capa-lluvia.activa,
.capa-lluvia-ficha.activa,
.capa-gotas-cristal.activa,
.capa-gotas-cristal-ficha.activa {
    display: block;
}


.nivel-1 {
    --factor-duracion: 1.80;
    --factor-longitud: 0.52;
    --factor-opacidad: 0.38;
    --ancho-gota: 0.7px;
}


.capa-lluvia.nivel-1 {
    background: rgba(8, 22, 34, 0.005);
}


.capa-lluvia-ficha.nivel-1 {
    background: rgba(8, 22, 34, 0.009);
}


.nivel-1 .gota-lluvia:nth-child(n+17) {
    display: none;
}


.nivel-2 {
    --factor-duracion: 1.18;
    --factor-longitud: 0.88;
    --factor-opacidad: 0.62;
    --ancho-gota: 1px;
}


.capa-lluvia.nivel-2 {
    background: rgba(8, 22, 34, 0.020);
}


.capa-lluvia-ficha.nivel-2 {
    background: rgba(8, 22, 34, 0.030);
}


.nivel-2 .gota-lluvia:nth-child(n+49) {
    display: none;
}


.nivel-3 {
    --factor-duracion: 0.76;
    --factor-longitud: 1.32;
    --factor-opacidad: 0.84;
    --ancho-gota: 1.4px;
}


.capa-lluvia.nivel-3 {
    background: rgba(6, 19, 31, 0.052);
}


.capa-lluvia-ficha.nivel-3 {
    background: rgba(6, 19, 31, 0.072);
}


.nivel-3 .gota-lluvia:nth-child(n+97) {
    display: none;
}


.nivel-4 {
    --factor-duracion: 0.44;
    --factor-longitud: 1.90;
    --factor-opacidad: 1;
    --ancho-gota: 2px;
}


.capa-lluvia.nivel-4 {
    background: rgba(4, 16, 28, 0.105);
}


.capa-lluvia-ficha.nivel-4 {
    background: rgba(4, 16, 28, 0.135);
}


.nivel-4 .gota-lluvia {
    display: block;
}


.gota-lluvia {
    position: absolute;
    top: -18%;
    left: var(--x);
    width: var(--ancho-gota);
    height:
        calc(
            var(--longitud)
            *
            var(--factor-longitud)
        );
    opacity:
        calc(
            var(--opacidad)
            *
            var(--factor-opacidad)
        );
    border-radius: 999px;
    background:
        linear-gradient(
            to bottom,
            rgba(194, 231, 255, 0),
            rgba(180, 226, 255, 0.98)
        );
    box-shadow:
        0 0 4px
        rgba(116, 201, 255, 0.34);
    animation-name: caer-lluvia;
    animation-duration:
        calc(
            var(--duracion)
            *
            var(--factor-duracion)
        );
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-delay: var(--retraso);
    will-change: transform;
}


.nivel-4 .gota-lluvia:nth-child(3n) {
    box-shadow:
        0 0 7px
        rgba(166, 222, 255, 0.54);
}


@keyframes caer-lluvia {

    from {
        transform:
            translate3d(
                var(--inicio-x),
                -40px,
                0
            )
            rotate(
                var(--angulo-gota)
            );
    }

    to {
        transform:
            translate3d(
                var(--final-x),
                var(--recorrido-y),
                0
            )
            rotate(
                var(--angulo-gota)
            );
    }

}


.gota-cristal {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--tamano);
    height:
        calc(
            var(--tamano)
            *
            1.24
        );
    border-radius:
        54% 46% 59% 41%
        /
        44% 47% 53% 56%;
    border:
        1px solid
        rgba(220, 244, 255, 0.18);
    background:
        radial-gradient(
            circle at 32% 24%,
            rgba(255, 255, 255, 0.38),
            rgba(177, 225, 251, 0.12) 30%,
            rgba(86, 161, 205, 0.06) 67%,
            rgba(255, 255, 255, 0.02)
        );
    box-shadow:
        inset 1px 1px 2px
        rgba(255, 255, 255, 0.18),
        0 1px 4px
        rgba(0, 0, 0, 0.16);
    opacity: 0;
    transform: scale(0.65);
    animation:
        vida-gota-cristal
        var(--vida)
        ease-in-out
        forwards;
    will-change: transform, opacity;
}


.gota-cristal::after {
    content: "";
    position: absolute;
    width: 28%;
    height: 20%;
    left: 20%;
    top: 17%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.36);
    filter: blur(0.3px);
}


@keyframes vida-gota-cristal {

    0% {
        opacity: 0;
        transform:
            translate3d(
                0,
                -3px,
                0
            )
            scale(0.55);
    }

    12% {
        opacity: var(--opacidad-cristal);
        transform:
            translate3d(
                0,
                0,
                0
            )
            scale(1);
    }

    70% {
        opacity:
            calc(
                var(--opacidad-cristal)
                *
                0.88
            );
        transform:
            translate3d(
                var(--desvio-x),
                calc(
                    var(--deslizar)
                    *
                    0.25
                ),
                0
            )
            scale(0.98);
    }

    100% {
        opacity: 0;
        transform:
            translate3d(
                var(--desvio-x),
                var(--deslizar),
                0
            )
            scale(0.88);
    }

}


/* ==========================================================
   ICONO METEOROLÓGICO
   ========================================================== */


.sol {
    position: absolute;
    top: 3px;
    left: 25px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background:
        linear-gradient(
            135deg,
            #ffd44f,
            var(--accent)
        );
    box-shadow:
        0 0 24px
        rgba(240, 165, 0, 0.28);
}


.nube {
    position: absolute;
    left: 10px;
    bottom: 7px;
    width: 52px;
    height: 23px;
    border:
        2px solid
        #e5edf5;
    border-radius: 22px;
    background: var(--bg);
}


.nube::before,
.nube::after {
    content: "";
    position: absolute;
    background: var(--bg);
    border:
        2px solid
        #e5edf5;
    border-bottom: 0;
    border-radius:
        50% 50% 0 0;
}


.nube::before {
    width: 21px;
    height: 17px;
    left: 7px;
    top: -13px;
}


.nube::after {
    width: 25px;
    height: 21px;
    left: 23px;
    top: -17px;
}


/* ==========================================================
   CONTENIDO DE ACTUALIDAD
   ========================================================== */


.contenido {
    width: min(1800px, 100%);
    margin: 0 auto;
    padding:
        18px
        clamp(
            18px,
            2vw,
            34px
        )
        28px;
}


.panel-superior {
    display: grid;
    grid-template-columns:
        250px
        minmax(0, 1fr)
        minmax(0, 1fr);
    gap: 14px;
}


/*
 * Disposición dinámica.
 *
 * Estas reglas solo entran en funcionamiento cuando JavaScript
 * activa la clase panel-superior-dinamico.
 *
 * Hasta entonces se conserva exactamente el diseño anterior.
 */

.panel-superior-dinamico {
    grid-template-columns:
        250px
        minmax(0, 1fr);
    align-items: start;
}


.rejilla-estaciones {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    align-items: start;
    gap: 14px;
    min-width: 0;
}


.rejilla-estaciones
.estacion-principal {
    min-width: 0;
}


/*
 * Cuando existe un número impar de estaciones en escritorio, la última
 * ficha no deja una media fila vacía: ocupa las dos columnas.
 *
 * Además, esa ficha utiliza el ancho adicional para redistribuir sus
 * bloques principales en horizontal y reducir su altura.
 *
 * En móvil esta regla no se aplica y todas las fichas conservan su
 * presentación vertical habitual.
 */
@media (min-width: 851px) {

    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }


    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .estacion-contenido {
        display: grid;
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);
        grid-template-areas:
            "cabecera cabecera"
            "lectura lluvia";
        column-gap: 20px;
        align-items: stretch;
    }


    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .estacion-cabecera {
        grid-area: cabecera;
    }


    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .lectura-principal {
        grid-area: lectura;
        grid-template-columns:
            minmax(0, 1fr)
            minmax(225px, 0.8fr);
        align-self: stretch;
    }


    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .lluvia-resumen {
        grid-area: lluvia;
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
        align-self: center;
        margin:
            14px
            0
            12px;
    }


    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .metricas-estacion {
        grid-template-columns:
            repeat(
                6,
                minmax(0, 1fr)
            );
    }


    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .metrica-estacion {
        border-right:
            1px solid
            rgba(255, 255, 255, 0.08);
    }


    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .metrica-estacion:last-child {
        border-right: none;
    }

}


.tarjeta {
    background:
        linear-gradient(
            145deg,
            rgba(17, 30, 46, 0.98),
            rgba(9, 22, 34, 0.98)
        );
    border:
        1px solid
        var(--border);
    border-radius: 11px;
    box-shadow: var(--shadow);
}


/* ==========================================================
   RESUMEN
   ========================================================== */


.resumen {
    display: flex;
    flex-direction: column;
    padding: 20px;
}


.seccion-titulo {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}


.estado {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
}


.punto {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    box-shadow:
        0 0 12px
        rgba(34, 197, 94, 0.5);
}


.estado-grafico {
    display: grid;
    flex: 1 1 auto;
    place-items: center;
    min-height: 220px;
    margin: 13px 0;
}


/*
 * El icono se dibuja con medidas fijas en px (sol, nube y sus
 * pseudoelementos), así que se agranda con scale en lugar de tocar cada
 * medida. min-height de .estado-grafico deja sitio a los 192 px finales.
 */
.estado-grafico .tiempo-icono {
    transform: scale(1.6);
}


.tiempo-icono {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border:
        2px solid
        #244567;
    background:
        radial-gradient(
            circle,
            #163354,
            #0b1724 70%
        );
}


.tiempo-icono .sol {
    width: 42px;
    height: 42px;
    left: 27px;
    top: 24px;
}


.tiempo-icono .nube {
    left: 43px;
    bottom: 25px;
    width: 61px;
    background: #d9e2e9;
    border: none;
}


.tiempo-icono .nube::before,
.tiempo-icono .nube::after {
    background: #d9e2e9;
    border: none;
}


.ubicacion {
    font-size: 18px;
    font-weight: 600;
}


.ubicacion-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}


.sol-horas {
    display: grid;
    grid-template-columns:
        1fr 1fr;
    gap: 10px;
    margin-top: 19px;
    padding-top: 16px;
    border-top:
        1px solid
        var(--border);
}


.sol-hora {
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 12px;
}


.sol-hora span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-family:
        "Sora",
        sans-serif;
    font-size: 10px;
}


/* ==========================================================
   SOL Y LUNA
   ========================================================== */

/*
 * Columna izquierda del panel: «Condiciones actuales» y, debajo,
 * «Sol y luna». Las rellena js/sol-luna.js.
 */
/*
 * La columna se estira hasta el final de las fichas de estaciones
 * (align-self: stretch, frente al start del panel) y las dos tarjetas
 * se reparten el alto a partes iguales; en cada una, el dibujo central
 * (el tiempo, la luna) se centra en el espacio que sobra.
 */
.columna-resumen {
    display: grid;
    grid-template-rows:
        1fr
        1fr;
    align-self: stretch;
    gap: 14px;
    min-width: 0;
}


/*
 * Dentro, el bloque de la luna se centra en el alto sobrante y las
 * fechas de luna llena y nueva bajan al pie de la tarjeta.
 */
.sol-luna {
    display: flex;
    flex-direction: column;
    padding: 20px;
}


.sol-luna-dia {
    display: grid;
    gap: 4px;
    margin-top: 14px;
}


.sol-luna-etiqueta {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


.sol-luna-duracion {
    color: var(--amber);
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 22px;
    font-weight: 600;
}


.sol-luna-nota {
    color: var(--muted);
    font-size: 11px;
}


.luna {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 16px;
    padding-top: 16px;
    border-top:
        1px solid
        var(--border);
}


.luna-dibujo {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    filter:
        drop-shadow(
            0 0 10px
            rgba(217, 226, 233, 0.18)
        );
}


.luna-sombra {
    fill: #1a2a3c;
    stroke: #244567;
    stroke-width: 2;
}


.luna-luz {
    fill: #e4ebf1;
}


.luna-fase {
    margin-bottom: 3px;
    font-size: 14px;
    font-weight: 600;
}


.sol-luna .luna {
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    text-align: center;
}


.sol-luna .luna-dibujo {
    width: 150px;
    height: 150px;
}


.sol-luna .sol-horas {
    margin-top: 16px;
}


/* ==========================================================
   ESTACIONES
   ========================================================== */


.estacion-principal {
    position: relative;
    overflow: hidden;
    min-height: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(4, 29, 57, 0.35),
            rgba(3, 13, 23, 0.94)
        ),
        radial-gradient(
            circle at 70% 0%,
            rgba(59, 158, 255, 0.28),
            transparent 48%
        ),
        linear-gradient(
            135deg,
            #0d2c49,
            #101c27 60%,
            #07111c
        );
}


.estacion-contenido {
    padding: 18px 20px 0;
}


.estacion-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}


.estacion-nombre {
    margin: 0;
    font-size: 21px;
}


.estacion-localidad {
    margin-top: 3px;
    color: #c7d7e5;
    font-size: 12px;
}


.estacion-localidad:empty {
    display: none;
}


.online {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--green);
    font-size: 11px;
    white-space: nowrap;
}


.lectura-principal {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(225px, 0.72fr);
    align-items: center;
    gap: 18px;
    padding: 14px 0;
}


.temperatura-bloque {
    min-width: 0;
}


.temperatura {
    font-family:
        "JetBrains Mono",
        monospace;
    font-size:
        clamp(
            45px,
            4.4vw,
            68px
        );
    font-weight: 600;
    color: #85c948;
    letter-spacing: -0.06em;
    line-height: 1;
}


.temperatura sup {
    font-size: 24px;
    letter-spacing: 0;
}


.sensacion {
    margin-top: 5px;
    font-size: 12px;
}


.observacion {
    margin-top: 5px;
    color: var(--muted);
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 10px;
}


/* ==========================================================
   VIENTO
   ========================================================== */


.viento-panel {
    display: grid;
    grid-template-columns:
        108px
        minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border:
        1px solid
        rgba(59, 158, 255, 0.20);
    border-radius: 10px;
    background:
        rgba(
            3,
            17,
            29,
            0.58
        );
}


.veleta {
    position: relative;
    width: 106px;
    height: 106px;
    border:
        2px solid
        #315878;
    border-radius: 50%;
    background:
        radial-gradient(
            circle at center,
            rgba(31, 73, 108, 0.45),
            rgba(5, 17, 27, 0.90) 68%
        ),
        repeating-conic-gradient(
            from 0deg,
            rgba(142, 195, 232, 0.22) 0deg,
            rgba(142, 195, 232, 0.22) 1deg,
            transparent 1deg,
            transparent 15deg
        );
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    box-shadow:
        inset 0 0 22px
        rgba(59, 158, 255, 0.08);
    --angulo: 0deg;

    -webkit-touch-callout: none;
}


.veleta::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    transform:
        translate(
            -50%,
            -50%
        );
    border-radius: 50%;
    background: var(--accent);
    box-shadow:
        0 0 10px
        rgba(240, 165, 0, 0.60);
    z-index: 5;
}


@media (hover: hover) {
.veleta:hover {
    border-color: var(--blue);
}
}


.veleta:focus-visible {
    outline:
        2px solid
        var(--cyan);
    outline-offset: 3px;
}


.veleta-cardinal {
    position: absolute;
    color: #dce9f5;
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 9px;
    font-weight: 600;
    z-index: 4;
}


.veleta-n {
    top: 5px;
    left: 50%;
    transform:
        translateX(-50%);
}


.veleta-s {
    bottom: 5px;
    left: 50%;
    transform:
        translateX(-50%);
}


.veleta-e {
    right: 6px;
    top: 50%;
    transform:
        translateY(-50%);
}


.veleta-o {
    left: 6px;
    top: 50%;
    transform:
        translateY(-50%);
}


.veleta-rotor {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform:
        rotate(
            var(--angulo)
        );
    transition:
        transform
        0.45s
        ease;
    z-index: 3;
}


.veleta-aguja {
    position: absolute;
    left: -1.5px;
    bottom: 0;
    width: 3px;
    height: 36px;
    border-radius: 3px;
    background:
        linear-gradient(
            to top,
            #f0a500,
            #ffd257
        );
    box-shadow:
        0 0 7px
        rgba(240, 165, 0, 0.40);
}


.veleta-aguja::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 50%;
    transform:
        translateX(-50%);
    width: 0;
    height: 0;
    border-left:
        5px solid
        transparent;
    border-right:
        5px solid
        transparent;
    border-bottom: 0;
    border-top:
        10px solid
        #ffd257;
}


.viento-datos {
    min-width: 0;
}


.direccion-principal {
    display: flex;
    align-items: baseline;
    gap: 6px;
}


.direccion-cardinal {
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 23px;
    font-weight: 700;
    color: var(--accent);
}


.direccion-grados {
    color: var(--muted);
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 11px;
}


.viento-actual {
    margin-top: 5px;
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 16px;
    font-weight: 600;
}


.viento-actual small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 400;
}


.viento-secundarios {
    display: grid;
    grid-template-columns:
        1fr 1fr;
    gap: 4px 8px;
    margin-top: 6px;
}


.viento-secundario {
    min-width: 0;
    color: var(--muted);
    font-size: 8px;
}


.viento-secundario strong {
    display: block;
    margin-top: 1px;
    color: var(--text);
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
}


.simulacion-estacion {
    display: none;
    margin-top: 7px;
    padding: 3px 6px;
    width: fit-content;
    border:
        1px solid
        rgba(54, 213, 255, 0.30);
    border-radius: 999px;
    background:
        rgba(
            3,
            29,
            43,
            0.82
        );
    color: var(--cyan);
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


.simulacion-estacion.visible {
    display: block;
}


/* ==========================================================
   PATROCINIO
   ========================================================== */


/*
 * La estructura de patrocinio se conserva preparada para uso futuro,
 * pero permanece oculta mientras no existan patrocinadores reales.
 *
 * No eliminar: bastará retirar este display:none cuando el contenido
 * comercial sea real y esté aprobado para publicación.
 */
.patrocinio-estacion {
    display: none;
    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;
    align-items: center;
    min-height: 34px;
    margin: 0 0 8px;
    overflow: hidden;
    border:
        1px solid
        rgba(0, 168, 255, 0.42);
    border-radius: 7px;
    background:
        linear-gradient(
            90deg,
            rgba(7, 21, 38, 0.96),
            rgba(13, 32, 53, 0.96)
        );
}


.patrocinio-estacion-titulo {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 10px;
    white-space: nowrap;
    border-right:
        1px solid
        rgba(0, 168, 255, 0.30);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.07em;
    background:
        rgba(
            255,
            255,
            255,
            0.025
        );
}


.patrocinio-estacion-ventana {
    min-width: 0;
    overflow: hidden;

    -webkit-mask-image:
        linear-gradient(
            to right,
            transparent,
            #000 5%,
            #000 95%,
            transparent
        );

    mask-image:
        linear-gradient(
            to right,
            transparent,
            #000 5%,
            #000 95%,
            transparent
        );
}


.patrocinio-estacion-pista {
    display: flex;
    width: max-content;
    animation:
        patrocinio-estacion-desplazar
        21s
        linear
        infinite;
    will-change: transform;
}


.patrocinio-estacion-texto {
    display: block;
    flex: none;
    padding: 0 34px;
    white-space: nowrap;
    color: #00a8ff;
    font-size: 10px;
    font-weight: 600;
    text-shadow:
        0 0 8px
        rgba(0, 168, 255, 0.28);
}


.patrocinio-estacion-texto strong {
    color: #42c7ff;
    font-weight: 800;
    text-shadow:
        0 0 10px
        rgba(66, 199, 255, 0.38);
}


.patrocinio-estacion-control {
    align-self: stretch;
    width: 34px;
    border: 0;
    border-left:
        1px solid
        rgba(0, 168, 255, 0.25);
    background: transparent;
    color: #42c7ff;
    cursor: pointer;
    font-size: 10px;
}


@media (hover: hover) {
.patrocinio-estacion-control:hover {
    background:
        rgba(
            0,
            168,
            255,
            0.07
        );
}
}


.patrocinio-estacion-control:focus-visible {
    outline:
        2px solid
        #00a8ff;
    outline-offset: -3px;
}


.patrocinio-estacion.pausado
.patrocinio-estacion-pista {
    animation-play-state: paused;
}


@keyframes patrocinio-estacion-desplazar {

    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }

}


/* ==========================================================
   RESUMEN DE LLUVIA
   ========================================================== */


.lluvia-resumen {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 7px;
    margin: 0 0 12px;
    padding: 9px 10px;
    border:
        1px solid
        rgba(54, 213, 255, 0.14);
    border-radius: 8px;
    background:
        rgba(
            11,
            35,
            52,
            0.78
        );
}


.lluvia-resumen-item {
    min-width: 0;
    display: grid;
    grid-template-columns:
        30px
        minmax(0, 1fr);
    grid-template-areas:
        "icono label"
        "icono valor"
        "icono extra";
    align-items: center;
    column-gap: 7px;
    min-height: 48px;
    padding: 5px 6px;
    border:
        1px solid
        rgba(54, 213, 255, 0.07);
    border-radius: 6px;
    background:
        rgba(
            5,
            24,
            37,
            0.24
        );
}


.lluvia-resumen-icono {
    grid-area: icono;
    font-size: 21px;
}


.lluvia-resumen-label {
    grid-area: label;
    color: var(--muted);
    font-size: 8px;
    text-transform: uppercase;
}


.lluvia-resumen-valor {
    grid-area: valor;
    margin-top: 2px;
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--cyan);
    white-space: nowrap;
}


.lluvia-resumen-extra {
    grid-area: extra;
    margin-top: 1px;
    color: var(--muted);
    font-size: 7px;
}


/* ==========================================================
   MÉTRICAS
   ========================================================== */


.metricas-estacion {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            1fr
        );
    background:
        rgba(
            3,
            13,
            23,
            0.80
        );
    border-top:
        1px solid
        rgba(255, 255, 255, 0.08);
}


.metrica-estacion {
    min-width: 0;
    padding: 11px 13px;
    border-right:
        1px solid
        rgba(255, 255, 255, 0.08);
    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.06);
}


.metrica-estacion:nth-child(3n) {
    border-right: none;
}


.metrica-label {
    color: var(--muted);
    font-size: 9px;
}


.metrica-valor {
    margin-top: 4px;
    font-family:
        "JetBrains Mono",
        monospace;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}


.metrica-secundaria {
    margin-top: 3px;
    color: var(--muted);
    font-size: 8px;
}


/* ==========================================================
   GRÁFICOS
   ========================================================== */


.paneles-graficos {
    display: grid;
    grid-template-columns:
        1.1fr
        0.85fr
        1fr;
    gap: 14px;
    margin-top: 14px;
}


.grafico {
    min-height: 270px;
    padding: 18px;
}


.grafico-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}


.grafico-titulo {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}


/*
 * "Ver todas →" de la tarjeta de cámaras. Llevaba el color y el tamaño
 * escritos en el propio HTML, y un style en línea manda sobre
 * cualquier hoja: en móvil no había forma de agrandarlo.
 */
.grafico-enlace {
    color: var(--blue);
    font-size: 10px;
}


.leyenda {
    display: flex;
    gap: 14px;
    color: var(--muted);
    font-size: 10px;
}


.leyenda span::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--green);
}


.leyenda span:last-child::before {
    background: var(--blue);
}


.grafico-svg {
    width: 100%;
    height: 185px;
}


.rejilla {
    stroke: #183149;
    stroke-width: 1;
}


.linea-silo {
    fill: none;
    stroke: var(--green);
    stroke-width: 3;
}


.linea-llanos {
    fill: none;
    stroke: var(--blue);
    stroke-width: 3;
}


.barra {
    fill: #3b9eff;
}


/* ==========================================================
   CÁMARAS
   ========================================================== */


.camaras {
    display: grid;
    grid-template-columns:
        1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}


.camara {
    position: relative;
    min-height: 175px;
    overflow: hidden;
    border-radius: 8px;
    border:
        1px solid
        var(--border);
    background:
        linear-gradient(
            to bottom,
            #286ca2 0%,
            #7dbbda 36%,
            #6c8e69 37%,
            #34452f 70%,
            #18251c 100%
        );
}


.camara::before {
    content: "";
    position: absolute;
    left: -5%;
    right: -5%;
    bottom: 32px;
    height: 60px;
    background:
        linear-gradient(
            160deg,
            transparent 35%,
            #334e35 36% 53%,
            #223428 54%
        );
    opacity: 0.9;
}


.camara-estado {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 4px 7px;
    border-radius: 4px;
    background:
        rgba(
            6,
            20,
            31,
            0.75
        );
    font-size: 9px;
}


.camara-nombre {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 10px;
    background:
        rgba(
            4,
            12,
            19,
            0.88
        );
    font-size: 10px;
}


/* ==========================================================
   ACCESOS
   ========================================================== */


.accesos {
    display: grid;
    grid-template-columns:
        repeat(
            6,
            1fr
        );
    gap: 12px;
    margin-top: 14px;
    padding: 18px;
}


.acceso {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border:
        1px solid
        var(--border);
    border-radius: 8px;
    background:
        rgba(
            12,
            28,
            43,
            0.8
        );
}


@media (hover: hover) {
.acceso:hover {
    border-color: #315579;
    transform: translateY(-1px);
}
}


.acceso-icono {
    font-size: 26px;
}


.acceso-titulo {
    font-size: 11px;
    font-weight: 700;
}


.acceso-subtitulo {
    margin-top: 4px;
    color: var(--muted);
    font-size: 9px;
}


/* ==========================================================
   PIE
   ========================================================== */









/* ==========================================================
   RESPONSIVE
   ========================================================== */


@media (max-width: 1250px) {

    .panel-superior {
        grid-template-columns:
            210px
            1fr
            1fr;
    }


    .panel-superior-dinamico {
        grid-template-columns:
            210px
            minmax(0, 1fr);
    }


    .lectura-principal {
        grid-template-columns: 1fr;
    }


    /*
     * La ficha impar a ancho completo dispone de espacio suficiente
     * incluso dentro de este tramo responsive, por lo que conserva
     * temperatura y viento en paralelo.
     */
    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .lectura-principal {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(225px, 0.8fr);
    }


    .viento-panel {
        grid-template-columns:
            100px
            1fr;
    }


    .veleta {
        width: 98px;
        height: 98px;
    }


    .paneles-graficos {
        grid-template-columns:
            1fr 1fr;
    }


    .paneles-graficos
    .grafico:last-child {
        grid-column: 1 / -1;
    }


    .accesos {
        grid-template-columns:
            repeat(
                3,
                1fr
            );
    }

}


@media (max-width: 1100px) {

    .panel-superior {
        grid-template-columns:
            1fr 1fr;
    }


    .panel-superior-dinamico {
        grid-template-columns: 1fr;
    }


    .panel-superior-dinamico
    .rejilla-estaciones {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    /*
     * La columna lateral se esconde ya desde 1100 px: entre 1020 y 1100
     * (tableta apaisada) le quedaban unos 130 px de ancho y salía
     * estrecha y estirada, con el dibujo del tiempo suelto en medio.
     */
    .resumen,
    .columna-resumen {
        display: none;
    }

}


@media (max-width: 850px) {

    .panel-superior {
        grid-template-columns: 1fr;
    }


    .panel-superior-dinamico
    .rejilla-estaciones {
        grid-template-columns: 1fr;
    }


    .lectura-principal {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(230px, 0.8fr);
    }


    .paneles-graficos {
        grid-template-columns: 1fr;
    }


    .paneles-graficos
    .grafico:last-child {
        grid-column: auto;
    }


    .accesos {
        grid-template-columns:
            repeat(
                2,
                1fr
            );
    }

}


@media (max-width: 620px) {

    .contenido {
        padding: 12px;
    }


    .estacion-contenido {
        padding: 16px 16px 0;
    }


    .estacion-nombre {
        font-size: 19px;
    }


    /*
     * También la ficha impar: su regla del tramo de 1250 px es más
     * específica y, sin repetirla aquí, en el móvil dejaba temperatura y
     * viento en paralelo y la veleta tapaba los grados.
     */
    .lectura-principal,
    .rejilla-estaciones
    .estacion-principal:last-child:nth-child(odd)
    .lectura-principal {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 13px 0;
    }


    .temperatura {
        font-size: 47px;
    }


    .viento-panel {
        grid-template-columns:
            106px
            minmax(0, 1fr);
    }


    .veleta {
        width: 104px;
        height: 104px;
    }


    .patrocinio-estacion {
        grid-template-columns:
            auto
            minmax(0, 1fr);
        min-height: 32px;
    }


    .patrocinio-estacion-titulo {
        padding: 0 8px;
        font-size: 8px;
    }


    .patrocinio-estacion-control {
        display: none;
    }


    .patrocinio-estacion-texto {
        padding: 0 26px;
        font-size: 9px;
    }


    .lluvia-resumen {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
        gap: 7px;
        padding: 8px;
    }


    .lluvia-resumen-item {
        grid-template-columns:
            26px
            minmax(0, 1fr);
        padding: 5px 3px;
        column-gap: 5px;
    }


    .lluvia-resumen-icono {
        font-size: 18px;
    }


    .lluvia-resumen-label {
        font-size: 7px;
    }


    .lluvia-resumen-valor {
        font-size: 11px;
    }


    .metricas-estacion {
        grid-template-columns:
            1fr 1fr;
    }


    .metrica-estacion:nth-child(3n) {
        border-right:
            1px solid
            rgba(255, 255, 255, 0.08);
    }


    .metrica-estacion:nth-child(2n) {
        border-right: none;
    }


    .camaras {
        grid-template-columns: 1fr;
    }


    .accesos {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 390px) {

    .viento-panel {
        grid-template-columns:
            94px
            minmax(0, 1fr);
    }


    .veleta {
        width: 92px;
        height: 92px;
    }


    .veleta-aguja {
        height: 31px;
    }


    .direccion-cardinal {
        font-size: 20px;
    }


    .viento-actual {
        font-size: 14px;
    }


    .lluvia-resumen {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .lluvia-resumen-item {
        grid-template-columns:
            22px
            minmax(0, 1fr);
        column-gap: 4px;
    }


    .lluvia-resumen-icono {
        font-size: 16px;
    }


    .lluvia-resumen-valor {
        font-size: 10px;
    }

}


@media (prefers-reduced-motion: reduce) {

    .patrocinio-estacion-pista {
        animation: none;
    }


    .patrocinio-estacion-texto:nth-child(2) {
        display: none;
    }


    .capa-lluvia,
    .capa-lluvia-ficha,
    .capa-gotas-cristal,
    .capa-gotas-cristal-ficha {
        display: none !important;
    }


    .veleta-rotor {
        transition: none;
    }

}


/* ==========================================================
   MÓVIL: LETRA LEGIBLE
   ========================================================== */

/*
 * En 375 px había etiquetas de 7, 8 y 9 px ("Lluvia hoy", "Media 2
 * min", "km/h", los puntos de la veleta...). Por debajo de 11 px no se
 * lee en un teléfono, y menos al sol. Va al final para mandar sobre
 * las reglas anteriores, también las de los @media de 620 px.
 */
@media (max-width: 620px) {

    .lluvia-resumen-label,
    .lluvia-resumen-extra,
    .viento-secundario,
    .viento-actual small,
    .metrica-label,
    .metrica-secundaria,
    .veleta-cardinal,
    .patrocinio-estacion-titulo,
    .patrocinio-estacion-texto,
    .acceso-subtitulo,
    .camara-estado,
    .camara-nombre,
    .observacion,
    .grafico-cabecera .leyenda span,
    .grafico-enlace {
        font-size: 11px;
    }

    /* Son datos, no etiquetas: un punto más. En 390 px bajaban a 10. */
    .lluvia-resumen-valor {
        font-size: 12px;
    }

    .viento-secundario strong {
        font-size: 12px;
    }

    .patrocinio-estacion {
        min-height: 38px;
    }

}


/* Fin de fichero: css/actualidad.css */