/* Horizontal campaign artwork: preserve 1920 x 240 without cropping. */
body.moto-design .moto-banner-slot {
  position: relative;
  isolation: isolate;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
body.moto-design .moto-banner__label {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 1;
  display: block;
  align-self: flex-start;
  margin: 0;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgb(0 0 0 / 60%);
  color: #fff;
  font: 400 10px/1.2 var(--sans);
  text-align: left;
  pointer-events: none;
}
body.moto-design .moto-banner__picture { display: block; width: 100%; min-width: 0; }
body.moto-design .moto-banner__image {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 8 / 1;
  object-fit: contain;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

body.moto-design .moto-banner__variants, body.moto-design .moto-banner__link { display: block; width: 100%; min-width: 0; }
body.moto-design .moto-banner__creative { display: none; width: 100%; }
body.moto-design .moto-banner__link:focus-visible, body.moto-design a.moto-banner__creative:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 4px; }
@media (min-width: 1101px) { body.moto-design [data-banner-layout="1101-721"] > .moto-banner__creative--desktop { display: block; } }
@media (min-width: 721px) and (max-width: 1100px) { body.moto-design [data-banner-layout="1101-721"] > .moto-banner__creative--tablet { display: block; } }
@media (max-width: 720px) { body.moto-design [data-banner-layout="1101-721"] > .moto-banner__creative--mobile { display: block; } }
@media (min-width: 901px) { body.moto-design [data-banner-layout="901-561"] > .moto-banner__creative--desktop { display: block; } }
@media (min-width: 561px) and (max-width: 900px) { body.moto-design [data-banner-layout="901-561"] > .moto-banner__creative--tablet { display: block; } }
@media (max-width: 560px) { body.moto-design [data-banner-layout="901-561"] > .moto-banner__creative--mobile { display: block; } }
@media (min-width: 901px) { body.moto-design [data-banner-layout="901-621"] > .moto-banner__creative--desktop { display: block; } }
@media (min-width: 621px) and (max-width: 900px) { body.moto-design [data-banner-layout="901-621"] > .moto-banner__creative--tablet { display: block; } }
@media (max-width: 620px) { body.moto-design [data-banner-layout="901-621"] > .moto-banner__creative--mobile { display: block; } }
@media (min-width: 1001px) { body.moto-design [data-banner-layout="1001-621"] > .moto-banner__creative--desktop { display: block; } }
@media (min-width: 621px) and (max-width: 1000px) { body.moto-design [data-banner-layout="1001-621"] > .moto-banner__creative--tablet { display: block; } }
@media (max-width: 620px) { body.moto-design [data-banner-layout="1001-621"] > .moto-banner__creative--mobile { display: block; } }

/* Unfilled advertising placements keep their dimensions and a quiet dashed outline. */
body.moto-design .moto-ad-placeholder {
  box-sizing: border-box;
  border: 1px dashed var(--color-border-strong);
  background: transparent;
}

/* Portrait placements use the original 300 x 600 artwork on every screen. */
body.moto-design .moto-banner-slot.moto-banner-slot--portrait {
  display: block;
  width: 100%;
  max-width: 300px;
  min-height: 0;
  height: auto;
  padding: 0;
  align-self: start;
  justify-self: center;
  margin-inline: auto;
  aspect-ratio: 1 / 2;
}
body.moto-design .moto-banner-slot--portrait .moto-banner__image {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 2;
  object-fit: contain;
}

/* Start with one calendar banner; reveal extras only when the feed is tall enough. */
body.moto-design .calendar-ad-layout--secondary > .calendar-ad-rail > .moto-banner-slot--portrait:nth-child(n+2):not([data-calendar-ad-visible]),
body.moto-design .calendar-event__body-layout > .editorial-ad-sidebar > .moto-banner-slot--portrait:nth-child(n+2):not([data-calendar-ad-visible]) {
  display: none;
}

/* Phone portrait ads: compact artwork and a swipeable row for multiple slots. */
@media (max-width: 720px) {
  body.moto-design .moto-banner-slot.moto-banner-slot--portrait {
    width: min(220px, 100%);
    max-width: 220px;
  }
  body.moto-design :is(.editorial-ad-sidebar, .moto-tech-ads):has(> .moto-banner-slot--portrait:nth-child(2)) {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding: 4px 0 12px;
    box-sizing: border-box;
  }
  body.moto-design :is(.editorial-ad-sidebar, .moto-tech-ads):has(> .moto-banner-slot--portrait:nth-child(2)) > .moto-banner-slot--portrait {
    flex: 0 0 min(220px, 75%);
    margin-inline: 0;
    scroll-snap-align: start;
  }
  /* Event pages deliberately show only one banner for a short programme. */
  body.moto-design .calendar-event__body-layout > .editorial-ad-sidebar {
    justify-content: center;
  }
}
