/* =====================================================================
   Ambijent početne strane (js/ambijent.js): dan/noć, sneg, kiša, lampice
   ===================================================================== */

/* ===== Padavine: platno preko scena, ispod menija i dugmadi ===== */
.amb-fx { position: fixed; inset: 0; z-index: 45; width: 100%; height: 100%; pointer-events: none; }
/* po kiši scena je malo tamnija i hladnija */
.is-rain .scene__view::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(30,40,55,.28), rgba(20,28,40,.12));
}

/* ===== Brisači (šoferšajbna kamiona, desno gore na kabini) ===== */
.truck__wiper {
  position: absolute;
  left: 81.2%;
  top: 14%;
  z-index: 3;
  width: .45%;
  height: 17%;
  border-radius: 2px;
  background: linear-gradient(#2b2b2b, #0c0c0c);
  box-shadow: 0 0 2px rgba(0,0,0,.6);
  transform-origin: 50% 100%;
  transform: rotate(-30deg);
  opacity: 0;
  pointer-events: none;
}
.is-rain .truck__wiper { opacity: 1; animation: wipe 1.15s ease-in-out infinite alternate; }
@keyframes wipe { from { transform: rotate(-32deg); } to { transform: rotate(14deg); } }

/* ===== Sezonski ukrasi (slike iz slike/sezona/, js/ambijent.js) =====
   mere su u % kamiona (slika kamiona 1400×730): sanduk x 2,5–59 %, krov kabine x 62–79 %, y 12 % */
.dec { position: absolute; z-index: 3; height: auto; max-width: none; pointer-events: none; }
.dec--snow-box { left: 1.2%; width: 59.5%; top: -15.5%; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.dec--snow-cab { left: 61.5%; width: 18.5%; top: 6.6%; }
.dec--garland { left: 2.4%; width: 57%; top: -1%; }
.dec--eggs { top: -2%; }
.dec--wreath { left: 69%; width: 8.5%; top: 40%; }
/* luka: ukrasi su na kontejneru (u % kontejnera) – isti i na kranu i na kamionu */
.dec--on-box.dec--snow-box { left: -1.5%; width: 103%; top: -33%; }
.dec--on-box.dec--garland { left: .3%; width: 97%; top: 3%; }
.dec--on-box.dec--eggs { top: 1%; }
/* hvataljka krana ostaje preko snega */
.hoist__spreader { z-index: 4; }
/* bilbord */
.dec--snow-board { left: -2%; width: 104%; top: -9%; }
.dec--board-garland { left: 2%; width: 96%; top: 6%; }
@keyframes decTwinkle { from { filter: brightness(.92); } to { filter: brightness(1.18) drop-shadow(0 0 4px rgba(255,210,120,.6)); } }
.is-xmas .dec--garland:not(.dec--eggs), .is-xmas .dec--board-garland:not(.dec--eggs), .dec--wreath { animation: decTwinkle 1.4s ease-in-out infinite alternate; }

/* ===== Snežne pozadine puta (luka i ulica menjaju <picture> u JS-u) ===== */
.is-snowbg .scene--put .scene__track { background-image: image-set(url("../slike/scena-put-petlja-sneg.webp") type("image/webp"), url("../slike/scena-put-petlja-sneg.jpg") type("image/jpeg")); }
.is-snowbg.is-day .scene--put .scene__track { background-image: image-set(url("../slike/scena-put-petlja-dan-sneg.webp") type("image/webp"), url("../slike/scena-put-petlja-dan-sneg.jpg") type("image/jpeg")); }
@media (max-aspect-ratio: 1/1) {
  .is-snowbg .scene--put .scene__track { background-image: image-set(url("../slike/mobile/scena-put-petlja-sneg.webp") type("image/webp"), url("../slike/mobile/scena-put-petlja-sneg.jpg") type("image/jpeg")); }
  .is-snowbg.is-day .scene--put .scene__track { background-image: image-set(url("../slike/mobile/scena-put-petlja-dan-sneg.webp") type("image/webp"), url("../slike/mobile/scena-put-petlja-dan-sneg.jpg") type("image/jpeg")); }
}

/* ===== Dan: noćni efekti se gase ===== */
.is-day .put-sky,
.is-day .put-meteor,
.is-day .put-flies { display: none; }
.is-day .truck__beam { opacity: 0 !important; }
.is-day .ul-glow { opacity: .25; }
.is-day .scene--put .scene__track {
  background-image: url("../slike/scena-put-petlja-dan.jpg");
  background-image: image-set(url("../slike/scena-put-petlja-dan.webp") type("image/webp"), url("../slike/scena-put-petlja-dan.jpg") type("image/jpeg"));
}
@media (max-aspect-ratio: 1/1) {
  .is-day .scene--put .scene__track {
    background-image: url("../slike/mobile/scena-put-petlja-dan.jpg");
    background-image: image-set(url("../slike/mobile/scena-put-petlja-dan.webp") type("image/webp"), url("../slike/mobile/scena-put-petlja-dan.jpg") type("image/jpeg"));
  }
}
/* gornja senka (zbog menija) je danju blaža */
.is-day .scene__shade { opacity: .55; }

@media (prefers-reduced-motion: reduce) {
  .dec, .is-rain .truck__wiper { animation: none; }
}

/* U magacinu (unutra) i na završnom panelu sa tekstom ne pada ni kiša ni sneg, a brisači miruju */
.amb-fx { transition: opacity .6s ease; }
.film-page:has(#magacin.is-active) .amb-fx,
.film-page:has(#o-nama-ukratko.is-active) .amb-fx { opacity: 0; }
.scene--magacin .truck__wiper { display: none; }
