/* ==========================================================
   Jopestkil V35 — sitewide related pages, back-to-top and
   footer optimization. Scoped additions only.
   ========================================================== */

/* Related pages */
.jp-related-pages{
  width:100%;
  padding:54px 0 58px;
  background:#f5f8f6;
  border-top:1px solid #e0e9e3;
  font-family:var(--site-font,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif);
  color:#17372c;
}
.jp-related-pages__inner{
  width:min(calc(100% - 56px),1280px);
  margin:0 auto;
}
.jp-related-pages__head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:24px;
}
.jp-related-pages__eyebrow{
  display:block;
  margin:0 0 7px;
  color:#087a40;
  font-size:12px;
  line-height:1.2;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.jp-related-pages h2{
  margin:0;
  color:#12352a;
  font-size:clamp(27px,2.35vw,34px);
  line-height:1.12;
  font-weight:800;
  letter-spacing:-.025em;
}
.jp-related-pages__intro{
  max-width:500px;
  margin:0;
  color:#61736c;
  font-size:14px;
  line-height:1.65;
  text-align:right;
}
.jp-related-pages__grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:16px;
}
.jp-related-card{
  position:relative;
  min-width:0;
  min-height:156px;
  padding:22px 48px 21px 22px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  color:#17372c!important;
  text-decoration:none!important;
  background:#fff;
  border:1px solid #dbe6df;
  border-radius:12px;
  box-shadow:0 8px 24px rgba(18,58,43,.045);
  transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease;
}
.jp-related-card:hover{
  transform:translateY(-3px);
  border-color:#a9ceb7;
  box-shadow:0 14px 32px rgba(18,58,43,.09);
}
.jp-related-card__type{
  margin:0 0 8px;
  color:#138348;
  font-size:11px;
  line-height:1.2;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.jp-related-card strong{
  display:block;
  margin:0 0 8px;
  color:#102f25;
  font-size:17px;
  line-height:1.28;
  font-weight:800;
}
.jp-related-card p{
  margin:0!important;
  color:#64756f!important;
  font-size:13.5px!important;
  line-height:1.55!important;
}
.jp-related-card__arrow{
  position:absolute;
  right:18px;
  top:20px;
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:50%;
  color:#0c7540;
  background:#eaf5ed;
  font-size:18px;
  font-weight:700;
  transition:transform .2s ease,background .2s ease;
}
.jp-related-card:hover .jp-related-card__arrow{
  transform:translateX(2px);
  background:#dff0e4;
}

/* Footer optimization — fixes old five-track desktop grid for four real columns. */
.jpf-footer{
  --jpf-footer-shell:1280px;
  contain:layout paint;
}
.jpf-footer__main{
  min-height:0!important;
  height:auto!important;
  padding:48px 0 40px!important;
}
.jpf-footer__grid,
.jpf-footer__grid--v17{
  width:min(calc(100% - 64px),var(--jpf-footer-shell))!important;
  max-width:none!important;
  height:auto!important;
  margin:0 auto!important;
  display:grid!important;
  grid-template-columns:minmax(250px,1.3fr) minmax(150px,.72fr) minmax(175px,.86fr) minmax(300px,1.38fr)!important;
  gap:0!important;
  align-items:start!important;
}
.jpf-footer__brand{
  padding:0 40px 0 0!important;
}
.jpf-footer__brand p{
  max-width:330px!important;
  font-size:14.5px!important;
  line-height:1.68!important;
}
.jpf-footer__logo{
  width:218px!important;
  max-width:100%!important;
  height:auto!important;
  margin:0 0 16px!important;
  object-fit:contain!important;
}
.jpf-social{
  gap:11px!important;
  margin-top:18px!important;
}
.jpf-social__item{
  width:36px!important;
  height:36px!important;
  flex:0 0 36px!important;
  box-shadow:none!important;
  outline:1px solid rgba(255,255,255,.08);
}
.jpf-footer__col,
.jpf-footer__contact{
  min-height:0!important;
  padding:0 26px!important;
  border:0!important;
  border-left:1px solid rgba(86,145,120,.24)!important;
}
.jpf-footer__contact{
  padding-right:0!important;
}
.jpf-footer h3{
  margin:0 0 17px!important;
  font-size:17px!important;
  line-height:1.25!important;
}
.jpf-footer__col a{
  margin:0 0 9px!important;
  color:#c8d3cf!important;
  font-size:14.5px!important;
  line-height:1.45!important;
  transition:color .18s ease,transform .18s ease!important;
}
.jpf-footer__col a:hover,
.jpf-contact-row:hover{
  color:#b5ea58!important;
}
.jpf-contact-row{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr)!important;
  gap:11px!important;
  min-height:36px!important;
  margin:0 0 10px!important;
  font-size:14px!important;
  line-height:1.42!important;
}
.jpf-contact-icon{
  width:32px!important;
  height:32px!important;
}
.jpf-footer__bottom{
  min-height:72px!important;
  height:auto!important;
  border-top:1px solid rgba(74,139,112,.28)!important;
}
.jpf-footer__bottom-inner{
  width:min(calc(100% - 64px),var(--jpf-footer-shell))!important;
  min-height:72px!important;
  height:auto!important;
  margin:0 auto!important;
  padding:14px 0!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:24px!important;
}
.jpf-footer__bottom p,
.jpf-footer__bottom .jp-policy-links{
  margin:0!important;
  color:#bfcfc9!important;
  font-size:13px!important;
  line-height:1.5!important;
}
.jpf-footer__bottom .jp-policy-links a{
  color:#d6e1dd!important;
  text-decoration:none!important;
}
.jpf-footer__bottom .jp-policy-links a:hover{
  color:#b5ea58!important;
}

/* Back to top — left side so it never clashes with Call / WhatsApp controls. */
.jp-back-to-top{
  position:fixed;
  left:18px;
  bottom:20px;
  z-index:1090;
  width:46px;
  height:46px;
  padding:0;
  display:grid;
  place-items:center;
  color:#fff;
  background:#0a7440;
  border:1px solid rgba(255,255,255,.22);
  border-radius:50%;
  box-shadow:0 9px 24px rgba(5,54,34,.24);
  cursor:pointer;
  opacity:0;
  visibility:hidden;
  transform:translateY(10px);
  transition:opacity .2s ease,visibility .2s ease,transform .2s ease,background .2s ease;
}
.jp-back-to-top.is-visible{
  opacity:1;
  visibility:visible;
  transform:none;
}
.jp-back-to-top:hover{background:#075f35}
.jp-back-to-top:focus-visible{
  outline:3px solid rgba(164,224,67,.6);
  outline-offset:3px;
}
.jp-back-to-top svg{
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.4;
  stroke-linecap:round;
  stroke-linejoin:round;
}

@media(max-width:1050px){
  .jp-related-pages__grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .jpf-footer__grid,.jpf-footer__grid--v17{
    width:min(calc(100% - 44px),var(--jpf-footer-shell))!important;
    grid-template-columns:1.25fr 1fr!important;
    gap:34px 0!important;
  }
  .jpf-footer__brand{padding:0 34px 0 0!important}
  .jpf-footer__col,.jpf-footer__contact{padding:0 0 0 28px!important}
  .jpf-footer__contact{padding-right:0!important}
  .jpf-footer__bottom-inner{width:calc(100% - 44px)!important}
}
@media(max-width:720px){
  .jp-related-pages{padding:42px 0 46px}
  .jp-related-pages__inner{width:calc(100% - 30px)}
  .jp-related-pages__head{display:block;margin-bottom:20px}
 .jp-related-pages__intro{margin-top:9px;text-align:left}
  .jp-related-card{min-height:142px;padding:20px 46px 19px 19px}
  .jpf-footer__main{padding:38px 0 30px!important}
  .jpf-footer__grid,.jpf-footer__grid--v17{
    width:calc(100% - 34px)!important;
    grid-template-columns:1fr 1fr!important;
    gap:30px 20px!important;
  }
  .jpf-footer__brand,
  .jpf-footer__contact{grid-column:1/-1!important}
  .jpf-footer__brand{padding:0!important}
  .jpf-footer__brand p{max-width:520px!important}
  .jpf-footer__col,
  .jpf-footer__contact{
    padding:0!important;
    border-left:0!important;
  }
  .jpf-footer__bottom-inner{
    width:calc(100% - 34px)!important;
    min-height:0!important;
    padding:20px 0!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    gap:7px!important;
  }
  .jp-back-to-top{left:12px;bottom:max(12px,env(safe-area-inset-bottom));width:44px;height:44px}
}
@media(max-width:520px){
  .jp-related-pages__grid{grid-template-columns:1fr}
  .jp-related-pages h2{font-size:27px}
  .jpf-footer__grid,.jpf-footer__grid--v17{grid-template-columns:1fr!important;gap:27px!important}
  .jpf-footer__brand,.jpf-footer__contact{grid-column:1!important}
  .jpf-footer__logo{width:200px!important}
  .jpf-footer__col a,.jpf-contact-row,.jpf-footer__brand p{font-size:14px!important}
  .jpf-footer h3{font-size:16px!important;margin-bottom:13px!important}
}
@media(prefers-reduced-motion:reduce){
  .jp-related-card,.jp-related-card__arrow,.jp-back-to-top{transition:none!important}
  .jp-related-card:hover{transform:none}
}


/* V36 related-pages refinement — cleaner, service-card-like presentation */
.jp-related-pages__head{align-items:center!important;margin-bottom:22px!important}
.jp-related-pages__viewall{
  display:inline-flex;align-items:center;gap:8px;white-space:nowrap;
  color:#087a40!important;text-decoration:none!important;font-size:14px;font-weight:800;
  line-height:1.2;padding:9px 0;border-bottom:2px solid #9ecdb0;
}
.jp-related-pages__viewall span{font-size:18px;line-height:1;transition:transform .2s ease}
.jp-related-pages__viewall:hover span{transform:translateX(3px)}
.jp-related-pages__grid{gap:18px!important}
.jp-related-card{
  min-height:168px!important;padding:24px 46px 22px 22px!important;
  border:1px solid #d8e3dc!important;border-top:3px solid #16834c!important;
  border-radius:4px!important;box-shadow:0 8px 22px rgba(18,58,43,.045)!important;
  overflow:hidden;
}
.jp-related-card:hover{transform:translateY(-3px);border-color:#b8d4c2!important;box-shadow:0 14px 30px rgba(18,58,43,.09)!important}
.jp-related-card__arrow{top:auto!important;bottom:18px!important;right:18px!important;border-radius:4px!important;width:30px!important;height:30px!important}
.jp-related-card p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;padding-right:6px}
@media(max-width:760px){
 .jp-related-pages__head{display:flex!important;align-items:flex-end!important;gap:16px!important}
 .jp-related-pages__viewall{font-size:13px;padding-bottom:7px}
 .jp-related-card{min-height:150px!important}
}


/* V37 — image-led Related Pages cards: modern, simple, lightweight */
.jp-related-pages{
  padding:52px 0 56px!important;
  background:#f6f8f7!important;
}
.jp-related-pages__head{margin-bottom:22px!important}
.jp-related-pages__grid{gap:18px!important}
.jp-related-card{
  display:block!important;
  min-height:0!important;
  padding:0!important;
  background:#fff!important;
  border:1px solid #dbe5df!important;
  border-top:1px solid #dbe5df!important;
  border-radius:4px!important;
  overflow:hidden!important;
  box-shadow:0 5px 18px rgba(18,58,43,.045)!important;
  color:#15382d!important;
  text-decoration:none!important;
}
.jp-related-card:hover{
  transform:translateY(-3px)!important;
  border-color:#aed0ba!important;
  box-shadow:0 12px 28px rgba(18,58,43,.09)!important;
}
.jp-related-card__media{
  display:block;
  width:100%;
  aspect-ratio:16/10;
  overflow:hidden;
  background:#edf4ef;
  border-bottom:1px solid #e3ebe6;
}
.jp-related-card__media img{
  display:block;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  object-fit:cover!important;
  object-position:center!important;
  margin:0!important;
  transition:transform .3s ease;
}
.jp-related-card__media--contain{
  background:#edf4ef;
  padding:15px 18px 0;
}
.jp-related-card__media--contain img{
  object-fit:contain!important;
  object-position:center bottom!important;
}
.jp-related-card:hover .jp-related-card__media img{transform:scale(1.025)}
.jp-related-card__body{
  display:flex;
  flex-direction:column;
  min-height:112px;
  padding:18px 18px 17px;
}
.jp-related-card strong{
  display:block;
  margin:0!important;
  color:#102f25!important;
  font-size:17px!important;
  line-height:1.3!important;
  font-weight:800!important;
  letter-spacing:-.01em;
}
.jp-related-card__link{
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-top:auto;
  padding-top:14px;
  color:#087a40;
  font-size:12.5px;
  line-height:1.2;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.035em;
}
.jp-related-card__link span{font-size:16px;transition:transform .2s ease}
.jp-related-card:hover .jp-related-card__link span{transform:translateX(3px)}
.jp-related-card__type,.jp-related-card p,.jp-related-card__arrow{display:none!important}
@media(max-width:980px){
  .jp-related-card__body{min-height:106px}
}
@media(max-width:760px){
  .jp-related-pages{padding:42px 0 46px!important}
  .jp-related-pages__grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}
  .jp-related-card__body{min-height:102px;padding:15px 15px 14px}
  .jp-related-card strong{font-size:15.5px!important}
  .jp-related-card__media--contain{padding:10px 12px 0}
}
@media(max-width:520px){
  .jp-related-pages__grid{grid-template-columns:1fr!important}
  .jp-related-card{display:grid!important;grid-template-columns:132px 1fr!important;min-height:116px!important}
  .jp-related-card__media{height:100%;aspect-ratio:auto;border-bottom:0;border-right:1px solid #e3ebe6}
  .jp-related-card__media--contain{padding:10px 8px 0}
  .jp-related-card__body{min-height:116px;padding:15px}
  .jp-related-card strong{font-size:15.5px!important}
  .jp-related-card__link{padding-top:10px}
}
@media(prefers-reduced-motion:reduce){
  .jp-related-card__media img,.jp-related-card__link span{transition:none!important}
  .jp-related-card:hover .jp-related-card__media img{transform:none!important}
}
