.service-gallery-hint {
  margin: -22px 0 26px;
  color: #d9e6fb !important;
  font-size: 14px !important;
}

.service-gallery-hint .jpl-ja {
  display: none;
}

html[lang="ja"] .service-gallery-hint .jpl-ko {
  display: none;
}

html[lang="ja"] .service-gallery-hint .jpl-ja {
  display: inline;
}

.services-list.service-gallery {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  height: 540px;
  margin: 0 0 64px;
}

.service-gallery .service-photo-card {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  border: 3px solid #070b12;
  background: #fff;
  color: #fff;
  box-shadow: 5px 5px 0 #1555e8;
  transition: flex .5s cubic-bezier(.22,.65,.25,1), box-shadow .25s, transform .25s;
}

.service-gallery .service-photo-card > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 44%;
  transition: transform .7s cubic-bezier(.22,.65,.25,1), filter .35s;
}

.service-gallery .service-photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #07132600 24%, #0713264d 48%, #071326f5 100%);
  transition: background .35s;
}

.service-gallery .service-card-copy {
  position: absolute;
  inset: auto 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px;
  text-align: center;
}

.service-gallery .service-no {
  padding: 4px 8px;
  border: 1px solid #dce9ff;
  background: #0b1730c7;
  color: #dce9ff;
  font: 800 10px/1 Arial, sans-serif;
  letter-spacing: .14em;
}

.service-gallery h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  margin: 10px 0 0;
  color: #fff;
  font-size: clamp(16px,1.35vw,23px);
  line-height: 1.22;
  letter-spacing: -.04em;
  text-shadow: 0 2px 12px #000;
}

.service-gallery .service-photo-card p,
.service-gallery .service-price,
.service-gallery .service-cta {
  grid-column: auto;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.65;
  transform: translateY(8px);
  transition: opacity .25s, max-height .45s, margin .3s, transform .35s;
}

.service-gallery .service-price {
  color: #bcd3ff;
  font-size: 12px;
  font-weight: 800;
}

.service-gallery .service-cta {
  border: 1px solid #fff;
  background: #1555e8;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.service-gallery .arrow {
  display: none;
}

.service-gallery .service-photo-card:hover,
.service-gallery .service-photo-card:focus-visible {
  flex: 3.15 1 0;
  z-index: 2;
  box-shadow: 8px 8px 0 #1555e8;
  transform: translateY(-4px);
}

.service-gallery .service-photo-card:is(:hover,:focus-visible)::after {
  background: linear-gradient(180deg, #07132600 12%, #07132638 36%, #071326f7 100%);
}

.service-gallery .service-photo-card:is(:hover,:focus-visible) > img {
  transform: scale(1.025);
  filter: saturate(1.04) contrast(1.03);
}

.service-gallery .service-photo-card:is(:hover,:focus-visible) p,
.service-gallery .service-photo-card:is(:hover,:focus-visible) .service-price,
.service-gallery .service-photo-card:is(:hover,:focus-visible) .service-cta {
  max-height: 100px;
  opacity: 1;
  transform: translateY(0);
}

.service-gallery .service-photo-card:is(:hover,:focus-visible) .service-price {
  margin-top: 7px;
}

.service-gallery .service-photo-card:is(:hover,:focus-visible) .service-cta {
  margin-top: 15px;
}

.service-gallery .service-photo-card:focus-visible {
  outline: 4px solid #9ebcff;
  outline-offset: 4px;
}

@media (max-width: 1000px) and (hover: hover) {
  .services-list.service-gallery {
    height: 490px;
    gap: 7px;
  }

  .service-gallery .service-photo-card:hover,
  .service-gallery .service-photo-card:focus-visible {
    flex: 3.7 1 0;
  }

  .service-gallery h3 {
    font-size: 16px;
  }
}

/* Keep the existing IPv4 copy hint inside the homepage viewport in Japanese. */
@media (min-width: 1400px) and (max-width: 1599px) {
  .jph-connection-copy-hint {
    left: auto;
    right: 0;
    top: calc(100% + 7px);
    transform: translateY(-3px);
  }

  .jph-connection[data-state="ready"]:hover .jph-connection-copy-hint,
  .jph-connection[data-state="ready"]:focus-visible .jph-connection-copy-hint {
    transform: translateY(0);
  }
}

@media (max-width: 700px), (hover: none) {
  .service-gallery-hint {
    margin: -12px 0 20px;
    font-size: 13px !important;
  }

  .services-list.service-gallery {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(82vw, 350px);
    gap: 16px;
    height: auto;
    margin-right: calc(var(--pad) * -1);
    margin-bottom: 46px;
    padding: 4px var(--pad) 18px 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-color: #1555e8 #dce7fb;
    scrollbar-width: thin;
  }

  .service-gallery .service-photo-card {
    min-height: 500px;
    flex: none;
    scroll-snap-align: start;
    box-shadow: 6px 6px 0 #1555e8;
  }

  .service-gallery .service-photo-card:hover,
  .service-gallery .service-photo-card:focus-visible {
    transform: none;
  }

  .service-gallery .service-photo-card > img {
    object-position: 50% 43%;
  }

  .service-gallery .service-card-copy {
    bottom: 22px;
    padding: 0 20px;
  }

  .service-gallery h3 {
    min-height: 0;
    margin: 11px 0 7px;
    font-size: 24px;
  }

  .service-gallery .service-photo-card p,
  .service-gallery .service-price,
  .service-gallery .service-cta {
    max-height: none;
    overflow: visible;
    opacity: 1;
    transform: none;
  }

  .service-gallery .service-price {
    margin-top: 7px;
  }

  .service-gallery .service-cta {
    margin-top: 14px;
  }
}

@media (max-width: 380px) {
  .services-list.service-gallery {
    grid-auto-columns: 84vw;
  }

  .service-gallery .service-photo-card {
    min-height: 460px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-gallery .service-photo-card,
  .service-gallery .service-photo-card > img,
  .service-gallery .service-photo-card p,
  .service-gallery .service-price,
  .service-gallery .service-cta {
    transition: none;
  }
}
