/* === ESTILOS GENERALES === */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

/* === ENCABEZADO === */
header {
  background-color: #003f87;
  color: white;
  text-align: center;
  padding: 30px 0 20px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

header h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}
/* === FIX CABECERAS EN MOVIL (FORZAR ESTILOS) === */
th {
  background-color: #005faf !important;  /* azul medio */
  color: #ffffff !important;
  font-weight: bold !important;
  border: 1px solid #004b8d !important;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 16px;
  transition: color 0.3s;
}

nav ul li a:hover,
nav ul li a.activo {
  color: #ffe66d;
}

/* === TITULOS Y SECCIONES === */
h2 {
  text-align: center;
  margin-top: 40px;
  color: #003f87;
}

/* === TABLAS === */
table {
  border-collapse: collapse;
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

th, td {
  border: 1px solid #ccc;
  text-align: center;
  padding: 8px;
}

/* ?? CABECERAS RESTAURADAS */
th {
  background-color: #005faf;   /* azul medio */
  color: #ffffff;
  font-weight: bold;
  border: 1px solid #004b8d;
}

/* alternancia filas */
tr:nth-child(even) {
  background-color: #e6f0fa;
}

/* === TEMPERATURAS === */
td.temp.low { background-color: #4f9ddf; color: #fff; }    /* Azul medio */
td.temp.medium { background-color: #ffcc4d; color: #333; } /* Amarillo */
td.temp.high { background-color: #f44336; color: #fff; }   /* Rojo */

/* === LLUVIA Y VIENTO === */
td.rain { background-color: #a7e0ff; }
td.wind { background-color: #dff7ff; }

/* === FIJAR ENCABEZADO EN MÓVILES === */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* === TABLAS RESPONSIVAS === */
table {
  width: 100%;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === ENCABEZADO RESPONSIVO === */
@media (max-width: 768px) {
  header {
    padding: 20px 10px;
  }

  header h1 {
    font-size: 28px;
  }

  nav ul {
    flex-wrap: wrap;
    gap: 10px;
  }

  nav ul li a {
    font-size: 15px;
  }

  table {
    font-size: 14px;
  }

  th {
    font-size: 14px;
  }

  td {
    font-size: 13px;
  }
}
/* === FIX GALERÍA EN MÓVILES === */
.imagenes {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}

.imagenes img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s;
  object-fit: cover;
}

@media (max-width: 600px) {
  .imagenes img {
    max-width: 90%;
  }
}
/* ==== SUBMENÚ DATOS/Lluvia/HISTÓRICO ==== */
.subnav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}
.subnav a {
  background-color: #0077b6;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s;
}
.subnav a:hover {
  background-color: #005f8a;
}
.subnav a.active {
  background-color: #023e8a;
}
