/*
Theme Name: 52 Ans Official
Author: Benjamin
Description: Thème sur-mesure pour le projet 52 courses.
Version: 1.1 (Fixed)
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    /* Sticky Footer Setup */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
}

/* --- FIX MENU NAVIGATION --- */
.nav-menu {
    display: flex;
    /* Force l'horizontale */
    list-style: none;
    /* Enlève les puces */
    gap: 40px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #fff;
    /* Blanc par défaut (Accueil) */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    position: relative;
}

/* Soulignement au survol */
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #312783, #019ce0);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

/* Couleur du menu sur les pages internes (Fond blanc) */
body:not(.home) .nav-menu a {
    color: #312783;
}

/* Couleur du menu au scroll sur l'accueil */
.header.scrolled .nav-menu a {
    color: #312783 !important;
}

/* --- LOGO SYSTEM (MASTER FIX) --- */

/* 1. Base du logo (Page d'accueil par défaut) */
.logo {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 140px;
    width: auto;
    z-index: 1001;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    cursor: pointer;
}

.logo img {
    height: 100%;
    width: auto;
    /* Rend le logo tout blanc pour le Hero sombre (supprime si tu veux le logo bleu) */
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

/* IMPORTANT : On annule le filtre blanc quand on scrolle ou sur pages internes */
.logo.scrolled img,
body:not(.home) .logo img {
    filter: none;
}

/* 2. Logo au Scroll (Page d'accueil) */
.logo.scrolled {
    position: fixed;
    z-index: 1002;
    height: 40px;
    width: auto;
    left: 50px;
    transform: none !important;
    top: 28px;
}

/* 3. Logo sur les PAGES INTERNES (Fixe, petit, couleur originale) */
body:not(.home) .logo {
    position: fixed;
    z-index: 1002;
    height: 40px;
    width: auto;
    left: 50px;
    transform: none !important;
    top: 20px;
}

/* 4. LE FIX ADMIN BAR (Pour toi connecté) */
body.admin-bar:not(.home) .logo {
    top: 60px !important;
}

/* Version Mobile */
@media (max-width: 768px) {
    .logo.scrolled {
        left: 18px;
        top: 20px;
        height: 30px;
    }

    body.admin-bar .logo.scrolled {
        top: 64px !important;
    }
}

/* --- HEADER --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 50px;
    background: transparent;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 15px 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Header sur pages internes (Blanc) */
body:not(.home) .header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.header-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
}

/* Fix Admin Bar pour le Header */
body.admin-bar .header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .header {
        top: 46px;
    }
}

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #312783 0%, #019ce0 100%);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    z-index: 1;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.9;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(49, 39, 131, 0.3), rgba(1, 156, 224, 0.3));
    z-index: 2;
}

.hero-content {
    position: relative;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
    z-index: 3;
    margin-top: 120px;
}

.hero-tagline {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    opacity: 0;
    /* Animation requise */
    animation: fadeInUp 1s ease 0.8s forwards;
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0;
    /* Animation requise */
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease 1.1s forwards;
}

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 0;
    /* Animation requise */
    animation: fadeInUp 1s ease 1.4s forwards;
}

.cta-button:hover {
    background: #019ce0;
    border-color: #019ce0;
    color: #ffffff;
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    opacity: 0;
    animation: fadeIn 1s ease 2s forwards, bounce 2s ease 2s infinite;
    z-index: 5;
}

/* --- BANDEAU PAGES INTERNES --- */
.page-header-banner {
    padding-top: 140px;
    padding-bottom: 60px;
    background: #f9f9f9;
    text-align: center;
}

.page-header-banner h1 {
    color: #312783;
    text-transform: uppercase;
    font-weight: 800;
    margin: 0;
}

/* --- CONTENU --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
}

.section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    width: 100%;
}

.section-title h2 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #312783, #019ce0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* --- BLOG GRID --- */
.blog-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-top: 60px;
}

@media (max-width: 800px){
  .blog-grid{
    grid-template-columns: 1fr;
  }
}

.blog-card{
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
  transition: transform .3s ease, box-shadow .3s ease;
}

.blog-card:hover{
  transform: translateY(-10px);
  box-shadow: 0 20px 50px rgba(0,0,0,.15);
}

/* Vignette */
.blog-card-image{
  height: 220px;
  background: linear-gradient(135deg, #312783, #019ce0);
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

/* Lien plein cadre sur la vignette */
.blog-card-image-link{
  position: absolute;
  inset: 0;
  display: block;
  z-index: 2;
  text-decoration: none;
}

/* Effet hover propre sur la vignette */
.blog-card-image::after{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background .25s ease;
  z-index: 1;
}

.blog-card:hover .blog-card-image::after{
  background: rgba(0,0,0,.06);
}

/* Contenu */
.blog-card-content{
  padding: 30px;
}

/* Titre cliquable */
.blog-card-title{
  font-size: 1.4rem;
  margin: 0 0 15px;
  color: #312783;
  font-weight: 600;
  line-height: 1.2;
}

.blog-card-title a{
  color: inherit;
  text-decoration: none;
}

.blog-card-title a:hover{
  text-decoration: underline;
}

/* Accessibilité : focus visible (titre + vignette) */
.blog-card-title a:focus-visible,
.blog-card-image-link:focus-visible{
  outline: 3px solid rgba(1,156,224,.45);
  outline-offset: 4px;
  border-radius: 10px;
}

/* Lire la suite */
.read-more{
  color: #019ce0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .85rem;
  text-decoration: none;
}

.read-more:hover{
  text-decoration: underline;
}


/* --- STATS SECTION --- */
.stats-section {
    background: linear-gradient(135deg, #312783, #019ce0);
    color: white;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 60px;
    margin-top: 60px;
}

.stat-item h3 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

/* Titre Spécifique Stats */
.stats-section h2 {
    font-size: 2.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 40px;
    color: white !important;
    background: none !important;
    -webkit-text-fill-color: white !important;
}

/* --- FOOTER --- */
.footer {
    background: #333;
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-top: auto;
    /* Sécurité Sticky footer */
}

.footer-logo img {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
    margin-bottom: 30px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.social-links a {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.social-links a:hover {
    color: #019ce0;
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .nav-menu {
        gap: 20px;
        font-size: 0.9rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    /* Logo Mobile */
    .logo {
        height: 100px;
    }

    .logo.scrolled,
    body:not(.home) .logo {
        left: 20px;
        height: 30px;
        top: 15px;
    }

    body.admin-bar:not(.home) .logo {
        top: 61px !important;
    }
}

/* --- ANIMATIONS (ESSENTIEL POUR LE TEXTE) --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ==========================================================================
   DESIGN DES PAGES INTERNES (CLEAN & CONSOLIDÉ)
   ========================================================================== */

/* --- 1. LE BANDEAU DE TITRE (Pages standards & Blog) --- */
.page-header-banner {
    background: linear-gradient(135deg, rgba(49, 39, 131, 0.85), rgba(1, 156, 224, 0.85)),
        url('https://52ans.com/wp-content/uploads/2025/08/ed_running_home.jpg');
    background-size: cover;
    background-position: center;

    /* Dimensions et Espacement */
    padding-top: 180px;
    padding-bottom: 60px;
    /* Réduit pour éviter le vide */
    margin-bottom: 0;
    /* Collé au contenu suivant */
    position: relative;
    text-align: center;
}

.page-header-banner h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: #ffffff !important;
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin: 0;

    /* STYLE SPORTIF */
    text-transform: uppercase;
    font-style: italic;
    letter-spacing: 1px;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .page-header-banner h1 {
        font-size: 2.2rem;
    }
}


/* --- 2. CONTENU GÉNÉRAL (Pages internes) --- */

/* Correction de l'espace haut du contenu */
body:not(.home) .section {
    padding-top: 40px !important;
}

/* Le Texte (Aligné gauche, aéré, max 800px) */
body:not(.home) .container p {
    font-size: 1.15rem;
    color: #4a4a4a;
    line-height: 1.8;
    margin-bottom: 2em;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Suppression de la marge du tout premier élément pour coller au bandeau */
body:not(.home) .container p:first-of-type,
body:not(.home) .container img:first-of-type,
body:not(.home) .container h2:first-of-type {
    margin-top: 0 !important;
}

/* Les Images dans le contenu (Carrées & Nettes) */
body:not(.home) .container img:not(.page-header-banner img) {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
    margin: 60px auto;
}

/* Les Titres H2, H3 (Sportifs & Bleus) */
body:not(.home) .container h2,
body:not(.home) .container h3 {
    color: #312783;
    font-weight: 800;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    text-transform: uppercase;
    font-style: italic;
    line-height: 1.2;
}

body:not(.home) .container h2 {
    font-size: 2.5rem;
    margin-top: 80px;
    margin-bottom: 30px;
}

body:not(.home) .container h3 {
    font-size: 1.8rem;
    margin-top: 50px;
    margin-bottom: 20px;
}

/* Les Liens (Bleu simple, pas souligné) */
body:not(.home) .container a {
    color: #312783;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

body:not(.home) .container a:hover {
    color: #019ce0;
}


/* --- 3. PAGE BLOG (Grille) --- */

/* Titres des cartes cliquables */
.blog-card h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h3 a:hover {
    color: #019ce0;
}


/* --- 4. PAGE ARTICLE UNIQUE (Single Post - Mode Magazine) --- */

/* L'En-tête Blanc */
.single-header {
    text-align: center;
    padding-top: 140px;
    padding-bottom: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.single-title {
    color: #312783;
    font-size: 3rem;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.single-meta {
    font-size: 0.9rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.meta-sep {
    margin: 0 10px;
    color: #ccc;
}

.single-category a {
    color: #019ce0;
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 15px;
}

/* L'Image à la Une (Large 1100px) */
.single-featured-wrapper {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto 60px auto;
}

.single-featured-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

/* LE CONTENU HYBRIDE (Texte étroit / Images larges) */
.single .entry-content {
    max-width: 1100px;
    /* Conteneur global large */
    margin: 0 auto;
}

/* On force tous les textes à être étroits (800px) et centrés */
.single .entry-content p,
.single .entry-content ul,
.single .entry-content ol,
.single .entry-content h2,
.single .entry-content h3,
.single .entry-content blockquote {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* On laisse les images prendre toute la largeur (1100px) */
.single .entry-content img,
.single .entry-content figure {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 60px 0;
}

/* Cas particulier : Images alignées (left/right) */
.single .entry-content .alignleft,
.single .entry-content .alignright {
    max-width: 50%;
}

/* Légendes */
.single .entry-content figcaption {
    text-align: center;
    max-width: 800px;
    margin: 10px auto 40px auto;
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}


/* --- 5. NAVIGATION (Bas de page) --- */

.post-navigation {
    margin-top: 80px;
    padding-top: 0;
    border-top: none;
    margin-bottom: 100px;
}

.single-featured-wrapper img,
.single .entry-content {
    border: none !important;
    box-shadow: none !important;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.nav-previous,
.nav-next {
    flex: 1;
    max-width: 45%;
}

.nav-next {
    text-align: right;
}

.nav-subtitle {
    display: block;
    font-size: 0.9rem;
    color: #999;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 700;
}

.nav-title {
    font-size: 1.3rem;
    color: #312783;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    font-style: italic;
    transition: color 0.3s ease;

    /* ICI LE FIX POUR L'INTERLIGNE */
    line-height: 1.1;
}

.nav-title:hover {
    color: #019ce0;
}

/* --- FORMULAIRES & PAGE CONTACT (Style Universel) --- */

/* On cible le formulaire Contact Form 7, où qu'il soit */
.wpcf7 {
    margin-top: 20px;
}

/* Les champs (Inputs & Textarea) - Design Sport Carré */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
    width: 100%;
    background: #f8f8f8;
    border: 2px solid #eee;
    padding: 15px 20px;
    font-size: 1rem;
    color: #333;
    font-family: inherit;
    border-radius: 0;
    /* Carré */
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    /* Sécurité pour ne pas déborder */
}

/* Au clic (Focus) */
.wpcf7 input:focus,
.wpcf7 textarea:focus {
    background: #fff;
    border-color: #312783;
    /* Bordure bleue au clic */
    outline: none;
}

/* Le Bouton Envoyer */
.wpcf7 input[type="submit"] {
    display: inline-block;
    padding: 15px 50px;
    background: #312783;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    font-style: italic;
    margin-top: 10px;
}

.wpcf7 input[type="submit"]:hover {
    background: #019ce0;
    /* Bleu clair */
    transform: translateY(-2px);
}

/* Petit ajustement pour les messages d'erreur/succès du plugin */
.wpcf7-response-output {
    border-radius: 0 !important;
    font-size: 0.9rem;
    margin: 20px 0 !important;
}

/* Style des Labels du formulaire */
.wpcf7 label {
    font-size: 0.9rem;
    font-weight: 800;
    /* Très gras */
    text-transform: uppercase;
    /* Majuscules */
    color: #312783;
    /* Bleu foncé charte */
    font-style: italic;
    /* Touche "Sport" */
    display: block;
    margin-bottom: 5px;
}

/* --- CORRECTIF ESPACES FORMULAIRE --- */

/* On annule les marges par défaut des paragraphes ajoutés par le plugin */
.wpcf7 p {
    margin-bottom: 0 !important;
    padding: 0 !important;
}

/* On contrôle l'espace uniquement via les champs eux-mêmes */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
    margin-bottom: 15px !important;
    /* On réduit de 20px à 15px */
    margin-top: 5px !important;
    /* On colle un peu plus au label */
}

/* On serre un peu les labels */
.wpcf7 label {
    margin-bottom: 2px !important;
}

/* On laisse de l'espace juste avant le bouton envoyer */
.wpcf7 input[type="submit"] {
    margin-top: 20px !important;
}

/* ==========================================================================
   FOOTER - SOCIAL ICONS (OVERRIDES)
   ========================================================================== */

.footer .social-links{
  display:flex;
  justify-content:center;
  gap:12px;
  margin-top:30px;
  align-items:center;
  flex-wrap:wrap;
}

.footer .social-links a{
  font-weight:600;
  text-decoration:none;
}

.footer .social-links .social-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:999px;

  background:#3f3f3f;
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 1px 0 rgba(0,0,0,.25) inset;

  color:#fff; /* pilote les icônes */
  transition:transform .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
}

.footer .social-links .social-link svg{
  display:block;
  width:22px;
  height:22px;
}

/* Icônes "fill" (toutes sauf Instagram) */
.footer .social-links .social-link:not(.social-link--instagram) svg path{
  fill:currentColor;
}

/* Instagram (outline) : on empêche le remplissage, on garde le stroke */
.footer .social-links .social-link--instagram svg path{
  fill:none !important;
}
.footer .social-links .social-link--instagram svg [stroke]{
  stroke:currentColor;
}

.footer .social-links .social-link:hover{
  transform:translateY(-1px);
  background:#4a4a4a;
  border-color:rgba(255,255,255,.18);
  color:#019ce0;
}

.footer .social-links .social-link:focus-visible{
  outline:2px solid rgba(1,156,224,.75);
  outline-offset:3px;
}
