/* ============================================================================
   PAGE BACKGROUND AND SPACING
   ============================================================================ */

body[class*="cpt_services"]:not([class*="single-"]) .page_content_wrap {
  padding-top: 72px !important;
  padding-bottom: 96px !important;
  background-image: radial-gradient(
    ellipse 60% 50% at 0% 100%,
    rgba(255, 81, 33, .20) 0%,
    rgba(255, 81, 33, .07) 40%,
    transparent 72%
  ) !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}


/* ============================================================================
   CONTENT WIDTH AND PAGE HEADING
   ============================================================================ */

/* Centered content column, max 1180px */
body[class*="cpt_services"]:not([class*="single-"]) .content {
  box-sizing: border-box;
  float: none !important;
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-head {
  margin: 0 0 40px;
}

/* Small uppercase label above the title */
body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-eyebrow {
  display: block;
  margin: 0 0 14px;
  color: #ff5121;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 16px;
  text-transform: uppercase;
}

body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-title {
  margin: 0 0 12px;
  padding: 0;
  color: #fff;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.08;
}

/* Optional intro paragraph (empty by default, see services-archive.php) */
body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-intro {
  max-width: 560px;
  margin: 0;
  color: #b5b5b5;
  font-size: 17px;
  line-height: 1.6;
}


/* ============================================================================
   GRID
   ============================================================================ */

body[class*="cpt_services"]:not([class*="single-"]) .content :has(> [class*="trx_addons_column-"]) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* The theme's clearfix (::before / ::after) must not become grid cells */
body[class*="cpt_services"]:not([class*="single-"]) .content :has(> [class*="trx_addons_column-"])::before,
body[class*="cpt_services"]:not([class*="single-"]) .content :has(> [class*="trx_addons_column-"])::after {
  content: none !important;
  display: none !important;
}

/* Column wrappers: remove the theme's float and width, the grid controls them */
body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"] {
  float: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Equal-height cards */
body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"] > * {
  height: 100%;
}


/* ============================================================================
   CARD
   ============================================================================ */

/* Card container */
body[class*="cpt_services"]:not([class*="single-"]) .content .hentry {
  position: relative;
  display: flex !important;
  flex-direction: column;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: #111;
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}

body[class*="cpt_services"]:not([class*="single-"]) .content .hentry:hover {
  border-color: rgba(255, 81, 33, .5);
  transform: translateY(-3px);
}

/* Image: 4:3 ratio, corners follow the card */
body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .post_featured {
  width: 100%;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
}

body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .post_featured img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Text block: left-aligned, "Lihat detail" link pinned to the bottom */
body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_info {
  display: flex !important;
  flex-direction: column;
  flex: 1;
  padding: 24px !important;
  text-align: left !important;
}

/* Category label: orange, intended to sit above the title (order: -1).
   See "Known behavior" in the file header. */
body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_subtitle {
  order: -1;
  margin: 0 0 10px !important;
  color: #ff5121;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: left !important;
  text-transform: uppercase;
}

body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_title {
  margin: 0 0 10px !important;
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left !important;
}

body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_title a {
  color: #fff;
}

body[class*="cpt_services"]:not([class*="single-"]) .content .hentry:hover .sc_services_item_title a {
  color: #ff5121;
}

/* Whole card is clickable: the title link is stretched over the card */
body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* Description */
body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_info :is(p, [class*="sc_services_item_desc"], [class*="sc_services_item_text"]) {
  margin: 0 !important;
  color: #b5b5b5;
  font-size: 15px;
  line-height: 1.7;
  text-align: left !important;
}

/* "Lihat detail →" text link (decorative: the card itself is the link) */
body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_info::after {
  content: "Lihat detail \2192"; /* right arrow */
  margin-top: auto;
  padding-top: 16px;
  color: #ff5121;
  font-size: 14px;
  font-weight: 700;
}


/* ============================================================================
   TABLET (768px - 1024px)
   ============================================================================ */

@media (min-width: 768px) and (max-width: 1024px) {
  body[class*="cpt_services"]:not([class*="single-"]) .content :has(> [class*="trx_addons_column-"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  /* Last card when the count is odd: full width, horizontal layout */
  body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"]:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"]:last-child:nth-child(odd) .hentry {
    flex-direction: row;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"]:last-child:nth-child(odd) .hentry .post_featured {
    flex: 0 0 46%;
    width: 46%;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"]:last-child:nth-child(odd) .hentry .post_featured img {
    height: 100%;
    min-height: 260px;
    aspect-ratio: auto;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"]:last-child:nth-child(odd) .hentry .sc_services_item_info {
    justify-content: center;
  }
}


/* ============================================================================
   MOBILE (max-width 767px)
   ============================================================================ */

@media (max-width: 767px) {
  body[class*="cpt_services"]:not([class*="single-"]) .page_content_wrap {
    padding-top: 40px !important;
    padding-bottom: 56px !important;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content {
    padding-right: 20px !important;
    padding-left: 20px !important;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-title {
    font-size: 34px;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-intro {
    font-size: 15px;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-head {
    margin-bottom: 28px;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content :has(> [class*="trx_addons_column-"]) {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_info {
    padding: 20px !important;
  }

  body[class*="cpt_services"]:not([class*="single-"]) .content .hentry .sc_services_item_title {
    font-size: 20px;
  }
}


/* ============================================================================
   REVEAL ANIMATIONS (PAGE LOAD AND SCROLL)
   ============================================================================ */

@keyframes m15sv-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* 7.1 Page heading (plays on load, staggered) */
body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-eyebrow {
  animation: m15sv-fade .9s ease-out .1s backwards;
}

body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-title {
  animation: m15sv-fade .9s ease-out .3s backwards;
}

body[class*="cpt_services"]:not([class*="single-"]) .m15-sv-intro {
  animation: m15sv-fade .9s ease-out .5s backwards;
}

/* 7.2 Cards: hidden until revealed.
   The effect is on the column wrapper (not .hentry) so the card's own hover
   transform is not disturbed. :where() keeps the html.m15sv-js part at zero
   specificity. */
:where(html.m15sv-js) body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1);
}

/* Revealed state (class set by the footer script) */
html.m15sv-js body[class*="cpt_services"]:not([class*="single-"]) .content .is-in {
  opacity: 1;
  transform: none;
}

/* 7.3 Respect the device's "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  body[class*="cpt_services"]:not([class*="single-"]) :is(.m15-sv-eyebrow, .m15-sv-title, .m15-sv-intro) {
    animation: none;
  }

  html.m15sv-js body[class*="cpt_services"]:not([class*="single-"]) .content [class*="trx_addons_column-"] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}