/* Atmospheric weather card, scoped to the portal. No external image or animation library. */
.epg .epg-top-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(350px, .9fr);
  align-items: stretch;
}
.epg .epg-weather {
  --weather-highlight: #bcecff;
  position: relative;
  padding: 22px 24px 17px;
  background: radial-gradient(ellipse at 95% 0%, #9bddf9 0%, transparent 58%), linear-gradient(150deg, #08639c, #2585bc 70%, #52a5ce);
  border: 1px solid #ffffff38;
  border-radius: 26px;
  box-shadow: 0 14px 35px #224a7021, inset 0 1px 0 #ffffff45;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.epg .epg-weather:before {
  width: 310px; height: 310px; top: -165px; right: -90px;
  background: #ffffff0a; box-shadow: 0 0 0 45px #ffffff06, 0 0 0 90px #ffffff04;
}
.epg .epg-weather.epg-night {
  background: radial-gradient(ellipse at 95% 0%, #475595, transparent 65%), linear-gradient(145deg, #111a35, #253d65);
}
.epg .epg-weather.epg-wet {
  background: radial-gradient(ellipse at 90% 0%, #8babc4, transparent 65%), linear-gradient(145deg, #354963, #50738d);
}
.epg .epg-weather[data-weather-kind="sun"] {
  --weather-highlight: #fff0b3;
  background: radial-gradient(ellipse at 95% 5%, #b3e3ed, transparent 60%), linear-gradient(145deg, #096c9f, #399ac0);
}
.epg .epg-weather[data-weather-kind="storm"] {
  background: radial-gradient(ellipse at 90% 0%, #6a7e9c, transparent 65%), linear-gradient(145deg, #26334e, #49627a);
}
.epg .epg-weather > :not(.epg-atmosphere) { position: relative; z-index: 1; }
.epg .epg-weather-top { display: flex; flex-direction: row; justify-content: space-between; align-items: center; }
.epg .epg-pill { border: 0; padding: 0; font-size: 12px; letter-spacing: .11em; font-weight: 650; }
.epg .epg-motion-toggle {
  appearance: none; min-height: 30px; padding: 4px 10px; margin: 0;
  font: inherit; font-size: 12px; line-height: 1.5;
  color: #fff; background: #ffffff12; border: 1px solid #ffffff38; border-radius: 20px;
  cursor: pointer; box-shadow: none;
}
.epg .epg-motion-toggle:hover { background: #ffffff28; color: #fff; }
.epg .epg-motion-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.epg .epg-weather-main { min-height: 130px; padding: 12px 0 8px; }
.epg .epg-weather h3 { color: #e9f4fc; font-size: 16px; font-weight: 450; line-height: 1.3; margin: 0; }
.epg .epg-temperature { font-size: 72px; font-weight: 500; letter-spacing: -.065em; margin: 5px 0 0; }
.epg .epg-temperature span { font-size: 25px; font-weight: 400; line-height: 1.8; }
.epg .epg-condition { font-size: 15px; line-height: 1.4; margin-top: 2px; color: #fff; }
.epg .epg-sky { width: 150px; margin: -8px -8px -14px 0; filter: drop-shadow(0 14px 16px #122e5426); }
.epg .epg-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px; padding: 11px 0 14px; border-bottom: 1px solid #ffffff26;
}
.epg .epg-metrics span { font-size: 12px; color: #e5f1fa; line-height: 1.4; }
.epg .epg-metrics strong { font-size: 15px; font-weight: 600; margin-top: 4px; }
.epg .epg-forecast-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 13px; font-size: 12px; }
.epg .epg-forecast-label span:last-child { font-size: 11px; color: #e3eff9; }
.epg .epg-trend { height: 26px; color: var(--weather-highlight); margin: 5px 0 0; }
.epg .epg-trend svg { width: 100%; height: 26px; overflow: visible; }
.epg .epg-hours { gap: 3px; padding: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.epg .epg-hour { background: none; border: 0; border-radius: 0; padding: 5px 1px 0; font-size: 12px; }
.epg .epg-hour + .epg-hour { border-left: 1px solid #ffffff1a; }
.epg .epg-hour-icon { width: 36px; height: 33px; }
.epg .epg-hour strong { font-size: 17px; font-weight: 600; }
.epg .epg-hour small { font-size: 11px; margin-top: 2px; color: #e5f1fa; }
.epg .epg-source { margin-top: 14px; font-size: 11px; color: #e5f1fa; text-decoration-color: #ffffff55; }
.epg .epg-weather-error { font-size: 13px; background: #102e4a30; border-radius: 8px; padding: 8px; margin: 8px 0; }
.epg .epg-weather-error:empty { padding: 0; margin: 0; }
.epg .epg-board { min-height: 410px; }

/* Slow atmospheric movement. Content and controls always stay still. */
.epg .epg-atmosphere { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.epg .epg-atmosphere:before,
.epg .epg-atmosphere:after {
  content: ""; position: absolute; width: 220px; height: 100px;
  top: 45px; right: -120px; border-radius: 50%;
  background: radial-gradient(ellipse, #fff 0%, #ffffff00 70%);
  opacity: .12; animation: epg-sky-drift 28s ease-in-out infinite alternate;
}
.epg .epg-atmosphere:after { top: 110px; right: -20px; width: 300px; height: 100px; opacity: .08; animation-delay: -14s; animation-duration: 38s; }
.epg .epg-weather[data-weather-kind="sun"] .epg-atmosphere:before { width: 240px; height: 240px; top: -110px; right: -100px; opacity: .19; animation: epg-glow 8s ease-in-out infinite; }
.epg .epg-atmosphere i { display: none; position: absolute; }
.epg .epg-atmosphere i:nth-child(1) { left: 8%; animation-delay: -.4s; }
.epg .epg-atmosphere i:nth-child(2) { left: 23%; animation-delay: -1.8s; }
.epg .epg-atmosphere i:nth-child(3) { left: 37%; animation-delay: -.9s; }
.epg .epg-atmosphere i:nth-child(4) { left: 51%; animation-delay: -2.6s; }
.epg .epg-atmosphere i:nth-child(5) { left: 65%; animation-delay: -1.3s; }
.epg .epg-atmosphere i:nth-child(6) { left: 78%; animation-delay: -2.2s; }
.epg .epg-atmosphere i:nth-child(7) { left: 88%; animation-delay: -.6s; }
.epg .epg-atmosphere i:nth-child(8) { left: 96%; animation-delay: -3.1s; }
.epg .epg-weather:is([data-weather-kind="rain"], [data-weather-kind="storm"]) .epg-atmosphere i { display: block; top: -25px; width: 1px; height: 25px; background: linear-gradient(transparent, #e2f5ff70); animation-name: epg-rainfall; animation-duration: 3.5s; animation-timing-function: linear; animation-iteration-count: infinite; }
.epg .epg-weather.epg-night:not(.epg-wet) .epg-atmosphere i { display: block; top: 12%; width: 2px; height: 2px; border-radius: 50%; background: #eef7ff; animation-name: epg-twinkle; animation-duration: 6s; animation-iteration-count: infinite; }
.epg .epg-weather.epg-night:not(.epg-wet) .epg-atmosphere i:nth-child(even) { top: 35%; }
.epg .epg-weather[data-weather-kind="snow"] .epg-atmosphere i { display: block; top: -10px; width: 3px; height: 3px; border-radius: 50%; background: #ffffff90; animation-name: epg-rainfall; animation-duration: 9s; animation-timing-function: linear; animation-iteration-count: infinite; }
.epg .epg-sun-rays { transform-origin: 87px 71px; animation: epg-spin 70s linear infinite; }
.epg .epg-sun-halo { transform-origin: 87px 71px; animation: epg-glow 7s ease-in-out infinite; }
.epg .epg-cloud { animation: epg-cloud-front 7s ease-in-out infinite; }
.epg .epg-cloud-back { animation: epg-cloud-back 11s ease-in-out infinite; }
.epg .epg-rain { animation: none; }
.epg .epg-rain path { animation: epg-droplet 1.8s ease-in infinite; }
.epg .epg-rain .epg-drop-b { animation-delay: -.6s; }
.epg .epg-rain .epg-drop-c { animation-delay: -1.2s; }
.epg .epg-moon { animation: epg-cloud-back 10s ease-in-out infinite; }
.epg .epg-stars { animation: epg-twinkle 5s ease-in-out infinite; }
.epg .epg-mist { animation: epg-cloud-front 9s ease-in-out infinite; }
.epg .epg-snow { animation: epg-droplet 4s ease-in-out infinite; }
.epg .epg-lightning { animation: epg-twinkle 7s ease-in-out infinite; }
.epg .epg-hour-icon * { animation: none !important; }
.epg .epg-weather.epg-motion-paused *,
.epg .epg-weather.epg-motion-paused *:before,
.epg .epg-weather.epg-motion-paused *:after { animation-play-state: paused !important; }
@keyframes epg-sky-drift { to { transform: translateX(-140px); } }
@keyframes epg-glow { 50% { opacity: .65; transform: scale(1.07); } }
@keyframes epg-cloud-front { 50% { transform: translate(6px, -2px); } }
@keyframes epg-cloud-back { 50% { transform: translate(-5px, 3px); } }
@keyframes epg-droplet { 0% { transform: translate(0, -3px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-4px, 13px); opacity: 0; } }
@keyframes epg-rainfall { 0% { transform: translate(0, 0) rotate(12deg); opacity: 0; } 20% { opacity: .6; } 100% { transform: translate(-55px, 480px) rotate(12deg); opacity: 0; } }
@keyframes epg-twinkle { 50% { opacity: .35; } }
@media (max-width: 850px) {
  .epg .epg-top-grid { grid-template-columns: minmax(0, 1fr); }
  .epg .epg-board { min-height: 0; }
  .epg .epg-weather { max-width: 100%; }
}
@media (max-width: 540px) {
  .epg .epg-weather { padding: 20px 18px 16px; }
  .epg .epg-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .epg .epg-metrics strong { font-size: 13px; }
  .epg .epg-metrics span { font-size: 11px; }
  .epg .epg-sky { width: 135px; }
  .epg .epg-temperature { font-size: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .epg *, .epg *:before, .epg *:after { animation: none !important; transition: none !important; }
  .epg .epg-motion-toggle { display: none; }
}

/* Equal-height dashboard cards; mobile keeps natural content height. */
@media (min-width: 851px) {
  .epg .epg-top-grid > .epg-board,
  .epg .epg-top-grid > .epg-weather { align-self: stretch; min-height: 0; }
  .epg .epg-top-grid > .epg-weather { display: flex; flex-direction: column; }
  .epg .epg-weather .epg-source { margin-top: auto; padding-top: 14px; }
}

/* Compact portal heading beneath the municipal site's own masthead. */
.epg .epg-masthead { padding: 14px 0 18px; margin-bottom: 22px; border-bottom: 1px solid var(--line); align-items: center; }
.epg .epg-masthead h2 { margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.03em; }
@media (max-width: 540px) { .epg .epg-masthead { padding-top: 8px; gap: 12px; } }
