/* =========================================================
   DLE Frames – Horizontal strip (3 PC / 2 Mobile) + Lightbox
   DLE 18.x
========================================================= */

/* ---------- Base ---------- */
.dle-frames{
  margin:16px 0;
}

/* ---------- HORIZONTAL STRIP ---------- */
/* працює і для контейнера, і для вкладеної галереї DLE */
.dle-frames--ready,
.dle-frames--ready > :first-child{
  display:flex !important;
  flex-direction:row !important;
  gap:10px !important;
  overflow-x:auto !important;
  overflow-y:hidden !important;
  scroll-snap-type:x mandatory !important;
  -webkit-overflow-scrolling:touch !important;
  align-items:flex-start !important;
  padding:6px 2px 10px !important;
}

/* прибираємо <br>, які ламають стрічку */
.dle-frames--ready br,
.dle-frames--ready > :first-child br{
  display:none !important;
}

/* ---------- CARD SIZE ---------- */
/* 3 кадри на ПК */
.dle-frames--ready a,
.dle-frames--ready > :first-child a{
  flex:0 0 calc((100% - 20px) / 3) !important;
  max-width:calc((100% - 20px) / 3) !important;
  position:relative !important;
  display:block !important;
  overflow:hidden !important;
  border-radius:14px !important;
  scroll-snap-align:start !important;
  line-height:0 !important;
}

/* картинка займає всю карточку */
.dle-frames--ready img,
.dle-frames--ready > :first-child img{
  width:100% !important;
  height:auto !important;
  display:block !important;
  border-radius:14px !important;
  cursor:zoom-in !important;
  transition:transform .18s ease, filter .18s ease !important;
}

/* ---------- LOUPE ---------- */
.dle-frames--ready a::after,
.dle-frames--ready > :first-child a::after{
  content:"🔍";
  position:absolute;
  right:8px;
  bottom:8px;
  width:34px;
  height:34px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(0,0,0,.55);
  color:#fff;
  opacity:0;
  transform:scale(.9);
  transition:opacity .18s ease, transform .18s ease;
  pointer-events:none;
}

/* hover */
.dle-frames--ready a:hover img,
.dle-frames--ready > :first-child a:hover img{
  transform:scale(1.04);
  filter:brightness(.95);
}
.dle-frames--ready a:hover::after,
.dle-frames--ready > :first-child a:hover::after{
  opacity:1;
  transform:scale(1);
}

/* ---------- SCROLLBAR ---------- */
.dle-frames--ready::-webkit-scrollbar,
.dle-frames--ready > :first-child::-webkit-scrollbar{
  height:8px;
}
.dle-frames--ready::-webkit-scrollbar-thumb,
.dle-frames--ready > :first-child::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.18);
  border-radius:999px;
}
.dle-frames--ready::-webkit-scrollbar-track,
.dle-frames--ready > :first-child::-webkit-scrollbar-track{
  background:rgba(255,255,255,.06);
  border-radius:999px;
}

/* ---------- MOBILE: 2 CARDS ---------- */
@media (max-width:700px){
  .dle-frames--ready a,
  .dle-frames--ready > :first-child a{
    flex:0 0 calc((100% - 10px) / 2) !important;
    max-width:calc((100% - 10px) / 2) !important;
  }
}

/* =========================================================
   LIGHTBOX
========================================================= */

#dleFramesLightbox{
  position:fixed;
  inset:0;
  display:none;
  z-index:99999;
}
#dleFramesLightbox.is-open{
  display:block;
}

/* background */
#dleFramesLightbox .dflb__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.78);
  opacity:0;
  animation:dflbFade .18s ease forwards;
}
@keyframes dflbFade{ to{opacity:1;} }

/* wrapper */
#dleFramesLightbox .dflb__wrap{
  position:relative;
  max-width:92vw;
  max-height:92vh;
  margin:4vh auto 0;
  display:flex;
  align-items:center;
  justify-content:center;
  transform:translateY(10px) scale(.97);
  opacity:0;
  animation:dflbPop .18s ease forwards;
}
@keyframes dflbPop{
  to{ transform:translateY(0) scale(1); opacity:1; }
}

/* image */
#dleFramesLightbox .dflb__img{
  max-width:92vw;
  max-height:92vh;
  transform-origin:center center;
  transition:transform .06s linear;
  cursor:zoom-in;
  user-select:none;
}

/* close */
#dleFramesLightbox .dflb__close{
  position:absolute;
  top:-12px;
  right:-12px;
  width:44px;
  height:44px;
  border-radius:999px;
  border:0;
  font-size:28px;
  line-height:44px;
  cursor:pointer;
  background:#fff;
  color:#000;
}

/* arrows */
#dleFramesLightbox .dflb__nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:44px;
  height:44px;
  border-radius:999px;
  border:0;
  font-size:20px;
  line-height:44px;
  cursor:pointer;
  background:rgba(255,255,255,.9);
  color:#000;
}
#dleFramesLightbox .dflb__prev{ left:10px; }
#dleFramesLightbox .dflb__next{ right:10px; }

/* counter */
#dleFramesLightbox .dflb__counter{
  position:absolute;
  top:10px;
  left:50%;
  transform:translateX(-50%);
  padding:6px 10px;
  border-radius:999px;
  font-size:14px;
  background:rgba(0,0,0,.55);
  color:#fff;
  user-select:none;
}

/* mobile tweaks */
@media (max-width:600px){
  #dleFramesLightbox .dflb__nav{
    width:38px;
    height:38px;
    font-size:18px;
    line-height:38px;
  }
}
