/* Advert slots (xag-slots.js). An empty slot is hidden: no box, no gap. Colours inherit, so every theme stays readable. */
.xag-slot[hidden]{display:none!important}
.xag-slot{max-width:1200px;margin:1rem auto;padding:0 .5rem}
.xag-slot-item{position:relative;display:block}
.xag-slot-link{display:block;line-height:0;border-radius:var(--xag-radius-s);overflow:hidden;border:1px solid rgba(128,128,128,.35)}
.xag-slot-link img{display:block;width:100%;height:auto;object-fit:cover}
.xag-slot-label{position:absolute;top:8px;left:8px;padding:.1rem .5rem;border-radius:var(--xag-radius-pill);font:700 .68rem/1.4 var(--xag-font-body);letter-spacing:.03em;text-transform:uppercase;background:var(--xag-c-inverse);color:var(--xag-c-on-inverse)}
.xag-slot-more{display:block;text-align:right;margin-top:.2rem;font:.7rem/1.3 var(--xag-font-body);opacity:.75;color:inherit}
.xag-slot[data-xag-slot="footer-strip"]{max-width:728px}
.xag-slot[data-xag-slot="news-spotlight"]{max-width:640px}
@media print{.xag-slot{display:none!important}}
/* The house advert "Free: meet your teacher!" (xag-sets-wire.js): a 4 : 1 picture. Top of #teachers / #learning: a banner (ratio 4 : 1, wider than the 2.4 : 1 minimum), the picture fills it exactly.
   In a mid-page pair (home slot) it sits letter-boxed on the picture's own colours so the pair keeps its equal 16 : 9 boxes. The rgb() colours are the picture's own (they are part of the SVG, not a theme colour). */
.xag-meet[hidden],.xag-slot .xs-house[hidden]{display:none!important}
.xag-slot.xag-lead-banner.xag-meet-top{aspect-ratio:4/1;max-height:none;max-width:1040px}   /* 1040 x 260: the banner height limit */
.xag-meet-top .xag-meet .xag-slot-link img{object-fit:cover}
.xag-meet-top .xag-slot-label{top:4px;left:4px;font-size:.6rem;padding:.05rem .4rem}
.xag-meet .xag-slot-more{position:absolute;right:8px;bottom:4px;margin:0;color:rgb(230 237 245);opacity:.9;text-shadow:0 1px 2px rgba(0,0,0,.5)}
.xag-duo .xag-meet .xag-slot-link{display:flex;align-items:center;background:linear-gradient(135deg,rgb(11 42 63),rgb(14 107 122))}
.xag-duo .xag-meet .xag-slot-link img{height:auto;object-fit:contain;-webkit-mask-image:linear-gradient(to bottom,transparent,black 14%,black 86%,transparent);mask-image:linear-gradient(to bottom,transparent,black 14%,black 86%,transparent)}   /* soft top and bottom edge: no seam against the box colour */
@media (min-width:641px){.xag-meet-top .xag-slot-label{top:8px;left:8px;font-size:.68rem;padding:.1rem .5rem}}

/* Layout stability (speed work): on the Browse classes page the boxes under the sub-title (audience box, time-zone note, advert and banner) are drawn by script one after another. Until the last of them (the picture band)
   is in, the search, the list and the footer stay unpainted (visibility: the room is kept), so nothing visible jumps while they arrive. Only for visitors with scripting on; the page shows itself after 15 s in any case. */
@media (scripting: enabled) {
  #page-browse-classes.active:not(:has(> .xs-band)) > :not(.xl-hero, .page-back, .page-sub, .page-title),
  body:has(#page-browse-classes.active):not(:has(#page-browse-classes > .xs-band)) footer.xf { visibility: hidden; animation: xs-gate-open 0s linear 15s forwards; }
}
@keyframes xs-gate-open { to { visibility: visible; } }

/* House adverts (xag-slots.js, db/ads-007). A picture whose shape is not the box's sits letter-boxed on the brand navy, never cropped. */
.xag-slot-link.xag-house-fit{background:rgb(11 28 45)}
.xag-slot-link.xag-house-fit img{object-fit:contain!important}

/* No layout shift: until xag-slots.js has chosen the advert (one lookup), the room of the slot is kept but nothing is painted (visibility), so the page below does not jump when the advert arrives.
   Only with scripting on. If the script never answers, the room is given back after 10 s. */
@media screen and (scripting:enabled){
  .xag-duo:has(> .xag-slot[hidden]){display:grid!important}
  .xag-duo > .xag-slot[hidden]{display:block!important;visibility:hidden;animation:xag-slot-giveup 0s linear 10s forwards}
  .xag-slot[data-xag-slot="footer-strip"][hidden]{display:block!important;visibility:hidden;min-height:calc((min(100vw,728px) - 1rem) / 8.09 + 1.1rem);animation:xag-slot-giveup 0s linear 10s forwards}
}
@keyframes xag-slot-giveup{to{height:0;min-height:0;aspect-ratio:auto;margin:0;padding:0;overflow:hidden}}
