/* ============================================
   climasantiago.cl - Estilos v5.0
   ============================================ */

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

html, body {
  background: #0d1117;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-text-size-adjust: 100%;
}

body, html, #page, #content, .site-content, .inside-article, .entry-content {
  background: #0d1117 !important;
}

.site-footer { display: none !important; }

#cs-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #0d1117;
}

/* BUSCADOR FIJO */
#cs-buscador {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
  background: #0d1117;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #1a2a3a;
}

#cs-buscador-inner {
  display: flex;
  align-items: center;
  background: #161c24;
  border-radius: 14px;
  border: 1px solid #1e2a38;
  padding: 0 14px;
  gap: 10px;
  height: 54px;
}

#cs-search-icon { color: #6a8aaa; font-size: 20px; flex-shrink: 0; }

#cs-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 17px;
  color: #ffffff;
  font-family: inherit;
}

#cs-input::placeholder { color: #3a5a7a; }

#cs-tag {
  background: #0a2540;
  color: #4a9eff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid #1a4a7a;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

#cs-lista {
  display: none;
  flex-direction: column;
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#cs-lista.visible { display: flex; }

.cs-comuna-item {
  padding: 14px 4px;
  font-size: 18px;
  color: #8a9aaa;
  border-bottom: 1px solid #161c24;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cs-comuna-item::before {
  content: "▶";
  font-size: 10px;
  color: #4a9eff;
  flex-shrink: 0;
}

.cs-comuna-item:last-child { border-bottom: none; }
.cs-comuna-item.activa { color: #4a9eff; font-weight: 500; }

/* CONTENIDO */
#cs-contenido {
  padding: 90px 20px 40px;
}

/* HEADER */
#cs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}

.cs-eyebrow {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #7a9aaa;
}

#cs-nombre {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  margin-top: 3px;
}

#cs-temp-wrap { text-align: right; }

#cs-temp-num {
  font-size: 52px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

#cs-temp-hora {
  font-size: 15px;
  color: #6a8aaa;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* SECCIONES */
.cs-seccion-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  margin-top: 28px;
}

.cs-seccion-titulo {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7a9aaa;
  white-space: nowrap;
}

.cs-linea {
  flex: 1;
  height: 1px;
  background: #1e2a38;
}

/* PRONOSTICO */
#cs-pronostico {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.cs-dia {
  background: #161c24;
  border-radius: 14px;
  padding: 18px 10px;
  text-align: center;
  border: 1px solid #1e2a38;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 170px;
}

.cs-dia.hoy { background: #0a2540; border-color: #1a4a7a; }

.cs-dia-nombre {
  font-size: 14px;
  font-weight: 700;
  color: #6a8aaa;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.cs-dia.hoy .cs-dia-nombre { color: #4a9eff; }

.cs-dia-icono-txt {
  margin-bottom: 12px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-dia-icono-txt img {
  width: 48px;
  height: 48px;
  display: block;
}

.cs-dia-temps {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
}

.cs-tmax {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
}

.cs-tmin {
  font-size: 26px;
  font-weight: 300;
  color: #5a6a7a;
}

.cs-sep {
  font-size: 20px;
  color: #3a4a5a;
  margin: 0 2px;
}

.cs-lluvia {
  font-size: 14px;
  font-weight: 600;
  color: #4a9eff;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.cs-lluvia.seco { color: #3a4a5a; }

.cs-dia-cond {
  font-size: 11px;
  color: #5a7a9a;
  margin-top: 6px;
  text-align: center;
  min-height: 16px;
}

/* CONDICIONES ACTUALES */
#cs-condiciones {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.cs-dato {
  background: #161c24;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #1e2a38;
}

.cs-dato-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.cs-dato-label {
  font-size: 11px;
  font-weight: 700;
  color: #6a8aaa;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.cs-dato-badge {
  font-size: 10px;
  color: #3a5a7a;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cs-dato-valor {
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.cs-dato-unidad {
  font-size: 14px;
  color: #5a6a7a;
  margin-left: 2px;
}

/* ADSENSE */
#cs-adsense {
  margin: 24px 0;
  min-height: 60px;
  background: #161c24;
  border-radius: 12px;
  border: 1px solid #1e2a38;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* HERRAMIENTAS HISTÓRICAS */
#cs-historico {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cs-tool {
  background: #161c24;
  border-radius: 16px;
  border: 1px solid #1e2a38;
  padding: 16px;
}

.cs-tool-pregunta {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 14px;
  line-height: 1.3;
}

.cs-barra-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cs-barra-val { font-size: 28px; font-weight: 700; color: #ffffff; }
.cs-barra-val span { font-size: 14px; color: #6a8aaa; font-weight: 400; margin-left: 2px; }
.cs-barra-ref { text-align: right; }
.cs-barra-ref-num { font-size: 18px; color: #4a5a6a; }
.cs-barra-ref-label { font-size: 12px; color: #3a4a5a; display: block; }

.cs-barra-bg {
  height: 8px;
  background: #1e2a38;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.cs-barra-fill {
  height: 8px;
  border-radius: 4px;
  background: #4a9eff;
  transition: width 0.6s ease;
}

.cs-barra-estado { font-size: 13px; color: #4a9eff; }
.cs-barra-estado.sobre { color: #2aaa6a; }

.cs-ranking { display: flex; flex-direction: column; gap: 10px; }

.cs-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cs-rank-num { font-size: 12px; color: #3a5a7a; width: 16px; text-align: center; flex-shrink: 0; }
.cs-rank-ano { font-size: 15px; font-weight: 600; color: #ffffff; width: 52px; flex-shrink: 0; white-space: nowrap; }

.cs-rank-barra-bg {
  flex: 1;
  height: 6px;
  background: #1e2a38;
  border-radius: 3px;
  overflow: hidden;
}

.cs-rank-barra { height: 6px; border-radius: 3px; background: #1a4a7a; }
.cs-rank-barra.primero { background: #4a9eff; }
.cs-rank-mm { font-size: 12px; color: #6a8aaa; width: 52px; text-align: right; flex-shrink: 0; }

.cs-respuesta { text-align: center; padding: 8px 0; }
.cs-respuesta-ano { font-size: 56px; font-weight: 300; color: #ffffff; line-height: 1; }
.cs-respuesta-sub { font-size: 15px; color: #6a8aaa; margin-top: 8px; }
.cs-respuesta-detalle { font-size: 11px; color: #3a5a7a; margin-top: 4px; }

.cs-comp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #1e2a38;
}

.cs-comp-row:last-child { border-bottom: none; }
.cs-comp-label { font-size: 15px; color: #8a9aaa; }
.cs-comp-val { font-size: 22px; font-weight: 600; color: #ffffff; }
.cs-comp-val.frio { color: #7ab4ff; }

.cs-comp-badge {
  font-size: 11px;
  background: #0a2540;
  color: #4a9eff;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #1a4a7a;
}

.cs-meses { display: flex; flex-direction: column; gap: 7px; }

.cs-mes-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-mes-nombre { font-size: 12px; color: #6a8aaa; width: 30px; flex-shrink: 0; }

.cs-mes-bg {
  flex: 1;
  height: 6px;
  background: #1e2a38;
  border-radius: 3px;
  overflow: hidden;
}

.cs-mes-fill { height: 6px; border-radius: 3px; background: #1a4a7a; }
.cs-mes-fill.pico { background: #4a9eff; }
.cs-mes-mm { font-size: 12px; color: #4a5a6a; width: 38px; text-align: right; flex-shrink: 0; }

.cs-tend-val { font-size: 36px; font-weight: 700; color: #e06060; margin-bottom: 8px; }
.cs-tend-desc { font-size: 15px; color: #8a9aaa; line-height: 1.5; }

.cs-slider-wrap { margin-top: 14px; }
.cs-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #3a5a7a;
  margin-bottom: 6px;
}

#cs-slider-tend { width: 100%; accent-color: #4a9eff; }
.cs-tend-periodo { font-size: 12px; color: #4a9eff; text-align: center; margin-top: 6px; }

/* EDITORIAL */
#cs-editorial {
  margin-top: 4px;
  font-size: 16px;
  color: #8a9aaa;
  line-height: 1.8;
}

#cs-editorial p { margin-bottom: 16px; }

/* ACORDEONES */
.cs-acord {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-acord details {
  background: #161c24;
  border: 1px solid #1e2a38;
  border-radius: 16px;
  overflow: hidden;
}

.cs-acord details[open] {
  border-color: #1a4a7a;
}

.cs-acord summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 18px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  gap: 12px;
}

.cs-acord summary::-webkit-details-marker { display: none; }

.cs-acord-titulo {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.cs-acord-icono {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  margin-left: auto;
  color: #4a9eff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.cs-acord details[open] .cs-acord-icono {
  transform: rotate(180deg);
}

.cs-acord-cuerpo {
  padding: 0 18px 20px;
  font-size: 15px;
  color: #8a9aaa;
  line-height: 1.8;
  border-top: 1px solid #1e2a38;
}

.cs-acord-cuerpo p {
  margin: 16px 0 0;
}

/* ENLACES INTERNOS COMUNAS */
#cs-comunas-links {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #1a2a3a;
}

.cs-comunas-links-titulo {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #2a4a6a;
  margin-bottom: 12px;
  font-weight: 500;
}

.cs-comunas-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cs-comunas-links-grid a {
  font-size: 12px;
  color: #3a5a7a;
  text-decoration: none;
  background: #161c24;
  border: 1px solid #1e2a38;
  border-radius: 20px;
  padding: 4px 12px;
  white-space: nowrap;
}

.cs-comunas-links-grid a:hover {
  color: #4a9eff;
  border-color: #1a4a7a;
}

/* FUENTES */
#cs-fuentes {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #1a2a3a;
}

.cs-fuentes-titulo {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #2a4a6a;
  margin-bottom: 12px;
  font-weight: 500;
}

.cs-fuente-item {
  display: flex;
  flex-direction: column;
  padding: 7px 0;
  border-bottom: 1px solid #111820;
}

.cs-fuente-item:last-child { border-bottom: none; }
.cs-fuente-sigla { font-size: 10px; font-weight: 600; color: #3a5a7a; letter-spacing: 1px; }
.cs-fuente-nombre { font-size: 10px; color: #2a3a4a; margin-top: 1px; }

/* CRÉDITO */
#cs-credito {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #1a2a3a;
  font-size: 12px;
  color: #3a5a7a;
  text-align: center;
}

#cs-credito a {
  color: #3a5a7a;
  text-decoration: none;
}

#cs-credito a:hover {
  color: #4a9eff;
}

@media (max-width: 380px) {
  #cs-nombre { font-size: 24px; }
  #cs-temp-num { font-size: 44px; }
  .cs-tmax, .cs-tmin { font-size: 22px; }
}
