/* /var/www/html/jdserver/2026/modules/climate_pro_monthly/climate_pro_monthly.css
 * JDServer-Webs v6.7.5 — climate_pro_monthly.css
 * Resumen mensual + climograma — tabla compacta Apple-ish
 * FIX: tokens auto/claro/oscuro + iOS/Safari <select> + color-scheme + focus
 */

#climate-pro-monthly{
  margin: 18px 0 64px;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;

  /* ayuda a controles nativos (iOS/Safari/Windows) */
  color-scheme: light dark;
}

.climatepro-monthly{
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-1);
  padding: 14px 18px 16px;
  margin-top: 0;

  /* base text: evita herencias raras en auto */
  color: var(--text, inherit);
  -webkit-text-fill-color: var(--text, currentColor);

  /* ayuda a controles nativos (iOS/Safari/Windows) */
  color-scheme: light dark;
}

.climatepro-monthly-head{
  margin-bottom: 10px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
}

.climatepro-monthly-title{
  margin: 0;
  font-size: 1.05rem;
  font-weight:600;
  color: var(--text, inherit);
}

.climatepro-monthly-sub{
  margin: 3px 0 0;
  font-size: .88rem;
  color: var(--muted);
}

.climatepro-monthly-empty{
  margin: 8px 0 0;
  font-size: .9rem;
  color: var(--muted);
}

/* Selector de año */
.climatepro-monthly-year{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:.86rem;
}
.climatepro-monthly-year label{ color:var(--muted); }

/* FIX: iOS/Safari puede poner color “del sistema” y se pierde en auto/oscuro */
.climatepro-monthly-year select{
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--card);
  font-size:.9rem;
  line-height: 1.2;

  color: var(--text, inherit);
  -webkit-text-fill-color: var(--text, currentColor);
  color-scheme: light dark;
  appearance: auto;

  outline: none;
}

.climatepro-monthly-year select:focus-visible{
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 22%, transparent);
}

.climatepro-monthly-year select option{
  background: var(--card);
  color: var(--text, inherit);
}

/* Tabla */
.climatepro-monthly-table-wrap{
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.climatepro-monthly-table{
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  min-width: 520px;

  /* base por si el navegador hereda raro */
  color: var(--text, inherit);
}

.climatepro-monthly-table thead th{
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  color: var(--text, inherit);
}

.climatepro-monthly-table tbody td{
  padding: 6px 8px;
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  vertical-align: middle;
  color: var(--text, inherit);
}

/* Nombre del mes + badges */
.climatepro-month-name{ font-weight: 500; }

.climatepro-badges{
  display: inline-flex;
  gap: 6px;
  margin-top: 4px;
}

.climatepro-badge{
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated, var(--card));
  color: var(--muted);
}

.climatepro-badge.warmest{
  border-color: color-mix(in oklab, var(--brand) 45%, transparent);
}
.climatepro-badge.rainiest{
  border-color: color-mix(in oklab, var(--brand) 45%, transparent);
}

/* Resaltar filas */
.climatepro-monthly-table tbody tr.is-warmest{
  background: color-mix(in oklab, var(--brand) 6%, transparent);
}
.climatepro-monthly-table tbody tr.is-rainiest{
  background: color-mix(in oklab, var(--brand) 10%, transparent);
}
.climatepro-monthly-table tbody tr.is-warmest.is-rainiest{
  background: color-mix(in oklab, var(--brand) 14%, transparent);
}

/* ---- Climograma (gráfico) ------------------------------------ */
.climatepro-monthly-chart-wrap{ margin-top: 18px; }

.climatepro-monthly-chart-title{
  margin: 0 0 8px;
  font-size: .9rem;
  color: var(--muted);
}

.cp-monthly-chart-box{
  width:100%;
  height:260px;
}

.climatepro-monthly-chart-wrap canvas{
  width: 100% !important;
  height: 100% !important;
  display:block;
}

/* Responsive */
@media (max-width: 640px){
  #climate-pro-monthly{ margin: 14px 0 40px; }

  .climatepro-monthly{ padding-inline: 12px; }

  .climatepro-monthly-table{
    min-width: 100%;
    font-size: .84rem;
  }

  .climatepro-monthly-table thead th{
    white-space: normal;
    line-height: 1.15;
    padding: 4px 6px;
    font-size: .78rem;
  }

  .climatepro-monthly-table tbody td{
    padding: 4px 6px;
    font-size: .82rem;
  }

  .cp-monthly-chart-box{ height: 230px; }
}
