/* ==== FPC ADVERTISEMENTS (banners + popups + corner cards + promo bands) ====
   Uses site.css brand tokens: --navy --navy-solid --navy-deep --navy-bright --gold
   --gold-deep --gold-strong --card --text --muted --shadow --ff (+ *-rgb triplets)
   RTL-safe: logical properties (inset-inline / padding-inline) only. */

.ad-banner[hidden],
.ad-popup[hidden],
.ad-corner[hidden],
.ad-promo[hidden] { display: none !important; }

/* ---------- Banner strip ---------- */
.ad-banner {
  position: relative;
  background: var(--gold, #F7CF28);
  color: var(--navy-deep, #0B2D52); /* readable on gold in both themes */
  font-family: var(--ff, system-ui, sans-serif);
  padding-block: 10px;
  padding-inline: 28px 52px; /* room for the close button */
  text-align: center;
  z-index: 70;
}
.ad-banner-in {
  max-width: var(--maxw, 1180px);
  margin: 0 auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 14px;
  font-size: 15px;
  line-height: 1.45;
}
.ad-banner-title { font-weight: 800; }
.ad-banner-text { opacity: .9; }
.ad-banner-link {
  font-weight: 700;
  color: var(--navy, #104681);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.ad-banner-link:hover { opacity: .8; }
.ad-banner .ad-close {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- Shared close button ---------- */
.ad-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: rgba(var(--ink-deep-rgb, 7, 30, 56), .12);
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.ad-close:hover { background: rgba(var(--ink-deep-rgb, 7, 30, 56), .22); transform: scale(1.06); }

/* ---------- Popup overlay ---------- */
.ad-popup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: var(--ff, system-ui, sans-serif);
}
.ad-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 22, 40, .62);
  backdrop-filter: blur(7px) saturate(1.1);
  -webkit-backdrop-filter: blur(7px) saturate(1.1);
  animation: ad-fade .35s ease;
}
@keyframes ad-fade { from { opacity: 0; } to { opacity: 1; } }
.ad-popup-card {
  position: relative;
  width: min(100%, 480px);
  max-height: min(88vh, 680px);
  overflow-y: auto;
  background: var(--card, #fff);
  color: var(--text, #122A45);
  border-radius: 18px;
  box-shadow: 0 8px 24px -12px rgba(4, 16, 32, .35), 0 32px 80px -24px rgba(4, 16, 32, .55);
  animation: ad-rise .5s cubic-bezier(.16, 1, .3, 1);
}
@keyframes ad-rise {
  from { opacity: 0; transform: translateY(32px) scale(.95); }
  to { opacity: 1; transform: none; }
}
.ad-popup-card .ad-close {
  position: absolute;
  inset-inline-end: 14px;
  top: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--navy-deep, #0B2D52);
  font-size: 22px;
  box-shadow: 0 2px 10px rgba(4, 16, 32, .28);
  backdrop-filter: blur(4px);
}
.ad-popup-card .ad-close:hover { background: #fff; transform: scale(1.08) rotate(90deg); }
.ad-popup-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.ad-popup-body { padding: 26px 30px 28px; }
.ad-popup-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-deep, #B8860B);
  margin-bottom: 10px;
}
.ad-popup-eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--gold, #F7CF28);
  border-radius: 2px;
}
[dir="rtl"] .ad-popup-eyebrow { letter-spacing: .02em; }
.ad-popup-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.015em;
  color: var(--navy, #104681);
}
.ad-popup-text {
  margin-top: 12px;
  color: var(--muted, #4E6479);
  font-size: 15.5px;
  line-height: 1.65;
}
.ad-popup-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.ad-popup-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 10px;
  background: var(--gold, #F7CF28);
  color: var(--navy-deep, #0B2D52);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  transition: transform .18s, box-shadow .22s;
}
.ad-popup-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(var(--gold-rgb, 247, 207, 40), .6);
}
.ad-popup-card .ad-close--text,
.ad-corner .ad-close--text {
  position: static;
  width: auto;
  height: auto;
  padding: 12px 16px;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--muted, #4E6479);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
}
.ad-popup-card .ad-close--text:hover,
.ad-corner .ad-close--text:hover { background: rgba(var(--ink-deep-rgb, 7, 30, 56), .07); transform: none; }

/* ---------- Corner floating card ---------- */
.ad-corner {
  position: fixed;
  inset-block-end: 22px;
  inset-inline-end: 22px;
  width: min(340px, calc(100vw - 32px));
  z-index: 150; /* below the popup overlay (200) */
  overflow: hidden;
  border-radius: 16px;
  background: var(--card, #fff);
  color: var(--text, #122A45);
  font-family: var(--ff, system-ui, sans-serif);
  box-shadow: 0 2px 8px -2px rgba(4, 16, 32, .18), 0 24px 60px -18px rgba(4, 16, 32, .45);
  animation: ad-corner-in .55s cubic-bezier(.16, 1, .3, 1);
}
@keyframes ad-corner-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}
.ad-corner > .ad-close {
  position: absolute;
  inset-inline-end: 10px;
  top: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--navy-deep, #0B2D52);
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(4, 16, 32, .24);
  backdrop-filter: blur(4px);
}
.ad-corner > .ad-close:hover { background: #fff; transform: scale(1.08) rotate(90deg); }
.ad-corner-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.ad-corner-body { padding: 18px 20px; }
.ad-corner .ad-popup-eyebrow { font-size: 10.5px; margin-bottom: 8px; }
.ad-corner-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--navy, #104681);
}
.ad-corner-text {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted, #4E6479);
}
.ad-corner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.ad-corner .ad-popup-link { padding: 10px 18px; font-size: 13.5px; border-radius: 9px; }
.ad-corner .ad-close--text { padding: 9px 12px; font-size: 13px; border-radius: 9px; }

/* ---------- Promo band (page content, not dismissible) ---------- */
.ad-promo {
  position: relative;
  overflow: hidden;
  padding-block: 64px;
  text-align: start;
  font-family: var(--ff, system-ui, sans-serif);
}
.ad-promo--navy {
  background: linear-gradient(135deg, var(--navy-deep, #0B2D52), var(--navy-solid, #104681) 60%, var(--navy-bright, #1A5A9E));
  color: #fff;
}
.ad-promo--gold {
  background: linear-gradient(135deg, var(--gold, #F7CF28), var(--gold-strong, #EFB90F));
  color: var(--navy-deep, #0B2D52);
}
/* decorative translucent circles / weave */
.ad-promo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle 340px at 86% 18%, rgba(255, 255, 255, .1), transparent 70%),
    radial-gradient(circle 260px at 4% 108%, rgba(var(--gold-rgb, 247, 207, 40), .12), transparent 70%);
}
.ad-promo--gold::before {
  background-image:
    radial-gradient(circle 340px at 86% 18%, rgba(255, 255, 255, .38), transparent 70%),
    radial-gradient(circle 260px at 4% 108%, rgba(var(--navy-rgb, 16, 70, 129), .14), transparent 70%);
}
.ad-promo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.ad-promo-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(var(--navy-overlay-rgb, 9, 36, 66), .9), rgba(var(--navy-overlay-rgb, 9, 36, 66), .55));
}
[dir="rtl"] .ad-promo-overlay { background: linear-gradient(270deg, rgba(var(--navy-overlay-rgb, 9, 36, 66), .9), rgba(var(--navy-overlay-rgb, 9, 36, 66), .55)); }
.ad-promo--gold .ad-promo-overlay { background: linear-gradient(90deg, rgba(var(--gold-strong-rgb, 239, 185, 15), .92), rgba(var(--gold-rgb, 247, 207, 40), .6)); }
[dir="rtl"] .ad-promo--gold .ad-promo-overlay { background: linear-gradient(270deg, rgba(var(--gold-strong-rgb, 239, 185, 15), .92), rgba(var(--gold-rgb, 247, 207, 40), .6)); }
.ad-promo-wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw, 1180px);
  margin: 0 auto;
  padding-inline: 28px;
}
.ad-promo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.ad-promo-eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
[dir="rtl"] .ad-promo-eyebrow { letter-spacing: .02em; }
.ad-promo--navy .ad-promo-eyebrow { color: var(--gold, #F7CF28); }
.ad-promo--gold .ad-promo-eyebrow { color: var(--navy-deep, #0B2D52); }
.ad-promo-title {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.015em;
}
.ad-promo-text {
  margin: 14px 0 0;
  max-width: 640px;
  font-size: 16.5px;
  line-height: 1.7;
}
.ad-promo--navy .ad-promo-text { color: rgba(255, 255, 255, .86); }
.ad-promo--gold .ad-promo-text { color: rgba(var(--navy-deep-rgb, 11, 45, 82), .82); }
.ad-promo-actions { margin-top: 26px; }
.ad-promo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  transition: transform .18s, box-shadow .22s;
}
.ad-promo--navy .ad-promo-link { background: var(--gold, #F7CF28); color: var(--navy-deep, #0B2D52); }
.ad-promo--navy .ad-promo-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(var(--gold-rgb, 247, 207, 40), .55);
}
.ad-promo--gold .ad-promo-link { background: var(--navy-solid, #104681); color: #fff; }
.ad-promo--gold .ad-promo-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -10px rgba(var(--navy-deep-rgb, 11, 45, 82), .5);
}

/* ---------- Countdown ---------- */
.ad-count {
  display: inline-flex;
  gap: 10px;
  margin-top: 18px;
}
.ad-count-cell {
  min-width: 58px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14); /* default: on dark promo band */
  text-align: center;
}
.ad-count-cell b {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.ad-count-cell i {
  font-style: normal;
  font-size: 11px;
  opacity: .75;
  letter-spacing: .06em;
}
[dir="rtl"] .ad-count-cell i { letter-spacing: 0; }
.ad-promo--gold .ad-count-cell { background: rgba(var(--ink-deep-rgb, 7, 30, 56), .12); }
.ad-popup .ad-count-cell,
.ad-corner .ad-count-cell {
  background: rgba(var(--ink-deep-rgb, 7, 30, 56), .07);
  color: var(--navy, #104681);
}
:root[data-theme="dark"] .ad-popup .ad-count-cell,
:root[data-theme="dark"] .ad-corner .ad-count-cell {
  background: rgba(255, 255, 255, .1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ad-popup .ad-count-cell,
  :root:not([data-theme="light"]) .ad-corner .ad-count-cell {
    background: rgba(255, 255, 255, .1);
  }
}

/* ---------- Small screens: bottom sheet ---------- */
@media (max-width: 640px) {
  /* clears the floating WhatsApp button */
  .ad-corner{inset-block-end:80px}

  .ad-banner { padding-inline: 14px 46px; }
  .ad-banner-in { font-size: 13.5px; gap: 4px 10px; }
  .ad-popup { padding: 0; place-items: end center; }
  .ad-popup-card {
    width: 100%;
    border-radius: 22px 22px 0 0;
    animation-name: ad-sheet;
  }
  @keyframes ad-sheet {
    from { opacity: 0; transform: translateY(60%); }
    to { opacity: 1; transform: none; }
  }
  .ad-popup-body { padding: 22px 22px 26px; }
  .ad-popup-title { font-size: 20px; }
  .ad-popup-actions { gap: 10px; }
  .ad-popup-link { flex: 1; justify-content: center; }
  .ad-corner {
    inset-inline: 16px;
    inset-block-end: 16px;
    width: auto;
  }
  .ad-promo { padding-block: 44px; }
  .ad-count { gap: 8px; }
  .ad-count-cell { min-width: 52px; padding: 8px 6px; }
  .ad-count-cell b { font-size: 19px; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .ad-popup-backdrop, .ad-popup-card, .ad-corner { animation: none; }
  .ad-popup-card .ad-close:hover, .ad-corner > .ad-close:hover { transform: none; }
  .ad-popup-link:hover, .ad-promo-link:hover { transform: none; }
}

/* ==== Video media (uploaded clips + YouTube facades) ==== */

/* Uploaded clip in the popup/corner 16:9 media slot */
.ad-media-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--navy-deep, #0B2D52);
}

/* Click-to-play YouTube facade: thumbnail + play button, iframe only on demand */
.ad-yt {
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
  background: var(--navy-deep, #0B2D52);
}
.ad-yt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), opacity .25s;
}
.ad-yt:hover img { transform: scale(1.045); }
.ad-yt-play {
  position: absolute;
  inset: 0;            /* centered via margin:auto — RTL-safe, no translate */
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold, #F7CF28);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px -8px rgba(4, 16, 32, .55);
  transition: transform .18s, box-shadow .22s;
}
.ad-yt-play::before {
  content: "";
  border-style: solid;
  border-width: 11px 0 11px 18px; /* right-pointing triangle — universal play glyph */
  border-color: transparent transparent transparent var(--navy-deep, #0B2D52);
  transform: translateX(2px);     /* optical centering toward the point */
}
.ad-yt:hover .ad-yt-play {
  transform: scale(1.1);
  box-shadow: 0 14px 34px -8px rgba(var(--gold-rgb, 247, 207, 40), .65);
}
.ad-yt iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Promo band: uploaded clip as full-bleed background, under the overlay
   (.ad-promo-overlay follows it in the DOM, so it paints above at z-index 0;
   .ad-promo-wrap content sits at z-index 1 and stays readable) */
.ad-promo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Promo band: YouTube facade as a framed card under the text/actions */
.ad-promo .ad-yt {
  max-width: 560px;
  border-radius: 14px;
  margin-top: 22px;
  box-shadow: 0 4px 14px -6px rgba(4, 16, 32, .35), 0 26px 60px -22px rgba(4, 16, 32, .6);
}

@media (max-width: 640px) {
  .ad-yt-play { width: 54px; height: 54px; }
  .ad-yt-play::before { border-width: 9px 0 9px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-yt img { transition: none; }
  .ad-yt:hover img { transform: none; }
  .ad-yt:hover .ad-yt-play { transform: none; }
}

/* ---------- Clean YouTube player (no YouTube chrome) ---------- */
.ad-yt .ad-yt-frame {
  position: absolute;
  /* aggressive oversize + center-crop: YouTube's title bar (top), watermark and
     suggestions (bottom) are pushed outside the visible window */
  width: 152%;
  height: 164%;
  left: -26%;
  top: -32%;
  border: 0;
  z-index: 1;
  opacity: 1;
  transition: opacity .25s ease;
  /* clicks land on .ad-yt itself, never on YouTube — its hover chrome
     never appears and youtube.com can never be opened from the ad */
  pointer-events: none;
}
/* paused (or not yet started): hide the iframe entirely so NO YouTube UI can
   ever be seen — the poster + play button cover the slot completely */
.ad-yt:not(.playing) .ad-yt-frame { opacity: 0; }
.ad-yt img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  transition: opacity .3s ease;
}
.ad-yt .ad-yt-play {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 3;
  transition: opacity .3s ease, transform .2s ease;
}
.ad-yt.playing img,
.ad-yt.starting .ad-yt-play,
.ad-yt.playing .ad-yt-play { opacity: 0; pointer-events: none; }
.ad-yt.starting img { animation: ad-yt-warm 1.4s ease-in-out infinite; }
@keyframes ad-yt-warm { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.12); } }
@media (prefers-reduced-motion: reduce) { .ad-yt.starting img { animation: none; } }


/* ---------- Sound toggle on native video ads ---------- */
.ad-video-wrap { position: relative; }
.ad-sound {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 12px;
  z-index: 5;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: rgba(7, 30, 56, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(4, 16, 32, .3);
  transition: transform .18s ease, background .18s ease;
}
.ad-sound:hover { transform: scale(1.1); background: rgba(7, 30, 56, .75); }
.ad-sound svg { width: 19px; height: 19px; }
.ad-sound .i-on { display: none; }
.sound-on .ad-sound .i-off { display: none; }
.sound-on .ad-sound .i-on { display: block; }
.ad-media-video { cursor: pointer; }
/* promo band: floating sound button above the overlay */
.ad-video-wrap--promo {
  position: absolute;
  inset-inline-end: 26px;
  bottom: 22px;
  z-index: 4;
}
.ad-video-wrap--promo .ad-sound { position: static; }
