/* ==========================================================================
   diseno-clima.css · /clima/{slug}/{mes} en el diseño nuevo (templates/diseno/clima.php).
   Se apoya en sistema.css y diseno-lugar.css.
   ========================================================================== */

/* Selector de los 12 meses: carril con el mes actual en señal */
.cl-meses { margin-top: calc(-1 * var(--e-3)); }
.cl-meses .carril { padding-block: 2px 4px; }
.cl-meses .carril__it { text-decoration: none; color: var(--ink-2); min-width: 0; }
.cl-meses .carril__it:hover { border-color: var(--ink); color: var(--ink); }
.cl-meses .carril__it[aria-current] { background: var(--senal); border-color: var(--senal); color: var(--on-senal); font-weight: 600; }
.cl-mes-c { display: none; }
@media (min-width: 1040px) {
  .cl-meses .carril { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); overflow: visible; }
  .cl-meses .carril__it { padding: 0 4px; }
}
@media (min-width: 1040px) and (max-width: 1240px) { .cl-mes-l { display: none; } .cl-mes-c { display: inline; } }

/* La respuesta: cuatro cifras, la barra de temperaturas y la procedencia */
.cl-resp { display: grid; gap: var(--e-4); }
.cl-resp__cifras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e-4) var(--e-5); }
@media (min-width: 700px) { .cl-resp__cifras { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cl-big { display: grid; gap: 2px; min-width: 0; }
.cl-big .cifra small { font: 500 var(--t-2) var(--f-texto); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.cl-big .cl-min { color: var(--ink-2); }

.cl-barra { display: grid; gap: 4px; }
.cl-barra__pista { position: relative; height: 14px; border-radius: var(--r-1); background: var(--sunk); }
.cl-barra__pista::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--pal-temp); opacity: .22; }
.cl-barra__tramo { position: absolute; inset: 0; border-radius: inherit; background: var(--pal-temp); clip-path: inset(0 var(--b) 0 var(--a) round 4px); box-shadow: inset 0 0 0 1px rgba(15, 27, 43, .15); }
.cl-barra__media { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 1.5px var(--surface); }
.cl-barra__abs { position: absolute; top: 2px; bottom: 2px; width: 0; margin-left: -.5px; border-left: 1.5px dashed var(--ink-2); }
.cl-barra__esc { position: relative; height: 1.3em; font-size: var(--t-1); color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-barra__esc span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.cl-barra__ley { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.cl-barra__ley span, .cl-clave span { display: inline-flex; align-items: center; gap: 6px; }

/* Muestras de leyenda */
.cl-clave { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cl-m { display: inline-block; width: 14px; height: 10px; flex: none; border-radius: 1px; }
.cl-m--tramo { background: var(--pal-temp); width: 22px; }
.cl-m--media { width: 3px; height: 14px; background: var(--ink); border-radius: 2px; }
.cl-m--abs { width: 0; height: 12px; border-left: 1.5px dashed var(--ink-2); border-radius: 0; }
.cl-m--max { height: 3px; background: var(--ink); width: 18px; }
.cl-m--min { height: 2px; background: var(--muted); width: 18px; }
.cl-m--media-l { height: 0; border-top: 1.5px dashed var(--ink); width: 18px; border-radius: 0; }
.cl-m--normal { height: 0; border-top: 1.5px dashed var(--ink-2); width: 18px; border-radius: 0; }
.cl-m--sel { width: 10px; height: 10px; border-radius: 50%; background: var(--senal); }
.cl-m--ll { background: #318be6; }

/* Este mes, hasta ahora */
.cl-frase-obs { font-size: var(--t-3); line-height: 1.4; max-width: 62ch; }
.cl-frase-obs b { font-weight: 600; }
.cl-obs { display: grid; gap: var(--e-3); }
@media (min-width: 1040px) { .cl-obs { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } }
.cl-calido { color: var(--av-rojo-t, #b42318); } .cl-fresco { color: #1d63b8; } .cl-igual { color: var(--muted); font-weight: 500; }
:root[data-theme="dark"] .cl-fresco { color: #7db7f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cl-fresco { color: #7db7f5; } }
.cl-ll { display: grid; gap: var(--e-2); }
.cl-ll__mm { font-size: var(--t-4); font-variant-numeric: tabular-nums; margin-inline: 4px; }
.cl-ll__barra { position: relative; height: 10px; border-radius: 5px; background: var(--sunk); margin-block: 6px; }
.cl-ll__lleno { position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: #318be6; }
.cl-ll__hoy { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 1.5px var(--surface); }
.cl-ver { font-weight: 600; } .cl-ver--seco { color: #a15c07; } .cl-ver--lluvioso { color: #1d63b8; }
:root[data-theme="dark"] .cl-ver--seco { color: #f0b45c; } :root[data-theme="dark"] .cl-ver--lluvioso { color: #7db7f5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cl-ver--seco { color: #f0b45c; } :root:not([data-theme="light"]) .cl-ver--lluvioso { color: #7db7f5; } }

/* El mes en detalle: grupos de cifras */
.cl-grupos { display: grid; gap: var(--e-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .cl-grupos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .cl-grupos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cl-grupo { display: grid; gap: var(--e-2); align-content: start; }
.cl-grupo__t { display: flex; align-items: center; gap: 8px; }
.cl-grupo__t .ico { color: var(--muted); }
.cl-dl { display: grid; margin: 0; }
.cl-dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e-3); padding: 7px 0; border-top: 1px solid var(--line); }
.cl-dl > div:first-child { border-top: 0; }
.cl-dl dt { color: var(--ink-2); font-size: var(--t-1); min-width: 0; }
.cl-dl dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-dl--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cl-dl--3 > div { display: grid; justify-items: center; border: 1px solid var(--line); border-radius: var(--r-2); padding: 6px 4px; }
.cl-dl--3 > div:first-child { border-top: 1px solid var(--line); }
.cl-grupo__nota { margin-top: 2px; }

/* Gráficos: lo normal y la media, en discontinua */
.d2-clima .g-previsto { stroke-dasharray: 5 4; }
.cl-dif { display: block; margin-top: 2px; }

/* Gráficos del año */
.g-barra-wf.cl-ll-mes { --c: #9fcbef; }
:root[data-theme="dark"] .g-barra-wf.cl-ll-mes { --c: #2f5a85; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-barra-wf.cl-ll-mes { --c: #2f5a85; } }
.cl-tabla-anio tr.cl-fila-sel > * { background: var(--senal-suave); }
.cl-tabla-anio tr.cl-fila-sel th { box-shadow: inset 2px 0 0 var(--senal); }

/* Tendencia del mes en curso */
.cl-tend { display: grid; grid-template-columns: 20px minmax(0, 1fr) 16px; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.cl-tend:hover { border-color: var(--ink); }
.cl-tend > span { display: grid; gap: 2px; }
.cl-tend b { font-weight: 600; }

@media print { .cl-meses, .cl-tend { display: none !important; } }
