/* assets/ads.css — own ad system. Every slot has a FIXED size (set per slot via
   --dw/--dh desktop and --mw/--mh mobile) so pages never jump while an ad loads. */

.tdfad{display:flex;flex-direction:column;align-items:center;margin:14px auto;width:fit-content;max-width:100%;position:relative;clear:both}
.tdfad-tag{font:600 9.5px/1 -apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:.9px;text-transform:uppercase;color:#8b92a5;margin:0 0 4px;align-self:flex-end}
.tdfad-box{width:var(--dw);height:var(--dh);max-width:100%;overflow:hidden;border-radius:10px;background:rgba(127,135,150,.14);box-shadow:0 1px 0 rgba(0,0,0,.04),0 6px 18px rgba(15,23,42,.1);position:relative;display:block}
.tdfad-box a.tdfad-link,.tdfad-box picture{display:block;width:100%;height:100%}
.tdfad-box img{display:block;width:100%;height:100%;object-fit:contain;border:0}   /* right-size images fill exactly; a wrong-size one is shown whole, never stretched */
.tdfad-isHtml .tdfad-box{background:transparent;box-shadow:none;border-radius:0}
.tdfad-html{width:100%;height:100%;overflow:hidden}

/* text ad */
.tdfad-text{display:flex;flex-direction:column;justify-content:center;gap:4px;width:100%;height:100%;padding:12px 16px;color:#fff;text-decoration:none;box-sizing:border-box;
  background:linear-gradient(135deg,#e8001d,#7c3aed)}
.tdfad-text b{font-size:15px;line-height:1.25}
.tdfad-text span{font-size:12.5px;opacity:.92;line-height:1.35;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.tdfad-text em{font-style:normal;align-self:flex-start;margin-top:2px;background:#fff;color:#111;font-weight:700;font-size:12px;padding:5px 12px;border-radius:99px}

/* side rails: only on screens with a real gutter beside the ~1240px content */
.tdfad-rail_left,.tdfad-rail_right{display:none;position:fixed;top:104px;margin:0;z-index:20}
.tdfad-rail_left{left:calc(50% - 620px - 184px)}
.tdfad-rail_right{right:calc(50% - 620px - 184px)}
.tdfad-rail_left .tdfad-tag,.tdfad-rail_right .tdfad-tag{align-self:center}
@media(min-width:1600px){.tdfad-rail_left,.tdfad-rail_right{display:flex}}

/* mobile / tablet sizes */
@media(max-width:999px){
  .tdfad-box{width:var(--mw);height:var(--mh)}
  .tdfad-only-d{display:none!important}
}
@media(min-width:1000px){.tdfad-only-m{display:none!important}}

/* slot not available on this breakpoint */
.tdfad-anchor{display:none}
@media(min-width:1000px){.tdfad-sidebar,.tdfad-top,.tdfad-inline{}}
@media(max-width:999px){.tdfad-rail_left,.tdfad-rail_right{display:none!important}}

/* sticky bottom (mobile) */
@media(max-width:820px){
  .tdfad-anchor{display:flex;width:auto;position:fixed;left:0;right:0;bottom:var(--tab-offset,0px);margin:0;z-index:940;padding:6px 0 6px;background:rgba(255,255,255,.96);
    -webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-top:1px solid rgba(0,0,0,.08);box-shadow:0 -6px 20px rgba(15,23,42,.1)}
  .tdfad-anchor .tdfad-tag{position:absolute;left:8px;top:3px;align-self:auto;margin:0}
  .tdfad-anchor .tdfad-box{box-shadow:none;margin-top:8px}
  .tdfad-close{position:absolute;right:6px;top:-12px;width:26px;height:26px;border-radius:50%;border:1px solid rgba(0,0,0,.12);background:#fff;color:#444;font-size:18px;line-height:1;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.15);padding:0}
  html.has-anchor-ad body{padding-bottom:calc(var(--tab-offset,0px) + 66px)}
}
@media(max-width:820px) and (prefers-color-scheme:dark){.tdfad-anchor{background:rgba(15,17,23,.95);border-top-color:rgba(255,255,255,.1)}}

/* sidebar / inline spacing */
.tdfad-sidebar{margin:12px auto;padding:0 8px;box-sizing:border-box}
.tdfad-sidebar .tdfad-tag{align-self:center}
.tdfad-article{margin:26px auto;clear:both}
.article-body .tdfad-box img{margin:0;box-shadow:none;border-radius:0}
.tdfad-bottom{margin:22px auto 26px;padding:0 8px}
.tdfad-top{margin:12px auto 0;padding:0 8px}
.tdfad-inline{margin:18px auto}

/* video ads: muted looping clip, plays only while visible */
.tdfad-box video.tdfad-video{display:block;width:100%;height:100%;object-fit:cover;background:#000;border:0}
.tdfad-isVideo .tdfad-box a.tdfad-link{position:relative}
.tdfad-isVideo .tdfad-box{background:#000}

/* tag: readable on light and dark pages */
.tdfad-tag{color:#8b92a5;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (prefers-color-scheme:dark){.tdfad-tag{color:#9aa3b8}.tdfad-box{box-shadow:0 1px 0 rgba(255,255,255,.04),0 6px 18px rgba(0,0,0,.4)}}

/* full-page ad between pages (hidden until a link is clicked) */
.tdfad-vig{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box;
  background:rgba(10,12,18,.74);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:tdfadVigIn .18s ease-out}
.tdfad-vig[hidden]{display:none!important}
@keyframes tdfadVigIn{from{opacity:0}to{opacity:1}}
.tdfad-vig-card{display:flex;flex-direction:column;max-width:100%;max-height:100%}
.tdfad-vig-bar{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:8px}
.tdfad-vig-go{border:0;border-radius:99px;background:#fff;color:#111;font:600 13px/1 -apple-system,"Segoe UI",Roboto,Arial,sans-serif;padding:9px 14px;cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.25)}
.tdfad-vig-x{width:34px;height:34px;border-radius:50%;border:0;background:#fff;color:#222;font-size:22px;line-height:1;cursor:pointer;padding:0;box-shadow:0 2px 10px rgba(0,0,0,.25)}
.tdfad-vig-go:focus-visible,.tdfad-vig-x:focus-visible{outline:3px solid #3b82f6;outline-offset:2px}
.tdfad-vig .tdfad{margin:0;background:#fff;border-radius:14px;padding:8px 10px 12px;box-sizing:border-box}
.tdfad-vig .tdfad-box{max-height:calc(100vh - 120px);box-shadow:none}
.tdfad-vig .tdfad-box img{object-fit:contain}                                      /* a picture of another size is shown whole, never stretched */
html.tdfad-vig-on,html.tdfad-vig-on body{overflow:hidden}
@media (prefers-color-scheme:dark){.tdfad-vig .tdfad{background:#161a22}}
@media (prefers-reduced-motion:reduce){.tdfad-vig{animation:none}}

/* video "Choose visible area": the video is scaled and shifted so exactly the chosen part fills the box */
@media(min-width:1000px){.tdfad-box video.tdfad-video.vc-d{position:absolute;object-fit:fill;max-width:none;left:calc(var(--cx) * -100% / var(--cw));top:calc(var(--cy) * -100% / var(--ch));width:calc(100% / var(--cw));height:calc(100% / var(--ch))}}
@media(max-width:999px){.tdfad-box video.tdfad-video.vc-m{position:absolute;object-fit:fill;max-width:none;left:calc(var(--kx) * -100% / var(--kw));top:calc(var(--ky) * -100% / var(--kh));width:calc(100% / var(--kw));height:calc(100% / var(--kh))}}

/* "Advertise here" card in an empty placement */
.tdfad-isHouse .tdfad-box{container-type:size;background:linear-gradient(135deg,#0f172a,#1e1b4b 55%,#4c0519);box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),0 6px 18px rgba(15,23,42,.12)}
.tdfad-house{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:5px;width:100%;height:100%;padding:10px 14px;box-sizing:border-box;
  color:#fff;text-decoration:none;font:500 12px/1.3 -apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  background:repeating-linear-gradient(135deg,transparent 0 14px,rgba(255,255,255,.035) 14px 28px)}
.tdfad-house .th-k{font-size:10px;font-weight:800;letter-spacing:1.4px;text-transform:uppercase;color:#fda4af}
.tdfad-house b{font-size:15px;font-weight:800;line-height:1.2}
.tdfad-house .th-t{font-size:11.5px;color:rgba(255,255,255,.78)}
.tdfad-house em{font-style:normal;font-weight:800;font-size:12px;background:#e8001d;color:#fff;border-radius:99px;padding:6px 14px;margin-top:2px;white-space:nowrap}
.tdfad-house:hover em{background:#ff1a36}
@container (max-height:130px) and (min-width:420px){
  .tdfad-house{flex-direction:row;justify-content:space-between;text-align:left;gap:14px;padding:8px 22px}
  .tdfad-house .th-k{writing-mode:horizontal-tb}
  .tdfad-house b{font-size:16px;flex:1}
}
@container (max-height:70px){.tdfad-house .th-t,.tdfad-house .th-k{display:none}.tdfad-house b{font-size:13px}.tdfad-house em{padding:4px 10px;font-size:11px}}
@container (max-width:200px){.tdfad-house b{font-size:17px}.tdfad-house{gap:10px}}

/* admin preview of a draft ad (only the admin sees it) */
.tdfad-pv .tdfad-box{outline:3px solid #2563eb;outline-offset:3px;animation:tdfadPv 1.4s ease-in-out 3}
.tdfad-pv .tdfad-tag{color:#2563eb!important;font-weight:800}
@keyframes tdfadPv{50%{outline-color:rgba(37,99,235,.15)}}

/* keyboard focus */
.tdfad a.tdfad-link:focus-visible{outline:3px solid #3b82f6;outline-offset:-3px}
@media print{.tdfad,.tdfad-vig{display:none!important}}