/* MS Digital Asset Academy — bitcoinhyper.li
 * Iubenda consent banner: bottom-bar positioning override for the LI portal.
 *
 * The page-level styling already dresses the banner, but it anchors it through
 * `#iubenda-cs-banner.iubenda-cs-default-floating` — a modifier class the
 * unified widget does not necessarily emit. When that class is absent the
 * anchoring never applies and the banner renders as a floating panel toward the
 * top/centre of the viewport. These rules pin the banner to the bottom edge
 * from the id alone, so they hold whatever modifier classes the widget adds.
 *
 * Loaded after the page-level <style> block, so equal-weight !important
 * declarations resolve in this file's favour.
 *
 * Positioning only: no consent semantics, no wording, no behaviour.
 */

/* A transformed / filtered / contained ancestor would make `position: fixed`
   resolve against that ancestor instead of the viewport, which is how a
   bottom-anchored bar ends up floating mid-screen. Neutralise those on the
   wrappers the widget is known to use. */
#iubenda-cs-banner,
.iubenda-cs-container,
#iubenda-cs-container,
.iubenda-cs-overlay {
  transform: none !important;
  filter: none !important;
  perspective: none !important;
  will-change: auto !important;
  contain: none !important;
}

/* A `position: fixed` wrapper establishes its own stacking context in Blink,
   which would scope the banner's z-index inside it and let page sections
   (a z-index:1 subtree on the home page) paint over the buttons. Lift the
   wrapper to the banner's own layer so the controls stay clickable.
   Above content and footer, below nav (1100) and book announcement (1050). */
.iubenda-cs-container,
#iubenda-cs-container,
.iubenda-cs-overlay {
  z-index: 999 !important;
}

/* Banner root — pinned to the bottom edge regardless of modifier classes
   (iubenda-cs-default-floating, iubenda-cs-top, iubenda-cs-center, …). */
#iubenda-cs-banner,
#iubenda-cs-banner.iubenda-cs-default-floating,
#iubenda-cs-banner.iubenda-cs-top,
#iubenda-cs-banner.iubenda-cs-center,
#iubenda-cs-banner.iubenda-cs-bottom {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
  /* Height comes from the content. A floating layout may give the root a
     viewport-sized box; letting it collapse to its content stops the bar
     covering (and swallowing clicks across) the whole page. */
  height: auto !important;
  /* Above content and footer, below nav (1100) and book announcement (1050) */
  z-index: 999 !important;
}

/* Content box — fill the bar without spilling past the viewport.
   A float-top-center layout positions this card absolutely inside the banner
   root. Against a bottom-anchored root that leaves the root zero-height and
   drops the card below the fold — the banner is in the DOM but nothing is
   visible. Returning the card to normal flow is what gives the bar its height. */
#iubenda-cs-banner .iubenda-cs-content {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  width: auto !important;
  max-width: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
}

/* No horizontal overflow from the inner rows at any width. */
#iubenda-cs-banner .iubenda-cs-rationale,
#iubenda-cs-banner .iubenda-cs-opt-group {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Narrow viewports: let the button group wrap rather than push the bar wide. */
@media (max-width: 560px) {
  #iubenda-cs-banner .iubenda-cs-opt-group {
    flex-wrap: wrap !important;
    width: 100% !important;
    justify-content: flex-start !important;
  }
}

/* The floating preferences control must stay reachable once the bar is gone. */
.iubenda-tp-btn {
  z-index: 1000 !important;
}
