/* BPR Penataran V14 - performance-only rules.
   Does not change the intended visual design. */

#pengumuman,
#produk,
#tentang,
#kantor,
#berita,
#instagram,
#simulasi,
#kontak,
.institution-strip{
  content-visibility:auto;
  contain-intrinsic-size:700px;
}

img{
  image-rendering:auto;
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}


/* ==========================================================
   V14 ANTI-FLASH GAMBAR LAMA
   File CSS ini dibaca di <head>, jadi bekerja SEBELUM JS bawah
   halaman sempat menampilkan fallback lama.
   ========================================================== */

/* Hero/banner fallback statis lama */
#heroSlider img[src^="assets/banner"],
#heroSlider img[src^="assets/banners/"],
#heroSlider img[src*="/banner-"],
#heroSlider img[src*="/slide-"]{
  visibility:hidden!important;
}

/* Pengumuman lama */
#announcementCarousel img[src^="assets/announcements/"]{
  visibility:hidden!important;
}

/* Kantor/jaringan lama */
#branchCarousel img[src^="assets/offices/"]{
  visibility:hidden!important;
}

/* Berita lama */
#newsHomeCarousel img[src^="assets/news/"]{
  visibility:hidden!important;
}

/* Thumbnail kategori Kredit/Tabungan/Deposito lama */
.product-category-visual img[src^="assets/products/"]{
  visibility:hidden!important;
}

/* Logo statis lama.
   Saat JS mengganti src menjadi admin/uploads/... selector ini otomatis tidak cocok. */
.brand img[src="assets/logo-bpr-penataran.png"],
.footer-brand img[src="assets/logo-bpr-penataran.png"]{
  visibility:hidden!important;
}

/* Visual placeholder Tentang Kami lama */
#tentang .about-visual .building-placeholder,
#tentang .about-visual .about-photo-note{
  visibility:hidden!important;
}

/* Tetap beri wadah netral saat foto dinamis belum masuk */
#heroSlider{
  background:linear-gradient(135deg,#e9f1f8,#dce8f4);
}
#announcementCarousel .announcement-image,
#newsHomeCarousel .news-image,
#branchCarousel .branch-image,
.product-category-visual,
#tentang .about-visual{
  background-color:#eef4f9;
}

/* Hindari gambar legacy berkedip saat browser sedang decode */
#announcementCarousel img,
#newsHomeCarousel img,
#branchCarousel img,
.product-category-visual img,
.brand img,
.footer-brand img{
  transition:opacity .15s ease;
}


/* ==========================================================
   V14 FINAL ANTI-GAMBAR-LAMA
   Dibuat dari file aktif hosting 23-09-2026.
   ========================================================== */
.v14-hero-placeholder{
  background:linear-gradient(135deg,#dce8f5 0%,#edf4fb 48%,#dbe8f6 100%)!important;
}
.v14-hero-loading{
  width:100%;height:100%;
  display:flex;align-items:center;justify-content:center;
  color:#7d90a7;font-size:13px;font-weight:700;
  background:linear-gradient(110deg,#e3edf7 8%,#f6f9fc 18%,#e3edf7 33%);
  background-size:200% 100%;
  animation:v14InitialShimmer 1.25s linear infinite;
}
.v14-initial-loading-card{
  min-height:210px!important;
  display:flex!important;
  align-items:stretch!important;
}
.v14-initial-loading-block{
  width:100%;min-height:210px;
  display:flex;align-items:center;justify-content:center;
  padding:24px;text-align:center;
  border-radius:22px;
  color:#7d90a7;font-size:12px;font-weight:700;
  background:linear-gradient(110deg,#eef3f8 8%,#fafcff 18%,#eef3f8 33%);
  background-size:200% 100%;
  animation:v14InitialShimmer 1.25s linear infinite;
}
.product-category-visual img:not([src]){
  visibility:hidden!important;
}
@keyframes v14InitialShimmer{
  to{background-position-x:-200%}
}
@media (prefers-reduced-motion:reduce){
  .v14-hero-loading,.v14-initial-loading-block{animation:none!important}
}


/* ==========================================================
   V14 FIX LOGO LAMA HEADER + LOADING SCREEN
   Logo header/footer tidak memakai file statis lama.
   ========================================================== */
.brand{
  min-width:205px;
}
.brand img:not([src]),
.footer-brand img:not([src]){
  opacity:0!important;
  visibility:hidden!important;
}
@media (max-width:767px){
  .brand{min-width:165px}
}


/* ==========================================================
   V14 FIX ASET LAMA / PLACEHOLDER - 28-09-2026
   Aset offices/ dan logo statis sekarang sudah berisi file resmi/aktual.
   ========================================================== */

/* File kantor statis kini adalah foto asli, jadi boleh tampil sebagai fallback. */
#branchCarousel img[src^="assets/offices/"]{
  visibility:visible!important;
}

/* Logo fallback statis kini logo transparan terbaru, bukan kapsul lama. */
.brand img[src="assets/logo-bpr-penataran.png"],
.footer-brand img[src="assets/logo-bpr-penataran.png"]{
  visibility:visible!important;
}

/* Jika foto kantor dari API gagal dimuat, background ini tetap menampilkan foto kantor asli. */
#branchCarousel .branch-image{
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:cover!important;
}
#branchCarousel .branch-slide:nth-of-type(1) .branch-image{background-image:url("../offices/sanankulon.webp")!important}
#branchCarousel .branch-slide:nth-of-type(2) .branch-image{background-image:url("../offices/kota-blitar.webp")!important}
#branchCarousel .branch-slide:nth-of-type(3) .branch-image{background-image:url("../offices/tulungagung.webp")!important}
#branchCarousel .branch-slide:nth-of-type(4) .branch-image{background-image:url("../offices/wlingi.webp")!important}
#branchCarousel .branch-slide:nth-of-type(5) .branch-image{background-image:url("../offices/sutojayan.webp")!important}
#branchCarousel .branch-image img{
  color:transparent!important;
  font-size:0!important;
}
