/*
Theme Name: MotoGPInside Sous les Projecteurs
Theme URI: https://motogpinside.com
Author: MotoGPInside
Description: Thème custom "Sous les Projecteurs" — asphalte de nuit, halo de projecteur, chrome, orange incandescent.
Version: 1.0.0
Text Domain: mgp-projecteurs
*/

:root {
  /* Couleurs */
  --mgp-bg: #0b0b0d;
  --mgp-bg-asphalt: #08080a;
  --mgp-bg-raised: #17161a;
  --mgp-cream: #fff4e2;
  --mgp-orange: #ff5a1f;
  --mgp-orange-hover: #ff7440;
  --mgp-chrome: #9aa0a6;
  --mgp-text: #f3efe9;
  --mgp-text-dark: #150a05;
  --mgp-border: #2c2b30;
  --mgp-card-bg: #17161a;
  --mgp-white: #fff4e2;

  /* Typo */
  --mgp-font-heading: 'Big Shoulders Display', Arial, sans-serif;
  --mgp-font-body: 'Inter', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--mgp-bg);
  color: var(--mgp-text);
  font-family: var(--mgp-font-body);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--mgp-font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 0.5em;
}

a { color: var(--mgp-orange); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.mgp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Bouton CTA — pilule, lueur chaude au survol */
.mgp-btn {
  display: inline-block;
  background: var(--mgp-orange);
  color: var(--mgp-text-dark);
  font-family: var(--mgp-font-body);
  font-weight: 600;
  padding: 12px 26px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.mgp-btn:hover {
  background: var(--mgp-orange-hover);
  box-shadow: 0 0 0 6px rgba(255, 90, 31, 0.16), 0 8px 20px -8px rgba(255, 90, 31, 0.55);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Badge — plaque claire façon numéro de course */
.mgp-badge {
  display: inline-block;
  background: var(--mgp-cream);
  color: var(--mgp-text-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 999px;
}

/* Card article */
.mgp-card {
  background: var(--mgp-card-bg);
  border: 1px solid var(--mgp-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}
.mgp-card:hover { border-color: rgba(255, 90, 31, 0.5); }
/* Les images à la une sont parfois servies dans un <picture> (support WebP) et
   parfois en <img> nu selon que le fichier a été converti — les deux cas sont
   couverts pour que le ratio 4:3 s'applique quel que soit le balisage généré. */
.mgp-card picture,
.mgp-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
}
.mgp-card picture img {
  height: 100%;
}
.mgp-card picture img,
.mgp-card img {
  object-fit: cover;
}
.mgp-card .mgp-card-body { padding: 16px; }
.mgp-card p { font-size: 14px; opacity: 0.85; margin: 0 0 12px; }

/* Titre de card — classe découplée du niveau de titre (h2/h3/etc.) */
.mgp-card-title { font-size: 18px; margin-bottom: 8px; }
.mgp-card-title a { color: var(--mgp-cream); }

/* Grille responsive générique */
.mgp-grid { display: grid; gap: 24px; }
.mgp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mgp-grid-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 800px) {
  .mgp-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .mgp-grid-2-1 { grid-template-columns: minmax(0, 1fr); }
}

.mgp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 13, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 244, 226, 0.08);
}
.mgp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  gap: 16px;
}
.mgp-logo { display: flex; align-items: center; line-height: 0; flex-shrink: 0; }
.mgp-logo a { display: inline-block; line-height: 0; }
.mgp-logo span {
  font-family: var(--mgp-font-heading);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mgp-cream);
}
.mgp-logo img,
.mgp-logo picture,
.mgp-logo picture img {
  max-height: 30px;
  width: auto;
  height: auto;
  display: block;
}
.mgp-nav {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 90, 31, 0.4) transparent;
}
.mgp-nav::-webkit-scrollbar { height: 4px; }
.mgp-nav::-webkit-scrollbar-track { background: transparent; }
.mgp-nav::-webkit-scrollbar-thumb { background: rgba(255, 90, 31, 0.4); border-radius: 2px; }

.mgp-nav-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0 0 2px;
}
.mgp-nav-list a {
  display: inline-block;
  white-space: nowrap;
  color: var(--mgp-cream);
  font-family: var(--mgp-font-heading);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.mgp-nav-list a:hover { color: var(--mgp-orange); text-decoration: none; }

/* Hamburger — masqué par défaut, affiché uniquement en mobile (voir media query plus bas) */
.mgp-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.mgp-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--mgp-cream);
}

/* Slideout mobile */
.mgp-slideout {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 280px;
  max-width: 80vw;
  background: var(--mgp-bg-asphalt);
  border-left: 1px solid var(--mgp-border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 300;
  padding: 20px;
  overflow-y: auto;
}
.mgp-slideout.is-open { transform: translateX(0); }
.mgp-slideout-close {
  background: transparent;
  border: none;
  color: var(--mgp-cream);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  margin-bottom: 16px;
}
.mgp-slideout-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mgp-slideout-list li { border-bottom: 1px solid var(--mgp-border); }
.mgp-slideout-list a {
  display: block;
  padding: 14px 4px;
  color: var(--mgp-cream);
  font-family: var(--mgp-font-heading);
  text-transform: uppercase;
  font-size: 15px;
}
.mgp-slideout-list a:hover { color: var(--mgp-orange); text-decoration: none; }
.mgp-slideout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 290;
}
.mgp-slideout-overlay.is-open { opacity: 1; pointer-events: auto; }

@media (max-width: 1400px) {
  .mgp-nav { display: none; }
  .mgp-hamburger { display: flex; }
}

.mgp-footer {
  background: var(--mgp-bg-asphalt);
  border-top: 1px solid var(--mgp-border);
  margin-top: 60px;
  padding: 30px 0;
  font-size: 14px;
}
.mgp-footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.mgp-footer-nav a { color: var(--mgp-chrome); margin-right: 16px; }
.mgp-footer-nav a:hover { color: var(--mgp-orange); }

/* Hero — clair-obscur, halo de projecteur en surimpression sur la photo à la une */
.mgp-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
}
.mgp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 22% 0%, rgba(255, 244, 226, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(11, 11, 13, 0.1) 0%, rgba(11, 11, 13, 0.92) 88%);
  pointer-events: none;
}
.mgp-hero-inner {
  position: relative;
  z-index: 1;
  padding: 44px 20px;
  width: 100%;
}
.mgp-hero h1 { font-size: clamp(28px, 5vw, 50px); margin: 10px 0; }
.mgp-hero h1 a { color: var(--mgp-cream); }

.mgp-seo-intro { font-size: 14px; opacity: 0.75; padding: 16px 0 0; }

.mgp-next-gp-inner {
  background: var(--mgp-card-bg);
  border: 1px solid var(--mgp-border);
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 20px 0;
}
.mgp-countdown, .mgp-countdown-pending {
  font-family: var(--mgp-font-heading);
  color: var(--mgp-orange);
  font-size: 20px;
  text-transform: uppercase;
}

.mgp-classement-widget {
  background: var(--mgp-card-bg);
  border: 1px solid var(--mgp-border);
  padding: 16px;
  border-radius: 10px;
  position: sticky;
  top: 90px;
  align-self: flex-start;
}

.mgp-affiliate-band { margin: 40px 0 20px; text-align: center; }
.mgp-affiliate-band .mgp-btn { width: 100%; text-align: center; }
.mgp-small { font-size: 11px; opacity: 0.6; margin-top: 12px; }

@media (max-width: 800px) {
  .mgp-hero-inner { padding: 24px 16px; }
}

/* single.php — article + sidebar */
.mgp-article { min-width: 0; }
.mgp-article h1 { font-size: clamp(24px, 4vw, 38px); margin: 12px 0; }
.mgp-article > picture,
.mgp-article > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}
.mgp-article > picture > img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
.mgp-article > picture > img,
.mgp-article > img {
  object-fit: cover;
}

/* page.php — pages statiques (guides, etc.), même traitement que single.php */
.mgp-page-main { min-width: 0; }
.mgp-page-main > picture,
.mgp-page-main > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}
.mgp-page-main > picture > img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
.mgp-page-main > picture > img,
.mgp-page-main > img {
  object-fit: cover;
}

/* Pages "guide" générées par un plugin tiers (balisage page-head__*, hors
   contrôle du thème) — même correctif de ratio appliqué par-dessus. */
.page-head__media {
  display: block;
  overflow: hidden;
  border-radius: 8px;
}
.page-head__media img,
.page-head__img {
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  object-fit: cover !important;
}

.mgp-article-content blockquote {
  background: rgba(255, 90, 31, 0.07);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 20px 0;
  font-style: italic;
}
.mgp-article-content blockquote::before {
  content: "\201C";
  display: block;
  font-family: var(--mgp-font-heading);
  font-size: 42px;
  line-height: 1;
  color: var(--mgp-orange);
  margin-bottom: 4px;
  font-style: normal;
}
.mgp-article-content a { text-decoration: underline; }

.mgp-sidebar { position: sticky; top: 90px; align-self: flex-start; }
.mgp-sidebar-block {
  background: var(--mgp-card-bg);
  border: 1px solid var(--mgp-border);
  padding: 16px;
  margin-bottom: 16px;
  border-radius: 10px;
}

.mgp-desktop-only { display: block; }
.mgp-mobile-only { display: none; }
@media (max-width: 800px) {
  .mgp-desktop-only { display: none; }
  .mgp-mobile-only { display: block; margin: 24px 0; padding: 16px; background: var(--mgp-card-bg); border: 1px solid var(--mgp-border); border-radius: 10px; }
}

/* archive.php — pagination */
.mgp-pagination { margin: 40px 0; text-align: center; }
.mgp-pagination .page-numbers {
  display: inline-block;
  background: var(--mgp-card-bg);
  border: 1px solid var(--mgp-border);
  color: var(--mgp-cream);
  padding: 8px 16px;
  margin: 0 4px;
  border-radius: 999px;
}
.mgp-pagination .page-numbers.current { background: var(--mgp-orange); border-color: var(--mgp-orange); color: var(--mgp-text-dark); }

/* header.php — sous-menus en dropdown */
.mgp-nav-list li { position: relative; }
.mgp-nav-list ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--mgp-bg-asphalt);
  border: 1px solid var(--mgp-border);
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  z-index: 200;
}
.mgp-nav-list li:hover > ul,
.mgp-nav-list li:focus-within > ul {
  display: block;
}
.mgp-nav-list ul li { padding: 0; }
.mgp-nav-list ul a {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
}

/* Habillage du contenu existant (pages/articles déjà rédigés avant la refonte) —
   sans ça, le contenu ancien reste visuellement neutre et ne porte aucune des
   touches "Sous les Projecteurs" (accent orange, tableaux stylés, listes, etc.) */
.mgp-article-content h2 {
  padding-top: 16px;
}
.mgp-article-content h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 12px;
  background: var(--mgp-orange);
}
.mgp-article-content h3 { color: var(--mgp-orange); }
.mgp-article-content .wp-block-table {
  overflow-x: auto;
}
.mgp-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: transparent;
}
.mgp-article-content table th {
  background: var(--mgp-card-bg);
  color: var(--mgp-orange);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--mgp-orange);
  font-family: var(--mgp-font-heading);
  text-transform: uppercase;
  font-size: 13px;
  white-space: nowrap;
}
.mgp-article-content table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--mgp-border) !important;
  font-size: 14px;
  color: var(--mgp-text);
  background: transparent !important;
}
/* Neutralise le style "rayures" gris clair de WordPress (pensé pour un thème clair) */
.mgp-article-content table.has-fixed-layout,
.mgp-article-content .is-style-stripes table,
.mgp-article-content table tbody tr {
  background: transparent !important;
}
.mgp-article-content .is-style-stripes tbody tr:nth-child(odd),
.mgp-article-content table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.04) !important;
}
.mgp-article-content table tbody tr:first-child td {
  color: var(--mgp-orange);
  font-weight: 700;
}
.mgp-article-content ul,
.mgp-article-content ol {
  padding-left: 20px;
}
.mgp-article-content ul li::marker { color: var(--mgp-orange); }
.mgp-article-content ol li::marker { color: var(--mgp-orange); font-weight: 700; }
.mgp-article-content img,
.mgp-article-content figure img {
  border-radius: 8px;
  width: 100%;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  object-fit: cover !important;
}
.mgp-article-content figure { margin: 20px 0; }
.mgp-article-content figcaption {
  font-size: 13px;
  opacity: 0.7;
  text-align: center;
  margin-top: 6px;
}
.mgp-article-content > *:first-child { margin-top: 0; }

/* Calendrier — grille dynamique [mgp_calendrier] */
.mgp-calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0;
}
.mgp-cal-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--mgp-card-bg);
  border: 1px solid var(--mgp-border);
  border-radius: 10px;
  padding: 16px 20px;
  transition: border-color 0.2s ease;
}
.mgp-cal-row:hover { border-color: rgba(255, 90, 31, 0.5); }
.mgp-cal-row.is-done { opacity: 0.72; }
.mgp-cal-round {
  font-family: var(--mgp-font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--mgp-orange);
  width: 44px;
  flex-shrink: 0;
  text-align: center;
}
.mgp-cal-row.is-done .mgp-cal-round { color: var(--mgp-text); opacity: 0.5; }
.mgp-cal-main { flex: 1; min-width: 0; }
.mgp-cal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.mgp-badge-muted {
  background: transparent;
  border: 1px solid var(--mgp-border);
  color: var(--mgp-text);
  opacity: 0.75;
}
.mgp-cal-dates {
  font-family: var(--mgp-font-heading);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.65;
}
.mgp-cal-title {
  font-size: 18px;
  margin: 0 0 2px;
  text-transform: none;
}
.mgp-cal-circuit {
  font-size: 13px;
  opacity: 0.65;
  margin: 0;
}
.mgp-cal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.mgp-btn-sm { padding: 8px 18px; font-size: 13px; }
.mgp-btn-outline {
  display: inline-block;
  background: transparent;
  border: 1.5px solid var(--mgp-border);
  color: var(--mgp-text);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 999px;
}
.mgp-btn-outline:hover { border-color: var(--mgp-orange); color: var(--mgp-orange); text-decoration: none; }

@media (max-width: 700px) {
  .mgp-cal-row { flex-wrap: wrap; }
  .mgp-cal-actions { width: 100%; margin-top: 4px; padding-left: 64px; }
}
