/*
 * Modern Styles - Theme by Socreativ 2.0
 * Consolidation des styles avec CSS modernes
 */

:root {
    /* Palette couleurs (sauge / noir / background / blanc) */
    --wp--preset--color--sauge: #C0C4B4;
    --wp--preset--color--noir: #1F1F1F;
    --wp--preset--color--background: #F8F8F8;
    --wp--preset--color--blanc: #FFFFFF;
    --wp--preset--color--rouge: #D84438;

    /* Espacement */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* Border radius */
    --border-radius: 8px;
    --border-radius-lg: 16px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
    
    /* Shadows */
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
    --z-top: 1070;

    /* Gutters */
    --gutters: 12vw;
}
@media (max-width: 1600px) {
    :root {
        --gutters: 10vw;
    }
}
@media (max-width: 1440px) {
    :root {
        --gutters: 6vw;
    }
}
@media (max-width: 576px) {
    :root {
        --gutters: 3vw;
    }
}

/* Reset moderne */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow: ensure the page width equals the viewport and hide any overflowing content to the right */
html,
body {
    overflow-x: hidden; /* Hide horizontal overflow globally */
}

/* Make sure the body can't grow wider than the viewport (guards against scrollbar/100vw issues) */
body {
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Allow flex/grid children to shrink properly so they don't force horizontal scroll */
.flex > *,
.grid > * {
    min-width: 0;
}

/* Constrain media elements to container width to avoid overflow */
img,
picture,
video,
iframe,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

body {
    margin: 0;
    line-height: 1.2;
    font-family: var(--wp--preset--font-family--montserrat);
    padding: 0 var(--gutters);
    color: var(--wp--preset--color--noir);
    overflow-x: hidden;
}

/* Container moderne */
.wp-site-blocks {
    padding-left: var(--wp--custom--spacing--outer, var(--spacing-md));
    padding-right: var(--wp--custom--spacing--outer, var(--spacing-md));
}

/* Layout Grid moderne */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-full {
    width: 100%;
    padding: 0 var(--spacing-md);
}

/* Grid System moderne */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Flexbox utilities */
.flex {
    display: flex;
    color: var(--wp--preset--color--noir);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}
.flex-row{
    display: flex;
    flex-direction: row!important;
}

/* Typography moderne */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* Espacement utilities */
.m-0 { margin: 0; }
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; }
.px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }

/* Position utilities */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Buttons modernes */
.wp-block-button__link,
.button,
.btn {
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    position: relative;
    overflow: hidden;
}

.wp-block-button__link:hover,
.button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.wp-block-button__link:active,
.button:active,
.btn:active {
    transform: translateY(0);
}

/* Header moderne */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background-color: var(--wp--preset--color--blanc);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    display: flex;
    justify-content: center;
}
/* Logo */
.site-branding {
    display: flex;
    align-items: center;
}
.logo-link{
    display: flex;
}
.site-logo {
    max-height: 75px;
    width: auto;
}
@media (max-width: 576px) {
    .site-logo {
        max-height: 40px;
    }
}
.site-title a {
    text-decoration: none;
    color: var(--wp--preset--color--noir);
    font-weight: 700;
    transition: var(--transition);
}
.site-title a:hover {
    color: var(--wp--preset--color--vert);
}

/* Navigation moderne */
.main-navigation {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: column;
}
.nav-menu{
    display: flex;
    gap: 2rem;
}
.submenu-links{
    display: flex;
    width: 100%;
    justify-content: space-evenly;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 1.75rem);
    text-transform: uppercase;
    font-size: 11px;
}
.nav-menu li a{
    text-transform: uppercase;
    text-wrap: nowrap;

}
.nav-menu li.current-menu-item a{
    font-weight: 800;
}
.submenu-links li a.active{
    font-weight: 800;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--spacing-xs);
    cursor: pointer;
    color: var(--wp--preset--color--noir);
    font-size: 1.5rem;
}

/* Custom classes for ACF WYSIWYG */
.fw-300 { font-weight: 300; }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-900 { font-weight: 900; }

.is-char-reverted {
    color: var(--wp--preset--color--blanc);
    background: var(--wp--preset--color--noir);
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
}

/* Color utilities */
.has-blanc-color { color: var(--wp--preset--color--blanc); }
.has-noir-color { color: var(--wp--preset--color--noir); }
.has-sable-color { color: var(--wp--preset--color--sauge); }
.has-rouille-color { color: var(--wp--preset--color--noir); }
.has-gris-sombre-color { color: var(--wp--preset--color--noir); }
.has-bleu-gris-color { color: var(--wp--preset--color--noir); }

.has-blanc-background-color { background-color: var(--wp--preset--color--blanc); }
.has-noir-background-color { background-color: var(--wp--preset--color--noir); }
.has-sable-background-color { background-color: var(--wp--preset--color--sauge); }
.has-rouille-background-color { background-color: var(--wp--preset--color--noir); }
.has-gris-sombre-background-color { background-color: var(--wp--preset--color--noir); }
.has-bleu-gris-background-color { background-color: var(--wp--preset--color--noir); }

/* Font size utilities */
.has-xs-text-font-size { font-size: 9px; }
.has-s-text-font-size { font-size: 10px; }
.has-m-text-font-size { font-size: 12px; }
.has-l-text-font-size { font-size: 14px; }
.has-xl-text-font-size { font-size: 16px; }

/* Titles: usage logique des tailles fournies (toutes présentes au moins une fois) */
.has-xs-title-font-size { font-size: 11px; }
.has-s-title-font-size { font-size: 13px; }
.has-m-title-font-size { font-size: 15px; }
.has-l-title-font-size { font-size: 20px; }
.has-xl-title-font-size { font-size: 25px; }
.has-xxl-title-font-size { font-size: 30px; }
.has-xxxl-title-font-size { font-size: 35px; }
.has-big-title-font-size { font-size: 30px; }
.has-super-big-title-font-size { font-size: 35px; }

@media (max-width: 840px) {
    .has-xs-title-font-size { font-size: 9px!important; }
    .has-s-title-font-size { font-size: 11px!important; }
    .has-m-title-font-size { font-size: 13px!important; }
    .has-l-title-font-size { font-size: 18px!important; }
    .has-xl-title-font-size { font-size: 22px!important; }
    .has-xxl-title-font-size { font-size: 26px!important; }
    .has-xxxl-title-font-size { font-size: 30px!important; }
    .has-big-title-font-size { font-size: 26px!important; }
    .has-super-big-title-font-size { font-size: 30px!important; }
}
@media (max-width: 576px) {
    .has-xs-title-font-size { font-size: 9px!important; }
    .has-s-title-font-size { font-size: 11px!important; }
    .has-m-title-font-size { font-size: 13px!important; }
    .has-l-title-font-size { font-size: 16px!important; }
    .has-xl-title-font-size { font-size: 20px!important; }
    .has-xxl-title-font-size { font-size: 24px!important; }
    .has-xxxl-title-font-size { font-size: 28px!important; }
    .has-big-title-font-size { font-size: 24px!important; }
    .has-super-big-title-font-size { font-size: 28px!important; }
}

/* Font family utilities */
.has-montserrat-font-family { font-family: 'Montserrat', sans-serif; }
.has-lexend-tera-font-family { font-family: 'Lexend_Tera', sans-serif; }
.has-bamida-font-family { font-family: 'Montserrat', serif; }

/* Responsive styles */
.no-mobile {
    display: flex!important;
}
@media (max-width: 768px) {
    .no-mobile {
        display: none!important;
    }
}
.no-desktop {
    display: none!important;
}
@media (max-width: 1024px) {
    .no-desktop {
        display: flex!important;
    }
}
.no-tablet {
    display: flex!important;
}
@media (max-width: 1024px) {
    .no-tablet {
        display: none!important;
    }
}
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--wp--preset--color--blanc);
        box-shadow: var(--shadow-lg);
    .has-blanc-color { color: var(--wp--preset--color--blanc); }
    .has-noir-color { color: var(--wp--preset--color--noir); }
    .has-sable-color { color: var(--wp--preset--color--sauge); }
    .has-rouille-color { color: var(--wp--preset--color--noir); }
    .has-gris-sombre-color { color: var(--wp--preset--color--noir); }
        transition: var(--transition);
    }
    
    .main-navigation.toggled .nav-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* Cards modernes */
.card {
    background: var(--wp--preset--color--blanc);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Utilities responsives */
@media (max-width: 768px) {
    .hide-mobile { 
        display: none !important; 
    }
}

@media (min-width: 769px) {
    .hide-desktop { 
        display: none !important; 
    }
}

/* Screen reader only */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus styles accessibles */
:focus-visible {
    outline: 2px solid var(--wp--preset--color--vert);
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
