/* --- HomePage Styles (front-page.php) --- */
.front-page-content .container { /* Specific to front-page sections */
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.front-page-section:not(.hero-section) {
    padding: 20px 0 20px 0;
    text-align: center;
}

.front-page-section h2 { /* Specific to front-page sections */
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 1.5em;
}

.front-page-section p { /* Specific to front-page sections */
    line-height: 1.5;
    margin-bottom: 1.5em;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Section Héros */
.hero-section {
    position: relative;
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-background-image {
    position: absolute;
    width: 100%; 
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-background-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top right, var(--color-primary), var(--color-secondary), var(--color-brand));
    z-index: 1;
}


/* Styles for the content within the hero section */
.hero-section .hero-content {      
    margin: 0;    
    top: 8em;
    /* left: 5em; */
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px 0 20px;
    position: relative;
    z-index: 3;
}

/* Styles for the text to improve readability on blurred background */
.hero-section h2 {
    font-size: 2.3em;
    color: white;
    margin: 0; 
    font-weight: 700; 
}

.hero-section .hero-philosophy,
.hero-section p {
    /* font-size: 1.8em; */
    color: white; 
    max-width: 1000px;
    font-weight: 500;
    margin: 0.5em 0 1em 0;
    letter-spacing: 0.5px;
}

/* Style for the carousel button */
.hero-section .hero-content .hero-button {
    background: linear-gradient(
        45deg,
        var(--color-primary) 0%, 
        var(--color-secondary) 50%, 
        var(--color-brand) 100% 
    );
    background-size: 200% 200%;
    /* background-color: var(--color-background-white); */
    color: white; 
    /* border: none; */
    border: 2px solid var(--color-tertiary); 
    padding: 12px 15px 10px 15px; 
    font-size: 14px;
    text-transform: uppercase; 
    font-weight: 700; 
    border-radius: 5px; 
    transition: background-color 0.5s ease, color 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hero-section .hero-content .hero-button:hover,
.hero-section .hero-content .hero-button:focus {
    background-color: var(--color-brand);
    background-position: 100% 0; 
    transform: translateY(-2px); 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); 
    cursor: pointer;
}

.mobile-only { /* Hide the button "Prendre Rendez-vous" on desktop */
    display: none;
}

@media (max-width: 1000px) { /* Show the button "Prendre Rendez-vous" on mobile */
    .mobile-only {
        display: inline-block;
    }
}

.presentation-grid {
    display: grid;
    grid-template-columns: 1fr 225px; 
    gap: 10px 125px; /* Adjusted gap for better spacing */
    /* margin-top: 4em; */
    align-items: start;

    grid-template-areas:
        "title image"
        "content image"
        "button image";
}
.presentation-title {
    grid-area: title;
    text-align: left;
}

.presentation-text {
    grid-area: content;
    /* font-size: 16px; */
    line-height: 1.5;
    text-align: left;
}

.presentation-read-more-button {
    grid-area: button;
    margin-top: 1.5em; /* Ou retirez si le gap suffit */
    text-align: left;
}

.presentation-image {
    grid-area: image;
    margin-top: 10px; /* Marge pour l'image sur desktop */
}

.presentation-title h2, 
#presentation h2 { 
    font-size: 1.8em; 
    font-weight: 500;
    /* color: var(--color-brand); */
    text-align: left; 
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 10px; 
}

.presentation-title h3 {
    margin-top: 0;    
    /* font-size: 1.2em;  */
    line-height: 1.3;
    margin-bottom: 5px;
}

.presentation-text span {
    font-weight: 300; /* Slightly bolder (Medium weight for Montserrat) */
    letter-spacing: 1px; /* A bit more space between letters */
    color: var(--color-brand);
    font-size: 1.3em; /* Slightly larger for emphasis */
}

.presentation-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: var(--shadow-medium);
    /* margin-top: 10px; */
}
.presentation-read-more-button {
    margin-top: 2em;
}

@media screen and (max-width: 800px) { /* Combines with (min-width: 450px) and (max-width: 700px) */
    .presentation-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        /* margin-top: 2em; */
        grid-template-areas:
            "title"
            "image"
            "content"
            "button";
    }    
    .presentation-title {
        grid-area: title; 
        text-align: center; 
    }
    .presentation-image {
        grid-area: image;
        max-width: 300px; 
        margin-top: 0; 
        margin-left: auto;
        margin-right: auto;
    }
    .presentation-text { 
        grid-area: content; 
        text-align: center; 
        /* font-size: 14px; */
        /* margin-left: 2em; */
        /* margin-right: 2em; */
        max-width: 600px;
        padding: 10px;
        margin-left: auto;
        margin-right: auto;
    }
    .presentation-read-more-button {
        grid-area: button;
        margin-top: 2.5em;
        text-align: center;
    }
    .presentation-section h2,
    #presentation h2 {
        text-align: center; 
        font-size: 1.8em;
        margin-top: 10px;
        margin-bottom: 10px;
        line-height: 1.2;
        order: 1;
    }    
}
@media screen and (max-width: 450px) {
    #presentation .container {
        margin-top: 3em;
    }    
}


/* Container for the services grid */
#services .container {
    max-width: 1100px;
}
.services-grid {
    display: flex; 
    flex-wrap: wrap; 
    gap: 40px;
    justify-content: center; 
}

/* Style of individual service card */
.service-item {
    position: relative;
    border-radius: 5px; 
    overflow: hidden; 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-decoration: none;     
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 300px; /* Fixed height for visual uniformity */
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    cursor: pointer;
    flex-grow: 1; 
    flex-shrink: 1; 
    flex-basis: 300px; 
    max-width: 350px; 
    margin: 0; 
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
}

.service-item:hover {
    transform: translateY(-10px); 
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Define the gradient for the card without image */
.service-item.no-image {
    background: linear-gradient(to top right, var(--color-primary), var(--color-secondary)); 
}
.service-item.no-image h3 {
    color: white;
}

/* Image or background of the card */
.service-item img { 
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; 
    object-fit: cover;
    z-index: 1; 
    transition: transform 0.3s ease;
    border-radius: 5px;
    transform: translateZ(0); 
    backface-visibility: hidden;
    will-change: transform;
}

.service-item:hover img {
    transform: scale(1.08) translateZ(0);
}

/* Overlay on the image for text readability */
.service-item .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%; 
    background: linear-gradient(to top, 
                                rgba(255, 255, 255, 0.8) 0%, /* Semi-transparent white at the bottom (for dark text) */
                                rgba(255, 255, 255, 0.3) 40%, /* Less transparent in the middle */
                                transparent 80%); /* Completely transparent at the top */
    z-index: 2; 
    border-radius: 5px; 
}

/* Text content of the card (title and description) */
.service-item .card-content { 
    position: relative;
    z-index: 4; 
    padding: 1.5em; 
    text-align: left; 
    display: flex; 
    flex-direction: column;
    justify-content: flex-end; 
    height: 100%;
}

.service-item h3 {
    font-size: clamp(1.4em, 2.5vw, 1.8em);
    color: var(--color-brand);
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.3;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

/* Media Queries for responsiveness */
/* Screens of medium size (ex: tablets - between 1024px and 769px) */
@media (max-width: 1034px) and (min-width: 769px) {
    .service-item:not(.service-consultations) {
        flex-basis: calc(50% - 20px); 
        max-width: 350px;
    }

    /* The "Consultations" card takes 100% width to be alone on its line */
    .service-item.service-consultations {
        flex-basis: 100%; 
        max-width: 350px; 
        margin-left: 10em;
        margin-right: 10em;
        /* max-width: 450px;  */
    }
}

@media screen and (max-width: 768px) {
    .services-grid {
        /* grid-template-columns: 1fr;  */
        gap: 2.5em;
        justify-items: center; 
    }
    .service-item {
        flex-basis: 100%;
        max-width: 350px;
        margin: 0 auto; 
        height: 350px; 
    }
    .service-item .card-content {
        padding: 1.2em;
    }
}

@media screen and (max-width: 400px) {
    .services-grid {
        /* grid-template-columns: 1fr;  */
        gap: 2.5em;
        justify-items: center; 
    }
    .service-item {
        flex-basis: 100%;
        max-width: 250px;
        margin: 0 auto; 
        height: 250px; 
    }
}

@media screen and (max-width: 305px) {
    .services-grid {
        /* grid-template-columns: 1fr;  */
        gap: 2.5em;
        justify-items: center; 
    }
    .service-item {
        flex-basis: 100%;
        max-width: 150px;
        margin: 0 auto; 
        height: 150px; 
    }
}

/* Contact CTA Section */
#contact-cta {
    margin-top: 80px;
    margin-bottom: 40px;
}
.contact-cta-section .container {
    padding-right: 20px;
    padding-left: 20px;
}
.contact-cta-section {
    /* border-radius: 5px; */
    background-color: var(--color-secondary);
    color: var(--color-text-light);
    max-width: 1500px;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
}
/* Retire la bordure sur les écrans larges pour l'effet "bord à bord" */
@media (min-width: 1500px) {
    .contact-cta-section {
        border-radius: 5px;
    }
}
.contact-cta-section h2 {
    color: var(--color-text-light);
    margin: 20px 10px;
}
.contact-cta-section p {
    font-size: 16px;
    color: var(--color-text-light);
}
.contact-cta-section .button-tertiary { 
    background-color: var(--button-tertiary-bg-color);
    color: var(--button-tertiary-text-color);
    border: 1px solid var(--button-tertiary-border-color);
    margin-bottom: 20px;
}
.contact-cta-section .button-tertiary:hover {
    background-color: var(--button-tertiary-bg-hover-color);
    color: var(--button-tertiary-text-hover-color);
    border-color: var(--button-tertiary-border-hover-color);
}

@media screen and (max-width: 800px) {
    .contact-cta-section {
        font-size: 14px;
    }
    
}


/* Latest Posts Section (Homepage) */
#latest-posts .container {
    max-width: 1100px;
}
/* .latest-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 2em;
    text-align: left;
} */
 .latest-posts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center; 
    margin-top: 2em;
    text-align: left;
 }
.latest-post-item {
    flex: 1 1 280px;
    max-width: 350px;
    background-color: var(--color-background-white);
    border: 1px solid var(--color-border-light);
    border-radius: 5px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.latest-post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong-primary);
}
.latest-posts-grid .post-thumbnail { 
    margin-bottom: 15px; 
}
.post-thumbnail a { 
    display: block; 
}

#primary .latest-posts-grid .post-thumbnail img,
#primary.blog article.post.has-post-thumbnail .post-thumbnail img,
#primary.archive article.post.has-post-thumbnail .post-thumbnail img,
#primary.post-type-archive-recette article.post.has-post-thumbnail .post-thumbnail img,
#primary.search article.post.has-post-thumbnail .post-thumbnail img,
.site-content .latest-posts-grid .post-thumbnail img,
.site-content.blog article.post.has-post-thumbnail .post-thumbnail img,
.site-content.archive article.post.has-post-thumbnail .post-thumbnail img,
.site-content.post-type-archive-recette article.post.has-post-thumbnail .post-thumbnail img,
.site-content.search article.post.has-post-thumbnail .post-thumbnail img {
    width: 100%;
    height: 200px; 
    object-fit: cover;
    border-radius: 5px;
    display: block;
}

.latest-post-title {
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 0.5em;
}
.latest-post-title a {
    color: var(--color-text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}
.latest-post-title a:hover {
    color: var(--color-brand);
}
.latest-post-excerpt {
    /* font-size: 12px; */
    flex-grow: 1;
    margin-bottom: 1em;
}
/* .latest-post-excerpt p {
    font-size: 13px;
} */
.latest-post-read-more.button {
    margin-top: auto;
    align-self: flex-start;
    padding-left: 0;
    background: none;
}

@media screen and (min-width: 701px) and (max-width: 1200px) {
    .hero-section {
        min-height: 500px;
        width: 100%;
        margin-top: 50px;
    }    
}

@media screen and (min-width: 450px) and (max-width: 700px) {
    .hero-section {
        min-height: 300px;
        width: 100%;
        padding-top: 50px;
        padding-bottom: 50px;
    }

    .hero-section h2 {
        /* font-size: 2em; */
        font-weight: 700;
    }
    .hero-section .hero-philosophy {
        font-size: 1.3em;
        font-weight: 600;
    }
    .hero-section .hero-content {
        top: 7em; 
    }
    /* .hero-section .hero-button { 
        margin-top: 4em;
    } */
}

@media screen and (max-width: 450px) {
    .front-page-section h2 { /* Already covered by base h2 responsive */
        margin-bottom: 1em;
    }
    .hero-section {
        min-height: 200px;
        width: 100%;
    }
    .hero-section .hero-content {
        top: 5em; 
    }
    .hero-section h2 {
        font-weight: 800;
        margin-bottom: 1em;
    }
    .hero-section .hero-philosophy {
        font-weight: 700;
        line-height: 1.3;
        margin-bottom: 2em;
    }
    .hero-section .hero-button { /* .button.button-primary.hero-button */
        padding: 8px 12px;
        margin-top: 2em;
    }

    .hero-slide-background {    
    background-size: contain;
    }
}
