/* Boxed Elementor treatment inspired by Acara, adapted for UQ Press. */
body.home {
  background: #f4f6f1;
}

body.home .elementor-112 > .e-con.e-parent {
  width: min(1360px, calc(100% - 48px));
  margin-right: auto !important;
  margin-left: auto !important;
  border-radius: 28px;
  overflow: clip;
  padding-right: clamp(20px, 3vw, 44px) !important;
  padding-left: clamp(20px, 3vw, 44px) !important;
}

body.home .elementor-112 > .e-con.e-parent + .e-con.e-parent {
  margin-top: 24px;
}

/* Hero (first homepage section): full-bleed background to match the Acara
   reference, whose hero spans the full viewport. The boxed treatment above
   confined it to 1360px with side margins, so the background looked "not full".
   :first-child (not a brittle Elementor ID) keeps this stable across rebuilds. */
body.home .elementor-112 > .e-con.e-parent:first-child {
  width: 100% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
  border-radius: 0 !important;
}

/* The inner container carries the hero background image — let it reach the edges. */
body.home .elementor-112 > .e-con.e-parent:first-child > .e-con {
  width: 100% !important;
  max-width: none !important;
}

/* Keep the hero copy in a centered, padded column so it never touches the edges. */
body.home .elementor-112 > .e-con.e-parent:first-child > .e-con > .e-con-inner {
  width: min(1360px, 100%) !important;
  max-width: 1360px !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: clamp(20px, 3vw, 44px) !important;
  padding-left: clamp(20px, 3vw, 44px) !important;
}

.elementor-location-header > .elementor > .e-con.e-parent {
  width: min(1360px, calc(100% - 32px));
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: clamp(16px, 2.5vw, 36px) !important;
  padding-left: clamp(16px, 2.5vw, 36px) !important;
}

.elementor-location-footer > .elementor > .e-con.e-parent {
  width: min(1360px, calc(100% - 32px));
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: clamp(20px, 3vw, 44px) !important;
  padding-left: clamp(20px, 3vw, 44px) !important;
}

.elementor-112 > .e-con.e-parent img,
.elementor-location-header img,
.elementor-location-footer img {
  max-width: 100%;
  height: auto;
}

.uqp-catalog {
  width: min(1240px, calc(100% - 96px));
  margin: 40px auto 64px;
  padding: 48px;
  border: 1px solid #e5e9e1;
  border-radius: 28px;
  background: #f7f8f4;
}

.uqp-catalog-heading {
  max-width: 680px;
  margin-bottom: 36px;
}

.uqp-catalog-heading h1 {
  margin: 0 0 10px;
  color: #18392b;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
}

.uqp-catalog-heading p {
  margin: 0;
  color: #5d6b63;
  font-size: 17px;
}

.uqp-book-card {
  border-color: #e2e8e1;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(24, 57, 43, .08);
  transition: transform .2s ease, box-shadow .2s ease;
}

.uqp-book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(24, 57, 43, .13);
}

/* Homepage "Buku Terbaru" (ElementsKit Blog Posts widget). The cards use tall
   portrait book covers; ElementsKit leaves the image uncapped (height:auto),
   so each cover balloons to ~1800px and the cards stack full-width. Crop the
   covers to a fixed thumbnail and force a compact grid — the Acara "Latest
   Event" section it was cloned from used landscape images, so it stayed tidy. */
body.home .elementor-widget-elementskit-blog-posts .ekit-row.post-items {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 24px !important;
  height: auto !important;
  /* ElementsKit gives .ekit-row negative side margins (Bootstrap-style); left in
     place they push the grid ~30px wider than the boxed container and clip card
     text on mobile. */
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.home .elementor-widget-elementskit-blog-posts .ekit-col-4 {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

body.home .elementor-widget-elementskit-blog-posts .elementskit-post-image-card {
  display: flex;
  flex-direction: column;
  width: 100% !important;
  height: 100%;
}

/* Cover: book covers are a 2:3 portrait, but catalog.css frames the thumb 3:4 —
   which forces either a crop or side letterbox bars. Match the frame to the
   cover ratio so the whole cover shows with no crop and no bars. The `!important`
   also beats this file's generic `.elementor-112 … img { height:auto }` rule,
   which was otherwise letting the cover overflow the frame. */
body.home .elementor-widget-elementskit-blog-posts .elementskit-entry-thumb {
  aspect-ratio: 2 / 3 !important;
}

body.home .elementor-widget-elementskit-blog-posts .elementskit-entry-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.home .elementor-widget-elementskit-blog-posts .elementskit-post-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px 24px;
  /* catalog.css sets height:100% here; under CSS grid a percentage-height child
     is ignored for track sizing, so the buttons overflowed below the card and
     got clipped by overflow:hidden. height:auto lets them size the track. */
  height: auto !important;
  /* Author-credential lines are long comma-runs with no breakable spaces; let
     them wrap instead of forcing the card wider than its grid track. */
  overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
  body.home .elementor-widget-elementskit-blog-posts .ekit-row.post-items {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767px) {
  body.home .elementor-112 > .e-con.e-parent {
    width: calc(100% - 24px);
    border-radius: 18px;
    padding-right: 16px !important;
    padding-left: 16px !important;
  }

  body.home .elementor-112 > .e-con.e-parent + .e-con.e-parent {
    margin-top: 14px;
  }

  .elementor-location-header > .elementor > .e-con.e-parent {
    width: calc(100% - 16px);
    padding-right: 12px !important;
    padding-left: 12px !important;
  }

  .elementor-location-footer > .elementor > .e-con.e-parent {
    width: calc(100% - 24px);
    padding-right: 16px !important;
    padding-left: 16px !important;
  }

  .uqp-catalog {
    width: calc(100% - 24px);
    margin: 20px auto 40px;
    padding: 24px 16px;
    border-radius: 20px;
  }

  body.home .elementor-widget-elementskit-blog-posts .ekit-row.post-items {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
