/* ============================================================
   JNS Safety Nets — Image System CSS
   Hero Slider | Gallery | Lightbox | Service Image Cards
   ============================================================ */

/* ---- RESPONSIVE IMG DEFAULTS ---- */
img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ============================================================
   HERO IMAGE SLIDER
   ============================================================ */
.hero-slider-wrap {
  position: relative;
  width: 100%;
  height: 580px;
  overflow: hidden;
  background: var(--navy);
}
@media (max-width: 768px) { .hero-slider-wrap { height: 420px; } }
@media (max-width: 480px) { .hero-slider-wrap { height: 340px; } }

.slider-track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.77,0,0.175,1);
  will-change: transform;
}

.slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 6s ease;
}
.slide.active img { transform: scale(1.06); }

/* Gradient overlay on every slide */
.slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(13,43,69,0.82) 0%,
    rgba(13,43,69,0.55) 50%,
    rgba(13,43,69,0.20) 100%
  );
}

/* Slide text content */
.slide-content {
  position: absolute;
  bottom: 0; left: 0; right: 0; top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
}
.slide-content .container { width: 100%; }

.slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(245,166,35,0.22);
  border: 1px solid rgba(245,166,35,0.5);
  color: #f5a623;
  font-family: var(--font-head);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s .2s, transform .5s .2s;
}
.slide-content h2 {
  color: #fff;
  font-size: clamp(1.6rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
  max-width: 640px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s .35s, transform .5s .35s;
}
.slide-content p {
  color: rgba(255,255,255,.84);
  font-size: clamp(.9rem, 2vw, 1.1rem);
  max-width: 520px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s .48s, transform .5s .48s;
}
.slide-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s .6s, transform .5s .6s;
}

/* Animate in when slide is active */
.slide.active .slide-badge,
.slide.active h2,
.slide.active p,
.slide.active .slide-btns {
  opacity: 1;
  transform: translateY(0);
}

/* --- Slider Navigation Arrows --- */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .25s, transform .25s;
  color: #fff;
}
.slider-arrow:hover { background: var(--orange); transform: translateY(-50%) scale(1.1); }
.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }
.slider-arrow svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.5; }

/* --- Slider Dots --- */
.slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
}
.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: background .3s, transform .3s, width .3s;
  border: none;
}
.slider-dot.active {
  background: var(--orange);
  width: 24px;
  border-radius: 4px;
}

/* --- Slide counter --- */
.slider-counter {
  position: absolute;
  bottom: 22px;
  right: 24px;
  z-index: 10;
  color: rgba(255,255,255,.7);
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
}

/* --- Thumbnail strip below slider --- */
.slider-thumbs {
  display: flex;
  gap: 0;
  background: var(--navy);
  overflow-x: auto;
  scrollbar-width: none;
}
.slider-thumbs::-webkit-scrollbar { display: none; }
.slider-thumb {
  flex: 1;
  min-width: 120px;
  height: 68px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: flex .3s;
}
.slider-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
  filter: brightness(.5) saturate(.6);
}
.slider-thumb:hover img, .slider-thumb.active img {
  transform: scale(1.06);
  filter: brightness(.9) saturate(1);
}
.slider-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-bottom: 3px solid transparent;
  transition: border-color .25s;
}
.slider-thumb.active::after { border-color: var(--orange); }
.slider-thumb-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(13,43,69,.85));
  color: #fff;
  font-family: var(--font-head);
  font-size: .65rem;
  font-weight: 700;
  padding: 8px 8px 5px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
@media (max-width: 560px) { .slider-thumbs { display: none; } }

/* ============================================================
   SERVICE IMAGE CARDS
   ============================================================ */
.service-img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.svc-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(13,43,69,.10);
  transition: transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.svc-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 12px 40px rgba(13,43,69,.18);
}
.svc-card-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: var(--light-gray);
}
.svc-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.svc-card:hover .svc-card-img img { transform: scale(1.08); }

/* Badge on image */
.svc-card-img-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--orange);
  color: #fff;
  font-family: var(--font-head);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}

.svc-card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.svc-card-icon { font-size: 1.6rem; margin-bottom: 8px; }
.svc-card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--navy);
  line-height: 1.3;
}
.svc-card-body p {
  color: var(--gray);
  font-size: .88rem;
  line-height: 1.6;
  margin: 0 0 16px;
  flex: 1;
}
.svc-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--orange);
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 700;
  margin-top: auto;
  transition: gap .2s;
}
.svc-card:hover .svc-card-link { gap: 10px; }

/* Img fallback placeholder */
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8edf3, #d0dae8);
  color: var(--navy);
  gap: 8px;
}
.img-placeholder span { font-size: 2.5rem; }
.img-placeholder small { font-size: .75rem; opacity: .6; font-weight: 600; }

/* ============================================================
   SERVICE PAGE HERO IMAGE
   ============================================================ */
.service-hero-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.service-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.service-hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(13,43,69,0.88) 0%, rgba(13,43,69,0.6) 60%, rgba(13,43,69,0.3) 100%);
}
.service-hero { position: relative; overflow: hidden; min-height: 320px; }
.service-hero .container { position: relative; z-index: 2; }

/* Service content inline images */
.service-inline-img {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: 0 6px 28px rgba(13,43,69,.14);
}
.service-inline-img img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}
@media (max-width: 480px) { .service-inline-img img { height: 200px; } }

/* 2-col image layout inside service content */
.service-img-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}
.service-img-duo img {
  width: 100%;
  height: 180px;
  border-radius: 12px;
  object-fit: cover;
}
@media (max-width: 560px) {
  .service-img-duo { grid-template-columns: 1fr; }
  .service-img-duo img { height: 160px; }
}

/* Feature image with caption */
.img-caption {
  display: block;
  text-align: center;
  font-size: .8rem;
  color: var(--gray);
  margin-top: 8px;
  font-style: italic;
}

/* ============================================================
   GALLERY PAGE
   ============================================================ */
.gallery-hero {
  background: linear-gradient(135deg, var(--navy), #1a3c5e);
  color: #fff;
  padding: 60px 0 48px;
  text-align: center;
}
.gallery-hero h1 { color: #fff; margin-bottom: 12px; }
.gallery-hero p { color: rgba(255,255,255,.8); max-width: 540px; margin: 0 auto; }

/* Filter buttons */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}
.gf-btn {
  padding: 8px 20px;
  border-radius: 50px;
  font-family: var(--font-head);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--light-gray);
  background: var(--white);
  color: var(--navy);
  transition: all .25s;
}
.gf-btn:hover, .gf-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* Masonry-style gallery grid */
.gallery-grid {
  columns: 4 220px;
  column-gap: 16px;
  row-gap: 16px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--light-gray);
  box-shadow: 0 3px 16px rgba(13,43,69,.10);
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .45s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

/* Hover overlay */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13,43,69,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity .3s;
  padding: 16px;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-overlay .zoom-icon {
  width: 44px;
  height: 44px;
  background: var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item-overlay .zoom-icon svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; }
.gallery-item-overlay span {
  color: #fff;
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Gallery tag label */
.gallery-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(13,43,69,0.75);
  color: #fff;
  font-family: var(--font-head);
  font-size: .65rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
  z-index: 2;
  pointer-events: none;
}

@media (max-width: 768px) { .gallery-grid { columns: 2 160px; } }
@media (max-width: 400px) { .gallery-grid { columns: 1; } }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 24, 0.96);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.lightbox-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.lightbox-box {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.94);
  transition: transform .3s;
}
.lightbox-overlay.open .lightbox-box { transform: scale(1); }

.lightbox-img-wrap {
  position: relative;
  max-width: 900px;
  width: 100%;
  max-height: 75vh;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
}
.lightbox-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: 72vh;
  object-fit: contain;
  background: #000;
}

.lightbox-caption {
  margin-top: 14px;
  color: rgba(255,255,255,.75);
  font-family: var(--font-head);
  font-size: .88rem;
  text-align: center;
  letter-spacing: .04em;
}

/* Close button */
.lb-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s;
  color: #fff;
  font-size: 1.2rem;
}
.lb-close:hover { background: var(--orange); }

/* Prev / Next */
.lb-prev, .lb-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9995;
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,.25);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s;
  color: #fff;
}
.lb-prev:hover, .lb-next:hover { background: var(--orange); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-prev svg, .lb-next svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 2.5; }

/* Lightbox counter */
.lb-counter {
  position: fixed;
  top: 20px;
  right: 20px;
  color: rgba(255,255,255,.6);
  font-family: var(--font-head);
  font-size: .82rem;
  z-index: 9995;
}

/* ============================================================
   ABOUT / STATS WITH BACKGROUND IMAGE
   ============================================================ */
.about-img-section {
  position: relative;
  overflow: hidden;
  padding: 80px 0;
}
.about-img-bg {
  position: absolute;
  inset: 0;
}
.about-img-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.2) saturate(.5);
}
.about-img-section .container { position: relative; z-index: 2; }

/* ============================================================
   WHY CHOOSE SECTION WITH IMAGE
   ============================================================ */
.why-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 768px) { .why-img-grid { grid-template-columns: 1fr; } }

.why-img-col {
  position: relative;
}
.why-main-img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 16px 60px rgba(13,43,69,.22);
}
.why-img-badge {
  position: absolute;
  bottom: -20px;
  right: -20px;
  background: var(--orange);
  color: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  text-align: center;
  font-family: var(--font-head);
  box-shadow: 0 8px 32px rgba(245,166,35,.4);
}
.why-img-badge strong { display: block; font-size: 2rem; font-weight: 900; line-height: 1; }
.why-img-badge span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 480px) { .why-main-img { height: 260px; } .why-img-badge { right: 0; bottom: -16px; } }

/* ============================================================
   BEFORE/AFTER or Dual image strip
   ============================================================ */
.img-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 32px 0;
}
.img-strip-item {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.img-strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.img-strip-item:hover img { transform: scale(1.06); }
@media (max-width: 560px) { .img-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 360px) { .img-strip { grid-template-columns: 1fr; } }

/* ============================================================
   LOADING SKELETON for images
   ============================================================ */
.img-skeleton {
  background: linear-gradient(90deg, #e8edf3 25%, #f0f5fb 50%, #e8edf3 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Lazy-load fade in */
img.lazy { opacity: 0; transition: opacity .4s; }
img.lazy.loaded { opacity: 1; }

/* ============================================================
   RESPONSIVE UTILITIES
   ============================================================ */
.img-full  { width: 100%; height: auto; }
.img-cover { object-fit: cover; }
.img-rounded { border-radius: 14px; }
.img-shadow { box-shadow: 0 6px 28px rgba(13,43,69,.14); }
.img-aspect-16-9 { aspect-ratio: 16/9; overflow: hidden; }
.img-aspect-4-3 { aspect-ratio: 4/3; overflow: hidden; }
.img-aspect-3-2 { aspect-ratio: 3/2; overflow: hidden; }

/* Hide/show for different screen sizes */
@media (max-width: 768px) { .hide-mobile { display: none !important; } }
@media (min-width: 769px) { .show-mobile-only { display: none !important; } }

/* ============================================================
   TESTIMONIALS WITH IMAGES
   ============================================================ */
.testi-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
