.tko-ad {
  border-bottom: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
  box-sizing: border-box;
  clear: both;
  margin: 2rem auto;
  max-width: 100%;
  padding: 0.75rem 0 1rem;
  text-align: center;
}

.tko-ad__label {
  color: #555;
  display: block;
  font: 600 0.75rem/1.5 system-ui, sans-serif;
  letter-spacing: 0.08em;
  margin-bottom: 0.375rem;
}

.tko-ad__slot,
.tko-ad__gam {
  margin-left: auto;
  margin-right: auto;
  min-height: var(--tko-ad-desktop-height);
  max-width: 100%;
  overflow: visible;
  position: relative;
}

/* Stara oprawa TagDiv pozostaje tylko punktem ukladu. Widoczna jest jedna
   etykieta i nie ma juz linku handlowego przy boksie zarzadzanym przez plugin. */
.td-a-ad:has(.tko-ad--managed) > .td-adspot-title,
.tko-ad-wrapper:has(.tko-ad--managed) > .tko-ad-order {
  display: none !important;
}

.tko-ad-wrapper:has(.tko-ad--managed),
.tko-ad-wrapper:has(.tko-ad--managed) .tko-ad-slot {
  max-width: 100% !important;
  width: 100% !important;
}

.tko-kwords-relocated {
  box-sizing: border-box;
  clear: both;
  margin: 1.5rem auto;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
}

.td_block_wrap:has(.tko-google-source-btn) {
  clear: both;
  margin-top: 1rem;
  position: relative;
  z-index: 2;
}

/* Przycisk Google jest stylowany przez plugin. Kod CSS nie musi juz byc
   wklejany do bloku Raw HTML w szablonie TagDiv. */
a.tko-google-source-btn {
  align-items: center !important;
  background: #fff !important;
  border: 1px solid #dadce0 !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  color: #202124 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  font: 600 14px/1.2 Arial, Helvetica, sans-serif !important;
  gap: 9px !important;
  justify-content: center !important;
  margin: 0 !important;
  max-width: 100% !important;
  min-height: 40px !important;
  padding: 9px 15px !important;
  text-align: center !important;
  text-decoration: none !important;
  transition: background-color .2s ease, box-shadow .2s ease !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  width: auto !important;
}

a.tko-google-source-btn::before {
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%234285F4' d='M21.6 12.23c0-.71-.06-1.4-.18-2.07H12v3.92h5.38a4.6 4.6 0 0 1-2 3.02v2.54h3.24c1.9-1.75 2.98-4.33 2.98-7.41z'/%3E%3Cpath fill='%2334A853' d='M12 22c2.7 0 4.97-.9 6.62-2.42l-3.24-2.54c-.9.6-2.05.96-3.38.96-2.61 0-4.82-1.76-5.61-4.13H3.04v2.62A10 10 0 0 0 12 22z'/%3E%3Cpath fill='%23FBBC05' d='M6.39 13.87A6 6 0 0 1 6.08 12c0-.65.11-1.28.31-1.87V7.51H3.04A10 10 0 0 0 2 12c0 1.61.38 3.14 1.04 4.49l3.35-2.62z'/%3E%3Cpath fill='%23EA4335' d='M12 6c1.47 0 2.79.5 3.83 1.5l2.87-2.87A9.62 9.62 0 0 0 12 2a10 10 0 0 0-8.96 5.51l3.35 2.62C7.18 7.76 9.39 6 12 6z'/%3E%3C/svg%3E") !important;
  content: "" !important;
  display: block !important;
  flex: 0 0 22px !important;
  height: 22px !important;
  width: 22px !important;
}

a.tko-google-source-btn:hover,
a.tko-google-source-btn:focus {
  background: #f8f9fa !important;
  box-shadow: 0 1px 3px rgba(60, 64, 67, .25) !important;
  color: #202124 !important;
  text-decoration: none !important;
}

a.tko-google-source-btn:focus-visible {
  outline: 2px solid #4285f4 !important;
  outline-offset: 2px !important;
}

.tko-ad--managed {
  min-height: calc(var(--tko-ad-desktop-height) + 54px);
  width: 100%;
}

.tko-ad-desktop-c-host {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 1124px;
  width: calc(100% - 30px);
}

body.home .tko-ad-desktop-c-host {
  margin-bottom: 2rem;
  margin-top: 2rem;
}

/* Dla GAM deklarowana wysokosc jest calym budzetem rezerwy CLS. Oprawa
   (etykieta, padding i obramowanie) miesci sie w tych 250 px, a nie ponad nimi. */
@media (min-width: 768px) {
  body.single-post .tko-ad--managed:not(.tko-ad--article-sidebar) {
    max-width: 970px;
  }

  body.single-post .tko-ad--managed[data-tko-placement="gam_a"] {
    max-width: 1400px;
    width: calc(100% - 74px);
  }

  /* Jedna typografia etykiety reklamowej dla boksow TKO Ads
     oraz pozostalych punktow Newspaper, ktore nie zostaly jeszcze przejete. */
  .tko-ad__label,
  .td-adspot-title {
    color: #555 !important;
    display: block;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    line-height: 1.5 !important;
    text-align: center !important;
    text-transform: uppercase !important;
  }

  /* Galeria i nastepujacy po niej boks nie moga rysowac dwoch linii
     w tym samym miejscu. Dolna linia galerii pozostaje separatorem. */
  body.single-post .wp-block-gallery + .tko-ad {
    border-top: 0 !important;
  }

  .tko-ad--managed[data-tko-provider="gam"] {
    min-height: var(--tko-ad-desktop-height);
  }

  .tko-ad--managed[data-tko-provider="gam"] .tko-ad__gam {
    min-height: max(0px, calc(var(--tko-ad-desktop-height) - 54px));
  }

  /* Dominujaca kreacja 970x250 nie dziedziczy rezerwy przewidzianej dla
     wariantu 970x410. Dolna linia pozostaje tuz pod faktyczna kreacja. */
  .tko-ad--managed[data-tko-provider="gam"]:has(iframe[height="250"]) {
    min-height: 0;
  }

  .tko-ad--managed[data-tko-provider="gam"]:has(iframe[height="250"]) .tko-ad__gam {
    min-height: 250px;
  }
}

.tko-ad-wrapper .tko-ad-slot {
  max-width: 100% !important;
  width: 100% !important;
}

.tko-ad--mobile-only {
  display: none;
}

.tko-ad__device--desktop {
  display: block;
}

.tko-ad__device--mobile {
  display: none;
}

.tko-ad--managed[data-tko-provider="idmnet"] .tko-ad__idm {
  min-height: var(--tko-ad-desktop-height);
  overflow: visible;
}

.tko-ad[data-tko-rendered="1"] {
  visibility: visible;
}

.tko-ad[data-tko-provider="idmnet"] .tko-ad__slot {
  min-height: var(--tko-ad-desktop-height, 250px);
}

.tko-ad__idm-mobile {
  display: none;
}

.tko-ad__idm-desktop {
  display: block;
  margin-top: 1rem;
}

.tko-ad--local .tko-ad__idm-desktop {
  min-height: var(--tko-ad-desktop-height, 250px);
}

.tko-ad--local {
  border-top: 0;
  min-height: 310px;
  padding-top: 0;
}

.tko-ad--local .tko-ad__label {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
}

/* Taboola wstrzykuje wlasne, bardziej szczegolowe reguly z fontem Roboto.
   Ograniczamy nadpisanie do tekstowych elementow widzetu, aby nie naruszyc ikon. */
#taboola-below-article-widget .video-title,
#taboola-below-article-widget .video-label,
#taboola-below-article-widget .branding,
#taboola-below-article-widget .tbl-data-field,
#taboola-below-article-widget .trc_attribution_position_after_branding,
#taboola-below-article-widget .item-label-href {
  font-family: Verdana, Geneva, sans-serif !important;
}

body.single-post .tko-ad--article-sidebar {
  box-sizing: border-box;
  margin: 0 auto 32px;
  min-height: 654px;
  overflow: visible;
  width: 100%;
}

body.single-post .tko-ad--article-sidebar .tko-ad__idm {
  min-height: 600px;
}

@media (min-width: 768px) {
  .tko-ad--local {
    width: calc(100% - 30px);
    max-width: 1124px;
  }
}

@media (max-width: 767px) {
  /* Newspaper dodaje po slotach osobne bloki odstepu. Przy zarzadzanym
     boksie sa zbedne i tworza duza dziure przed wyszukiwarka. */
  .tko-ad--managed + .td_block_empty_space {
    display: none !important;
  }

  a.tko-google-source-btn {
    white-space: normal !important;
  }

  body.single-post .tko-ad[data-tko-placement="idm_m_inside_0"] {
    display: none !important;
    min-height: 0 !important;
  }

  .tko-ad--managed {
    min-height: calc(var(--tko-ad-mobile-height) + 54px);
  }

  body.single-post .tdb_single_content .tko-ad--managed {
    margin-bottom: 2.5rem !important;
    margin-top: 2.5rem !important;
  }

  body.single-post .tdb_single_content .tko-ad--managed + p,
  body.single-post .tdb_single_content .tko-ad--managed + h2,
  body.single-post .tdb_single_content .tko-ad--managed + h3 {
    margin-top: 1.5rem !important;
  }

  .tko-ad--desktop-only {
    display: none;
    min-height: 0;
  }

  .tko-ad--mobile-only {
    display: block;
  }
  .tko-ad__device--desktop {
    display: none;
  }

  .tko-ad__device--mobile {
    display: block;
    max-width: 100%;
    overflow: visible;
  }

  .tko-ad--managed[data-tko-provider="idmnet"] .tko-ad__idm {
    min-height: var(--tko-ad-mobile-height);
    overflow: visible;
  }
  .tko-ad--local {
    min-height: 340px;
  }
  .tko-ad--local .tko-ad__gam {
    display: none;
    min-height: 0;
  }

  .tko-ad__slot,
  .tko-ad__gam {
    min-height: var(--tko-ad-mobile-height);
  }

  .tko-ad__idm-mobile {
    display: block;
    margin-top: 1rem;
    min-height: var(--tko-ad-mobile-height, 280px);
  }

  .tko-ad__idm-desktop {
    display: none;
  }
}

.tko-mobile-home-ad-shell {
  position: relative;
  z-index: 1;
  clear: both;
  width: 100%;
  max-width: calc(100vw - 40px);
  margin: 24px auto;
  box-sizing: border-box;
}
.tko-mobile-home-ad-shell .tko-ad {
  margin: 0;
  min-height: 0;
}
.tko-mobile-home-ad-shell .tko-ad__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  min-height: 100px;
  padding: 16px;
  box-sizing: border-box;
  font: 700 16px/1.4 system-ui, sans-serif;
}
@media (min-width: 768px) {
  .tko-mobile-home-ad-shell { display: none; }
}
@media (max-width: 767px) {
  body.home .tko-mobile-gap-empty { display: none !important; }
  body.home .tko-mobile-gap-end {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

.tko-ad--idm-placeholder {
  min-height: 0 !important;
}

.tko-ad--idm-placeholder .tko-ad__placeholder {
  align-items: center;
  background: #f8fafc;
  border: 2px dashed #64748b;
  box-sizing: border-box;
  color: #334155;
  display: flex;
  font: 600 13px/1.4 system-ui, sans-serif;
  justify-content: center;
  margin: 0 auto;
  min-height: 72px;
  padding: 12px;
  width: min(100%, 970px);
}

@media (min-width: 768px) {
  .tko-home-ad-shell {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    clear: both;
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
  }

  .tko-ad--homepage {
    box-sizing: border-box;
    margin: 28px auto 48px;
    min-height: 0 !important;
    width: 100%;
  }

  .tko-ad--homepage .tko-ad__homepage-code {
    min-height: 250px;
    text-align: center;
  }

  .tko-home-empty-anchor {
    display: none !important;
  }

  .tko-home-before-ad {
    margin-bottom: 0 !important;
  }

  [data-tko-home-shell="homepage_desktop_slot_6"] .tko-ad,
  [data-tko-home-shell="homepage_desktop_slot_7"] .tko-ad {
    margin-top: 32px;
  }

  .tko-ad--homepage-placeholder .tko-ad__placeholder {
    align-items: center;
    background: #000;
    box-sizing: border-box;
    color: #fff;
    display: flex;
    font: 700 18px/1.3 system-ui, sans-serif;
    justify-content: flex-start;
    margin: 0 auto;
    min-height: 250px;
    padding: 24px 56px;
    text-transform: lowercase;
    width: min(100%, 970px);
  }
}

