*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Segoe UI, sans-serif;
    background:#f5f7fa;
    color:#0d3b66;
}

html {
    scroll-behavior: smooth;
}

#explorar {
    scroll-margin-top: 80px;
}

.container{
    width:min(1200px,90%);
    margin:auto;
    margin-bottom: 5%;
}

/* Efecto de scroll del hero */

.hero-video {
    transform: translateY(var(--hero-video-y, 0px))
               scale(1.12);
}

.hero-overlay {
    opacity: var(--hero-text-opacity, 1);
    transform: translateY(var(--hero-text-y, 0px));
}

/* Reducir efectos en móviles y para usuarios
   que prefieren menos movimiento */

@media (max-width: 900px),
       (prefers-reduced-motion: reduce) {
    .hero-video,
    .hero-overlay {
        transform: none;
    }

    .hero-overlay {
        opacity: 1;
    }
}


/* Clase que añadiremos con JavaScript para mostrar el menú */


.hero {
    position: relative;
    background: #0a3d62 url("../Fotos/General/hero.webp") center / cover no-repeat;
    height: 600px;
    padding: 100px 20px 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    z-index: 0;
    /* El elemento completo permanece oculto hasta reproducirse, incluidos sus controles nativos. */
    visibility: hidden;
    pointer-events: none;
}

.hero-video.is-playing {
    visibility: visible;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 20, 35, .5), rgba(0, 20, 35, .35));
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(245, 247, 250, 0) 0%,
    rgba(245, 247, 250, 0.35) 45%,
    rgba(245, 247, 250, 0.75) 75%,
    #f5f7fa 98%
  );
}

.hero-overlay {
    position: relative;
    z-index: 2;

    padding: 0 20px;
    max-width: 900px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .65);
}

.hero-explore {
    position: absolute;
    z-index: 3;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    min-height: 64px;
    padding: 6px 16px;
    color: #0d3b66;
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
}

.hero-explore:focus-visible {
    outline: 3px solid #227c9d;
    outline-offset: 3px;
}

.hero-explore svg {
    animation: hero-arrow 2s ease-in-out infinite;
}

@keyframes hero-arrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.hero h1{
    color:white;
    font-size:4rem;
}

.hero p{
    color:white;
    margin-top:15px;
    font-size:1.4rem;
}

section{
    margin-bottom:80px;
}

h2{
    font-size:2.3rem;
    margin-bottom:25px;
    
}

.info-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:20px;
}


.conditions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 15px;
}

.conditions-header h2 {
    margin: 0;
}

.weather-zone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.weather-zone label {
    font-weight: 600;
}

.weather-zone select {
    min-height: 44px;
    max-width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    color: #0d3b66;
    font: inherit;
}

.weather-zone select:focus-visible {
    outline: 3px solid #227c9d;
    outline-offset: 3px;
}

.weather-reference {
    margin: 0 0 15px;
    color: #5f7183;
    font-size: 1rem;
}


.card {
    min-height: 220px;
}

.weather-content,
.wind-content,
.moon-content {
    min-height: 140px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 10px;

    text-align: center;
}


/* CLIMA */

#weather-icon {
    font-size: 3rem;
    line-height: 1;
}

/* Bootstrap Icons cloud-moon, MIT: Fotos/Clima/icons/LICENSE. */
#weather-icon img {
    display: block;
    width: 1em;
    height: 1em;
    filter: brightness(0) invert(1);
}

#weather-condition {
    font-size: 1.25rem;
}

#temperature {
    font-size: 1.1rem;
    color: #5f7183;
}


/* VIENTO */

.wind-direction-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

#wind-direction,
.wind-arrow {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.wind-arrow {
    display: inline-block;
    transform-origin: center;
}

.wind-speed {
    font-size: 1.1rem;
    color: #5f7183;
}


/* LUNA */

#moon-icon {
    font-size: 3rem;
    line-height: 1;
}

#fase-lunar {
    font-size: 1.4rem;
}

.card{
    background:white;
    padding:30px;
    border-radius:18px;

    box-shadow:
    0 6px 20px rgba(0,0,0,.08);
}

/* Ambiente compartido por Clima, Viento y Fase Lunar. */
.info-grid[data-weather] {
    --weather-image: none;
    --weather-overlay: transparent;
    --weather-background: #fff;
    --weather-text: #0d3b66;
    --weather-detail: #5f7183;
}

.info-grid[data-weather]:not([data-weather="neutral"]) {
    --weather-overlay: rgba(8, 24, 42, .66);
    --weather-background: #152c42;
    --weather-text: #fff;
    --weather-detail: #f1f5f9;
}

.info-grid[data-weather="day-clear"] {
    --weather-image: url("../Fotos/Clima/dia-despejado.webp");
}

.info-grid[data-weather="day-partly-cloudy"] {
    --weather-image: url("../Fotos/Clima/dia-parcialmente-nublado.webp");
}

.info-grid[data-weather="night-clear"] {
    --weather-image: url("../Fotos/Clima/noche-estrellada.webp");
}

.info-grid[data-weather="night-partly-cloudy"] {
    --weather-image: url("../Fotos/Clima/noche-parcialmente-nublado.webp");
}

.info-grid[data-weather="day-cloudy"] {
    --weather-image: url("../Fotos/Clima/dia-nuboso.webp");
}

.info-grid[data-weather="night-cloudy"] {
    --weather-image: url("../Fotos/Clima/noche-nuboso.webp");
}

.info-grid[data-weather="day-rainy"] {
    --weather-image: url("../Fotos/Clima/dia-lluvioso.webp");
}

.info-grid[data-weather="night-rainy"] {
    --weather-image: url("../Fotos/Clima/noche-lluviosa.webp");
}

.info-grid[data-weather] > .card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-color: var(--weather-background);
    color: var(--weather-text);
}

/* Mismo lienzo y origen; cada card recorta su propia ventana del cielo. */
.info-grid[data-weather] > .card::before {
    content: "";
    position: absolute;
    z-index: -2;
    pointer-events: none;
    left: var(--sky-x, 0px);
    top: var(--sky-y, 0px);
    width: var(--sky-width, 100%);
    height: var(--sky-height, 100%);
    background-image: var(--weather-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: weather-sky-drift 80s ease-in-out infinite alternate;
    animation-play-state: paused;
}

.info-grid[data-weather]:not([data-weather="neutral"]) > .card::before {
    animation-play-state: running;
}

/* El contraste permanece fijo mientras se desplaza únicamente la imagen. */
.info-grid[data-weather] > .card::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    inset: 0;
    background: var(--weather-overlay);
}

@keyframes weather-sky-drift {
    from { transform: translateX(12px); }
    to { transform: translateX(-12px); }
}

@media (prefers-reduced-motion: reduce) {
    .info-grid[data-weather] > .card::before {
        animation: none;
        transform: none;
    }
}

.info-grid[data-weather] #temperature,
.info-grid[data-weather] .wind-speed {
    color: var(--weather-detail);
}

.info-grid[data-weather] #weather-icon,
.info-grid[data-weather] #moon-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}

.info-grid[data-weather] [hidden] {
    display: none;
}

.alert-box{
    margin-top:25px;
    background:#bde8f5;
    border-left:5px solid #227c9d;
    padding:20px;
    border-radius:8px;
}

/* CARDS EXPLORAR */

.explore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
}

.guide-card {
    display: block;
    color: #0d3b66;
    text-decoration: none;
}

.guide-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.guide-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.guide-card h3 {
    margin: 14px 0 0;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 600;
}

/* Efecto zoom */
@media (hover: hover) and (pointer: fine) {
    .guide-card:hover .guide-image img {
        transform: scale(1.07);
    }

    .guide-card:hover h3 {
        color: #227c9d;
    }
}

/* Navegación con teclado */
.guide-card:focus-visible {
    outline: 3px solid #227c9d;
    outline-offset: 5px;
    border-radius: 18px;
}

/* Responsive */
@media (max-width: 900px) {
    .explore-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .explore-grid {
        grid-template-columns: 1fr;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-video.is-playing {
        visibility: hidden;
    }

    .hero-explore svg {
        animation: none;
    }

    .guide-image img {
        transition: none;
    }

    .guide-card:hover .guide-image img {
        transform: none;
    }
}



@media(max-width:900px){

    .home-page .hero {
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
        margin-bottom: 24px;
    }

    .hero h1{
        font-size:2.5rem;
    }

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

}

@media (max-width: 600px) {

    .weather-zone {
        width: 100%;
        flex-wrap: wrap;
    }

    .weather-zone select {
        flex: 1;
        min-width: 0;
    }

    .container {
        width: 92%;
    }

    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
        line-height: 1.15;
    }

    .hero p {
        font-size: 1.05rem;
    }


    section {
        margin-bottom: 50px;
    }

    h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .card {
        padding: 20px;
    }

}
