/* Ad slots stay hidden until ads are switched on: add class "ads-on" to <html> when the ad tag is installed.
   Until then the live site shows no empty boxes. */
html:not(.ads-on) .ad-slot,html:not(.ads-on) .ad-rail,html:not(.ads-on) .ad-anchor{display:none!important}
html:not(.ads-on) body.has-anchor{padding-bottom:0}

/* Display ad slots. Space is reserved in the HTML so nothing jumps when an ad loads.
   Phones are 760px and under (same breakpoint as the tools' answer bar); desktop is 761px and up.
   Slots: top, incontent, end, infeed, rail (desktop 1200px+ only), anchor (sticky bottom). */

:root{
  --ad-bg:var(--paper-2,#f0f2ee);
  --ad-line:var(--rule,#dce0dc);
  --ad-label:var(--ink-3,#5c6469);
  --ad-anchor-h:66px;            /* phone: 16px label strip + 50px creative */
}
@media (min-width:761px){:root{--ad-anchor-h:110px}} /* desktop: 16px strip + 90px creative + 4px */

.ad-slot{display:flex;flex-direction:column;align-items:center;margin:var(--s4,34px) auto;max-width:100%;clear:both}
.ad-label{display:block;font-family:var(--sans,system-ui,sans-serif);font-size:10px;font-weight:600;line-height:16px;letter-spacing:.14em;text-transform:uppercase;color:var(--ad-label);text-align:center}
.ad-unit{display:flex;align-items:center;justify-content:center;max-width:100%;overflow:hidden;margin:0 auto}

/* Reserved sizes. Phone first. */
.ad-slot-top .ad-unit{width:320px;min-height:100px}
.ad-slot-incontent .ad-unit,.ad-slot-end .ad-unit,.ad-slot-endwide .ad-unit,.ad-slot-infeed .ad-unit{width:336px;min-height:280px}
@media (min-width:761px){
  .ad-slot-top .ad-unit,.ad-slot-infeed .ad-unit{width:728px;min-height:90px}
}
@media (min-width:1002px){
  .ad-slot-top .ad-unit,.ad-slot-infeed .ad-unit{width:970px}
}
/* end of page on desktop: a leaderboard beside the article column, a billboard on wide pages */
@media (min-width:761px){
  .ad-slot-end .ad-unit,.ad-slot-endwide .ad-unit{width:728px;min-height:90px}
}
@media (min-width:1002px){.ad-slot-endwide .ad-unit{width:970px;min-height:250px}}
.ad-slot-top{margin:var(--s2,14px) auto var(--s2,14px);padding:0 16px}
.post-body .ad-slot,.page .ad-slot{margin:var(--s5,48px) auto}
.ad-slot-infeed{grid-column:1 / -1;margin:var(--s5,48px) auto 0}
.feed-grid > .ad-slot-infeed{margin:0 auto}
@media (max-width:760px){.ad-slot-infeed{margin-top:var(--s4,34px)}.feed-grid > .ad-slot-infeed{margin-top:0}}
.ad-slot-end,.ad-slot-endwide{margin-top:var(--s5,48px)}
.wrap > .ad-slot-end:last-child,.wrap > .ad-slot-endwide:last-child{margin-bottom:var(--s5,48px)}
.page + .ad-slot-end,.page + .ad-slot-endwide{margin-top:0}

/* Desktop: in-article ads sit to the right of the section's text, which wraps beside them. Phones keep them centered. */
@media (min-width:761px){
  .post-body .ad-float,.page .ad-float{float:right;clear:right;width:300px;margin:6px 0 18px 28px}
  /* in-article ads that can't sit beside text are phone-only: on desktop they would leave dead space either side */
  .ad-slot-incontent:not(.ad-float){display:none}
  .ad-float .ad-unit{width:300px;min-height:250px}
  .post-body h2,.post-body h3,.post-body .script,.post-body .takeaway,.post-body blockquote,.post-body table,.post-body .imgbox,
  .page h2,.page h3,.page table,.page .paystats,.page details,.page .st-pick,.page .tpl-fill,.page .script{clear:both}
  .post-body ul,.post-body ol,.page ul,.page ol{display:flow-root}
}

/* Desktop right rail: a sticky 300x600 beside articles and pay pages. Hidden below 1200px. */
.ad-rail{display:none}
@media (min-width:1200px){
  .wrap.has-rail{display:grid;grid-template-columns:minmax(0,var(--rail-main,740px)) 300px;column-gap:48px;justify-content:center;align-items:start;max-width:calc(var(--rail-main,740px) + 396px)}
  .wrap.narrow.has-rail{--rail-main:760px}
  .wrap.has-rail > *{grid-column:1;min-width:0}
  .wrap.has-rail > .ad-rail{display:block;grid-column:2;grid-row:1 / span 40;align-self:stretch}
  .ad-rail .ad-slot{position:sticky;top:76px;margin:var(--s3,22px) 0 0}
  .ad-rail .ad-unit{width:300px;min-height:600px}
}

/* Job fit finder: the same tall ad in the empty column beside the questions, 1200px and wider */
@media (min-width:1200px){
  .wrap.has-siderail{display:grid;grid-template-columns:minmax(0,1fr) 300px;column-gap:48px;align-items:start}
  .wrap.has-siderail > *{grid-column:1 / -1;min-width:0}
  .wrap.has-siderail > .fit-form{grid-column:1;grid-row:2}
  .wrap.has-siderail > .ad-siderail{display:block;grid-column:2;grid-row:2;align-self:stretch}
}

/* Sticky bottom anchor: 320x50 on phones, 728x90 or 970x90 on desktop. One per page, closable. */
.ad-anchor{
  position:fixed;left:0;right:0;bottom:0;z-index:30;
  background:var(--paper,#fbfbf9);border-top:1px solid var(--ad-line);box-shadow:0 -3px 12px rgba(19,23,26,.08);
  padding:0 0 env(safe-area-inset-bottom,0px);
  transition:transform .2s ease;
}
.ad-anchor .ad-slot{margin:0 auto;height:var(--ad-anchor-h)}
.ad-anchor .ad-unit{width:320px;height:50px}
@media (min-width:761px){.ad-anchor .ad-unit{width:728px;height:90px}}
@media (min-width:1002px){.ad-anchor .ad-unit{width:970px}}
.ad-close{
  position:absolute;right:8px;top:-26px;width:44px;height:26px;
  display:flex;align-items:center;justify-content:center;
  background:var(--paper,#fbfbf9);border:1px solid var(--ad-line);border-bottom:0;border-radius:4px 4px 0 0;
  color:var(--ink-2,#464e53);font:600 16px/1 var(--sans,system-ui,sans-serif);cursor:pointer;padding:0;
}
.ad-close:hover{color:var(--ink,#13171a)}
.ad-close:focus-visible{outline:2px solid var(--accent,#125a47);outline-offset:1px}
body.has-anchor{padding-bottom:calc(var(--ad-anchor-h) + env(safe-area-inset-bottom,0px))}
.ad-anchor.is-closed{display:none}
.ad-anchor.is-yield{transform:translateY(110%)}   /* steps aside while a tool's answer bar is up */
body:has(#nav-toggle:checked) .ad-anchor{display:none} /* never sits over the open phone menu */
@media (prefers-reduced-motion:reduce){.ad-anchor{transition:none}}

/* Review only: sample ads. ads.js adds .ads-preview to <html> and draws a made-up advertiser into each slot while PREVIEW is on. */
.ads-preview .ad-unit{background:transparent}
.sa{position:relative;display:flex;align-items:center;gap:12px;box-sizing:border-box;max-width:100%;overflow:hidden;padding:10px 14px;
  background:var(--sa-bg);color:var(--sa-fg);font-family:var(--sans,system-ui,sans-serif);text-align:left;border-radius:2px;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.06)}
.sa-tag{position:absolute;top:0;right:0;font-size:9px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;background:rgba(255,255,255,.85);color:#333;padding:2px 6px;border-bottom-left-radius:3px}
.sa-art{flex:none;display:flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:50%;background:rgba(255,255,255,.12)}
.sa-art svg{width:60%;height:60%}
.sa-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.sa-copy b{font-size:15px;font-weight:700;line-height:1.15;letter-spacing:-.01em}
.sa-copy span{font-size:13px;line-height:1.3;opacity:.9}
.sa-cta{flex:none;font-size:12.5px;font-weight:700;letter-spacing:.02em;background:var(--sa-ac);color:var(--sa-bg);padding:9px 14px;border-radius:999px;white-space:nowrap}
/* leaderboards and phone banners */
.sa-bar .sa-art{width:58px;height:58px}
.sa-bar .sa-copy span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sa-tiny{padding:4px 8px;gap:8px}
.sa-tiny .sa-art{width:36px;height:36px}
.sa-tiny .sa-copy b{font-size:12.5px}
.sa-tiny .sa-copy span{font-size:10.5px}
.sa-tiny .sa-cta{font-size:10.5px;padding:6px 9px}
.sa-tiny .sa-tag{font-size:7.5px;padding:1px 4px}
/* rectangles */
.sa-rect{flex-direction:column;justify-content:center;text-align:center;gap:12px;padding:22px}
.sa-rect .sa-art{width:84px;height:84px}
.sa-rect .sa-copy{flex:none;align-items:center}
.sa-rect .sa-copy b{font-size:22px}
.sa-rect .sa-copy span{font-size:15px;max-width:26ch}
.sa-rect .sa-cta{font-size:14px;padding:11px 20px}
/* billboard */
.sa-bill{gap:28px;padding:24px 40px}
.sa-bill .sa-art{width:150px;height:150px}
.sa-bill .sa-copy b{font-size:34px}
.sa-bill .sa-copy span{font-size:19px}
.sa-bill .sa-cta{font-size:16px;padding:14px 26px}
/* tall rail */
.sa-tower{flex-direction:column;justify-content:space-between;text-align:center;padding:36px 24px 30px}
.sa-tower .sa-art{width:150px;height:150px;margin-top:20px}
.sa-tower .sa-copy{flex:none;align-items:center;gap:10px}
.sa-tower .sa-copy b{font-size:28px}
.sa-tower .sa-copy span{font-size:17px}
.sa-tower .sa-cta{font-size:15px;padding:13px 26px}

/* Gap-filler banners: between sections and between cards, so long pages never go far without an ad.
   320x100 on phones; 728x90 or 970x90 on desktop. Ones inside card grids (.ad-m) are phones only. */
.ad-slot-banner .ad-unit{width:320px;min-height:100px}
@media (min-width:761px){.ad-slot-banner .ad-unit{width:728px;min-height:90px}}
@media (min-width:1002px){.ad-slot-banner .ad-unit{width:970px}}
.ad-slot-banner{margin:var(--s4,34px) auto}
.feed-grid > .ad-slot-banner,.qcards > .ad-slot-banner,.ad-li{grid-column:1 / -1}
.ad-li{list-style:none;display:flex;justify-content:center;min-width:0}
.ad-li .ad-slot{margin:var(--s3,22px) auto}
@media (min-width:761px){.ad-m{display:none!important}}

.ad-off{display:none!important}
@media print{.ad-slot,.ad-rail,.ad-anchor{display:none!important}body.has-anchor{padding-bottom:0}}

/* Sample ads are off (ads.js PREVIEW = false), so html has no "ads-on" class and every slot above is hidden.
   These keep the layout tidy while ads are off. They stop applying the moment ads are switched on. */
html:not(.ads-on) .ad-li{display:none!important}
@media (min-width:1200px){
  html:not(.ads-on) .wrap.has-rail{grid-template-columns:minmax(0,var(--rail-main,740px))}  /* one centered column, no empty rail beside it */
  html:not(.ads-on) .wrap.has-siderail{display:block}
}
