/* ==========================================================================
   Home banner with an uploaded HTML offer (functions/custom/offer-html.php)
   Loaded only when Offer Type is "Uploaded HTML". The offer's own styles come
   from the .css files inside the uploaded zip.
   Kept out of style.scss so it can't affect the rest of the site.
   ========================================================================== */
.banner.offer-html { height: 762px; }
.banner.offer-html .mobile-img { display: none; }

/* ---- the offer: centred on desktop, filling most of the banner height --- */
.banner.offer-html .offer-graphic {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: min(700px, 40vw);
}
.banner.offer-html .offer-graphic > * { width: 100%; max-width: 100%; }

/* ---- corner badge (e.g. Trustpilot): top right on desktop --------------- */
.banner.offer-html .corner-badge {
  position: absolute;
  z-index: 2;
  top: 4.5%;
  right: 1.8%;
  width: clamp(110px, 10%, 180px);
}
.banner.offer-html .corner-badge img { display: block; width: 100%; height: auto; }

/* ---- phones and tablets ------------------------------------------------- */
@media only screen and (max-width: 1140px) {
  .banner.offer-html .offer-graphic { width: 43%; }
  .banner.offer-html .offer-graphic.mobile-top-right { top: 1.6%; right: 3%; left: auto; transform: none; }
  .banner.offer-html .corner-badge { top: auto; right: auto; bottom: 1.5%; left: 2.5%; width: clamp(70px, 18.5%, 130px); }

  /* one photo instead of the left and right halves */
  /* height set directly - aspect-ratio + max-height also caps the width and leaves a white gap */
  .banner.offer-html.has-mobile-img { height: min(106vw, 762px); }
  .banner.offer-html.has-mobile-img .left-img,
  .banner.offer-html.has-mobile-img .right-img { display: none; }
  .banner.offer-html.has-mobile-img .mobile-img { display: block; position: absolute; inset: 0; }
  .banner.offer-html.has-mobile-img .mobile-img img { object-position: 75% 50%; }
}
@media only screen and (max-width: 600px) {
  .banner.offer-html .offer-graphic.mobile-centre { width: 70%; }
}
/* without a mobile photo keep the usual home banner heights */
@media only screen and (max-width: 900px) { .banner.offer-html:not(.has-mobile-img) { height: 850px; } }
@media only screen and (max-width: 600px) { .banner.offer-html:not(.has-mobile-img) { height: 550px; } }
