/* =========================================================
   SERVICE PAGES — tampilan foto & keterangan layanan
   Dipakai: maintenance-trafo, install, panellv, panelmv, pengadaan.
   Dimuat paling akhir agar menimpa gaya kartu beranda di style.css
   (height 240px + overlay biru) yang sebelumnya memotong keterangan.
========================================================= */

.service-grid .service-card {
  position: relative;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3e8f1;
  border-radius: 18px;
  box-shadow: 0 14px 38px rgba(2, 20, 50, .07);
  transition: transform .35s ease, box-shadow .35s ease;
}

.service-grid .service-card::before {
  content: none;
}

.service-grid .service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 55px rgba(2, 20, 50, .14);
}

/* ---------- Foto ---------- */

.service-grid .service-image {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #dfe5ef;
}

.service-grid .service-image::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 20, 50, 0) 45%, rgba(2, 20, 50, .78) 100%);
}

.service-grid .service-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 35%;
  filter: saturate(1.06) contrast(1.05) brightness(1.02);
  transition: transform .7s ease, filter .4s ease;
}

.service-grid .service-card:hover .service-image img {
  transform: scale(1.06);
  filter: saturate(1.12) contrast(1.06) brightness(1.04);
}

/* Foto produk berlatar putih: tampil utuh, tidak dipotong */
.service-grid .service-image.is-product {
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.service-grid .service-image.is-product {
  aspect-ratio: 4 / 3.3;
}

.service-grid .service-image.is-product::after {
  content: none;
}

.service-grid .service-image.is-product img {
  object-fit: contain;
  padding: 14px 14px 52px;
  filter: none;
}

/* keterangan foto produk: strip terang di bawah gambar */
.service-grid .service-image.is-product .photo-caption {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 11px 18px;
  background: rgba(255, 255, 255, .92);
  border-top: 1px solid #e3e8f1;
  color: #334155;
  text-shadow: none;
}

/* Keterangan foto di atas gambar */
.photo-caption {
  position: absolute;
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .45);
}

.photo-caption::before {
  content: "";
  flex: none;
  width: 3px;
  align-self: stretch;
  min-height: 16px;
  border-radius: 2px;
  background: #facc15;
}

/* Nomor di pojok foto (halaman trafo & pengadaan) */
.service-grid .service-image .service-number {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 10px;
  background: #facc15;
  color: #021432;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

/* ---------- Teks ---------- */

.service-grid .service-content {
  position: static;
  height: auto;
  display: block;
  flex: 1;
  padding: 24px 26px 28px;
  text-align: left;
}

.service-grid .service-content .service-number,
.service-grid .service-category {
  display: inline-block;
  margin-bottom: 8px;
  color: #0020d3;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.service-grid .service-content h3 {
  margin: 0 0 10px;
  color: #021432;
  font-size: 19px;
  line-height: 1.35;
}

.service-grid .service-content p {
  margin: 0;
  color: #5b6779;
  font-size: 13.5px;
  line-height: 1.75;
}

/* =========================================================
   BENTO — 6 kartu: 1 sorotan besar + ukuran bervariasi
========================================================= */

@media (min-width: 992px) {

  .service-grid.bento {
    width: min(1180px, 100%);
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 26px;
  }

  /* Kartu sorotan: 2 kolom x 2 baris, teks di atas foto */
  .service-grid.bento > .service-card:first-child {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 560px;
    border: 0;
  }

  .service-grid.bento > .service-card:first-child .service-image {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    height: 100%;
  }

  .service-grid.bento > .service-card:first-child .service-image::after {
    background: linear-gradient(180deg, rgba(2, 20, 50, .6) 0%, rgba(2, 20, 50, 0) 18%, rgba(2, 20, 50, .05) 40%, rgba(2, 20, 50, .92) 100%);
  }

  .service-grid.bento > .service-card:first-child .photo-caption {
    top: 22px;
    bottom: auto;
    right: 80px;
    font-size: 12.5px;
  }

  .service-grid.bento > .service-card:first-child .service-content {
    position: relative;
    z-index: 2;
    margin-top: auto;
    flex: none;
    padding: 34px 38px 36px;
    max-width: 640px;
  }

  .service-grid.bento > .service-card:first-child .service-content h3 {
    color: #fff;
    font-size: 28px;
  }

  .service-grid.bento > .service-card:first-child .service-content p {
    color: rgba(255, 255, 255, .86);
    font-size: 14.5px;
  }

  .service-grid.bento > .service-card:first-child .service-content .service-number,
  .service-grid.bento > .service-card:first-child .service-category {
    color: #facc15;
  }

  /* Kartu kanan atas: foto lebih pendek agar sejajar sorotan */
  .service-grid.bento > .service-card:nth-child(2) .service-image,
  .service-grid.bento > .service-card:nth-child(3) .service-image {
    aspect-ratio: 16 / 9;
  }

  /* Baris bawah: foto lebih tinggi untuk variasi */
  .service-grid.bento > .service-card:nth-child(n + 4) .service-image {
    aspect-ratio: 4 / 3.4;
  }

  /* Kartu 2 & 3 ringkas: paragraf dipangkas 3 baris */
  .service-grid.bento > .service-card:nth-child(2) .service-content p,
  .service-grid.bento > .service-card:nth-child(3) .service-content p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .service-grid.bento > .service-card:nth-child(2) .service-content,
  .service-grid.bento > .service-card:nth-child(3) .service-content {
    padding: 18px 22px 22px;
  }

  .service-grid.bento > .service-card:nth-child(2) .service-content h3,
  .service-grid.bento > .service-card:nth-child(3) .service-content h3 {
    font-size: 17px;
    margin-bottom: 6px;
  }

  /* Pengadaan */
  .service-grid.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-grid.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-grid.grid-2 .service-image {
    aspect-ratio: 16 / 9;
  }
}

/* =========================================================
   Tablet & ponsel
========================================================= */

@media (min-width: 640px) and (max-width: 991px) {
  .service-grid.bento,
  .service-grid.grid-3,
  .service-grid.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-grid.bento > .service-card:first-child {
    grid-column: 1 / -1;
  }

  .service-grid.bento > .service-card:first-child .service-image {
    aspect-ratio: 16 / 8;
  }
}

@media (max-width: 639px) {
  .service-grid.bento,
  .service-grid.grid-3,
  .service-grid.grid-2 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-grid .service-content {
    padding: 20px 20px 24px;
  }

  .photo-caption {
    font-size: 11.5px;
    left: 14px;
    right: 14px;
  }
}

/* Foto dengan watermark timestamp kamera di bagian atas: fokus potongan ke bawah */
.service-grid .service-image img[src$="pergantian.png"],
.service-grid .service-image img[src$="coronalv.png"] {
  object-position: center 80%;
}
