/* Service galleries: isolated styles layered over the compiled site CSS. */
.service-detail-title {
  color: inherit;
  text-decoration: none;
}

.service-detail-title:hover {
  color: #35e7ff;
}

.service-detail-title:focus-visible {
  outline: 3px solid #35e7ff;
  outline-offset: 4px;
  border-radius: 4px;
}

.service-gallery-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-height: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .3s ease, transform .3s ease, max-height .3s ease;
}

[class*="_serviceCard_"]:hover .service-gallery-actions,
[class*="_serviceCard_"]:focus-within .service-gallery-actions {
  max-height: 52px;
  opacity: 1;
  transform: translateY(0);
}

.service-gallery-open,
.service-gallery-actions .service-quote-action {
  min-height: 44px;
  margin: 0;
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.service-gallery-open {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #061018;
  border: 1px solid #35e7ff;
  background: linear-gradient(135deg, #35e7ff, #5ca9ff);
  box-shadow: 0 8px 24px rgba(0, 179, 255, .2);
  cursor: pointer;
}

.service-gallery-open:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.service-gallery-open:focus-visible,
.service-gallery-close:focus-visible,
.service-gallery-nav:focus-visible,
.service-gallery-thumbnails button:focus-visible,
.service-gallery-footer a:focus-visible {
  outline: 3px solid #35e7ff;
  outline-offset: 3px;
}

.service-gallery-count {
  color: rgba(6, 16, 24, .7);
  font-size: 11px;
  font-weight: 700;
}

.service-gallery-actions .service-quote-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .82);
  background: rgba(3, 9, 18, .34);
  opacity: 1;
  transform: none;
  transition: background .2s ease, color .2s ease;
}

.service-gallery-actions .service-quote-action:hover {
  color: #061018;
  background: #fff;
}

.service-gallery-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 5, 13, .86);
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
  animation: serviceGalleryFade .2s ease-out both;
}

.service-gallery-dialog {
  width: min(1120px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  color: #f7faff;
  border: 1px solid rgba(91, 165, 255, .28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 90% 0%, rgba(0, 174, 255, .14), transparent 38%),
    #0a0f18;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .58);
  animation: serviceGalleryRise .28s cubic-bezier(.2, .8, .2, 1) both;
  scrollbar-color: #2969a8 #0a0f18;
}

.service-gallery-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.service-gallery-kicker {
  display: block;
  margin-bottom: 7px;
  color: #35e7ff;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .16em;
}

.service-gallery-header h3 {
  max-width: 820px;
  margin: 0;
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -.025em;
}

.service-gallery-header p {
  margin: 8px 0 0;
  color: #aeb9ca;
  font-size: 14px;
  line-height: 1.5;
}

.service-gallery-close {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
  font-size: 31px;
  line-height: 1;
  cursor: pointer;
}

.service-gallery-close:hover {
  color: #051018;
  background: #35e7ff;
}

.service-gallery-viewer {
  position: relative;
  margin: 18px 26px 14px;
}

.service-gallery-viewer figure {
  position: relative;
  aspect-ratio: 16 / 8.3;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  background: #05080d;
}

.service-gallery-viewer figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-gallery-viewer figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 32px 18px 14px;
  color: #eef7ff;
  background: linear-gradient(transparent, rgba(0, 5, 12, .9));
  font-size: 14px;
  line-height: 1.35;
}

.service-gallery-viewer figcaption strong {
  flex: 0 0 auto;
  color: #35e7ff;
  font-size: 12px;
  letter-spacing: .05em;
}

.service-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0 0 5px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(3, 9, 17, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.service-gallery-nav:hover {
  color: #061018;
  background: #35e7ff;
}

.service-gallery-prev { left: 14px; }
.service-gallery-next { right: 14px; }

.service-gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  padding: 0 26px 20px;
}

.service-gallery-thumbnails button {
  position: relative;
  aspect-ratio: 4 / 3;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #111a27;
  opacity: .58;
  cursor: pointer;
  transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.service-gallery-thumbnails button:hover,
.service-gallery-thumbnails button.is-active {
  border-color: #35e7ff;
  opacity: 1;
  transform: translateY(-2px);
}

.service-gallery-thumbnails img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.service-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 26px 24px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #aeb9ca;
  font-size: 14px;
}

.service-gallery-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  color: #05130d;
  border-radius: 10px;
  background: linear-gradient(135deg, #42ec83, #20bf68);
  box-shadow: 0 10px 28px rgba(32, 191, 104, .2);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

@keyframes serviceGalleryFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes serviceGalleryRise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .service-gallery-thumbnails { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-gallery-viewer figure { aspect-ratio: 4 / 3; }
}

@media (max-width: 768px) {
  .service-gallery-actions {
    max-height: 52px;
    opacity: 1;
    transform: none;
  }

  .service-gallery-actions .service-quote-action,
  .service-gallery-open {
    min-height: 44px;
  }

  .service-gallery-backdrop {
    align-items: end;
    padding: 0;
  }

  .service-gallery-dialog {
    width: 100%;
    max-height: 100dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  .service-gallery-header { padding: 20px 18px 15px; }
  .service-gallery-header p { display: none; }
  .service-gallery-viewer { margin: 14px 14px 12px; }
  .service-gallery-thumbnails { gap: 7px; padding: 0 14px 16px; }
  .service-gallery-footer { padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .service-gallery-actions { gap: 8px; }
  .service-gallery-open,
  .service-gallery-actions .service-quote-action { padding-inline: 11px; font-size: 12px; }
  .service-gallery-count { display: none; }
  .service-gallery-thumbnails { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service-gallery-viewer figure { aspect-ratio: 1 / 1; }
  .service-gallery-viewer figcaption { padding: 28px 12px 11px; font-size: 12px; }
  .service-gallery-nav { width: 44px; height: 44px; }
  .service-gallery-prev { left: 8px; }
  .service-gallery-next { right: 8px; }
  .service-gallery-footer { align-items: stretch; flex-direction: column; }
  .service-gallery-footer a { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .service-gallery-backdrop,
  .service-gallery-dialog { animation: none; }
  .service-gallery-actions,
  .service-gallery-open,
  .service-gallery-thumbnails button { transition: none; }
}
