/* ================================
   SERVICES – KAFLE (LISTA USŁUG)
   ================================ */

.mpa_service {
  position: relative;
  cursor: pointer;
}

.mpa-loop-post-wrapper {
	display: flex;
    flex-direction: column; /* kolumny w pionie */
    justify-content: center; /* wyśrodkowanie pionowe */
    align-items: center; /* wyśrodkowanie poziome */
    text-align: center; /* wymusza centrowanie tekstu w <h2> */
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.mpa-loop-post-thumbnail img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.mpa_service:hover img {
  transform: scale(1.08);
  filter: brightness(1.15);
}

.mpa-loop-post-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.65),
    rgba(0,0,0,0.15)
  );
  z-index: 1;
  pointer-events: none;
}

.mpa-post-title {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
}

.mpa-post-title a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 24px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  z-index: 3;
}

.mpa-post-title,
.mpa-loop-post-thumbnail {
  margin: 0;
}

.mpa_service p:not(.post-thumbnail) {
  display: none;
}

.oferta-title {
  text-align: center;
}

/* =====================================
   SINGLE SERVICE – HARD RESET
   ===================================== */

body.single-mpa_service {
  overflow-x: hidden;
}

/* RESET WSZYSTKICH WRAPPERÓW */
body.single-mpa_service .site-content,
body.single-mpa_service .content-area,
body.single-mpa_service main,
body.single-mpa_service article {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* =====================================
   SINGLE SERVICE – OBRAZ (DESKTOP)
   ===================================== */

/* ŁAPIEMY WSZYSTKO */
body.single-mpa_service figure,
body.single-mpa_service .post-thumbnail,
body.single-mpa_service .wp-block-image,
body.single-mpa_service .wp-block-image figure {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* KAŻDY MOŻLIWY OBRAZ */
body.single-mpa_service img,
body.single-mpa_service img.wp-post-image {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
}

/* =====================================
   🔥 MOBILE – PEWNY FIX (TO ZADZIAŁA)
   ===================================== */

@media (max-width: 768px) {

  /* WRAPPER HERO */
  body.single-mpa_service figure,
  body.single-mpa_service .post-thumbnail,
  body.single-mpa_service .wp-block-image,
  body.single-mpa_service .wp-block-image figure {
    height: 35vh !important;
    max-height: 35vh !important;
    overflow: hidden !important;
  }

  /* SAM OBRAZ – NADPISUJEMY WSZYSTKO */
  body.single-mpa_service img,
  body.single-mpa_service img.wp-post-image {
    width: 100% !important;
    height: 35vh !important;
    max-height: 35vh !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  /* BEZ INLINE WIDTH Z GUTENBERGA */
  body.single-mpa_service img[style] {
    width: 100% !important;
    height: 35vh !important;
  }

}

/* =====================================
   GLOBAL SAFE MOBILE FIX
   ===================================== */

@media (max-width: 768px) {
  body.single-mpa_service * {
    box-sizing: border-box;
    max-width: 100vw;
  }
}
