/* ==========================================================================
   diseno-territorio.css · provincia (/el-tiempo-{slug}-provincia) y comunidad
   (/tiempo-{slug}) en el diseño nuevo (templates/diseno/provincia.php, comunidad.php
   y _territorio_*.php). Se apoya en sistema.css y diseno-lugar.css.
   ========================================================================== */

.d2-terr .l-sec, .d2-terr section[id] { scroll-margin-top: 76px; }
.d2-terr .lc__sub { max-width: 72ch; }

/* Índice de la página: chips que llevan a cada sección */
.te-ind { margin-top: calc(-1 * var(--e-4)); }
.te-ind .chip { text-decoration: none; color: var(--ink-2); }
.te-ind .chip:hover { border-color: var(--ink); color: var(--ink); }

/* Primera pantalla: avisos y capital a la izquierda, mapa a la derecha */
.te-primera { display: grid; gap: var(--e-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .te-primera { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--e-5); } }

/* Avisos */
.te-avisos .aviso { text-decoration: none; color: var(--ink); }
.te-avisos .aviso:hover { border-color: var(--ink); }
.te-avisos .aviso b { font-weight: 600; overflow-wrap: anywhere; }
.te-avisos .aviso__niv .ico { vertical-align: -3px; }
.te-av-no { --c: var(--ok); }
.te-av-enl { gap: var(--e-2) var(--e-4); font-size: var(--t-1); }

/* Capital en resumen */
.te-cap { gap: var(--e-3); }
.te-cap h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.te-cap h2 a { color: var(--ink); text-decoration: none; }
.te-cap h2 a:hover { text-decoration: underline; text-decoration-color: var(--senal); }
.te-cap__ahora { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.te-cap__ahora .nota { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.te-cap__ahora a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.te-cap__dias { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.te-cap__dias li { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: var(--r-2); font-size: var(--t-1); min-width: 0; }
.te-cap__dias li:first-child { background: var(--sunk); }
.te-cap__d { color: var(--muted); font-weight: 500; white-space: nowrap; }
.te-cap__dias .num { white-space: nowrap; }
.te-cap__ll { display: inline-flex; align-items: center; gap: 1px; color: var(--muted); white-space: nowrap; }
.te-cap__ll .ico { width: 12px; height: 12px; }
@media (max-width: 420px) { .te-cap__dias li:nth-child(n + 6) { display: none; } .te-cap__dias { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.te-cap__enl { grid-template-columns: minmax(0, 1fr); }
.te-cap__mas { gap: var(--e-2) var(--e-4); font-size: var(--t-1); }

/* Mapa pequeño */
.te-mapa { height: 280px; min-height: 0; display: block; }
@media (min-width: 900px) { .te-mapa { height: 400px; } }
.te-mapa .d2-mf__p { display: none; } /* el centro del territorio no es un lugar */
.te-ley { max-width: 300px; }
.te-mapa--svg { background: var(--sunk); }
.te-mapa--svg > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.te-mapa--svg circle { stroke: var(--surface); stroke-width: 1.5; }
.te-mapa__t { font: 600 13px var(--f-texto); fill: var(--ink); paint-order: stroke; stroke: var(--sunk); stroke-width: 3px; }
/* Costa de las islas (Canarias): trazo ancho debajo y relleno encima, para que solo se vea la línea de costa */
.te-mapa__costa { fill: none; stroke: var(--line-2); stroke-width: 3; stroke-linejoin: round; }
.te-mapa__tierra { fill: var(--surface); stroke: var(--surface); stroke-width: 1; stroke-linejoin: round; }
.te-mapa--svg:has(.te-mapa__tierra) .te-mapa__t { stroke: var(--surface); }

/* Tabla de municipios: hoy y mañana */
.te-ctl { gap: var(--e-2) var(--e-3); }
.te-q { flex: 1 1 220px; min-width: 0; max-width: 340px; }
.te-ctl .chip { cursor: pointer; }
.te-seg { display: none; }
.te-tabla th[scope="row"] { text-align: left; white-space: normal; min-width: 150px; max-width: 220px; }
.te-tabla th[scope="row"] a { font-weight: 600; color: var(--ink); text-decoration: none; }
.te-tabla th[scope="row"] a:hover { text-decoration: underline; text-decoration-color: var(--senal); }
.te-tabla th[scope="row"] small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.te-tabla thead tr + tr th:first-child { position: static; border-right: 0; } /* la 2.ª fila de cabecera no es la columna fija */
.te-tabla thead th { text-transform: none; letter-spacing: 0; }
.te-tabla .te-dia { text-align: center; color: var(--ink); }
.te-dia__f { color: var(--muted); font-weight: 500; }
.te-tabla th.dia-ini, .te-tabla td.dia-ini { border-left: 1px solid var(--line-2); }
.te-tabla .te-cielo { text-align: center; padding-inline: 6px; }
.te-tabla .te-cielo .ico { vertical-align: middle; width: 22px; height: 22px; }
.te-tabla .te-cielo { min-width: 34px; }
.te-tabla td.max { color: var(--ink); }
.te-tabla .te-ll { color: var(--ink); font-weight: 600; }
.te-tabla .te-nd { text-align: left; color: var(--muted); font-style: italic; }
.te-tabla abbr { text-decoration: none; }
.te-av { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; background: var(--c); }
.te-av--amarillo { --c: var(--av-amarillo); } .te-av--naranja { --c: var(--av-naranja); } .te-av--rojo { --c: var(--av-rojo); }
.te-ctl, .te-mas { display: none; }                       /* sin JavaScript no hacen nada: se ven todas las filas */
.js .te-ctl, .js .te-mas { display: flex; }
.te-tabla-sec.te-todos .te-mas { display: none !important; }
.js .te-tabla-sec:not(.te-todos) .te-resto { display: none; }
.te-tabla tr.te-fuera { display: none !important; }
.te-mas { gap: var(--e-3); }
@media (max-width: 699px) {
  .js .te-seg { display: inline-flex; }
  .js .te-tabla[data-dia="0"] .d1, .js .te-tabla[data-dia="1"] .d0 { display: none; }
  .te-tabla th, .te-tabla td { padding-inline: 7px; }
  .te-tabla th[scope="row"] { min-width: 0; max-width: 150px; }
  .te-q { max-width: none; flex-basis: 100%; }
}

/* Franjas del calentamiento */
.te-franjas { display: flex; height: 64px; border-radius: var(--r-2); overflow: hidden; }
.te-franjas i { flex: 1 1 0; }

/* Provincias de la comunidad */
.te-provs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e-2); grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.te-prov { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--e-3); padding: 10px 12px; text-decoration: none; color: var(--ink); height: 100%; }
.te-prov:hover { border-color: var(--ink); }
.te-prov__n b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.te-prov__n small { display: block; color: var(--muted); font-size: var(--t-1); }
.te-prov__d { display: grid; justify-items: center; gap: 1px; font-size: var(--t-1); white-space: nowrap; }
.te-prov__d .rot { font-size: 11px; }

@media print { .te-ind, .te-ctl, .te-mas, .te-mapa-sec { display: none !important; } .te-tabla-sec .te-resto { display: table-row !important; } }
