/* Reader-facing first-party ad units. Loaded only when direct advertising is enabled. */
:root {
  --ad-bg: #242822;
  --ad-border: #69705f;
  --ad-label-bg: #e8b24c;
  --ad-label-ink: #1b1e1c;
}

html[data-theme="light"] {
  --ad-bg: #eee9dc;
  --ad-border: #9c9279;
  --ad-label-bg: #8b5f00;
  --ad-label-ink: #fffdf7;
}

.page-shell {
  position: relative;
}

.ad-unit {
  overflow: hidden;
  border: 1px solid var(--ad-border);
  border-radius: 10px;
  color: var(--ink);
  background: var(--ad-bg);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .08);
}

.ad-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.ad-disclosure {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 3px;
  color: var(--ad-label-ink);
  background: var(--ad-label-bg);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
}

.ad-advertiser {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-media-link,
.ad-headline-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.ad-creative {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  background: rgba(0, 0, 0, .08);
}

.ad-copy {
  min-width: 0;
  padding: 12px;
}

.ad-headline {
  margin: 0;
  color: var(--headline);
  font-family: var(--serif);
  font-size: clamp(18px, 1.4vw, 22px);
  line-height: 1.16;
}

.ad-headline-link:hover .ad-headline,
.ad-headline-link:focus-visible .ad-headline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ad-description {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ad-destination-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}

.ad-destination {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-cta {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 5px;
  color: #fff;
  background: var(--red-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.ad-cta:hover,
.ad-cta:focus-visible {
  filter: brightness(1.08);
}

.ad-top-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  margin: 18px auto 0;
  max-width: 1120px;
}

.ad-top-banner .ad-heading {
  grid-column: 1 / -1;
}

.ad-top-banner .ad-media-link {
  align-self: stretch;
  padding: 8px 0 10px 10px;
}

.ad-top-banner .ad-creative {
  height: 124px;
  max-height: 124px;
}

.ad-top-banner .ad-copy {
  align-self: center;
  padding: 12px 18px 16px;
}

.ad-side-rail {
  position: absolute;
  width: 300px;
  max-height: 600px;
}

.ad-side-rail .ad-heading {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.ad-side-rail .ad-creative {
  max-height: 300px;
}

.ad-side-rail .ad-headline {
  font-size: 18px;
}

.ad-side-rail .ad-destination-row {
  align-items: stretch;
  flex-direction: column;
}

.ad-side-rail .ad-cta {
  text-align: center;
}

.ad-sponsored-feed {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
  margin: 13px 0;
  border-left: 4px solid var(--ad-label-bg);
}

.ad-sponsored-feed .ad-heading {
  grid-column: 1 / -1;
}

.ad-sponsored-feed .ad-media-link {
  align-self: stretch;
  padding: 8px 0 10px 10px;
}

.ad-sponsored-feed .ad-creative {
  height: 130px;
  max-height: 130px;
}

html[data-view="compact"] .ad-sponsored-feed {
  grid-template-columns: 110px minmax(0, 1fr);
  margin: 8px 0;
}

html[data-view="compact"] .ad-sponsored-feed .ad-creative {
  height: 100px;
}

html[data-view="compact"] .ad-sponsored-feed .ad-headline {
  font-size: var(--compact-headline-font-size);
}

@media (max-width: 1100px) {
  .ad-side-rail {
    display: none;
  }
}

@media (max-width: 760px) {
  .ad-top-banner,
  .ad-sponsored-feed,
  html[data-view="compact"] .ad-sponsored-feed {
    grid-template-columns: 1fr;
  }

  .ad-top-banner {
    margin-top: 10px;
  }

  .ad-top-banner .ad-heading,
  .ad-sponsored-feed .ad-heading {
    grid-column: 1;
  }

  .ad-top-banner .ad-media-link,
  .ad-sponsored-feed .ad-media-link {
    padding: 8px 10px 0;
  }

  .ad-top-banner .ad-creative,
  .ad-sponsored-feed .ad-creative,
  html[data-view="compact"] .ad-sponsored-feed .ad-creative {
    height: auto;
    max-height: 180px;
  }

  .ad-top-banner .ad-copy,
  .ad-sponsored-feed .ad-copy {
    padding: 10px 12px 12px;
  }

  .ad-headline {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .ad-description {
    display: none;
  }

  .ad-destination-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .ad-cta {
    text-align: center;
  }
}
