/* ============ Base ============ */
:root {
  --bg: #17181c;
  --bg-alt: #1e2026;
  --surface: #24262e;
  --border: #33363f;
  --text: #e6e6ea;
  --muted: #9b9da6;
  --accent: #d0a24c;
  --accent-soft: rgba(208, 162, 76, 0.12);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --container: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(23, 24, 28, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo { border-radius: 50%; }

.brand-text {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.25;
}

.brand-text small {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}

.main-nav a:hover { color: var(--text); }

.main-nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ============ Sections ============ */
main { min-height: 60vh; }

.section { padding: 2.75rem 0; }

.section-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1.1rem;
}

.section-sub {
  color: var(--muted);
  margin: -0.5rem 0 1.5rem;
  font-size: 0.95rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.link-more {
  font-size: 0.9rem;
  text-decoration: none;
}

.link-more:hover { text-decoration: underline; }

/* ============ Intro ============ */
.intro {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

.intro h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
  margin: 0 0 0.9rem;
}

.intro-text {
  max-width: 640px;
  color: var(--muted);
  margin: 0 0 1.6rem;
}

.intro-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* ============ Boutons ============ */
.btn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #1c1608;
}

.btn-primary:hover { background: #ddb264; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover { border-color: var(--muted); }

.btn-small { padding: 0.4rem 0.9rem; font-size: 0.85rem; }

/* ============ Lecteur / vidéo à la une ============ */
.featured-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.featured-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.featured-caption {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.7rem 0 0;
}

.player-section { padding-top: 0; }

.player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.player-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.98rem;
}

/* ============ Grille accueil (plus vues) ============ */
.video-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.video-grid .card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.video-grid .card:hover { border-color: var(--muted); }

.video-grid a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.card-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.card-body { padding: 0.7rem 0.8rem 0.85rem; }

.card-title {
  margin: 0 0 0.3rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

/* ============ Thématiques ============ */
.topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.topic {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
}

.topic h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.topic p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ============ Plateformes ============ */
.platforms {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.platforms a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.platforms a:hover { border-color: var(--accent); }

.platforms svg { flex-shrink: 0; color: var(--accent); }

.platforms span { display: flex; flex-direction: column; line-height: 1.35; }

.platforms strong { font-size: 0.95rem; }

.platforms small { color: var(--muted); font-size: 0.8rem; }

/* ============ Page vidéos ============ */
.page-head { padding-bottom: 0.5rem; }

.page-head h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin: 0 0 0.6rem;
}

.list-section { padding-top: 1rem; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.25rem;
}

.tabs button {
  background: none;
  border: 0;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.87rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tabs button:hover { color: var(--text); }

.tabs button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar-right {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

#searchInput, #sortSelect {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  padding: 0.5rem 0.8rem;
}

#searchInput { width: 240px; }

#searchInput:focus, #sortSelect:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.result-count {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.4rem 0 1.1rem;
}

/* Liste détaillée */
.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.video-row {
  display: flex;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem;
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.video-row:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.video-row.playing { border-color: var(--accent); }

.row-thumb {
  position: relative;
  flex-shrink: 0;
  width: 168px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

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

.row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}

.row-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge-live { color: #e07a5f; border-color: rgba(224, 122, 95, 0.4); }
.badge-short { color: #7fb3d5; border-color: rgba(127, 179, 213, 0.4); }
.badge-video { color: var(--accent); border-color: rgba(208, 162, 76, 0.4); }

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 0;
}

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2.2rem 0;
  margin-top: 2rem;
}

.footer-inner { text-align: center; }

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 0.6rem;
}

.footer-links {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-links span { margin: 0 0.4rem; }

.footer-note {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem 1rem;
  }

  .main-nav.open { display: flex; }

  .main-nav a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }

  .main-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

  .brand-text small { display: none; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { width: 100%; }
  #searchInput { flex: 1; width: auto; }

  .row-thumb { width: 128px; }
  .row-title { font-size: 0.88rem; }
}

@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
  .row-thumb { width: 110px; }
  .row-meta { font-size: 0.74rem; }
}
