/* © 2026 ApexTech — Carlos Antonio Borda (Posadas, Misiones, Argentina). Todos los derechos reservados.
   Software protegido por la Ley 11.723 de Propiedad Intelectual. Ver LICENSE. */
/* =====================================================================
   48h Posadas · Modo Fiestas
   Del 1 de diciembre al 6 de enero la guía se viste de Navidad sola: lo
   activa un script chiquito en <head> de index.html poniéndole la clase
   "fiestas" a <html>. Fuera de esas fechas nada de esto se ve.
   Para probar cualquier día: index.html?fiestas=1 (y ?fiestas=0 para sacarlo).
   Colores: el verde de siempre + rojo (#d8343a) y dorado (#f2c14e).
   ===================================================================== */
@font-face { font-family: 'Dancing Script'; font-style: normal; font-weight: 700; font-display: swap;
             src: url(../fuentes/dancing-script-700.woff2) format('woff2'); }

/* lo que solo existe en fiestas, y lo que se esconde en fiestas */
.fx-b, .fx-f, .fx-i { display: none; }
html.fiestas .fx-b { display: block; }
html.fiestas .fx-f { display: flex; }
html.fiestas .fx-i { display: inline-block; }
html.fiestas .no-fx { display: none !important; }

/* capa de adornos (guirnalda, bolas, estrellitas, luces): la arma libs/fiestas.js */
.fx-capa { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.fx-capa svg { position: absolute; left: 0; display: block; }

/* ---------- pantalla de inicio ---------- */
html.fiestas #splash::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; z-index: 3;
  background: repeating-linear-gradient(135deg, #d8343a 0 9px, #ffffff 9px 18px); }
html.fiestas .splash-grad { background: linear-gradient(to bottom, rgba(6,18,14,0.9) 0%, rgba(6,18,14,0.5) 30%, rgba(6,18,14,0.15) 48%, rgba(6,18,14,0.55) 64%, rgba(6,18,14,0.96) 82%, #06120e 100%); }
.fx-sello { align-items: center; gap: 6px; margin: 14px auto 0; padding: 4px 14px 4px 8px; border-radius: 999px; background: rgba(216,52,58,0.2);
  border: 1px solid rgba(242,193,78,0.6); color: #ffd77a; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; width: max-content; }
.fx-sello::before { content: ''; width: 26px; height: 20px; flex: none; background: var(--fx-acebo) center / contain no-repeat; }
.fx-saludo { margin: 10px 0 0; font-family: 'Dancing Script', 'Be Vietnam Pro', cursive; font-weight: 700; font-size: 2.45rem; line-height: 1.02;
  color: #ffd77a; text-align: center; text-shadow: 0 4px 18px rgba(242,193,78,0.35); }
html.fiestas .splash-sub.fx-b { margin-top: 12px; }
.fx-arbol { position: relative; height: 150px; margin: 10px auto 0; width: 110px; }
.fx-arbol svg { display: block; }
.fx-cuenta { align-items: center; gap: 10px; width: max-content; max-width: 100%; margin: 0 auto 12px; padding: 6px 14px 6px 8px; border-radius: 16px;
  background: rgba(6,18,14,0.82); border: 1px solid rgba(242,193,78,0.5); color: #d7e2dd; font-size: 0.84rem; }
.fx-cuenta b { color: #fff; font-size: 1rem; }
.fx-turi { position: relative; flex: none; width: 38px; height: 38px; }
.fx-turi img { width: 38px; height: 38px; display: block; }
.fx-turi::after, html.fiestas .turi::after { content: ''; position: absolute; top: -15px; left: 15px; width: 28px; height: 25px; transform: rotate(14deg);
  background: var(--fx-gorro) center / contain no-repeat; pointer-events: none; }
.fx-cuenta::after { content: ''; width: 24px; height: 24px; flex: none; background: var(--fx-mono-rojo) center / contain no-repeat; }
html.fiestas .splash-enter { background: #d8343a; box-shadow: 0 14px 34px rgba(216,52,58,0.45), inset 0 0 0 2px rgba(242,193,78,0.6); }
.fx-mono { width: 22px; height: 22px; flex: none; background: var(--fx-mono-oro) center / contain no-repeat; }
/* el espacio manda: el arbolito solo en pantallas muy altas, el texto largo en las altas;
   en las demás quedan el sello, el saludo y la cuenta (si no, el logo se sale por arriba) */
@media (max-height: 939px) { .fx-arbol { display: none !important; } }
@media (max-height: 859px) { html.fiestas .splash-sub.fx-b { display: none; } }
@media (max-height: 800px) { html.fiestas .fx-sello { display: none; } .fx-saludo { font-size: 2.1rem; } }
@media (max-height: 680px) { .fx-saludo { font-size: 1.75rem; margin-top: 6px; } .fx-cuenta { margin-bottom: 8px; padding: 4px 12px 4px 6px; } }
@media (max-height: 600px) { html.fiestas .fx-saludo { display: none; } }
@media (orientation: landscape) and (max-height: 600px) { html.fiestas .fx-saludo { font-size: 1.6rem; margin-top: 4px; } .fx-sello { display: none !important; } }

/* ---------- Turi en el mapa, con gorro ---------- */
html.fiestas .turi::after { top: -16px; left: 22px; width: 32px; height: 28px; }

/* ---------- Mapa ---------- */
/* las estrellitas van arriba del mapa y abajo de los puntos (los puntos de Leaflet están en z-index 600) */
.fx-mapa-luces { position: absolute; inset: 0; z-index: 450; pointer-events: none; overflow: hidden; }
.fx-mapa-guirnalda { position: absolute; left: 0; right: 0; top: var(--head-h, 60px); height: 64px; z-index: 499; pointer-events: none; overflow: hidden; }
.fx-mapa-luces svg, .fx-mapa-guirnalda svg { position: absolute; left: 0; top: 0; display: block; }
.fx-pill { position: absolute; z-index: 501; bottom: calc(196px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  white-space: nowrap; padding: 7px 14px 7px 10px; border-radius: 999px; background: rgba(6,18,14,0.9); border: 1px solid rgba(242,193,78,0.55);
  color: #d7e2dd; font-size: 0.78rem; line-height: 1.2; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
/* con una ficha abierta o el panel de cómo llegar, la cuenta se esconde para no tapar */
#map-view.con-popup .fx-pill { display: none; }
.fx-pill b { color: #fff; }
.fx-pill i { width: 18px; height: 18px; flex: none; background: var(--fx-mono-rojo) center / contain no-repeat; }
.fx-pill:empty { display: none; }
html:not(.fiestas) .fx-pill, html:not(.fiestas) .fx-mapa-luces, html:not(.fiestas) .fx-mapa-guirnalda { display: none; }

/* árboles de la Municipalidad: el dibujo y la cuenta abajo, centrada */
.fx-arbol-icono { background: none; border: 0; }
.fx-arbolpin { position: relative; width: 52px; height: 71px; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.5)); cursor: pointer; }
.fx-arbolpin svg { display: block; }
.fx-arbolpin.on { filter: drop-shadow(0 0 10px rgba(242,193,78,0.55)) drop-shadow(0 6px 10px rgba(0,0,0,0.5)); }
.fx-arbolpin-t { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 9px; border-radius: 999px;
  background: rgba(6,18,14,0.92); border: 1px solid rgba(242,193,78,0.6); color: #ffd77a; font: 600 0.68rem/1.3 'Be Vietnam Pro', sans-serif; text-align: center; }
.fx-arbolpin-t b { color: #fff; }
.fx-pop .leaflet-popup-content { min-width: 200px; text-align: center; }
.fx-pop-in { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fx-pop-lema { font-family: 'Dancing Script', 'Be Vietnam Pro', cursive; font-size: 1.25rem; color: #ffd77a; line-height: 1.1; }
.fx-pop-t { font-size: 0.86rem; color: #fff; }
.fx-pop-l { color: #c9d6d0; }
.fx-pop-f { color: #ff8f92; }
.fx-pop-c { margin-top: 4px; padding: 4px 10px; border-radius: 999px; background: rgba(216,52,58,0.18); border: 1px solid rgba(242,193,78,0.45); color: #ffd77a; }
.fx-pop-c b { color: #fff; }
.fx-pop-ir { margin-top: 6px; padding: 7px 14px; border-radius: 10px; background: #d8343a; color: #fff !important; text-decoration: none; font-weight: 700; }
.fx-pop-o { margin-top: 4px; font-size: 0.66rem; color: #8fa59b; font-weight: 500; }

/* ---------- "¿Qué estás buscando hoy?" ---------- */
html.fiestas .busca { border-color: rgba(242,193,78,0.45); padding-top: 26px; }
html.fiestas .busca::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 7px;
  background: repeating-linear-gradient(135deg, #d8343a 0 9px, #ffffff 9px 18px); }
html.fiestas .busca h2::before { content: ''; display: inline-block; width: 30px; height: 23px; margin-right: 6px; vertical-align: -4px;
  background: var(--fx-acebo) center / contain no-repeat; }
html.fiestas .busca-x { top: 20px; }
/* en fiestas, títulos y saludos centrados */
html.fiestas .busca h2 { text-align: center; margin: 0 44px 4px; }
html.fiestas .busca > p { text-align: center; margin-left: 0; }
html.fiestas .greet, html.fiestas .greet-sub { text-align: center; }
html.fiestas .feed-hero-body { text-align: center; }
html.fiestas .feed-hero-meta { display: block; }
html.fiestas .feed-hero-meta i { vertical-align: -2px; margin-right: 2px; }

/* ---------- Agenda ---------- */
html.fiestas .feed-hero .fx-capa { z-index: 2; }
.greet.fx-b::before { content: ''; display: inline-block; width: 34px; height: 26px; margin-right: 8px; vertical-align: -3px;
  background: var(--fx-acebo) center / contain no-repeat; }
.greet.fx-b em { font-family: 'Dancing Script', 'Be Vietnam Pro', cursive; font-style: normal; font-size: 1.25em; color: #ff6b6f; }
html.fiestas .ia-cab { position: relative; }
html.fiestas .ia-cab::before { content: ''; position: absolute; left: 30px; top: -16px; width: 36px; height: 32px; transform: rotate(14deg); z-index: 1;
  background: var(--fx-gorro) center / contain no-repeat; pointer-events: none; }

/* dibujos chicos, como imágenes (sin pedir nada a otro servidor) */
:root {
  --fx-acebo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Cpath d='M20 16C12 6 4 10 1 4c4 10 9 15 19 12z' fill='%231f9a64'/%3E%3Cpath d='M20 16c8-10 16-6 19-12-4 10-9 15-19 12z' fill='%23147a4e'/%3E%3Ccircle cx='17' cy='19' r='4' fill='%23e0393e'/%3E%3Ccircle cx='24' cy='19' r='4' fill='%23c9262b'/%3E%3Ccircle cx='20.5' cy='24' r='4' fill='%23e0393e'/%3E%3Ccircle cx='16' cy='18' r='1.2' fill='%23fff' opacity='.6'/%3E%3C/svg%3E");
  --fx-gorro: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 36'%3E%3Cpath d='M6 26C8 12 18 2 30 4c6 1 8 8 6 14-3-6-8-8-12-6 6 4 8 10 9 14z' fill='%23d8343a'/%3E%3Crect x='3' y='24' width='33' height='9' rx='4.5' fill='%23fff'/%3E%3Ccircle cx='36.5' cy='19' r='4' fill='%23fff'/%3E%3C/svg%3E");
  --fx-mono-oro: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffd77a'%3E%3Cpath d='M12 11c-3-5-9-6-9-2.5S8 12 12 11zm0 0c3-5 9-6 9-2.5S16 12 12 11z'/%3E%3Cpath d='M11 11l-4 8 3-1 1 3 1-10zm2 0l4 8-3-1-1 3-1-10z' opacity='.85'/%3E%3Ccircle cx='12' cy='11' r='2'/%3E%3C/svg%3E");
  --fx-mono-rojo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e0393e'%3E%3Cpath d='M12 11c-3-5-9-6-9-2.5S8 12 12 11zm0 0c3-5 9-6 9-2.5S16 12 12 11z'/%3E%3Cpath d='M11 11l-4 8 3-1 1 3 1-10zm2 0l4 8-3-1-1 3-1-10z' opacity='.85'/%3E%3Ccircle cx='12' cy='11' r='2'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: no-preference) {
  html.fiestas .fx-luz { animation: fx-titila 2.4s ease-in-out infinite; }
  html.fiestas .fx-luz:nth-of-type(3n) { animation-delay: .8s; }
  html.fiestas .fx-luz:nth-of-type(3n+1) { animation-delay: 1.6s; }
}
@keyframes fx-titila { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
html.perf-lite .fx-luz { animation: none !important; }
