/* ===========================================================================
   Theme MPTV (site d'actualite) - CSS nu, aux couleurs de la plateforme de
   streaming. Point de depart a faire evoluer.
   =========================================================================== */

:root {
  --bg: #070c1c;
  --bg-2: #0b1330;
  --surface: #101a3d;
  --surface-2: #16224e;
  --line: rgba(150, 170, 255, 0.14);
  --line-soft: rgba(150, 170, 255, 0.08);
  --blue: #2f6bff;
  --blue-hi: #5a8bff;
  --red: #e5202e;
  --red-hi: #ff3b48;
  --gold: #f5b301;
  --text: #eaf0ff;
  --muted: #95a2cf;
  --muted-2: #6b78a4;
  --radius: 14px;
  --maxw: 1240px;
  --shadow: 0 18px 50px rgba(2, 6, 20, 0.55);
  --font: 'Archivo', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* --gh-font-body/-heading : polices choisies par l'admin dans Ghost, avec repli sur Archivo */
  font-family: var(--gh-font-body, var(--font));
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4,
.hero-title, .headline-title, .feed-title, .card-title, .article-title, .archive-title, .site-brand-text {
  font-family: var(--gh-font-heading, var(--font));
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.site-main { min-height: 60vh; padding-bottom: 40px; }

.kicker {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--blue-hi);
}
.meta { color: var(--muted); font-size: 13px; font-weight: 500; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 12, 28, 0.82);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue) 22%, var(--red) 78%, transparent);
  opacity: 0.5;
}
.site-header-inner { display: flex; align-items: center; gap: 22px; height: 72px; }
.site-brand img { height: 42px; width: auto; }
.site-brand-text { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }

.site-nav { flex: 1; }
.site-nav .nav { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
.site-nav .nav li a {
  color: var(--muted); font-weight: 600; font-size: 15px; padding: 6px 0;
  border-bottom: 2px solid transparent; transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav .nav li a:hover { color: var(--text); }
.site-nav .nav li.nav-current a { color: var(--text); border-bottom-color: var(--red); }

.site-stream {
  flex: none; font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(180deg, var(--red-hi), var(--red));
  padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 8px 22px rgba(229, 32, 46, 0.35);
}
.site-stream:hover { filter: brightness(1.06); }

/* ---------- Home actu : la une + rail "A la une" ---------- */
.news { padding-top: 28px; }

.news-top {
  display: grid; grid-template-columns: 1.9fr 1fr; gap: 28px;
  padding-bottom: 28px; border-bottom: 1px solid var(--line-soft);
}

.hero {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.18s ease;
}
.hero:hover { border-color: rgba(90, 139, 255, 0.4); }
.hero-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-body { padding: 22px 24px 26px; }
.hero-title { margin: 10px 0 0; font-size: clamp(22px, 2.6vw, 33px); line-height: 1.12; font-weight: 800; }
.hero-excerpt { margin: 12px 0 0; color: var(--muted); font-size: 15.5px; }
.hero .meta { display: block; margin-top: 14px; }

.news-secondary { display: flex; flex-direction: column; }

/* Titres de section, style presse (barre rouge a gauche) */
.rail-title, .section-title, .widget-title {
  margin: 0 0 8px; font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text); position: relative; padding-left: 12px;
}
.rail-title::before, .section-title::before, .widget-title::before {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px;
  border-radius: 2px; background: var(--red);
}
.section-title { margin-bottom: 6px; }

.headline { display: flex; gap: 13px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.headline-img { width: 88px; height: 62px; object-fit: cover; border-radius: 8px; flex: none; }
.headline-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.headline-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.headline:hover .headline-title { color: var(--blue-hi); }

/* ---------- Fil d'articles + aside ---------- */
.news-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; padding: 28px 0 50px; }
.news-main { min-width: 0; }

.feed { display: flex; flex-direction: column; }
.feed-item { border-top: 1px solid var(--line-soft); }
.feed-item:first-child { border-top: 0; }
.feed-link { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; padding: 22px 0; }
.feed-img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; }
.feed-img-empty { display: block; background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); }
.feed-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.feed-title { margin: 2px 0 0; font-size: 20px; line-height: 1.24; font-weight: 700; }
.feed-link:hover .feed-title { color: var(--blue-hi); }
.feed-excerpt { margin: 0; color: var(--muted); font-size: 14.5px; }

/* Aside */
.news-aside { display: flex; flex-direction: column; gap: 24px; align-self: start; position: sticky; top: 92px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 20px; }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li + li { border-top: 1px solid var(--line-soft); }
.widget-list a { display: flex; gap: 12px; align-items: baseline; padding: 11px 0; }
.widget-rank { font-size: 15px; font-weight: 800; color: var(--blue-hi); flex: none; width: 16px; }
.widget-post-title { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.widget-list a:hover .widget-post-title { color: var(--text); }
.widget-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-count { color: var(--muted-2); font-weight: 700; }
.widget-cta p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.widget-btn {
  display: inline-block; font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(180deg, var(--blue-hi), var(--blue)); padding: 9px 16px; border-radius: 999px;
}
.widget-btn:hover { filter: brightness(1.06); }

/* ---------- Grille (archives tag / auteur) ---------- */
.post-list { padding: 30px 0 50px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(90, 139, 255, 0.4); box-shadow: var(--shadow); }
.card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-img-empty { display: block; background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.card-title { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 700; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 20px;
  margin-top: 40px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.pagination a {
  color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.pagination a:hover { border-color: var(--blue); }

/* ---------- Archive (tag / auteur) ---------- */
.archive-head { padding: 40px 0 6px; }
.archive-title { margin: 6px 0 0; font-size: clamp(26px, 3.5vw, 40px); font-weight: 800; }
.archive-desc { margin: 10px 0 0; color: var(--muted); max-width: 620px; }

/* ---------- Article ---------- */
.article { padding-top: 34px; }
.article-head { max-width: 760px; margin: 0 auto 22px; text-align: center; }
.article-title { margin: 10px 0 0; font-size: clamp(28px, 4vw, 46px); line-height: 1.1; font-weight: 800; }
.article-lede { margin: 16px 0 0; font-size: 19px; color: var(--muted); }
.article-meta { margin-top: 16px; }
.article-img {
  width: 100%; max-height: 560px; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line); margin: 8px 0 30px;
}

/* Contenu (cartes Koenig de l'editeur Ghost) */
.gh-content { max-width: 720px; margin: 0 auto; font-size: 18px; line-height: 1.75; }
.gh-content > * + * { margin-top: 1.4em; }
.gh-content h2 { font-size: 1.55em; font-weight: 700; line-height: 1.2; margin-top: 1.8em; }
.gh-content h3 { font-size: 1.25em; font-weight: 700; margin-top: 1.6em; }
.gh-content a { color: var(--blue-hi); text-decoration: underline; text-underline-offset: 3px; }
.gh-content a:hover { color: var(--text); }
.gh-content img,
.gh-content figure { border-radius: var(--radius); }
.gh-content figure { margin-inline: 0; }
.gh-content figcaption { text-align: center; font-size: 13.5px; color: var(--muted-2); margin-top: 8px; }
.gh-content blockquote {
  margin: 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--red);
  color: var(--text); font-size: 1.1em; font-style: italic;
}
.gh-content hr { border: 0; border-top: 1px solid var(--line); }
.gh-content code {
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; font-size: 0.9em;
}
.gh-content pre {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; overflow: auto;
}

/* Largeurs des cartes image de Ghost */
.gh-content .kg-width-wide { width: min(1040px, 92vw); margin-inline: calc(50% - min(520px, 46vw)); max-width: none; }
.gh-content .kg-width-full { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; border-radius: 0; }

.article-tags { max-width: 720px; margin: 34px auto 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tag-chip {
  font-size: 13px; font-weight: 600; color: var(--muted);
  background: rgba(150, 170, 255, 0.08); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px;
}
.tag-chip:hover { color: var(--text); border-color: var(--blue); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative; margin-top: 30px; border-top: 1px solid var(--line-soft);
  padding: 40px 0 48px; color: var(--muted-2);
}
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue) 22%, var(--red) 78%, transparent);
  opacity: 0.4;
}
.site-footer-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-brand img { height: 54px; width: auto; }
.foot-brand p { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); max-width: 380px; }
.foot-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 13px; }
.foot-meta a { color: var(--muted); }
.foot-meta a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .news-top { grid-template-columns: 1fr; gap: 22px; }
  .news-secondary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
  .news-secondary .rail-title { grid-column: 1 / -1; }
  .news-secondary .headline { border-top: 0; flex-direction: column; gap: 8px; }
  .news-secondary .headline-img { width: 100%; height: auto; aspect-ratio: 16 / 10; }
  .news-body { grid-template-columns: 1fr; gap: 8px; }
  .news-aside { position: static; flex-direction: row; flex-wrap: wrap; margin-top: 20px; }
  .news-aside .widget { flex: 1 1 260px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .site-header-inner { height: 62px; gap: 14px; }
  .site-brand img { height: 34px; }
  .site-nav { display: none; }
  .news-secondary { grid-template-columns: 1fr; }
  .news-secondary .headline { flex-direction: row; gap: 12px; border-top: 1px solid var(--line-soft); }
  .news-secondary .headline-img { width: 88px; height: 62px; aspect-ratio: auto; }
  .feed-link { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; }
  .feed-title { font-size: 17px; }
  .feed-excerpt { display: none; }
  .news-aside { flex-direction: column; }
  .grid { grid-template-columns: 1fr; }
  .gh-content, .article-head { font-size: 17px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
  .foot-meta { align-items: flex-start; }
}
