/*
Theme Name: GeneratePress Child
Template:   generatepress
Version:    1.0.0
Description: Thème enfant GeneratePress — Les 3 Routes (magazine auto/moto/assurance)
*/

/* =========================================================
   DESIGN TOKENS — extraits du contrat (hero-original.png)
   ========================================================= */
:root {
  --l3-red:          #E52421;
  --l3-red-dark:     #C41C1A;
  --l3-ink:          #111111;
  --l3-text:         #111111;
  --l3-text-soft:    #6B7280;
  --l3-bg:           #FFFFFF;
  --l3-bg-soft:      #F7F7F5;
  --l3-border:       #E5E7EB;
  --l3-overlay:      rgba(11,11,11,.70);
  --l3-maxw:         1240px;
  --l3-radius:       6px;
  --l3-header-h:     64px;
}

/* =========================================================
   RESET GLOBAL — kill padding body / article GP
   ========================================================= */
html body,
html body[class] {
  background-color: var(--l3-bg) !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Kill sélecteurs GP base --base-3 */
html body .container,
html body #page,
html body #content,
html body main,
html body .site-main,
html body .inside-page-header {
  background-color: transparent !important;
}

/* L'article GP wrapper peut déborder — reset propre */
html body article:not([class*="l3-"]) { padding: 0 !important; margin: 0 !important; }

/* =========================================================
   ADMIN BAR — compenser top quand connecté (§27)
   ========================================================= */
body.admin-bar .l3-site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .l3-site-header { top: 46px; }
}

/* =========================================================
   HEADER STICKY (§28 : sticky = zéro padding-top body)
   ========================================================= */
.l3-site-header {
  position: sticky;
  top: 0;
  z-index: 9999;
  height: var(--l3-header-h);
  background: var(--l3-ink);
  display: flex;
  align-items: center;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.l3-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--l3-maxw);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  gap: 24px;
}

/* Logo */
.l3-logo { display: flex; flex-direction: column; line-height: 1; text-decoration: none; flex-shrink: 0; }
.l3-logo-text {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(18px, 2vw, 24px);
  color: #fff;
  letter-spacing: .02em;
}
.l3-logo-text .rouge { color: var(--l3-red); }
.l3-logo-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,.55);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav principale — centrée entre logo et actions */
.l3-nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.l3-nav-link {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.l3-nav-link:hover,
.l3-nav-link.is-active {
  color: #fff;
  background: rgba(255,255,255,.10);
}
.l3-nav-link.is-active { color: var(--l3-red); background: transparent; }

/* Actions header droite — poussé à l'extrême droite (mobile : margin-left auto) */
.l3-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

/* Bouton recherche (§80 : padding:0 + svg flex-shrink:0) */
.l3-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  color: rgba(255,255,255,.80) !important;
  cursor: pointer;
  padding: 0 !important;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.l3-search-btn svg { flex-shrink: 0; }
.l3-search-btn:hover,
.l3-search-btn:focus {
  background: rgba(255,255,255,.12) !important;
  background-color: rgba(255,255,255,.12) !important;
  color: #fff !important;
}

/* Search overlay */
.l3-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(11,11,11,.85);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.l3-search-overlay.open { display: flex; }
.l3-search-form {
  display: flex;
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.l3-search-input {
  flex: 1;
  border: 0;
  padding: 16px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  color: var(--l3-ink);
  outline: none;
  /* clamp §86 */
  width: clamp(260px, 50vw, 600px);
}
.l3-search-submit {
  background: var(--l3-red) !important;
  border: 0 !important;
  color: #fff !important;
  padding: 0 20px !important;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.l3-search-submit:hover { background: var(--l3-red-dark) !important; }
.l3-search-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent !important;
  border: 0 !important;
  color: #fff !important;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 0 !important;
}

/* Burger mobile */
.l3-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  color: #fff !important;
  cursor: pointer;
  padding: 0 !important;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.l3-burger:hover,
.l3-burger:focus {
  background: rgba(255,255,255,.12) !important;
  background-color: rgba(255,255,255,.12) !important;
  color: #fff !important;
}
.l3-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  margin: 0 auto;
  transition: all .2s;
}

/* Menu mobile */
.l3-mobile-nav {
  display: none;
  flex-direction: column;
  background: #1a1a1a;
  position: fixed;
  top: var(--l3-header-h);
  left: 0;
  right: 0;
  z-index: 9998;
  padding: 16px 0 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.l3-mobile-nav.open { display: flex; }
.l3-mobile-nav a {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  transition: color .15s, background .15s;
}
.l3-mobile-nav a:hover { color: var(--l3-red); background: rgba(255,255,255,.04); }
.l3-mobile-nav a.is-active { color: var(--l3-red); }

/* =========================================================
   RESPONSIVE HEADER
   ========================================================= */
@media (max-width: 900px) {
  .l3-nav { display: none; }
  .l3-burger { display: flex; }
  /* Logo à gauche — limiter sa largeur pour laisser place aux boutons */
  .l3-logo { max-width: calc(100% - 100px); flex-shrink: 1; }
  .l3-logo-sub { display: none; }
  /* Actions poussées à l'extrême droite, burger toujours visible */
  .l3-header-actions { margin-left: auto; flex-shrink: 0; }
  .l3-burger { flex-shrink: 0; }
}

/* =========================================================
   WRAPPER PAGES
   ========================================================= */
.l3-container {
  max-width: var(--l3-maxw);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 768px) { .l3-container { padding: 0 16px; } }

/* =========================================================
   FOOTER
   ========================================================= */
.l3-footer {
  background: #111;
  color: rgba(255,255,255,.75);
  margin-top: 0 !important;
}

.l3-footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: var(--l3-maxw);
  margin: 0 auto;
  padding: 56px 24px 40px;
}
@media (max-width: 900px) {
  .l3-footer-top { grid-template-columns: 1fr 1fr; gap: 32px; padding: 40px 16px 32px; }
}
@media (max-width: 540px) {
  .l3-footer-top { grid-template-columns: 1fr; gap: 24px; padding: 32px 16px 24px; }
}

.l3-footer-brand {}
.l3-footer-logo {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 12px;
}
.l3-footer-logo .rouge { color: var(--l3-red); }
.l3-footer-desc {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,.60);
  margin: 0 0 20px;
}
.l3-footer-rs {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.l3-footer-rs a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.l3-footer-rs a:hover { background: var(--l3-red); color: #fff; }

.l3-footer-col h4 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 16px;
}
.l3-footer-col ul { margin: 0; padding: 0; list-style: none; }
.l3-footer-col ul li { margin: 0 0 10px; }
.l3-footer-col ul li a {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,.60);
  text-decoration: none;
  transition: color .15s;
}
.l3-footer-col ul li a:hover { color: #fff; }

.l3-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  max-width: var(--l3-maxw);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 768px) { .l3-footer-bottom { padding: 16px; flex-direction: column; text-align: center; } }

.l3-footer-copy {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,.40);
}
.l3-footer-legal { display: flex; gap: 20px; flex-wrap: wrap; }
.l3-footer-legal a {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,.40);
  text-decoration: none;
  transition: color .15s;
}
.l3-footer-legal a:hover { color: rgba(255,255,255,.75); }

/* =========================================================
   FRONT-PAGE — HERO "À LA UNE"
   ========================================================= */
.l3-hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2px;
  background: #000;
  min-height: 480px;
}
@media (max-width: 900px) {
  .l3-hero { grid-template-columns: 1fr; min-height: auto; }
}

.l3-hero-main {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
}
.l3-hero-main-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.l3-hero-main-overlay {
  position: absolute;
  inset: 0;
  background: var(--l3-overlay);
}
.l3-hero-main-content {
  position: relative;
  z-index: 2;
  padding: 40px;
  width: 100%;
}
@media (max-width: 768px) { .l3-hero-main-content { padding: 24px 20px; } }

.l3-eyebrow {
  display: inline-block;
  background: var(--l3-red);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
}

.l3-hero-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.5vw, 42px);
  line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
}

.l3-hero-excerpt {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: rgba(255,255,255,.80);
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 560px;
}

.l3-btn-read {
  display: inline-block;
  background: var(--l3-red);
  color: #fff !important;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  padding: 10px 20px;
  border-radius: var(--l3-radius);
  text-decoration: none;
  text-transform: uppercase;
  transition: background .15s;
}
.l3-btn-read:hover { background: var(--l3-red-dark); }

/* Colonne secondaires hero */
.l3-hero-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.l3-hero-card-s {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 150px;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
}
.l3-hero-card-s img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.l3-hero-card-s:hover img { transform: scale(1.04); }
.l3-hero-card-s-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11,11,11,.80) 0%, rgba(0,0,0,.10) 60%);
}
.l3-hero-card-s-content {
  position: relative;
  z-index: 2;
  padding: 14px 16px;
  width: 100%;
}
.l3-hero-card-s-cat {
  display: inline-block;
  background: var(--l3-red);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 2px;
  margin-bottom: 6px;
}
.l3-hero-card-s-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
  line-height: 1.25;
  margin: 0;
}

@media (max-width: 900px) {
  .l3-hero-side { flex-direction: row; }
  .l3-hero-card-s { min-height: 160px; }
}
@media (max-width: 540px) {
  .l3-hero-side { flex-direction: column; }
  .l3-hero-card-s { min-height: 140px; }
}

/* =========================================================
   SECTIONS CATÉGORIES
   ========================================================= */
.l3-section {
  padding: 56px 0;
}
.l3-section.bg-soft { background: var(--l3-bg-soft); }
@media (max-width: 768px) { .l3-section { padding: 40px 0; } }

.l3-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}
.l3-section-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 26px);
  color: var(--l3-ink);
  margin: 0;
  border-left: 4px solid var(--l3-red);
  padding-left: 14px;
}
.l3-see-all {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--l3-red);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.l3-see-all:hover { color: var(--l3-red-dark); }

/* Grille 4 cards */
.l3-grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .l3-grid4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .l3-grid4 { grid-template-columns: 1fr; } }

/* Card article */
.l3-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--l3-radius);
  overflow: hidden;
  border: 1px solid var(--l3-border);
  text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}
.l3-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.10); transform: translateY(-3px); }

.l3-card-thumb {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: linear-gradient(135deg, #e0e0e0, #c8c8c8);
  position: relative;
}
.l3-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.l3-card:hover .l3-card-thumb img { transform: scale(1.04); }

.l3-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 18px 20px;
  gap: 8px;
}
.l3-card-cat {
  display: inline-block;
  background: var(--l3-red);
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .10em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 2px;
  align-self: flex-start;
}
.l3-card-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.3;
  color: var(--l3-ink);
  margin: 0;
  flex: 1;
}
.l3-card-date {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--l3-text-soft);
}

/* =========================================================
   SECTION FEATURES "ENTRETIEN & PRATIQUE"
   ========================================================= */
.l3-features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .l3-features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .l3-features-grid { grid-template-columns: 1fr; } }

.l3-feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 24px 20px;
  background: #fff;
  border-radius: var(--l3-radius);
  border: 1px solid var(--l3-border);
}
.l3-feature-icon {
  width: 44px;
  height: 44px;
  background: rgba(229,36,33,.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--l3-red);
}
.l3-feature-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--l3-ink);
  margin: 0;
}
.l3-feature-desc {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--l3-text-soft);
  line-height: 1.6;
  margin: 0;
}

/* =========================================================
   SECTION SEO TEXTE (§91)
   ========================================================= */
.l3-seo-text {
  padding: 56px 0 64px;
  background: var(--l3-bg-soft);
  border-top: 1px solid var(--l3-border);
}
.l3-seo-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}
.l3-seo-inner h2 {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--l3-ink);
  margin: 0 0 20px;
}
.l3-seo-inner p {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.75;
  color: var(--l3-text);
  margin: 0 0 18px;
}
.l3-seo-inner strong { color: var(--l3-ink); }
.l3-seo-inner a { color: var(--l3-red); text-decoration: none; }
.l3-seo-inner a:hover { text-decoration: underline; }

/* =========================================================
   UTILITAIRES GP KILL
   ========================================================= */
/* Cacher les éléments GP injectés hors thème enfant */
.generate-back-to-top { display: none !important; }
/* Éviter .site-content margin-top auto GP */
#content.site-content { background: transparent !important; padding: 0 !important; margin: 0 !important; }
.site-main { padding: 0 !important; margin: 0 !important; }

/* Pagination */
.l3-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 40px 0 0;
}
.l3-pagination a,
.l3-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--l3-border);
  border-radius: var(--l3-radius);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--l3-text);
  text-decoration: none;
  transition: all .15s;
}
.l3-pagination a:hover { border-color: var(--l3-red); color: var(--l3-red); }
.l3-pagination span.current { background: var(--l3-red); border-color: var(--l3-red); color: #fff; }
.l3-pagination ::marker { display: none; content: ''; }

/* ===== Tableaux contenu : suppression des marges top/bottom (retour Mathieu 15/06/2026) =====
   Sélecteur boosté :not(#z) (spécificité ID) pour battre les règles inline .xx-single-main .entry-content table */
.entry-content table:not(#z),
.entry-content .solutions-table:not(#z),
.entry-content .custom-table:not(#z){ margin:0 !important; }
.entry-content figure.wp-block-table:not(#z),
.entry-content .wp-block-table:not(#z),
.entry-content div[class*="table-wrap"]:not(#z){ margin:0 0 .6em !important; }


/* ===== Reset padding GeneratePress separate-containers (Mathieu 15/06 — gros padding 30px parasite) ===== */
.separate-containers .inside-article:not(#z),
.one-container .site-content:not(#z),
.inside-page-header:not(#z),
.separate-containers .paging-navigation:not(#z),
.separate-containers .comments-area:not(#z){ padding:0 !important; }
