/* Shared first-party ads — loaded on all public pages (blog, tools, home, …) */

/* First-party ad unit chrome */
.ad-unit-shell__inner,
.ad-unit {
  position: relative;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 1rem;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
  overflow: hidden;
}
.ad-unit {
  padding: 0.85rem 0.85rem 1rem;
}
.ad-unit--compact {
  padding: 0.65rem;
}
.ad-unit__badge,
.ad-unit__badge--slider,
.ad-unit__badge--inline {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #78350f;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  z-index: 2;
}
.ad-unit__badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}
.ad-unit__badge--slider {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}
.ad-unit__badge--inline {
  position: static;
  margin-bottom: 0.5rem;
}
.ad-unit__media,
.ad-unit__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  text-decoration: none;
}
.ad-unit__img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  object-fit: contain;
}
.ad-unit__fallback {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border-radius: 0.65rem;
  min-height: 100px;
}
.ad-unit__fallback-title {
  color: #9a3412;
  font-weight: 600;
  font-size: 0.9rem;
}
.ad-unit__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  width: 100%;
  min-height: 2.4rem;
  border-radius: 0.65rem;
  background: #ea580c;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none !important;
}
.ad-unit__cta:hover { background: #c2410c; }
.ad-unit--html,
.ad-unit__html {
  width: 100%;
  text-align: right;
}
.ad-unit__html-inner {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #78350f;
}
.ad-unit__html-inner a {
  color: #c2410c;
  font-weight: 600;
  text-decoration: underline;
}

/* Sidebar ad card — grouped by badge; carousel only within same badge */
.ad-sidebar-list {
  width: 100%;
}
.ad-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  padding: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.ad-card:hover {
  border-color: #dbeafe;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
}
.ad-card__accent {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb 0%, #f59e0b 100%);
  opacity: 0.9;
}
.ad-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.ad-card__tag {
  display: inline-flex;
  align-items: center;
  max-width: 70%;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-card__count {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}
.ad-card__body {
  position: relative;
}
.ad-card__viewport {
  position: relative;
  overflow: hidden;
}
.ad-card__track {
  position: relative;
}
.ad-card__track--slide {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.ad-card__track--slide .ad-card__slide-wrap {
  flex: 0 0 auto;
  min-width: 0;
}
.ad-card__track--fade .ad-card__slide-wrap {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
}
.ad-card__track--fade .ad-card__slide-wrap.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ad-card__slide {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ad-card__media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border-radius: 10px;
  overflow: hidden;
  background: #f1f5f9;
  text-decoration: none;
}
.ad-card__media--fallback {
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
  border: 1px dashed #e2e8f0;
}
.ad-card__media--empty {
  background: #f8fafc;
}
.ad-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ad-card__fallback-icon {
  color: #94a3b8;
  font-size: 1.75rem;
}
.ad-card__html {
  aspect-ratio: 16 / 10;
  min-height: 120px;
  max-height: 180px;
  overflow: auto;
  border-radius: 10px;
  background: #f8fafc;
  padding: 8px;
}
.ad-card__html-inner {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #334155;
}
.ad-card__caption {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #334155;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.ad-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: #2563eb;
  color: #fff !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.15s ease;
}
.ad-card__cta:hover {
  background: #1d4ed8;
}
.ad-card__cta:active {
  transform: scale(0.98);
}
.ad-card__nav {
  position: absolute;
  top: 70px;
  transform: translateY(-50%);
  z-index: 3;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background 0.2s ease;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.ad-sidebar-carousel:hover .ad-card__nav,
.ad-sidebar-carousel:focus-within .ad-card__nav {
  opacity: 1;
  pointer-events: auto;
}
.ad-card__nav:hover {
  background: rgba(37, 99, 235, 0.9);
}
.ad-card__nav--prev { right: 8px; }
.ad-card__nav--next { left: 8px; }
.ad-card__footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ad-card__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.ad-card__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: #cbd5e1;
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}
.ad-card__dot.is-active {
  width: 16px;
  background: #2563eb;
}
.ad-card__progress {
  height: 2px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.ad-card__progress-bar {
  height: 100%;
  width: 0;
  background: #2563eb;
  border-radius: inherit;
}
@media (hover: none) {
  .ad-sidebar-carousel .ad-card__nav {
    opacity: 0.7;
    pointer-events: auto;
  }
}
@media (max-width: 1023px) {
  .ad-card__media {
    min-height: 130px;
  }
}

/* Mobile sticky ad */
.ad-mobile-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8400;
  display: none;
  padding: 0.45rem 2.25rem 0.45rem 0.75rem;
  background: #fffbeb;
  border-top: 2px solid #f59e0b;
  box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.1);
}
.ad-mobile-sticky.is-visible { display: block; }
.ad-mobile-sticky[hidden] { display: none !important; }
@media (min-width: 1024px) {
  .ad-mobile-sticky,
  .ad-mobile-sticky.is-visible { display: none !important; }
}
.ad-mobile-sticky__close {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.ad-mobile-sticky__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  min-height: 2.75rem;
}
.ad-mobile-sticky__img {
  max-height: 44px;
  width: auto;
  max-width: 70%;
  object-fit: contain;
  border-radius: 0.35rem;
}
.ad-mobile-sticky__text {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #78350f;
}
.ad-mobile-sticky__cta {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  background: #ea580c;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.ad-mobile-sticky__html {
  padding-right: 0.25rem;
  font-size: 0.8rem;
}
body.has-ad-mobile-sticky { padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); }
body.has-ad-mobile-sticky.has-tool-sticky-cta {
  padding-bottom: calc(9rem + env(safe-area-inset-bottom, 0px));
}
body.pwa-standalone.pwa-has-bottom-nav.has-ad-mobile-sticky.has-tool-sticky-cta {
  padding-bottom: calc(12.5rem + env(safe-area-inset-bottom, 0px));
}

.inarticle-ad-slot {
  width: 100%;
  margin: 1.5rem 0;
  min-height: 120px;
  overflow: hidden;
}
#mediaad-RlB8R {
  min-height: 120px;
  width: 100%;
}
.ma-bnr-slot {
  width: 100%;
  min-height: 250px;
  position: relative;
  z-index: 0;
}
#mediaad-AABQz,
#mediaad-nwm1g {
  min-height: 250px;
  width: 100%;
}
