/* Ads module. Colours use Blocksy variables so dark mode works. */
.sn-only-mobile { display: block; }
@media (min-width: 1000px) {
  .sn-only-mobile { display: none !important; }
}
@media (max-width: 999.98px) {
  .sn-only-desktop { display: none !important; }
}

.sn-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  max-width: 100%;
}
.sn-ad__label {
  align-self: center;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--theme-text-color);
  opacity: .6;
}
.sn-ad__link {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
  background: var(--theme-palette-color-6, rgba(128,128,128,.12));
}
.sn-ad__link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0;
}

/* Slots in the article and in lists */
.sn-ads-slot { clear: both; }
.sn-ads-slot--inarticle,
.sn-ads-slot--infeed {
  margin: 32px 0;
  padding: 16px 0;
  border-block: 1px solid var(--theme-palette-color-5, rgba(128,128,128,.25));
}
.sn-ads-slot--infeed { grid-column: 1 / -1; width: 100%; }
.sn-ads-slot--rail { margin: 40px 0 24px; grid-column: 1 / -1; width: 100%; }

/* Swipe rail */
.sn-ads-rail { position: relative; }
.sn-ads-rail__hint {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--theme-text-color);
  opacity: .65;
}
.sn-ads-rail__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 0 24px 12px 0;
  scrollbar-width: thin;
}
.sn-ads-rail__item {
  flex: 0 0 min(300px, 82%);
  max-width: 300px;
  scroll-snap-align: start;
}
.sn-ads-rail::after {
  /* fade on the right edge: tells the reader there is more */
  content: "";
  position: absolute;
  top: 24px;
  right: 0;
  bottom: 12px;
  width: 36px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--theme-palette-color-8, #fff));
}

/* Desktop helpers */
.sn-ads-column { display: flex; flex-direction: column; gap: 24px; }

/* Leaderboard */
.sn-ad--leaderboard { margin-block: 24px; }
.sn-ad--leaderboard .sn-ad__link { max-width: 970px; }
.sn-ad--leaderboard img { height: auto; }
@media (max-width: 689px) {
  .sn-ad--leaderboard {
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
  }
  .sn-ad--leaderboard .sn-ad__link { max-width: none; border-radius: 0; }
}

/* Vertical stack (phones and tablets): the banners that are not between the stories */
.sn-ads-stack { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.sn-ads-stack .sn-ad { width: 100%; margin: 0; }

/* List of the newest stories that carries the banners (phones and tablets) */
.sn-tail { --sn-tail-line: color-mix(in srgb, var(--theme-text-color) 14%, transparent); margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--sn-tail-line); }
.sn-tail__title { margin: 0 0 6px; font-size: 22px; line-height: 1.2; }
.sn-tail__item { display: grid; grid-template-columns: 112px minmax(0, 1fr); column-gap: 13px; align-items: start; padding: 16px 0; border-top: 1px solid var(--sn-tail-line); }
.sn-tail__title + .sn-tail__item { border-top: 0; }
.sn-tail__item:last-child { padding-bottom: 0; }
.sn-tail__img { display: block; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: color-mix(in srgb, var(--theme-text-color) 6%, transparent); }
.sn-tail__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sn-tail__cat { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--sn-red, var(--theme-palette-color-1)); }
.sn-tail__h { margin: 0; font-size: 16px; line-height: 1.28; }
.sn-tail__h a { color: var(--theme-headings-color, var(--theme-text-color)); text-decoration: none; }
.sn-tail__date { display: block; margin-top: 6px; font-size: 13px; opacity: .7; }
.sn-tail .sn-ads-slot--tail { margin: 0; padding: 14px 0 16px; border-top: 1px solid var(--sn-tail-line); }
.sn-tail .sn-ad { margin: 0 auto; }
@media (min-width: 690px) { .sn-tail { max-width: 700px; margin-inline: auto; } }

/* ======================= Final check, 2026-11-27 ======================= */
/* Tablet, lists of 2 columns: the banner takes one cell, so no card stays alone in its row. */
@media (min-width: 690px) and (max-width: 999.98px) {
  body.sn-list .entries > .sn-ads-slot.sn-ads-slot--infeed,
  body.sn-article .ct-related-posts .sn-ads-slot.sn-ads-slot--infeed { grid-column: auto; width: auto; align-self: start; margin: 0; padding: 0; border: 0; }
}
/* Short list on desktop: the newest stories fill the main column beside the banner column. */
@media (min-width: 1000px) {
  .sn-tail--desk { max-width: none; margin-inline: 0; }
  .sn-tail--desk .sn-tail__item { grid-template-columns: 168px minmax(0, 1fr); column-gap: 20px; }
  .sn-tail--desk .sn-tail__h { font-size: 19px; }
}
