/* ads.css: everything for the ad slots (loaded after main.css). Colours reuse main.css variables with fallbacks. */
:root { --ad-header-h: 90px; --ad-ink: var(--color-ink, #1b1b1b); --ad-muted: var(--color-ink-muted, #666); --ad-line: var(--color-line, #ddd); --ad-soft: var(--color-bg-soft, #f4f5f7); --ad-accent: var(--color-primary, #0b4f6c); }

.ad-slot { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; width: 100%; margin: 0 auto; min-width: 0; }
.ad-slot[hidden] { display: none !important; }
.ad-slot__label { display: block; margin-bottom: 4px; font-size: 0.625rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ad-muted); text-align: center; }
.ad-slot__link { display: block; line-height: 0; max-width: 100%; }
.ad-slot__link img { display: block; max-width: 100%; height: auto; border-radius: 4px; }
.ad-slot__house { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; width: 100%; height: 100%; padding: 6px 10px; text-align: center; text-decoration: none; color: var(--ad-muted); background: var(--ad-soft); border: 1px dashed var(--ad-line); border-radius: 6px; line-height: 1.4; }
.ad-slot__house:hover { color: var(--ad-accent); border-color: var(--ad-accent); }
.ad-slot__house b { font-size: 0.95rem; color: var(--ad-ink); }
.ad-slot__house small { font-size: 0.72rem; }

/* Leaderboard: directly under the main menu, above the page */
.ad-slot--leaderboard { padding: 10px 12px; min-height: 118px; background: transparent; }
.ad-slot--leaderboard .ad-slot__body { width: 728px; max-width: 100%; height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-slot--leaderboard .ad-slot__link img { width: 100%; max-width: 728px; }
.ad-slot--leaderboard .ad-slot__house { min-height: 90px; }
@media (max-width: 768px) {
  .ad-slot--leaderboard { min-height: 78px; padding: 8px 10px; }
  .ad-slot--leaderboard .ad-slot__body { width: 320px; height: 50px; }
  .ad-slot--leaderboard .ad-slot__link img { max-width: 320px; }
  .ad-slot--leaderboard .ad-slot__house { min-height: 50px; padding: 2px 8px; flex-direction: row; gap: 8px; }
  .ad-slot--leaderboard .ad-slot__house small { display: none; }
}
.ad-slot--leaderboard.is-collapsed { display: none; }

/* Sidebar: sticky, desktop article/section pages only */
.ad-slot--sidebar { position: sticky; top: calc(var(--ad-header-h) + 16px); margin-block: 0.5rem; }
.ad-slot--sidebar .ad-slot__body { width: 300px; max-width: 100%; }
.ad-slot--sidebar .ad-slot__house { min-height: 250px; }
@media (max-width: 991px) { .ad-slot--sidebar { display: none; } }

/* In-feed cards sit in the page's own lists; they only add a quiet "Sponsored" tag */
.ad-slot--infeed { align-items: stretch; }
.ad-slot--infeed .ad-tag { font-size: 0.72rem; font-weight: 700; color: var(--ad-muted); }
.ad-slot--infeed img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-slot--infeed a { color: inherit; text-decoration: none; }
.ad-slot--infeed .ad-cta { display: inline-block; margin-top: 6px; font-size: 0.85rem; font-weight: 700; color: var(--ad-accent); }
.ad-slot--infeed .ad-house-card { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; min-height: 160px; height: 100%; padding: 16px; background: var(--ad-soft); border: 1px dashed var(--ad-line); border-radius: 8px; color: var(--ad-muted); }
.ad-slot--infeed .ad-house-card b { color: var(--ad-ink); font-size: 1rem; }
.ad-slot--inbody { display: none; margin: 1.5rem 0; padding: 12px; background: var(--ad-soft); border: 1px solid var(--ad-line); border-radius: 8px; clear: both; }
.ad-slot--inbody .ad-media { aspect-ratio: 16 / 9; width: 100%; overflow: hidden; border-radius: 6px; }
.ad-slot--inbody .ad-title { display: block; margin-top: 8px; font-weight: 700; line-height: 1.5; }
@media (max-width: 991px) { .ad-slot--inbody { display: block; } }
@media (min-width: 992px) { .ad-slot--inbody { display: none !important; } }

/* Category takeover strip: sticky right under the header */
.ad-takeover { position: sticky; top: var(--ad-header-h); z-index: 1019; width: 100%; background: var(--ad-accent); color: #fff; }
.ad-takeover a { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 6px 14px; color: inherit; text-decoration: none; font-size: 0.92rem; font-weight: 600; text-align: center; line-height: 1.4; }
.ad-takeover a:hover { text-decoration: underline; }
.ad-takeover img { height: 30px; width: auto; max-width: 110px; object-fit: contain; background: #fff; border-radius: 4px; padding: 2px 4px; }
.ad-takeover small { font-size: 0.65rem; opacity: 0.8; letter-spacing: 0.08em; text-transform: uppercase; }

/* Mobile bottom bar: sits above the trial banner when there is one */
.ad-bar { position: fixed; left: 0; right: 0; bottom: var(--trial-banner-h, 0px); z-index: 1040; height: 60px; display: none; align-items: center; gap: 10px; padding: 0 8px; background: #fff; color: var(--ad-ink); border-top: 1px solid var(--ad-line); box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.12); transform: translateY(110%); transition: transform 0.3s ease; }
.ad-bar.is-open { transform: none; }
@media (max-width: 768px) { .ad-bar { display: flex; } }
@media (prefers-reduced-motion: reduce) { .ad-bar { transition: none; } }
.ad-bar__link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 100%; color: inherit; text-decoration: none; }
.ad-bar__link img { height: 36px; width: auto; max-width: 90px; object-fit: contain; flex: none; }
.ad-bar__text { flex: 1; min-width: 0; font-size: 0.85rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-bar__text small { display: block; font-size: 0.6rem; font-weight: 400; color: var(--ad-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.ad-bar__cta { flex: none; padding: 6px 12px; font-size: 0.8rem; font-weight: 700; color: #fff; background: var(--ad-accent); border-radius: 999px; }
.ad-bar__close { flex: none; width: 36px; height: 36px; font-size: 1.1rem; line-height: 1; color: var(--ad-muted); background: none; border: 0; cursor: pointer; border-radius: 50%; }
.ad-bar__close:hover, .ad-bar__close:focus-visible { background: var(--ad-soft); color: var(--ad-ink); }

/* Exit-intent popup: desktop only */
.ad-modal { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.6); }
.ad-modal.is-open { display: flex; }
.ad-modal__box { position: relative; width: 600px; max-width: 100%; background: #fff; border-radius: 10px; padding: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.ad-modal__box .ad-slot__label { text-align: start; }
.ad-modal__box img { display: block; width: 100%; height: auto; border-radius: 6px; }
.ad-modal__close { position: absolute; top: -14px; inset-inline-end: -14px; width: 36px; height: 36px; font-size: 1.2rem; line-height: 1; color: #fff; background: var(--ad-ink); border: 2px solid #fff; border-radius: 50%; cursor: pointer; }
@media (max-width: 991px) { .ad-modal { display: none !important; } }

@media print { .ad-slot, .ad-takeover, .ad-bar, .ad-modal { display: none !important; } }
