/* ============================================================
   Clarity Unlocked — NBI Network house-ad wells
   Loaded after the article CSS. Relies on the site tokens:
   --paper, --paper-2, --ink, --grey, --rule, --rule-strong,
   --mono, --gutter, --duration, --ease.
   ============================================================ */

/* The site sets overflow-x: hidden on html/body, which turns body
   into a scroll container and defeats position: sticky (the rail).
   overflow-x: clip clips identically without breaking sticky; older
   browsers ignore it and keep the original hidden. */
body { overflow-x: clip; }

/* --- Base ad well ------------------------------------------- */
.ad-well {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ad-well__label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
  user-select: none;
}
.ad-well__frame {
  display: block;
  border: 1px solid var(--rule-strong);
  background: var(--paper-2);
  overflow: hidden;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.ad-well__frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 15, 13, 0.10);
  border-color: var(--grey-2);
}
.ad-well__frame img {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- Reserved dimensions (no layout shift) ------------------ */
/* Leaderboard + sticky-footer units: 728x90 desktop,
   swap to the 320x100 creative under 980px. */
.ad-well--leaderboard .ad-well__frame,
.ad-well--sticky .ad-well__frame {
  width: 728px;
  height: 90px;
}
@media (max-width: 979px) {
  .ad-well--leaderboard .ad-well__frame,
  .ad-well--sticky .ad-well__frame {
    width: 320px;
    height: 100px;
  }
}
.ad-well--incontent .ad-well__frame { width: 300px; height: 250px; }
.ad-well--rail .ad-well__frame      { width: 300px; height: 600px; }

/* --- Top leaderboard slot (after the site header) ------------ */
.ad-slot--top {
  display: flex;
  justify-content: center;
  padding: 20px var(--gutter) 4px;
}

/* --- In-content slot (inside the reading column) ------------- */
.ad-well--incontent {
  padding: clamp(20px, 3vw, 28px) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  align-self: stretch;
}

/* --- Right rail (wide viewports only) ------------------------ */
/* Absolute full-height track beside the reading column, with a
   sticky inner column so the unit rides along on scroll. */
.article-body { position: relative; }
.ad-rail {
  display: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% + 372px);
  width: 300px;
  pointer-events: none;
}
@media (min-width: 1380px) {
  .ad-rail { display: block; }
}
.ad-rail__inner {
  position: sticky;
  top: 90px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* "Why this placement" card */
.ad-note {
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  padding: 14px 16px;
  max-width: 300px;
}
.ad-note__label {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}
.ad-note p {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  color: var(--grey);
}

/* --- Sticky footer unit (dismissible) ------------------------ */
.ad-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(250, 250, 248, 0.97);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--rule-strong);
  padding: 8px var(--gutter) 12px;
}
.ad-sticky .ad-well { gap: 6px; }
.ad-sticky__close {
  position: absolute;
  top: 8px;
  right: 12px;
  appearance: none;
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ad-sticky__close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* --- Click-for-sound spot button ----------------------------- */
.ad-well__sound {
  appearance: none;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ad-well__sound:hover {
  color: var(--accent);
  border-color: var(--accent);
}


/* NBI ad audio — user volume control (revealed while a clip plays) */
.ad-well__vol{-webkit-appearance:none;appearance:none;width:104px;height:3px;margin:10px 0 2px;vertical-align:middle;background:#cfcabf;border-radius:3px;cursor:pointer;outline:none;opacity:.85;transition:opacity .15s}
.ad-well__vol:hover{opacity:1}
.ad-well__vol::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;border-radius:50%;background:#111;cursor:pointer;border:0}
.ad-well__vol::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:#111;cursor:pointer;border:0}
.ad-well--sticky .ad-well__vol{width:88px;margin:6px 0 0}
