/* =========================
   BASE GENERAL
========================= */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
  max-width: 100%;
  overflow-x: hidden;
}

/* =========================
   HEADER
========================= */
header.site-header {
  background-color: #003f87;
  background-image: url('fotos/imagen1.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  text-align: center;
  color: white;
  padding: 30px 0 20px 0;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

header.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 40, 90, 0.55);
  z-index: 0;
}

header.site-header .logo-container,
header.site-header nav {
  position: relative;
  z-index: 1;
}

.site-title {
  margin: 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
}

.site-subtitle {
  margin: 0;
  font-size: 16px;
  color: #ffffff;
}

/* =========================
   NAV (ESCRITORIO)
========================= */
.main-navigation {
  overflow: visible; /* sin scroll en PC */
}

.main-navigation ul {
  list-style: none;
  padding: 0;
  margin: 15px 0 0 0;

  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.main-navigation a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  transition: 0.2s;
}

.main-navigation a:hover,
.main-navigation a.activo {
  background: rgba(255,255,255,0.15);
  color: #ffe66d;
}

/* =========================
   TITULOS
========================= */
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);

  display: block;
  overflow-x: auto;
}

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

th {
  background-color: #005faf;
  color: #ffffff;
  font-weight: bold;
  border: 1px solid #004b8d;
}

tr:nth-child(even) {
  background-color: #e6f0fa;
}

/* =========================
   COLORES TEMPERATURA
========================= */
.temp.high {
  background-color: #ff6666 !important;
}

.temp.medium {
  background-color: #ffcc66 !important;
}

.temp.low {
  background-color: #66b3ff !important;
}

/* =========================
   SUBNAV
========================= */
.subnav {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.subnav a {
  background-color: #005faf;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}

.subnav a.active {
  background-color: #023e8a;
}

/* =========================
   GRÁFICOS FULL WIDTH
========================= */
.graficos-full {
  width: 100%;
  max-width: 100%;
  margin: 20px 0;
  padding: 0 10px;
}

.fila-graficos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grafico-box {
  width: 100%;
}

.grafico-box iframe,
.grafico-box canvas {
  width: 100%;
  height: 480px;
  display: block;
}

/* =========================
   OTROS GRÁFICOS
========================= */
.grafico-container,
.grafico-meteoros {
  width: 100%;
  max-width: 1200px;
  margin: 20px auto;
  height: 500px;
}

.grafico-container canvas,
.grafico-meteoros canvas {
  width: 100% !important;
  height: 100% !important;
}

/* =========================
   TABLAS DOBLES
========================= */
.tables-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}

.table-wrapper {
  flex: 1;
  min-width: 400px;
  max-width: 500px;
}

/* =========================
   ESPACIO ANTES DEL FOOTER
========================= */
main,
.page-content {
  padding-bottom: 10px;
}

/* =========================
   FOOTER
========================= */
.site-footer {
  text-align: center;
  padding: 20px;
  margin-top: 10px;
  color: #666;
  font-size: 0.9em;
}

/* =========================
   RESPONSIVE (SOLO AQUÍ TOCAMOS NAV)
========================= */
@media (max-width: 768px) {

  header.site-header {
    padding: 20px 10px 15px;
  }

  .site-title {
    font-size: 28px;
  }

  .site-subtitle {
    font-size: 14px;
  }

  /* 🔥 AQUÍ EL CAMBIO CLAVE */
  .main-navigation {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-navigation ul {
    justify-content: flex-start;
    gap: 8px;
  }

  .main-navigation a {
    font-size: 13px;
    padding: 5px 8px;
  }

  table {
    font-size: 14px;
  }

  th {
    font-size: 14px;
  }

  td {
    font-size: 13px;
  }

  /* GRÁFICOS EN MÓVIL */
  .fila-graficos {
    grid-template-columns: 1fr;
  }

  .grafico-box iframe,
  .grafico-box canvas {
    height: 300px;
  }
}

/* =========================
   GRÁFICOS ESTILO LIMPIO (GLOBAL)
========================= */
.grafico-box {
  background: #ffffff;
  border: none;              /* ❌ quitamos borde feo */
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.grafico-box iframe {
  border: none;
  border-radius: 8px;
  width: 100%;
  height: 480px;
}


.grafico-wrapper {
  height: 100%;
}

@media (max-width: 768px) {
  .grafico-meteoros {
    height: 320px;
  }

  .grafico-wrapper {
    height: 320px;
  }
}