/* ═══════════════════════════════════════════════════════
   SalaireQC.ca — Styles Publicitaires
   Tous les emplacements : sticky, inline, vidéo, flottant
   ═══════════════════════════════════════════════════════ */

/* ── Variables couleurs pub ─────────────────────────── */
:root {
  --ad-bg: #f8fafc;
  --ad-border: #e2e8f0;
  --ad-text: #94a3b8;
  --ad-tag-bg: #f1f5f9;
  --ad-tag-text: #64748b;
  --ad-video-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* ── Label "Pub" générique ──────────────────────────── */
.ad-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ad-tag-bg);
  color: var(--ad-tag-text);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--ad-border);
  white-space: nowrap;
}
.ad-tag-small {
  font-size: 0.6rem;
  color: var(--ad-text);
}

/* ── Placeholder générique ──────────────────────────── */
.ad-placeholder {
  background: var(--ad-bg);
  border: 1.5px dashed var(--ad-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s;
}
.ad-placeholder:hover { border-color: var(--accent); }

.ad-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
}

.ad-icon {
  width: 28px; height: 28px;
  color: #cbd5e1;
  flex-shrink: 0;
}

.ad-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ad-text);
  letter-spacing: 0.03em;
}

.ad-dims {
  font-size: 0.68rem;
  color: #cbd5e1;
  font-family: monospace;
}

/* ════════════════════════════════════════════════════
   1. BANNIÈRE STICKY TOP
   ════════════════════════════════════════════════════ */
.ad-sticky-top {
  position: fixed;
  top: 60px;   /* hauteur du header */
  left: 0; right: 0;
  z-index: 900;
  background: #fff;
  border-bottom: 1px solid var(--ad-border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.ad-sticky-top-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.ad-placeholder-bar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ad-text);
  background: var(--ad-bg);
  border: 1.5px dashed var(--ad-border);
  border-radius: 6px;
  padding: 8px 16px;
  min-height: 38px;
}

.ad-close-top, .ad-close-bottom {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ad-text);
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ad-close-top:hover, .ad-close-bottom:hover {
  background: var(--ad-tag-bg);
  color: var(--text);
}

/* Offset du contenu pour la sticky top */
.site-header + .ad-sticky-top + * {
  padding-top: 60px;
}

/* ════════════════════════════════════════════════════
   2. BARRE ANCHOR BOTTOM
   ════════════════════════════════════════════════════ */
.ad-sticky-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 900;
  background: #fff;
  border-top: 1px solid var(--ad-border);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  animation: slideUp 0.35s ease;
}

.ad-sticky-bottom-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ════════════════════════════════════════════════════
   3. VIDÉO FLOTTANTE (coin bas-droite)
   ════════════════════════════════════════════════════ */
.ad-floating-video {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 950;
  width: 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 1px solid var(--ad-border);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ad-float-in {
  animation: floatIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.ad-float-out {
  animation: floatOut 0.3s ease forwards;
}

@keyframes floatIn {
  from { transform: scale(0.5) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);       opacity: 1; }
}

@keyframes floatOut {
  from { transform: scale(1);    opacity: 1; }
  to   { transform: scale(0.5); opacity: 0; }
}

/* Version minimisée au scroll */
.ad-floating-video.ad-float-mini {
  width: 180px;
}
.ad-floating-video.ad-float-mini .ad-float-video-area { height: 101px; }
.ad-floating-video.ad-float-mini .ad-float-footer { display: none; }

.ad-float-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--ad-border);
}

.ad-float-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
}

.ad-float-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.ad-float-close:hover { background: var(--surface2); color: var(--text); }

.ad-float-video-area {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  position: relative;
  overflow: hidden;
  transition: height 0.3s;
}

.ad-float-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
}

.ad-float-play {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}
.ad-float-play:hover { background: rgba(14,165,233,0.5); }

.ad-float-dims {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.4);
  font-family: monospace;
}

/* Barre de progression animée */
.ad-video-timer-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
}
.ad-video-timer-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  animation: videoProgress 15s linear infinite;
}
@keyframes videoProgress {
  from { width: 0%; }
  to   { width: 100%; }
}

.ad-float-footer {
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--ad-border);
}

/* ════════════════════════════════════════════════════
   4. ADS INLINE (dans le contenu)
   ════════════════════════════════════════════════════ */
.ad-slot-wrapper {
  margin: 24px 0;
  text-align: center;
}

.ad-slot-wrapper .ad-placeholder {
  max-width: 100%;
  min-height: 100px;
}

/* 300×250 rectangle */
.ad-type-inline-rect .ad-placeholder {
  max-width: 336px;
  min-height: 280px;
  margin: 0 auto;
}

/* Bannière large */
.ad-type-inline-banner .ad-placeholder {
  min-height: 95px;
}

/* Sidebar ad */
.sidebar-ad-slot { margin-top: 16px; }
.sidebar-ad-slot .ad-placeholder {
  width: 100%;
  min-height: 250px;
}

/* ════════════════════════════════════════════════════
   5. VIDÉO INLINE (dans les articles)
   ════════════════════════════════════════════════════ */
.ad-video-slot {
  margin: 28px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--ad-border);
}

.ad-video-inner {
  background: var(--surface);
}

.ad-video-player-mock {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--ad-video-bg);
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.ad-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.ad-video-play-btn {
  width: 56px; height: 56px;
  background: rgba(14,165,233,0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  box-shadow: 0 4px 16px rgba(14,165,233,0.4);
  transition: transform 0.2s;
  cursor: pointer;
}
.ad-video-play-btn:hover { transform: scale(1.1); }

.ad-video-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ad-video-title {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
}

.ad-video-timer-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
}

.ad-video-caption {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
}

/* ════════════════════════════════════════════════════
   6. AD dans la grille du blog
   ════════════════════════════════════════════════════ */
.article-card-ad {
  border-radius: var(--radius);
  overflow: hidden;
}

/* ════════════════════════════════════════════════════
   7. SLOTS déjà en place (index.html, etc.)
   ════════════════════════════════════════════════════ */
.ad-slot {
  margin: 20px auto;
  text-align: center;
}

.ad-banner {
  width: 100%;
  min-height: 90px;
  background: var(--ad-bg);
  border: 1.5px dashed var(--ad-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--ad-text);
}

.ad-inline {
  max-width: 728px;
  min-height: 90px;
  margin: 0 auto;
}

.ad-video {
  max-width: 640px;
  min-height: 200px;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════════
   8. RESPONSIVE
   ════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ad-floating-video {
    width: 260px;
    bottom: 70px;
    right: 10px;
  }

  .ad-sticky-top {
    top: 56px;
  }

  /* Masquer vidéo flottante sur très petit écran */
  @media (max-width: 360px) {
    .ad-floating-video { display: none !important; }
  }
}

/* ── Espacements padding-bottom pour anchor bottom ── */
body { padding-bottom: 64px; }
