/*
Theme Name: Insuffle Académie
Theme URI: https://insuffle-academie.com
Author: Insuffle Académie
Description: Thème WordPress optimisé Gutenberg pour organisme de formation
Version: 3.3
Text Domain: insuffle-academie
License: GNU General Public License v2 or later
License URI: LICENSE
*/

/* =====================
   VARIABLES CSS
   ===================== */
:root {
    --primary: #8E2183;
    --secondary: #FFD466;
    --accent: #FFC0CB;
    --light: #FFFFFF;
    --dark: #333333;
    --grey: #F5F5F5;
    --text: #555555;
}

/* =====================
   RESET & BASE
   ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

/* =====================
   CONTAINER
   ===================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* =====================
   NAVIGATION
   ===================== */
#site-header {
    background: var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.custom-logo-link img,
.nav-logo {
    max-height: 50px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    align-items: center;
}

.nav-menu li {
    margin: 0;
    position: relative;
}

.nav-menu a {
    color: var(--light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    padding: 10px 0;
    display: block;
}

.nav-menu a:hover {
    color: var(--secondary);
}

.nav-menu a.active {
    color: var(--secondary);
}

.nav-menu a.nav-cta {
    background-color: var(--secondary);
    color: var(--primary) !important;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
}

.nav-menu a.nav-cta:hover {
    background-color: var(--light);
    color: var(--primary) !important;
    transform: translateY(-2px);
}

/* Sous-menu */
.nav-menu .menu-item-has-children {
    position: relative;
}

.nav-menu .menu-item-has-children > a {
    padding-right: 20px;
}

/* Flèche pour indiquer le sous-menu */
.nav-menu .menu-item-has-children > a::after {
    content: ' ▾';
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.3s;
}

.nav-menu .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.nav-menu .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: white;
    min-width: 280px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 15px 0;
    margin: 0;
    list-style: none !important;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.nav-menu .menu-item-has-children:hover > .sub-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-menu .sub-menu li {
    margin: 0;
    padding: 0;
    list-style: none !important;
}

.nav-menu .sub-menu li::before {
    display: none !important;
}

.nav-menu .sub-menu a {
    color: var(--primary) !important;
    padding: 12px 25px !important;
    font-size: 1rem;
    font-weight: 500;
    display: block;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-menu .sub-menu a:hover {
    background: var(--grey);
    color: var(--primary) !important;
    border-left-color: var(--secondary);
    padding-left: 30px !important;
}

.nav-menu .sub-menu li:first-child a {
    border-radius: 12px 12px 0 0;
}

.nav-menu .sub-menu li:last-child a {
    border-radius: 0 0 12px 12px;
}

/* Menu mobile toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
}

.mobile-menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background: var(--light);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* =====================
   BOUTONS
   ===================== */
.btn,
.wp-block-button__link {
    display: inline-block;
    background: var(--secondary);
    color: var(--primary);
    padding: 15px 40px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:hover,
.wp-block-button__link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.btn-white {
    background-color: var(--light);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline:hover {
    background-color: var(--secondary);
    color: var(--primary);
}

/* =====================
   BLOCS GUTENBERG - TYPOGRAPHIE
   ===================== */
.wp-block-heading,
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* TITRES BLANCS DANS LES SECTIONS HERO - PRIORITÉ MAXIMALE */
.hero h1,
.hero h2,
.hero h3,
.page-hero h1,
.page-hero h2,
.page-hero h3,
.page-hero .page-title,
.page-hero-content h1,
.page-hero-content h2,
.page-hero-content h3,
.formation-hero h1,
.formation-hero h2,
.formation-hero h3,
.formation-hero .page-title,
h1.page-title,
.entry-title,
.page-hero .entry-title {
    color: #FFFFFF !important;
}

/* Double sécurité pour les titres de pages */
body .page-hero h1,
body .page-hero-content h1,
body .formation-hero h1,
body h1.page-title {
    color: #FFFFFF !important;
}

h1, .wp-block-heading.has-large-font-size {
    font-size: 3rem;
    font-weight: 800;
}

h2, .wp-block-heading.has-medium-font-size {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.8rem;
}

h4 {
    font-size: 1.5rem;
}

.wp-block-paragraph {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
}

/* =====================
   BLOCS GUTENBERG - LISTES
   ===================== */
.wp-block-list {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.wp-block-list li {
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.wp-block-list ul li::marker {
    color: var(--primary);
}

/* =====================
   BLOCS GUTENBERG - IMAGES
   ===================== */
.wp-block-image {
    margin: 2rem 0;
}

.wp-block-image img {
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.wp-block-image.alignwide,
.wp-block-image.alignfull {
    margin-left: 0;
    margin-right: 0;
}

.wp-block-image figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

/* =====================
   BLOCS GUTENBERG - CITATIONS
   ===================== */
.wp-block-quote {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-left: 4px solid var(--primary);
    padding: 25px 30px;
    margin: 30px 0;
    border-radius: 10px;
    font-style: italic;
    font-size: 1.2rem;
    color: #666;
}

.wp-block-pullquote {
    border-top: 4px solid var(--primary);
    border-bottom: 4px solid var(--primary);
    padding: 2rem;
    text-align: center;
}

/* =====================
   BLOCS GUTENBERG - GROUPES & COLONNES
   ===================== */
.wp-block-group {
    margin-bottom: 2rem;
}

.wp-block-columns {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.wp-block-column {
    flex: 1;
}

/* =====================
   BLOCS GUTENBERG - COUVERTURE
   ===================== */
.wp-block-cover {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 20px;
    overflow: hidden;
}

.wp-block-cover__inner-container {
    max-width: 800px;
    text-align: center;
    z-index: 1;
}

.wp-block-cover h2,
.wp-block-cover p {
    color: white !important;
}

/* =====================
   BLOCS GUTENBERG - SÉPARATEUR
   ===================== */
.wp-block-separator {
    border: none;
    border-top: 2px solid var(--grey);
    margin: 3rem 0;
}

.wp-block-separator.is-style-wide {
    border-top-width: 3px;
}

/* =====================
   BLOCS GUTENBERG - ESPACEMENT
   ===================== */
.wp-block-spacer {
    clear: both;
}

/* =====================
   BLOCS GUTENBERG - TABLEAUX
   ===================== */
.wp-block-table {
    margin: 2rem 0;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}

.wp-block-table th {
    background: var(--primary);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.wp-block-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.wp-block-table tr:hover {
    background: var(--grey);
}

/* =====================
   BLOCS GUTENBERG - GALERIE
   ===================== */
.wp-block-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

/* =====================
   CLASSES PERSONNALISÉES
   ===================== */

/* Carte Formation */
.formation-card-block {
    background: var(--grey);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.formation-card-block:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

/* Sections colorées */
.section-primary {
    background: var(--primary);
    color: var(--light);
    padding: 60px 30px;
    border-radius: 20px;
    margin: 2rem 0;
}

.section-primary h2,
.section-primary h3,
.section-primary p {
    color: white !important;
}

.section-secondary {
    background: var(--secondary);
    color: var(--primary);
    padding: 60px 30px;
    border-radius: 20px;
    margin: 2rem 0;
}

.section-grey {
    background: var(--grey);
    padding: 60px 30px;
    border-radius: 20px;
    margin: 2rem 0;
}

/* Encadrés */
.callout {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-left: 4px solid var(--primary);
    padding: 25px 30px;
    margin: 30px 0;
    border-radius: 10px;
}

.callout-primary {
    background: var(--primary);
    color: white;
    border-left: 4px solid var(--secondary);
}

.callout-primary h2,
.callout-primary h3,
.callout-primary p {
    color: white !important;
}

/* Stats / Chiffres */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text);
}

/* =====================
   CONTENU PRINCIPAL
   ===================== */
#main-content {
    min-height: 60vh;
}

.entry-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* =====================
   FOOTER
   ===================== */
footer {
    background: var(--dark);
    color: var(--light);
    padding: 80px 0 40px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--secondary);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-contact p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.copyright {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

footer a {
    color: var(--light);
    text-decoration: none;
}

footer a:hover {
    color: var(--secondary);
}

/* =====================
   DECORATIVE ELEMENTS
   ===================== */
.shape {
    position: absolute;
    z-index: 1;
}

.shape-1 {
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background-color: var(--secondary);
    border-radius: 50%;
    opacity: 0.1;
}

.shape-2 {
    bottom: -150px;
    left: -150px;
    width: 400px;
    height: 400px;
    background-color: var(--accent);
    border-radius: 50%;
    opacity: 0.1;
}

.shape-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background-color: var(--secondary);
    border-radius: 50%;
    opacity: 0.05;
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 992px) {
    .wp-block-columns {
        flex-direction: column;
    }
    
    h1, .wp-block-heading.has-large-font-size {
        font-size: 2.5rem;
    }
    
    h2, .wp-block-heading.has-medium-font-size {
        font-size: 2rem;
    }
    
    /* Menu mobile */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        gap: 0;
        padding: 20px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    
    .nav-menu.active {
        max-height: calc(100vh - 80px);
        opacity: 1;
        overflow-y: auto;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-menu a {
        padding: 15px 10px;
        font-size: 1rem;
    }
    
    .nav-menu a.nav-cta {
        margin-top: 10px;
        text-align: center;
    }
    
    /* Sous-menu en mode mobile */
    .nav-menu .sub-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        padding: 0;
        margin: 10px 0 10px 20px;
        min-width: auto;
        width: calc(100% - 20px);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: none;
    }
    
    .nav-menu .menu-item-has-children.submenu-open > .sub-menu {
        max-height: 500px;
        opacity: 1;
        padding: 10px 0;
    }
    
    .nav-menu .menu-item-has-children > a::after {
        float: right;
        transition: transform 0.3s;
    }
    
    .nav-menu .menu-item-has-children.submenu-open > a::after {
        transform: rotate(180deg);
    }
    
    .nav-menu .sub-menu a {
        color: var(--light) !important;
        font-size: 0.95rem;
        padding: 10px 15px !important;
        border-left: none;
    }
    
    .nav-menu .sub-menu a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--secondary) !important;
        padding-left: 15px !important;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    h1, .wp-block-heading.has-large-font-size {
        font-size: 2rem;
    }
    
    h2, .wp-block-heading.has-medium-font-size {
        font-size: 1.75rem;
    }
    
    .btn,
    .wp-block-button__link {
        padding: 12px 30px;
        font-size: 0.95rem;
    }
    
    .wp-block-gallery {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* =====================
   ALIGNEMENTS GUTENBERG
   ===================== */
.alignwide {
    margin-left: -80px;
    margin-right: -80px;
    max-width: 1000px;
    width: auto;
}

.alignfull {
    margin-left: calc(-100vw / 2 + 100% / 2);
    margin-right: calc(-100vw / 2 + 100% / 2);
    max-width: 100vw;
    width: 100vw;
}

.alignleft {
    float: left;
    margin-right: 2rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* =====================
   CLASSES UTILITAIRES
   ===================== */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--secondary);
}

.bg-primary {
    background-color: var(--primary);
}

.bg-secondary {
    background-color: var(--secondary);
}

.bg-grey {
    background-color: var(--grey);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.p-1 { padding: 1rem; }
.p-2 { padding: 2rem; }
.p-3 { padding: 3rem; }