/**
 * Alle Werbe-Placements (9 Standard-Formate) – einheitliche Maximalbreiten.
 *
 * Block-Slots: <ad-content placement="…">
 * Artikel-Paragraph: .article-werbung-token--…
 *
 * Maße: :root in saarland-tokens.css (--st-ad-w-* / --st-ad-h-*)
 */

/* ── Placement → lokale Größen-Variablen (alle 9 Formate) ─────────────────── */
ad-content[placement='medium_rectangle'],
.article-werbung-token--google_ads_infeed_one,
.article-werbung-token--google_ads_infeed_two,
.article-werbung-token--google_ads_infeed_three,
.article-werbung-token--google_ads_infeed_four,
.article-werbung-token--medium_rectangle {
  --st-ad-max-w: 250px;
  /* 250 px Anzeigenfläche plus 13,2 px Kennzeichnung „Werbung“. */
  --st-ad-max-h: 263.2px;
}

ad-content[placement='rectangle'],
.article-werbung-token--rectangle {
  --st-ad-max-w: var(--st-ad-w-rectangle);
  --st-ad-max-h: var(--st-ad-h-rectangle);
}

ad-content[placement='skyscraper'],
.article-werbung-token--skyscraper {
  --st-ad-max-w: var(--st-ad-w-skyscraper);
  --st-ad-max-h: var(--st-ad-h-skyscraper);
}

ad-content[placement='mobile_leaderboard'],
.article-werbung-token--mobile_leaderboard {
  --st-ad-max-w: var(--st-ad-w-mobile_leaderboard);
  --st-ad-max-h: var(--st-ad-h-mobile_leaderboard);
}

ad-content[placement='halfsize_banner'],
.article-werbung-token--halfsize_banner {
  --st-ad-max-w: var(--st-ad-w-halfsize_banner);
  --st-ad-max-h: var(--st-ad-h-halfsize_banner);
}

ad-content[placement='fullsize_banner'],
.article-werbung-token--google_ads_infeed_five,
.article-werbung-token--google_ads_infeed_six,
.article-werbung-token--fullsize_banner {
  --st-ad-max-w: var(--st-ad-w-fullsize_banner);
  --st-ad-max-h: var(--st-ad-h-fullsize_banner);
}

ad-content[placement='leaderboard'],
.article-werbung-token--leaderboard {
  --st-ad-max-w: var(--st-ad-w-leaderboard);
  --st-ad-max-h: var(--st-ad-h-leaderboard);
}

ad-content[placement='large_leaderboard'],
.article-werbung-token--large_leaderboard {
  --st-ad-max-w: var(--st-ad-w-large_leaderboard);
  --st-ad-max-h: var(--st-ad-h-large_leaderboard);
}

ad-content[placement='billboard'],
.article-werbung-token--billboard {
  --st-ad-max-w: var(--st-ad-w-billboard);
  --st-ad-max-h: var(--st-ad-h-billboard);
}

/* ── Alle Werbe-Regionen / Slots (Spezifität > st-content-layout) ─────────── */
#block-saarland-today-gpt-top {
  margin-top: 20px;
}

#block-saarland-today-gpt-bottom {
  margin-bottom: 40px;
}

:is(
  #sidebar-box-first,
  #sidebar-box-second,
  #sidebar-box-main,
  #article_advertising_left,
  #article_advertising_right,
  #article_advertising_top,
  #article_advertising_bottom,
  #st_ad_left,
  #st_ad_right,
  #st_ad_top,
  .article-ad-slot,
  .region-advertising-left,
  .region-advertising-right,
  .region-advertising-top,
  .region-advertising-bottom,
  #article_content_1
) :is(ad-content[placement], [class*='article-werbung-token--']) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: min(100%, var(--st-ad-max-w, 100%));
  max-height: var(--st-ad-max-h, none);
  margin-inline: auto;
}

:is(
  #sidebar-box-first,
  #sidebar-box-second,
  #sidebar-box-main,
  #article_advertising_left,
  #article_advertising_right,
  #article_advertising_top,
  #article_advertising_bottom,
  #st_ad_left,
  #st_ad_right,
  .article-ad-slot,
  .region-advertising-left,
  .region-advertising-right,
  .region-advertising-top,
  .region-advertising-bottom,
  #article_content_1
) ad-content[placement] :is(a, .field, .field__item),
#article_content_1 [class*='article-werbung-token--'] .paragraph-werbung__slot {
  display: block;
  max-width: 100%;
  margin-inline: auto;
}

#article_content_1 .paragraph-werbung--left[class*='article-werbung-token--'],
#article_content_1 [class*='article-werbung-token--'].paragraph-werbung--left {
  display: block;
  box-sizing: border-box;
  width: fit-content;
  max-width: min(100%, var(--st-ad-max-w, 100%));
  margin: 0 var(--st-inline-ad-text-gap, 20px) var(--st-space-20, 20px) 0 !important;
}

#article_content_1 .paragraph-werbung--left[class*='article-werbung-token--'] .paragraph-werbung__slot,
#article_content_1 [class*='article-werbung-token--'].paragraph-werbung--left .paragraph-werbung__slot {
  margin-left: 0 !important;
  margin-right: auto !important;
}

#article_content_1 .paragraph-werbung--right[class*='article-werbung-token--'],
#article_content_1 [class*='article-werbung-token--'].paragraph-werbung--right {
  display: block;
  box-sizing: border-box;
  width: fit-content;
  max-width: min(100%, var(--st-ad-max-w, 100%));
  margin: 0 0 var(--st-space-20, 20px) var(--st-inline-ad-text-gap, 20px) !important;
}

#article_content_1 .paragraph-werbung--right[class*='article-werbung-token--'] .paragraph-werbung__slot,
#article_content_1 [class*='article-werbung-token--'].paragraph-werbung--right .paragraph-werbung__slot {
  margin-left: auto !important;
  margin-right: 0 !important;
}

#article_content_1 :is(
  .article-werbung-token--google_ads_infeed_five,
  .article-werbung-token--google_ads_infeed_six
) {
  float: none;
  clear: both;
  display: block;
  width: fit-content;
  max-width: min(100%, var(--st-ad-max-w, 468px));
  margin: var(--st-space-20, 20px) auto;
  text-align: center;
}

#article_content_1 :is(
  .article-werbung-token--google_ads_infeed_five,
  .article-werbung-token--google_ads_infeed_six
) .paragraph-werbung__slot {
  margin-inline: auto;
}

@media (max-width: 768px) {
  #article_content_1 .paragraph-werbung--left[class*='article-werbung-token--'],
  #article_content_1 [class*='article-werbung-token--'].paragraph-werbung--left,
  #article_content_1 .paragraph-werbung--right[class*='article-werbung-token--'],
  #article_content_1 [class*='article-werbung-token--'].paragraph-werbung--right {
    float: none;
    clear: both;
    width: fit-content;
    max-width: 100%;
    margin: var(--st-space-20, 20px) auto !important;
  }

  #article_content_1 .paragraph-werbung--left[class*='article-werbung-token--'] .paragraph-werbung__slot,
  #article_content_1 [class*='article-werbung-token--'].paragraph-werbung--left .paragraph-werbung__slot,
  #article_content_1 .paragraph-werbung--right[class*='article-werbung-token--'] .paragraph-werbung__slot,
  #article_content_1 [class*='article-werbung-token--'].paragraph-werbung--right .paragraph-werbung__slot {
    margin-inline: auto !important;
  }
}

:is(
  #sidebar-box-first,
  #sidebar-box-second,
  #sidebar-box-main,
  #article_advertising_left,
  #article_advertising_right,
  #article_advertising_top,
  #article_advertising_bottom,
  #st_ad_left,
  #st_ad_right,
  .article-ad-slot,
  .region-advertising-left,
  .region-advertising-right,
  .region-advertising-top,
  .region-advertising-bottom,
  #article_content_1
) :is(ad-content[placement] img, [class*='article-werbung-token--'] img) {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

:is(
  #sidebar-box-first,
  #sidebar-box-second,
  #sidebar-box-main,
  #article_advertising_left,
  #article_advertising_right,
  #article_advertising_top,
  #article_advertising_bottom,
  #st_ad_left,
  #st_ad_right,
  #st_ad_top,
  .article-ad-slot,
  .region-advertising-left,
  .region-advertising-right,
  .region-advertising-top,
  .region-advertising-bottom,
  #article_content_1
) :is(
  ad-content[placement],
  ad-content[placement] > *,
  [class*='article-werbung-token--'],
  [class*='article-werbung-token--'] .paragraph-werbung__slot,
  .saarlandtoday-gpt-ad,
  .saarlandtoday-gpt-ad__slot,
  .saarland-adsense,
  .saarland-adsense ins.adsbygoogle
) {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

:is(
  #sidebar-box-first,
  #sidebar-box-second,
  #sidebar-box-main,
  #article_advertising_left,
  #article_advertising_right,
  #article_advertising_top,
  #article_advertising_bottom,
  #st_ad_left,
  #st_ad_right,
  #st_ad_top,
  .article-ad-slot,
  .region-advertising-left,
  .region-advertising-right,
  .region-advertising-top,
  .region-advertising-bottom,
  #article_content_1
) :is(ad-content[placement] iframe, ad-content[placement] object, ad-content[placement] embed) {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  border: 0;
}

/* Block-Paragraph im Fließtext (leaderboard, billboard, …) */
#article_content_1 .paragraph-werbung--block[class*='article-werbung-token--'] {
  clear: both;
  margin-block: var(--st-space-20, 20px);
}

/* AdSense-Slots: Wrapper transparent (Theme-Hintergrund durchscheinen lassen) */
:is(
  #sidebar-box-first,
  #sidebar-box-second,
  #sidebar-box-main,
  #article_advertising_left,
  #article_advertising_right,
  #article_advertising_top,
  #article_advertising_bottom,
  #st_ad_left,
  #st_ad_right,
  #st_ad_top,
  .article-ad-slot,
  .region-advertising-left,
  .region-advertising-right,
  .region-advertising-top,
  .region-advertising-bottom
) :is(.saarland-adsense, .st-ad-slot--adsense) {
  background: var(--color-transparent) !important;
  background-color: var(--color-transparent) !important;
}
