/*
 * envi-recover — fixes for menu layout and dynamic blocks.
 * Designed to mimic the original sogyweb layout where the main nav sits
 * over the hero image (transparent), with a thin green-apple utility bar above.
 */

/* ========== Reset list styles inside menus ========== */
#top-left, #top-right,
#top-left ul, #top-right ul,
#menu-menu-principal, #menu-menu-principal ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ========== ROW 1 - thin green-apple utility bar ========== */
#MenuFixed .utility-bar {
    background-color: #85ac1c;
    padding: 0;
}
#MenuFixed .utility-bar .row { min-height: 38px; align-items: center; }

/* Top-left menu items */
.menu-menu-top-left-container { width: 100%; }
#top-left {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    text-transform: uppercase;
}
#top-left > li {
    position: relative;
    display: inline-block;
    list-style: none;
    line-height: 1;
}
#top-left > li > a {
    color: #ffffff !important;
    padding: 10px 14px;
    font-size: 13px;
    letter-spacing: 0.04em;
    display: inline-block;
    text-decoration: none !important;
    background-color: transparent;
    font-weight: 600;
}
#top-left > li > a:hover,
#top-left > li:hover > a {
    background-color: #136150 !important;
    color: #ffffff !important;
}

#top-left .sub-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #136150;
    padding: 6px 0;
    min-width: 200px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
#top-left > li:hover > .sub-menu,
#top-left > li:focus-within > .sub-menu {
    display: block !important;
}
#top-left .sub-menu li {
    display: block;
    line-height: 1.4;
}
#top-left .sub-menu a {
    color: #ffffff !important;
    padding: 8px 16px;
    display: block;
    font-size: 12px;
    text-decoration: none !important;
}
#top-left .sub-menu a:hover {
    background-color: #85ac1c !important;
}

/* Top-right (zone_RS) — social/share/search */
.zone_RS {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 4px 0;
    gap: 12px;
}
.zone_RS .widget {
    display: inline-flex;
    margin: 0;
    align-items: center;
}
.zone_RS .widget a { display: inline-flex; align-items: center; line-height: 0; }
.zone_RS .widget img {
    height: 22px;
    width: auto;
    max-width: 100%;
    vertical-align: middle;
    transition: opacity .15s;
    /* The original icons were dark on green - in our context the bar is green so we keep them dark */
}
.zone_RS .widget img:hover { opacity: 0.7; }
.zone_RS .search-form {
    display: none;
    align-items: center;
    gap: 4px;
}
#search-3.open .search-form,
.zone_RS #search-3.open .search-form { display: inline-flex; }
.zone_RS .search-field {
    border: 1px solid #136150;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    width: 140px;
}
.zone_RS .search-submit {
    background-color: #136150;
    color: #fff;
    border: 0;
    border-radius: 3px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

/* ========== ROW 2 - logo + main nav OVER the hero image ========== */
#MenuFixed .main-nav-bar {
    /* Transparent so the hero image shows through.
     * On non-home pages we still want a colored bar though - handle below. */
    background-color: transparent;
    padding: 12px 0;
    position: relative;
    z-index: 5;
}
.is-home #MenuFixed .main-nav-bar {
    background-color: transparent;
    /* Negative margin pulls the menu into the hero so the hero is visible behind it */
    margin-bottom: -90px;
}
/* On non-home pages, give it a teal background since there's no hero image */
body:not(.is-home) #MenuFixed .main-nav-bar {
    background-color: #136150;
}

/* Logo */
.logo-cell { padding-left: 16px; }
.custom-logo-link { display: inline-block; }
.custom-logo, .custom-logo-link img {
    max-width: 220px;
    height: auto;
    display: inline-block;
}

/* Main menu */
#menu-menu-principal {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    width: 100%;
}
#menu-menu-principal > li {
    list-style: none;
    padding: 0 14px;
    text-align: center;
    position: relative;
}
#menu-menu-principal > li > a {
    color: #ffffff !important;
    text-decoration: none !important;
    text-transform: uppercase;
    font-size: 13px;
    line-height: 1.2;
    display: inline-block;
    font-weight: 700;
    letter-spacing: 0.04em;
}
#menu-menu-principal > li > a img {
    display: block;
    margin: 0 auto 8px;
    max-height: 32px;
    width: auto;
    filter: brightness(0) invert(1);  /* force icons to white */
}
#menu-menu-principal > li:hover > a {
    color: #ffffaa !important;
}

#menu-menu-principal .dropdown-menu,
#menu-menu-principal ul.sub-menu {
    display: none !important;
    position: absolute;
    background-color: #136150;
    border: 0;
    margin: 0;
    padding: 6px 0;
    min-width: 240px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    top: 100%;
    left: 0;
    list-style: none;
}
#menu-menu-principal > li.dropdown:hover > .dropdown-menu,
#menu-menu-principal > li:hover > ul.sub-menu,
#menu-menu-principal > li:focus-within > .dropdown-menu,
#menu-menu-principal > li:focus-within > ul.sub-menu {
    display: block !important;
}
#menu-menu-principal .dropdown-menu li,
#menu-menu-principal ul.sub-menu li {
    display: block;
    list-style: none;
}
#menu-menu-principal .dropdown-menu a,
#menu-menu-principal ul.sub-menu a {
    color: #ffffff !important;
    padding: 8px 16px;
    text-align: left;
    display: block;
    font-size: 12px;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
#menu-menu-principal .dropdown-menu a:hover,
#menu-menu-principal ul.sub-menu a:hover {
    background-color: #85ac1c !important;
}
#menu-menu-principal .caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/* Mobile */
@media (max-width: 767px) {
    #menu-menu-principal { flex-direction: column; align-items: stretch; }
    #menu-menu-principal > li { text-align: left; }
    #menu-menu-principal .dropdown-menu,
    #menu-menu-principal ul.sub-menu {
        position: static;
        background-color: rgba(19, 97, 80, 0.6);
    }
    .zone_RS { justify-content: flex-start; }
    .is-home #MenuFixed .main-nav-bar { margin-bottom: 0; }
}

/* ========== Hero - extends FROM the top to overlap with main nav ========== */
#masthead.site-header {
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 100px 0 80px;
    min-height: 540px;
    display: flex;
    align-items: flex-end;
    position: relative;
}
.is-home #masthead.site-header {
    /* Pull hero up so it starts behind row-2 */
    margin-top: -90px;
    padding-top: 200px;
}
#masthead.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(19,97,80,.12), rgba(0,0,0,.05) 30%, rgba(0,0,0,.40));
    z-index: 0;
}
#masthead.site-header > .container { position: relative; z-index: 1; }

#ZoneIntroAccueil h1 {
    font-size: 4.6rem;
    font-weight: 800;
    line-height: 1.0;
    color: #fff;
    margin: 0;
    letter-spacing: -0.01em;
}
@media (max-width: 991px) {
    #ZoneIntroAccueil h1 { font-size: 3rem; }
}
#ZoneIntoP p { color: #fff; font-size: 1.05rem; line-height: 1.55; }
#ZoneIntoP { padding-top: 30px; padding-left: 30px; border-left: 1px solid rgba(255,255,255,.5); }
#ZoneIntoP .wp-block-button__link {
    background-color: #fff !important;
    color: #136150 !important;
    border-radius: 99px;
    padding: 14px 32px;
    font-weight: 700;
    text-decoration: none !important;
    display: inline-block;
    margin-top: 24px;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.05em;
}

/* ========== BoxHelp sidebar (fixed right side) ========== */
#BoxHelp {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 90;
    width: 92px;
    background: #ffffff;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 2px 12px rgba(0,0,0,.10);
    padding: 6px;
}
#BoxHelp .widget {
    text-align: center;
    margin: 0 0 4px 0;
    padding: 6px 4px;
    border-bottom: 1px solid #f0f0f0;
}
#BoxHelp .widget:last-child { border-bottom: 0; }
#BoxHelp .widgettitle {
    font-size: 9px;
    color: #85ac1c;
    text-transform: uppercase;
    margin: 0 0 4px;
    font-weight: 700;
    letter-spacing: 0.04em;
}
#BoxHelp .widget a { display: block; line-height: 0; }
#BoxHelp img {
    max-width: 60px;
    width: 100%;
    height: auto;
    display: inline-block;
}
@media (max-width: 1199px) {
    #BoxHelp { display: none; }
}

/* ========== Carousel "À la une" (#ZoneActu) ========== */
#ZoneActu {
    background-color: #f5f5f5;
    padding: 60px 0;
}
#carouselAlaUne #SlideNews {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
#carouselAlaUne .carousel-item {
    display: none;
    width: 100%;
    min-height: 420px;
    position: relative;
}
#carouselAlaUne .carousel-item.active { display: block; }
#carouselAlaUne .ImageBack {
    display: block;
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
}
#carouselAlaUne .ContenuBlock {
    background-color: #136150;
    color: #fff;
    padding: 18px 18px 48px;
    min-height: 200px;
    position: relative;
}
#carouselAlaUne .ContenuBlock h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; color: #fff; }
#carouselAlaUne .ContenuBlock .Date { font-size: 12px; margin-bottom: 8px; opacity: 0.85; }
#carouselAlaUne .ContenuBlock .Titre { font-size: 18px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
#carouselAlaUne .ContenuBlock > div { font-size: 13px; line-height: 1.4; }
#carouselAlaUne .UnboutonBlanc {
    position: absolute;
    bottom: 12px; right: 12px;
    background-color: #fff;
    color: #136150 !important;
    border-radius: 50%;
    width: 36px; height: 36px;
    line-height: 32px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none !important;
    border: 2px solid #fff;
}
#carouselAlaUne .UnboutonBlanc:hover { background-color: #136150; color: #fff !important; }
#carouselAlaUne #Dots .carousel-indicators {
    position: relative; margin: 0 0 8px 0; padding: 0;
    bottom: auto; list-style: none;
    display: flex; gap: 6px;
}
#carouselAlaUne #Dots .carousel-indicators li {
    width: 8px; height: 8px;
    background-color: #ccc;
    border-radius: 50%;
    border: 0; margin: 0; cursor: pointer; text-indent: -9999px;
}
#carouselAlaUne #Dots .carousel-indicators li.active { background-color: #136150; }
#carouselAlaUne .carousel-indicators2 { padding-left: 20px; }
#carouselAlaUne .carousel-indicators2 h2 { color: #136150; margin-bottom: 24px; font-size: 28px; font-weight: 700; }
#carouselAlaUne .News {
    background-color: #fff;
    border: 1px solid #EBEBEB;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
#carouselAlaUne .News:hover, #carouselAlaUne .News.active { background-color: #f0f7e8; border-color: #85ac1c; }
#carouselAlaUne .News h3 { font-size: 12px; text-transform: uppercase; color: #85ac1c; margin-bottom: 4px; letter-spacing: 0.06em; }
#carouselAlaUne .News .Contenu { font-size: 14px; color: #2a2a2a; line-height: 1.4; }

/* ========== Background utility classes ========== */
.BackgroundVertPomme { background-color: #85ac1c; }
.BackgroundVertClair { background-color: #85ac1c; }
.BackgroundVertFonce { background-color: #136150; color: #fff; }
.BackgroundGrisClair { background-color: #f5f5f5; }

/* ========== ImageFooter ========== */
#ZoneImageFooter .ImageFooter {
    background-size: cover;
    background-position: center;
    height: 240px;
}

/* ========== PreFooter ========== */
#PreFooter { background-color: #f5f5f5; padding: 50px 0; }
#PreFooter h2 { color: #136150; margin-bottom: 30px; }
#PreFooter h3.widget-title { color: #136150; font-size: 16px; text-transform: uppercase; margin-bottom: 12px; }

/* Single article styling */
.entry-title { color: #136150; margin-bottom: 1rem; }
.entry-content h2, .entry-content h3 { color: #136150; margin-top: 1.5em; }
.entry-content a { color: #85ac1c; }
.entry-content a:hover { color: #136150; }

/* Hide recovery banner in WP version */
#__recover-banner { display: none !important; }
