/**
 * Magical Meta ad slot reservations — reduces CLS.
 * Heights align with js/mm-ads.js FORMATS.minHeight.
 * Supporter / empty slots collapse without late layout jump (loader sets state classes).
 */
@import url("/css/mm-tokens.css");

[data-mm-ad] {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

[data-mm-ad="topBanner"] { min-height: var(--mm-ad-top-min); }
[data-mm-ad="inContent"] { min-height: var(--mm-ad-incontent-min); }
[data-mm-ad="related"] { min-height: var(--mm-ad-related-min); }
[data-mm-ad="gutter"] {
  min-height: 600px;
  width: 160px;
  min-width: 160px;
  max-width: 300px;
}
[data-mm-ad="footer"] { min-height: var(--mm-ad-footer-min); }

/* Outer MW gutters: hide AdSense label; keep skyscraper rail tight (160 or 300). */
.mw-ad-gutter [data-mm-ad="gutter"] .mm-ad-label { display: none !important; }
.mw-ad-gutter [data-mm-ad="gutter"] ins.adsbygoogle {
  display: inline-block;
  width: 160px;
  height: 600px;
  min-width: 160px;
  min-height: 600px;
  margin: 0;
  overflow: hidden;
}
@media (min-width: 2100px) {
  .mw-ad-gutter [data-mm-ad="gutter"] {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
  }
  .mw-ad-gutter [data-mm-ad="gutter"] ins.adsbygoogle {
    width: 300px;
    min-width: 300px;
  }
}

/* Collapsed when intentionally empty / ad-free / no-fill after loader decides */
[data-mm-ad].mm-ad-empty,
[data-mm-ad].mm-ad-suppressed,
html.mm-ad-free [data-mm-ad] {
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Never style ad units like product cards */
[data-mm-ad] ins.adsbygoogle {
  display: block;
}

/*
 * Shared MW sticky / footer anchor collapse.
 * Expanded: fixed bottom host; collapse tab sits on the ad (translateY -100%).
 * Collapsed: ad body height 0 (no reserved gap); only the floating tab remains.
 */
.mm-ad-sticky,
.mw-ad-mobile--sticky.mm-ad-sticky-ready {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 80;
  box-sizing: border-box;
  width: min(100% - 1rem, 728px);
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: none;
}

.mw-ad-sticky-tab {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -100%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 22px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(20, 20, 20, 0.96);
  color: #f0f0f0;
  cursor: pointer;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35);
}

.mw-ad-sticky-tab:hover,
.mw-ad-sticky-tab:focus-visible {
  background: rgba(32, 32, 32, 0.98);
  color: #fff;
  outline: none;
}

.mw-ad-sticky-tab .fa-chevron-down,
.mw-ad-sticky-tab .fa-chevron-up {
  font-size: 0.7rem;
  line-height: 1;
}

.mw-ad-sticky-body {
  overflow: hidden;
  max-height: min(32vh, 280px);
  background: rgba(15, 15, 15, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
  transition: max-height 0.22s ease, opacity 0.18s ease, border-width 0.18s ease;
}

.mm-ad-sticky.is-collapsed .mw-ad-sticky-body,
.mw-ad-mobile--sticky.is-collapsed .mw-ad-sticky-body {
  max-height: 0 !important;
  min-height: 0 !important;
  opacity: 0;
  border-width: 0;
  box-shadow: none;
  pointer-events: none;
}

.mm-ad-sticky.is-collapsed .mw-ad-sticky-tab,
.mw-ad-mobile--sticky.is-collapsed .mw-ad-sticky-tab {
  top: auto;
  bottom: 0;
  transform: translate(-50%, 0);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px 8px 0 0;
}

html.mm-ad-free .mm-ad-sticky,
html.mm-ad-free .mw-ad-mobile--sticky {
  display: none !important;
}

/*
 * Reserve scroll room for stacked bottom chrome (Google Anchor + CCPA / funding
 * choices). mm-ads.js writes --mm-anchor-pad / --mm-bottom-chrome from measured
 * stack height; keep a small CSS floor so content is not trapped under the bar
 * before JS runs.
 */
html:not(.mm-ad-free) .mw-viewport .mw-main,
html:not(.mm-ad-free) .mw-shell .mw-main,
html:not(.mm-ad-free) main.mw-main {
  scroll-padding-bottom: max(1.25rem, var(--mm-anchor-pad, 0px));
}

html.mm-has-anchor-pad:not(.mm-ad-free) body {
  /* Soft floor only; JS still owns exact pad via --mm-anchor-pad on shells. */
  padding-bottom: 0;
}

/*
 * When Google vignette / tall bottom overlay pressure is detected, hide our
 * second sticky so Anchor + site sticky + CCPA do not triple-stack.
 * mm-ads.js also clamps hostile fixed hosts to ~32vh.
 */
html.mm-has-vignette #mw-ad-sticky,
html.mm-has-vignette .mm-ad-sticky,
html.mm-has-vignette .mw-ad-mobile--sticky,
html.mm-has-bottom-overlay #mw-ad-sticky,
html.mm-has-bottom-overlay .mm-ad-sticky,
html.mm-has-bottom-overlay .mw-ad-mobile--sticky,
.mm-ad-sticky.mm-overlay-suppressed,
.mw-ad-mobile--sticky.mm-overlay-suppressed {
  display: none !important;
}

html.mm-has-vignette:not(.mm-ad-free) [data-mm-overlay-clamped="1"],
html.mm-has-bottom-overlay:not(.mm-ad-free) [data-mm-overlay-clamped="1"] {
  max-height: min(32vh, 280px) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  background: transparent !important;
}

html.mm-has-vignette:not(.mm-ad-free) .mw-viewport .mw-main,
html.mm-has-bottom-overlay:not(.mm-ad-free) .mw-viewport .mw-main,
html.mm-has-vignette:not(.mm-ad-free) .mw-shell .mw-main,
html.mm-has-bottom-overlay:not(.mm-ad-free) .mw-shell .mw-main,
html.mm-has-vignette:not(.mm-ad-free) main.mw-main,
html.mm-has-bottom-overlay:not(.mm-ad-free) main.mw-main {
  scroll-padding-bottom: max(1.25rem, var(--mm-anchor-pad, 0px), min(32vh, 280px));
}

/*
 * Narrow content viewports (phones, or desktop with DevTools side-docked):
 * tighter stack budget, contain over-wide Anchor iframes, hide white chrome.
 */
@media (max-width: 959px) {
  html.mm-has-vignette:not(.mm-ad-free) [data-mm-overlay-clamped="1"],
  html.mm-has-bottom-overlay:not(.mm-ad-free) [data-mm-overlay-clamped="1"],
  html.mm-narrow-bottom:not(.mm-ad-free) [data-mm-overlay-clamped="1"] {
    max-height: min(20vh, 140px) !important;
    max-width: 100% !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
    overflow: hidden !important;
    background: transparent !important;
  }

  html.mm-has-vignette:not(.mm-ad-free) [data-mm-overlay-clamped="1"] iframe,
  html.mm-has-bottom-overlay:not(.mm-ad-free) [data-mm-overlay-clamped="1"] iframe,
  html.mm-narrow-bottom:not(.mm-ad-free) [data-mm-overlay-clamped="1"] iframe {
    max-width: 100% !important;
    max-height: min(20vh, 140px) !important;
  }

  html.mm-has-vignette:not(.mm-ad-free) .mw-viewport .mw-main,
  html.mm-has-bottom-overlay:not(.mm-ad-free) .mw-viewport .mw-main,
  html.mm-has-vignette:not(.mm-ad-free) .mw-shell .mw-main,
  html.mm-has-bottom-overlay:not(.mm-ad-free) .mw-shell .mw-main,
  html.mm-has-vignette:not(.mm-ad-free) main.mw-main,
  html.mm-has-bottom-overlay:not(.mm-ad-free) main.mw-main {
    scroll-padding-bottom: max(1.25rem, var(--mm-anchor-pad, 0px), min(20vh, 140px));
  }

  html.mm-narrow-bottom.mm-has-bottom-overlay:not(.mm-ad-free) {
    overflow-x: hidden;
  }
}

/* JS-flagged narrow (covers DevTools dock when CSS width still reports wide in rare cases). */
html.mm-narrow-bottom.mm-has-bottom-overlay:not(.mm-ad-free) [data-mm-overlay-clamped="1"],
html.mm-narrow-bottom.mm-has-vignette:not(.mm-ad-free) [data-mm-overlay-clamped="1"] {
  max-height: min(20vh, 140px) !important;
  max-width: 100% !important;
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
}
