/* =========================================================
   PREMIUM CHRIST LIBRARY PHOTO GALLERY
   Enhances the existing #photo-gallery without changing JS
   ========================================================= */

#photo-gallery{
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at top right, rgba(217,134,0,.08), transparent 28%),
    linear-gradient(180deg,#f8f9fc 0%,#f4f6fa 100%) !important;
  border:1px solid rgba(15,30,74,.08);
  box-shadow:0 14px 36px rgba(15,30,74,.08);
}

#photo-gallery::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:4px;
  background:linear-gradient(90deg,#0f1e4a 0%,#0f1e4a 35%,#d98600 50%,#0f1e4a 65%,#0f1e4a 100%);
  background-size:220% 100%;
  animation:galleryTopLine 7s linear infinite;
}

@keyframes galleryTopLine{
  0%{background-position:0% 50%}
  100%{background-position:220% 50%}
}

/* Large featured image frame */
#photo-gallery .featured{
  position:relative;
  padding:4px;
  border-radius:18px !important;
  overflow:hidden;
  background:linear-gradient(135deg,#0f1e4a,#243b77 48%,#d98600 100%) !important;
  box-shadow:
    0 18px 38px rgba(15,30,74,.18),
    0 5px 14px rgba(15,30,74,.10);
  transition:transform .4s ease,box-shadow .4s ease;
  isolation:isolate;
}

#photo-gallery .featured::before{
  content:"";
  position:absolute;
  inset:-45%;
  z-index:0;
  background:conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255,255,255,.05) 75deg,
    rgba(217,134,0,.85) 115deg,
    transparent 155deg,
    transparent 360deg
  );
  animation:featuredBorderSweep 8s linear infinite;
}

@keyframes featuredBorderSweep{
  to{transform:rotate(360deg)}
}

#photo-gallery .featured::after{
  content:"";
  position:absolute;
  inset:4px;
  border-radius:14px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
  pointer-events:none;
  z-index:2;
}

#photo-gallery .featured img{
  position:relative;
  z-index:1;
  border-radius:14px;
  transition:transform .75s cubic-bezier(.2,.75,.2,1),filter .45s ease;
}

#photo-gallery .featured:hover{
  transform:translateY(-5px);
  box-shadow:
    0 28px 54px rgba(15,30,74,.24),
    0 8px 18px rgba(15,30,74,.12);
}

#photo-gallery .featured:hover img{
  transform:scale(1.025);
  filter:brightness(.96) contrast(1.03);
}

/* Caption refinement */
#photo-gallery .caption{
  z-index:4;
  left:4px;
  right:4px;
  bottom:4px;
  border-radius:0 0 14px 14px;
  padding:48px 24px 20px !important;
  background:linear-gradient(
    to top,
    rgba(7,16,43,.92) 0%,
    rgba(15,30,74,.72) 42%,
    rgba(15,30,74,.12) 78%,
    transparent 100%
  ) !important;
}

#photo-gallery .caption strong{
  position:relative;
  display:inline-block;
  font-size:19px !important;
  letter-spacing:.01em;
  text-shadow:0 2px 10px rgba(0,0,0,.35);
}

#photo-gallery .caption strong::before{
  content:"";
  display:block;
  width:34px;
  height:3px;
  margin-bottom:9px;
  border-radius:10px;
  background:#d98600;
  transition:width .35s ease;
}

#photo-gallery .featured:hover .caption strong::before{
  width:58px;
}

#photo-gallery .caption span{
  color:#eef2ff;
  font-weight:600;
  opacity:.92;
}

/* Thumbnails */
#photo-gallery .gallery-thumb{
  position:relative;
  border:1px solid rgba(15,30,74,.10) !important;
  box-shadow:
    0 5px 14px rgba(15,30,74,.08),
    0 1px 3px rgba(15,30,74,.05);
  transition:
    transform .28s ease,
    box-shadow .28s ease,
    border-color .28s ease;
}

#photo-gallery .gallery-thumb::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:2;
  border-radius:inherit;
  border:2px solid transparent;
  background:
    linear-gradient(#fff,#fff) padding-box,
    linear-gradient(120deg,#0f1e4a,#d98600,#0f1e4a) border-box;
  background-size:200% 200%;
  opacity:0;
  pointer-events:none;
  transition:opacity .28s ease;
}

#photo-gallery .gallery-thumb:hover{
  transform:translateY(-3px) scale(1.015);
  box-shadow:
    0 12px 24px rgba(15,30,74,.16),
    0 4px 10px rgba(15,30,74,.08);
}

#photo-gallery .gallery-thumb:hover::before{
  opacity:1;
  animation:thumbBorderFlow 2.2s linear infinite;
}

@keyframes thumbBorderFlow{
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}

#photo-gallery .gallery-thumb.active{
  border-color:#d98600 !important;
  box-shadow:
    0 0 0 2px rgba(217,134,0,.14),
    0 10px 22px rgba(15,30,74,.14);
}

#photo-gallery .gallery-thumb.active::after{
  content:"";
  position:absolute;
  left:0;
  top:14%;
  bottom:14%;
  width:4px;
  border-radius:0 8px 8px 0;
  background:#d98600;
  z-index:3;
}

#photo-gallery .gallery-thumb img{
  transition:transform .45s ease,filter .35s ease;
}

#photo-gallery .gallery-thumb:hover img{
  transform:scale(1.055);
  filter:brightness(.94) contrast(1.04);
}

/* Refined scrollbar for vertical thumbnails */
@media(min-width:761px){
  #photo-gallery .gallery-thumbs{
    padding-right:8px !important;
  }

  #photo-gallery .gallery-thumbs::-webkit-scrollbar{
    width:6px;
  }

  #photo-gallery .gallery-thumbs::-webkit-scrollbar-track{
    background:#e8ecf4;
    border-radius:10px;
  }

  #photo-gallery .gallery-thumbs::-webkit-scrollbar-thumb{
    background:linear-gradient(#0f1e4a,#d98600);
    border-radius:10px;
  }
}

/* Navigation buttons */
#photo-gallery .gallery-navs button{
  position:relative;
  overflow:hidden;
  box-shadow:0 6px 14px rgba(15,30,74,.16);
  transition:transform .25s ease,box-shadow .25s ease,background .25s ease;
}

#photo-gallery .gallery-navs button::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg,transparent 25%,rgba(255,255,255,.22),transparent 70%);
  transform:translateX(-130%);
  transition:transform .45s ease;
}

#photo-gallery .gallery-navs button:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 20px rgba(15,30,74,.20);
}

#photo-gallery .gallery-navs button:hover::after{
  transform:translateX(130%);
}

/* Mobile: keep styling but reduce movement */
@media(max-width:760px){
  #photo-gallery{
    padding:20px 14px !important;
  }

  #photo-gallery .featured{
    border-radius:14px !important;
    padding:3px;
  }

  #photo-gallery .featured::after{
    inset:3px;
    border-radius:11px;
  }

  #photo-gallery .featured img{
    border-radius:11px;
  }

  #photo-gallery .caption{
    left:3px;
    right:3px;
    bottom:3px;
    border-radius:0 0 11px 11px;
    padding:38px 16px 14px !important;
  }

  #photo-gallery .featured:hover,
  #photo-gallery .gallery-thumb:hover{
    transform:none;
  }

  #photo-gallery .gallery-thumb:hover img{
    transform:none;
  }
}

@media(prefers-reduced-motion:reduce){
  #photo-gallery::before,
  #photo-gallery .featured::before,
  #photo-gallery .gallery-thumb:hover::before{
    animation:none !important;
  }

  #photo-gallery .featured,
  #photo-gallery .featured img,
  #photo-gallery .gallery-thumb,
  #photo-gallery .gallery-thumb img,
  #photo-gallery .gallery-navs button{
    transition:none !important;
  }
}
