/* =====================================================================
   HOME SERVICES: image cards, description reveals on hover
   ADD AT THE END OF Materials/Css/style.css
   (the old .svc / a.svc / .svc-go rules can stay; the home page no longer uses them,
    .svc-ico is still used by the inner pages)
   ===================================================================== */

/* grid: 3 columns on desktop, 2 on tablet, 1 on mobile */
.svc-grid.svx-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.8vw, 24px);
}

@media (max-width: 1100px) {
  .svc-grid.svx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .svc-grid.svx-grid { grid-template-columns: 1fr; }
}

/* the wrapper carries the scroll "reveal"; the link carries the hover lift */
.svx-item { display: block; }


.svx {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(400px, 32vw, 500px);
  height: 100%;
  border-radius: 22px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 18px 40px -26px rgba(11, 37, 69, .55);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}

/* full-card background image (set per card with --img); gradient shows if the image is missing */
.svx-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--img), linear-gradient(135deg, #0b2545, #1d4f9e);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 1s var(--ease);
}
.svx-bg.image01 {
  background-image: url("../Images/services/01.jpg");
}
.svx-bg.image02 {
  background-image: url("../Images/services/02.jpg");
}
.svx-bg.image03 {
  background-image: url("../Images/services/03.jpg");
}
.svx-bg.image04 {
  background-image: url("../Images/services/04.jpg");
}
.svx-bg.image05 {
  background-image: url("../Images/services/05.jpg");
}
.svx-bg.image06 {
  background-image: url("../Images/services/06.jpg");
}

/* overlay: light at rest, darker on hover so the text stays readable */
.svx::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(11, 37, 69, .9) 0%, rgba(11, 37, 69, .35) 55%, rgba(11, 37, 69, .08) 100%);
  transition: background .55s var(--ease);
}

.svx-body {
  padding: clamp(22px, 2.4vw, 32px);
}

.svx h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.15;
  color: #fff;
}

/* accent line under the title, grows on hover */
.svx h3::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin-top: 14px;
  background: var(--gold);
  transition: width .6s var(--ease), background .4s ease;
}

/* description: collapsed at rest, slides up + fades in on hover */
.svx-desc {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(18px);
  transition: grid-template-rows .6s var(--ease), opacity .5s ease, transform .6s var(--ease);
}

.svx-desc p {
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 0.9375rem;
  line-height: 1.4;
  transition: padding-top .6s var(--ease);
}

.svx:hover,
.svx:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 30px 56px -24px rgba(11, 37, 69, .65);
  outline: none;
}

.svx:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.svx:hover .svx-bg,
.svx:focus-visible .svx-bg {
  transform: scale(1.08);
}

.svx:hover::before,
.svx:focus-visible::before {
  background: linear-gradient(to top, rgba(11, 37, 69, .96) 0%, rgba(11, 37, 69, .8) 62%, rgba(11, 37, 69, .5) 100%);
}

.svx:hover h3::after,
.svx:focus-visible h3::after {
  width: 84px;
  background: linear-gradient(90deg, var(--gold), #7fe0f7);
}

.svx:hover .svx-desc,
.svx:focus-visible .svx-desc {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: none;
}

.svx:hover .svx-desc p,
.svx:focus-visible .svx-desc p {
  padding-top: 14px;
}

/* touch devices have no hover: the description is always visible */
@media (hover: none) {
  .svx-desc {
    grid-template-rows: 1fr;
    opacity: 1;
    transform: none;
  }

  .svx-desc p { padding-top: 14px; }

  .svx::before {
    background: linear-gradient(to top, rgba(11, 37, 69, .95) 0%, rgba(11, 37, 69, .72) 65%, rgba(11, 37, 69, .4) 100%);
  }
}

@media (max-width: 700px) {
  .svx { min-height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  .svx,
  .svx-bg,
  .svx::before,
  .svx h3::after,
  .svx-desc,
  .svx-desc p {
    transition: none !important;
  }
}
