/* assets/banners.css — fills in the .ad-slot / [data-ad-placement] markup
   already on the page (see fsx.css for the base .ad-slot rules) with the
   paid banner-ad system (Gaurav, 31-Aug).

   3 spots on the homepage (Gaurav, 1-Sep): every active hero-placement ad
   slides right inside the existing #hx3Slider carousel (built in
   banners.js/fsx.js, no separate slot markup here); the "Advertise on
   FreeSoftwareX" side card next to it; and the full-width "Advertise on
   FreeSoftwareX" banner section further down the page. The old
   mid/zigzag x3/fixed-floating-side/standalone-hero-strip slots are gone. */
.ad-banner-link { display: block; position: relative; border-radius: 14px; overflow: hidden; text-decoration: none; background: #f1f5f9; }
.ad-banner-link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-banner-link .ad-label, .hx3-slide .ad-label { position: absolute; top: 8px; right: 8px; background: rgba(15,23,42,.72); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }

/* Real rotating slider inside a placement slot when 2+ advertisers are
   approved at once for it (24-Sep) -- banners.js wraps every slide in this
   when there's more than one, so every approved ad actually gets shown
   instead of only the first. The wrapper takes over the box (size/radius/
   shadow) that a single .ad-banner-link used to own directly; see the
   [data-ad-placement] context rules below, which now size .ad-banner-slider
   the same way they used to size a lone .ad-banner-link. */
.ad-banner-slider { position: relative; display: block; }
.ad-banner-slider .ad-banner-link { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.ad-banner-slider .ad-banner-link.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ad-banner-slider .ad-banner-link { transition: none; } }

/* Advertiser-uploaded images can be any aspect ratio — never guaranteed to
   match a container built for a specific ratio. Everywhere a real ad can be
   injected, show the FULL image (letterboxed on a neutral background)
   instead of cropping it with object-fit:cover, so nothing important in the
   uploaded banner ever gets cut off (Gaurav, 14-Sep). Curated built-in
   slides/cards (not ads) keep their existing cover-crop look untouched. */
.hx3-slide.hx3-slide-ad img,
.hx3-side[data-ad-placement] .ad-banner-link img,
.hx-topbanner-narrow[data-ad-placement] .ad-banner-link img {
  object-fit: contain;
  background: #fdfdfd;
}

/* Slot sizing must apply to the wrapper when it's a slider (2+ ads), same as
   it applies to a lone .ad-banner-link when there's only 1 -- otherwise a
   multi-ad slot would collapse to 0 height/width the moment banners.js
   wraps it (24-Sep). */
.hx3-side[data-ad-placement] .ad-banner-slider,
.hx-topbanner-narrow[data-ad-placement] .ad-banner-slider,
.hx-topbanner-in[data-ad-placement] .ad-banner-slider {
  flex: 1 1 0;
  min-height: 0;
}

/* Side ad now lives inside the already-built hx3-side card beside the hero
   slider instead of its own slot (Gaurav, 1-Sep). banners.js replaces the
   card's content wholesale when a paid ad is active, so match the card's
   existing rounded/shadow look here; when no ad is active the original
   static "Advertise on FreeSoftwareX" card is left untouched as fallback. */
.hx3-side[data-ad-placement] .ad-banner-link,
.hx3-side[data-ad-placement] .ad-banner-slider {
  flex: 1 1 0;
  min-height: 0;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 12, 40, .16), 0 4px 14px rgba(15, 12, 40, .08);
}
.hx3-side[data-ad-placement] .ad-banner-slider { overflow: hidden; }

/* Static "no ad active" placeholder card — matches Mayank's reference mock:
   a light gradient panel, dark "Sponsored" pill, image-placeholder glyph,
   bold headline, subtext, and an outlined pill CTA (12-Sep). */
.hx3-ad-placeholder {
  flex: 1 1 0; min-height: 0; position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 10px;
  padding: 44px 22px 30px; border-radius: 20px;
  background: linear-gradient(165deg, #fff 0%, #eef2fb 60%, #e6ecfa 100%);
  border: 1px solid var(--border); box-shadow: var(--sh-1); color: var(--ink);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.hx3-ad-placeholder:hover, .hx3-ad-placeholder:focus-visible {
  transform: translateY(-3px); text-decoration: none; color: var(--ink);
  box-shadow: 0 18px 40px rgba(16, 24, 40, .12);
}
.hx3-ad-label {
  position: absolute; top: 14px; right: 14px; background: #333a4d; color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
}
.hx3-ad-icon {
  width: 64px; height: 64px; display: grid; place-items: center; color: #97a1b8;
  border: none; margin-bottom: 4px;
}
.hx3-ad-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hx3-ad-title { font-size: 19px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.hx3-ad-sub { font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.hx3-ad-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 11px 22px; border-radius: 999px; border: 1.5px solid var(--brand);
  color: var(--brand-ink); font-size: 14px; font-weight: 700; background: #fff;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.hx3-ad-cta .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.hx3-ad-placeholder:hover .hx3-ad-cta { background: var(--brand); color: #fff; }

/* Two near-identical full-width "advertise/promote your business" banner
   sections on the homepage (Gaurav, 1-Sep: only one was wired up — "iss
   waale me abhi bhi show nehi ho reha" — the #siteBanner one further up the
   page was missed since it doesn't share the other's "Advertise" wording).
   Both reuse the mid_fullwidth placement/already-built static card instead
   of a separate slot; base rule below matches #siteBanner's own look
   (full-width, fixed clamp height, contain). The further-down section used
   to be capped narrower (900px, native aspect-ratio) but Mayank asked
   (14-Sep) for it to match #siteBanner's size, so it now just inherits the
   same full-width rule above with no extra override. */
.hx-topbanner-in[data-ad-placement] .ad-banner-link,
.hx-topbanner-in[data-ad-placement] .ad-banner-slider {
  display: block; border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 12, 40, .22), 0 4px 16px rgba(15, 12, 40, .1);
}
.hx-topbanner-in[data-ad-placement] .ad-banner-slider { height: clamp(90px, 11vw, 160px); }
.hx-topbanner-in[data-ad-placement] .ad-banner-link img {
  width: 100%; height: clamp(90px, 11vw, 160px); object-fit: contain; background: #fdfdfd;
}

/* Admin-managed promo cards container (grow-cards.js) — no longer sits
   beside an ad slot (removed, Gaurav, 14-Sep), so it's just a pass-through:
   display:contents keeps its 4 .gw-card children as direct flex items of
   .gw-grid, identical to the original hardcoded markup, both for the
   normal row and the mobile horizontal-scroll-snap layout (fsx.css). */
.gw-grid-cards { display: contents; }
