/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, ::after, ::before {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    background: #fefefe;
    font-family: Montserrat, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    color: #0a0a0a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    box-sizing: border-box;
    font-size: 100%;
}

::selection {
    background: #f8a531;
    color: #000;
}

/* Layout principal */
.layout {
    width: 100%;
}

#layer-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9989;
    width: 100%;
    background-color: #fff;
}

#layer-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: #f5f5f5;
    transition: .5s all cubic-bezier(.18, 1, .22, 1);
}

/* Navbar principale */
#nav {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
}

/* Burger menu (mobile) */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.burger span {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s;
    border-radius: 2px;
}

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

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.btn__give-mobile {
    display: none;
    background-color: #E73431;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

/* Logo */
.logo__cap48 {
    width: 190px;
    margin: 10px 0 0 1rem;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
    align-items: flex-start;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 120px;
    width: 120px;
    display: block;
    object-fit: contain;
}

/* Navigation principale */
.wrap-nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.wrap-nav-main {
    display: flex;
    height: 90px;
    justify-content: space-between;
    order: 2;
    align-items: center;
}

.wrap-nav-alt {
    order: 1;
    height: 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Menu principal */
#menu {
    margin: 0;
    display: flex;
    list-style: none;
    padding: 0;
}

#menu li {
    list-style: none;
}

#menu > li {
    text-transform: uppercase;
    height: 100%;
    position: relative;
    padding-bottom: 12px;
    margin-right: 50px;
}

#menu > li:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 0;
    background-color: #e63232;
    transition: 333ms all ease-out;
}

#menu > li:hover:after {
    height: 3px;
}

#menu > li > a {
    padding: 30px 0 0 0;
    display: inline-block;
    height: 100%;
    color: #707070;
    font-size: 16px;
    transition: .2s all ease-out;
    text-decoration: none;
}

#menu > li > a:hover {
    color: #E73431;
}

#menu > li b {
    font-weight: 600 !important;
}

/* Bouton FAIRE UN DON */
#nav .wrap-give-search {
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-justify-content: flex-start;
    -ms-flex-pack: start;
    justify-content: flex-start;
}

#box-give {
    background-color: #e63232;
    color: #fff !important;
    font-weight: 700;
    padding: 20px 20px;
    border-radius: 32px;
    display: inline-block;
    transition: 333ms all ease-in;
    text-decoration: none;
}

#box-give:hover {
    background-color: #c02a27;
}

/* Recherche */
#box-search {
    position: relative;
    margin: 0 20px;
}

.btn--open-search {
    cursor: pointer;
    font-size: 18px;
    color: #333;
    display: inline-block;
    padding: 8px;
    line-height: 1;
    transition: color 0.3s;
}

.btn--open-search:hover {
    color: #E73431;
}

#box-search form {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 10px;
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 250px;
}

#box-search form.active {
    display: flex;
    gap: 10px;
    align-items: center;
}

#field--search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#field--search:focus {
    outline: none;
    border-color: #E73431;
}

#box-search form input[type="submit"] {
    background-color: #E73431;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn--close-search {
    cursor: pointer;
    font-size: 18px;
    color: #666;
    padding: 5px;
}

/* Menu alternatif (en haut dans la barre grise) */
#menu-alt {
    justify-self: flex-end;
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

#menu-alt li {
    transition: .3s all cubic-bezier(.18, 1, .22, 1);
    list-style: none;
    margin: 5px 30px 0 0;
}

#menu-alt li:first-child {
    position: relative;
}

#menu-alt li:first-child:before {
    content: '';
    width: 25px;
    height: 25px;
    display: inline-block;
    position: absolute;
    top: 0;
    left: -30px;
    background: url('https://www.cap48.be/wp-content/themes/cap48/dist/images/sprite-cap48.svg');
    background-size: 500px 500px;
    background-position: 0 -150px;
    line-height: 999px;
    overflow: hidden;
    outline: 0;
    pointer-events: none;
}

#menu-alt li:first-child a {
    font-weight: 600;
}

#menu-alt li a {
    text-decoration: none;
    color: #1779ba;
    cursor: pointer;
    line-height: inherit;
}

/* Header Hero */
#header-hero {
    width: 100%;
    margin-top: 140px; /* Pour compenser la navbar fixed */
}

.header-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Block 2 colonnes */
.two-column-block {
    width: 100%;
    background-color: #fff;
    padding: 60px 0;
}

.two-column-block .block-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    gap: 60px;
    align-items: center;
}

.block-text {
    flex: 1;
}

.block-text h2 {
    font-size: 28px;
    font-weight: 700;
    color: #0a0a0a;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.block-text p {
    font-size: 16px;
    line-height: 1.6;
    color: #4a4a4a;
    margin-bottom: 20px;
}

.btn-cta {
    display: inline-block;
    background-color: #e63232;
    color: #fff !important;
    font-weight: 700;
    padding: 15px 30px;
    border-radius: 32px;
    text-decoration: none;
    transition: 333ms all ease-in;
    margin-top: 20px;
}

.btn-cta:hover {
    background-color: #c02a27;
}

.block-image {
    flex: 1;
}

.block-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Block 4 cartes */
.four-cards-block {
    width: 100%;
    background-color: #fff;
    padding: 80px 0;
}

.four-cards-block .block-content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
    display: block;
}

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #0a0a0a;
    margin-bottom: 60px;
    width: 100%;
    display: block;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    perspective: 1000px;
    align-items: start;
}

.card {
    background-color: #FFF5E7;
    padding: 0;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: visible;
    height: auto;
    min-height: 300px;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform, box-shadow;
    -webkit-font-smoothing: antialiased;
}

/* Effet sur les autres cartes quand on hover une carte */
.cards-grid:hover .card:not(:hover) {
    opacity: 0.7;
}

.card-content-front,
.card-content-back {
    padding: 40px;
    transform-style: preserve-3d;
    will-change: transform, opacity, clip-path;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.card-content-front {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    transform: rotateY(0deg);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    box-sizing: border-box;
    z-index: 1;
    flex: 1;
    justify-content: space-between;
}

/* Pour la carte 3, le front doit être visible seulement de face */
.card-3 .card-content-front {
    backface-visibility: hidden;
}

.card-3 .card-content-back {
    backface-visibility: hidden;
    transform: rotateY(180deg);
}

.card-content-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 40px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    height: auto;
    min-height: 100%;
    overflow: visible;
    z-index: 2;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.card-content-back p {
    font-size: 16px;
    line-height: 1.6;
    color: #4a4a4a;
    margin-bottom: 20px;
}

.card-content-back p:last-of-type {
    margin-bottom: 30px;
}

.card-content-back .card-btn-close {
    margin-top: auto;
    align-self: flex-start;
}

/* Les animations sont maintenant gérées par GSAP dans main.js */

.card h3 {
    font-size: 24px;
    font-weight: 700;
    color: #0a0a0a;
    margin-bottom: 20px;
}

.card-content-front p {
    font-size: 16px;
    line-height: 1.6;
    color: #4a4a4a;
    margin-bottom: 30px;
}

.card-btn,
.card-btn-close {
    display: inline-block;
    background-color: #fff;
    color: #e63232;
    font-weight: 600;
    padding: 12px 24px;
    border: 2px solid #e63232;
    border-radius: 32px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    transition: 333ms all ease-in;
    text-align: center;
    align-self: flex-start;
}

.card-btn:hover,
.card-btn-close:hover {
    background-color: #e63232;
    color: #fff;
}

/* Contenu principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

main {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    #menu {
        gap: 20px;
    }
    
    #menu .menu-item a {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .burger {
        display: flex;
    }
    
    .btn__give-mobile {
        display: block;
    }
    
    .logo-img {
        height: 60px;
    }
    
    .wrap-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding: 20px;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .wrap-nav.active {
        display: flex;
    }
    
    #menu {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    #box-give {
        display: none;
    }
    
    .wrap-give-search {
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
    }
    
    #box-search {
        margin-left: 0;
    }
    
    .wrap-nav-main {
        flex-direction: column;
        height: auto;
        align-items: flex-start;
    }
}
