/* ============================================================
   CPULSE.TV — STYLES SPÉCIFIQUES AUX PAGES
   Watch, Live, Magazine, Explore
   ============================================================ */

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  padding-top: calc(var(--nav-height) + var(--space-16));
  padding-bottom: var(--space-12);
  background: linear-gradient(180deg, var(--bg-section) 0%, var(--bg-page) 100%);
  position: relative;
  overflow: hidden;
  color: var(--text-page);
  transition: background var(--duration-base) var(--ease-out);
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: -10%;
  width: 50%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 70, 255, 0.08), transparent 70%);
  pointer-events: none;
}

.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.page-header .breadcrumb a:hover { color: var(--accent); }

.page-header h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-6);
  color: var(--text-page);
  text-transform: uppercase;
}

.page-header h1 .accent {
  font-style: italic;
  color: var(--accent);
  font-variation-settings: "opsz" 144;
}

.page-header .lede {
  max-width: 60ch;
  font-size: var(--text-lg);
  color: var(--text-muted);
}

/* ============================================================
   WATCH PAGE
   ============================================================ */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-12);
  padding: var(--space-12) 0;
}

.player-wrapper {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.player-wrapper iframe,
.player-wrapper > div {
  width: 100%;
  height: 100%;
}

.player-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--ink) 0%, var(--royal) 100%);
  color: var(--paper);
  text-align: center;
  padding: var(--space-8);
}

.watch-title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: var(--space-8) 0 var(--space-4);
  text-transform: uppercase;
}

.watch-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border-page);
}

.watch-meta strong { color: var(--text-page); font-weight: 600; }

.watch-actions {
  display: flex;
  gap: var(--space-3);
  margin-left: auto;
}

.watch-description {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--border-page);
}

.watch-description p {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--text-muted);
}

.watch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.watch-tag {
  padding: var(--space-1) var(--space-3);
  background: var(--bg-section);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-page);
  transition: all var(--duration-fast) var(--ease-out);
}

.watch-tag:hover {
  background: var(--cobalt);
  color: var(--snow);
}

/* Up next / sidebar */
.upnext {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.upnext-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-page);
}

.upnext-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  text-transform: uppercase;
}

.upnext-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.upnext-item:hover {
  background: var(--bg-section);
}

.upnext-thumb {
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated);
}

.upnext-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upnext-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.upnext-cat {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}

.upnext-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-page);
}

.upnext-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================================
   LIVE PAGE
   ============================================================ */
.live-featured {
  position: relative;
  aspect-ratio: 21/9;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--ink);
  margin-bottom: var(--space-12);
}

.live-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-featured-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.4) 0%, rgba(10, 14, 26, 0.9) 100%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-8);
  color: var(--paper);
}

.live-featured-content {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  max-width: 70%;
}

.live-featured-content .live-badge {
  padding: var(--space-2) var(--space-4);
  background: var(--live);
  color: var(--snow);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  flex-shrink: 0;
  align-self: flex-start;
}

.live-featured-content .live-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--snow);
  animation: pulse 1.5s ease-in-out infinite;
}

.live-featured h2 {
  color: var(--paper);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 600;
  margin: var(--space-3) 0 var(--space-2);
  text-transform: uppercase;
}

.live-featured p {
  color: rgba(250, 247, 240, 0.8);
  font-size: var(--text-base);
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.live-card {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--ink);
  cursor: pointer;
}

.live-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms var(--ease-out);
}

.live-card:hover img { transform: scale(1.05); }

.live-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 14, 26, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-4);
  color: var(--paper);
}

.live-card .live-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: var(--live);
  color: var(--snow);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
}

.live-card h4 {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
}

.live-card p {
  font-size: var(--text-sm);
  color: rgba(250, 247, 240, 0.7);
  margin: 0;
}

/* ============================================================
   MAGAZINE / EDITORIAL
   ============================================================ */
.mag-hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--nav-height) + var(--space-16)) 0 var(--space-16);   /* l'eyebrow doré touchait la nav fixe (top = 72 px) */
  margin-bottom: var(--space-16);
  overflow: hidden;
}

.mag-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.mag-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mag-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 26, 0.3) 0%, rgba(10, 14, 26, 0.85) 100%);
}

.mag-hero-content {
  position: relative;
  z-index: 1;
  color: var(--paper);
  max-width: 80ch;
}

.mag-hero-content .eyebrow {
  color: var(--gold);
  margin-bottom: var(--space-6);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-transform: uppercase;
}

.mag-hero-content .eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--gold);
}

.mag-hero-content h1 {
  color: var(--paper);
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: var(--space-6);
  text-transform: uppercase;
}

.mag-hero-content .lede {
  color: rgba(250, 247, 240, 0.85);
  font-size: var(--text-lg);
  max-width: 60ch;
  margin-bottom: var(--space-8);
}

.mag-hero-content .btn {
  background: var(--paper);
  color: var(--ink);
}

.mag-hero-content .btn:hover {
  background: var(--gold);
  color: var(--ink);
}

.mag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-12);
}

.mag-card {
  cursor: pointer;
}

.mag-card-image {
  aspect-ratio: 3/4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  margin-bottom: var(--space-6);
}

.mag-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms var(--ease-out);
}

.mag-card:hover .mag-card-image img {
  transform: scale(1.04);
}

.mag-card-cat {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.mag-card h3 {
  font-size: var(--text-2xl);
  font-weight: 500;
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: uppercase;
}

.mag-card:hover h3 { color: var(--accent); }

.mag-card p {
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.5;
  margin-bottom: var(--space-4);
}

.mag-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   EXPLORE / FILTERS
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6) 0;
  flex-wrap: wrap;
}

.filter-select {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-page);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-select:hover { border-color: var(--text-page); }

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--border-page);
}

.filter-view {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  border: 1px solid var(--border-page);
  border-radius: var(--radius-full);
  padding: var(--space-1);
}

.filter-view button {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-out);
}

.filter-view button.active {
  background: var(--text-page);
  color: var(--bg-page);
}

/* ============================================================
   EXPLORE — StreamVid-style sidebar layout (09/2026)
   ============================================================ */
.explore-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--space-10);
  align-items: start;
  padding-block: var(--space-8) var(--space-24);
}

.explore-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-6));
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-height: calc(100vh - var(--nav-height) - var(--space-12));
  overflow-y: auto;
  padding: var(--space-4);
  border-right: 1px solid var(--border-page);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.explore-sidebar-close {
  display: none;
  align-self: flex-end;
  background: transparent;
  border: 1px solid var(--border-page);
  border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  color: var(--text-page);
  margin-bottom: var(--space-2);
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-page);
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-page);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all var(--duration-fast) var(--ease-out);
}

.sidebar-link:hover {
  background: var(--bg-elevated);
  color: var(--accent);
}

.sidebar-link.active {
  background: var(--main);
  color: #FFFFFF;
}
.sidebar-link.active .sidebar-link-count {
  background: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
}

.sidebar-link-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-link-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: var(--space-2);
}

.sidebar-ch-dot {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  background: var(--c);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.sidebar-list-radio {
  gap: var(--space-1);
}
.sidebar-list-radio label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-page);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar-list-radio label:hover { background: var(--bg-elevated); }
.sidebar-list-radio input[type="radio"] {
  accent-color: var(--main);
  width: 16px; height: 16px;
}

.sidebar-reset {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-input);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  margin-top: var(--space-2);
  transition: all var(--duration-fast) var(--ease-out);
}
.sidebar-reset:hover {
  color: var(--coral);
  border-color: var(--coral);
}

.explore-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.filter-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-page);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  cursor: pointer;
}
.filter-toggle:hover { border-color: var(--main); color: var(--main); }

body.sidebar-open { overflow: hidden; }
body.sidebar-open::after {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

/* Mobile : sidebar en offcanvas */
@media (max-width: 900px) {
  .explore-layout {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  .explore-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: min(320px, 85vw);
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 100;
    background: var(--bg-page);
    border-right: 1px solid var(--border-page);
    padding: var(--space-6);
    transform: translateX(-100%);
    transition: transform var(--duration-base) var(--ease-out);
    box-shadow: var(--shadow-xl);
  }
  .explore-sidebar.open { transform: translateX(0); }
  .explore-sidebar-close { display: inline-grid; place-items: center; }
  .filter-toggle { display: inline-flex; }
}

/* Video grid list view */
.video-grid-list .video-card {
  flex-direction: row;
  align-items: stretch;
}
.video-grid-list .video-card .video-thumb {
  flex: 0 0 280px;
  margin-bottom: 0;
  margin-right: var(--space-6);
  aspect-ratio: 16/9;
}

/* ============================================================
   ANIMATIONS AU SCROLL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 560ms; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px) {
  .watch-layout { grid-template-columns: 1fr; }
  .live-grid { grid-template-columns: repeat(2, 1fr); }
  .mag-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .live-grid { grid-template-columns: 1fr; }
  .mag-grid { grid-template-columns: 1fr; }
  .live-featured { aspect-ratio: 16/9; }
  .live-featured-content { max-width: 100%; flex-direction: column; align-items: flex-start; }
  .watch-actions { margin-left: 0; }
}

/* ============================================================
   CORRECTIFS AUDIT DESIGN — gouttières, pages sombres, mobile
   ============================================================ */
/* explore.html:56 et mag.html:23,26 posent `padding: X 0 Y` en inline sur une .container,
   ce qui annule son padding latéral : grilles collées aux bords à toutes les largeurs.
   Hotfix à retirer quand ces pages passeront à `padding-block: X Y`. */
section.container[style*="padding"] {
  padding-left: var(--container-pad) !important;
  padding-right: var(--container-pad) !important;
}

/* Direct (live.html) / Programme (epg.html) : libellés mono 9-11 px à 45-60 % d'opacité
   → 11 px minimum, ≥ 70 % (AA sur encre). `body` ajoute la spécificité face aux <style> inline. */
body .epg-channel-tagline, body .epg-program-time, body .epg-program-cat,
body .on-now-card-channel, body .highlight-card-meta, body .epg-hours,
body .channel-tab-meta, body .channel-overview-card-meta, body .program-slot-meta { font-size: 11px; }
body .epg-now-line::before { font-size: 11px; color: var(--live-on-dark); }
body .epg-program-time { color: rgba(250, 247, 240, 0.8); }
body .epg-program-cat, body .epg-channel-tagline, body .highlight-card-meta, body .epg-hours,
body .channel-tab-meta, body .channel-overview-card-num, body .channel-overview-card-meta,
body .program-slot-meta { color: rgba(250, 247, 240, 0.72); }
body .epg-program.now .epg-program-time,
body .epg-program.now .epg-program-cat { color: rgba(10, 14, 26, 0.75); }
body .time-slot { min-height: 44px; display: inline-flex; align-items: center; }
body .channel-tab { min-height: 48px; }
/* Onglet de chaîne actif : texte blanc sur or CPULSE 2 (1.6:1) et sur vert CPULSE 4 (2.5:1) → encre */
body .channel-tab.active[style*="F5C518"],
body .channel-tab.active[style*="10B981"] { color: var(--ink); }
body .channel-tab.active[style*="F5C518"] .channel-tab-meta,
body .channel-tab.active[style*="10B981"] .channel-tab-meta { color: rgba(10, 14, 26, 0.75); }

/* Article : « Par X · date · N min » éclaté sur trois lignes à 375 px */
.article-hero .meta span { white-space: nowrap; }

@media (max-width: 768px) {
  /* Newsletter mag.html:29 : grille inline 1fr 1fr sans point de rupture → document de 437 px, hamburger hors écran */
  .section > .container[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .mag-hero { min-height: 60vh; }
  .filter-bar { gap: var(--space-2); }
  .filter-select { flex: 1 1 45%; }
}
