/*
Theme Name: Epsylhom
Theme URI: https://www.epsylhom.fr/
Author: Epsylhom
Author URI: https://www.epsylhom.fr/
Description: Thème WordPress classic minimal pour la reconstruction progressive du site Epsylhom.
Version: 2.2
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
Text Domain: epsylhom
*/

@font-face {
    font-family: 'Ink Free';
    src: url('fonts/Inkfree.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #ffffff;
}

body {
    position: relative;
    font-family: Calibri, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #3C7482;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    left: -2vw;
    right: -2vw;
    background: linear-gradient(
        135deg,
        rgba(193, 211, 223, 1) 0%,
        rgba(193, 211, 223, 0) 100%
    );
    z-index: -1;
    pointer-events: none;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* ------------------------------------------------------------------
   Structure générale
------------------------------------------------------------------- */

.epsylhom-wrapper {
    width: 100%;
    max-width: 1520px;
    margin: 0 auto;
    padding: 0.4rem 1rem 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

.epsylhom-left {
    width: 235px;
    flex: 0 0 235px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
    position: relative;
    z-index: 2;
}

.epsylhom-logo {
    max-width: 215px;
    height: auto;
    margin-bottom: 0.7rem;
}

.epsylhom-kpi-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.35rem;
}

.epsylhom-kpi {
    width: 125px;
    border-radius: 18px;
    border: 3px solid #8FD0D4;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transform-origin: center center;
    box-sizing: border-box;
}

.epsylhom-kpi:hover {
    transform: scale(2.1);
    box-shadow: 0 22px 42px rgba(0,0,0,0.22);
    position: relative;
    z-index: 10;
}

.epsylhom-main-area {
    flex: 1;
    min-width: 0;
    margin-left: 0.4rem;
    padding-top: 40px;
    position: relative;
    z-index: 20;
}

/* ------------------------------------------------------------------
   Haut de page : slogan + pavés
------------------------------------------------------------------- */

.epsylhom-top-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.2rem;
    min-height: 118px;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 200;
}

/* Slogan sur deux lignes, centré */
.epsylhom-tagline-text {
    width: 280px;
    height: 118px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Ink Free", "Segoe Script", "Comic Sans MS", cursive;
    font-size: 20px;
    font-weight: bold;
    color: #3C7482;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
    white-space: normal;
    flex-shrink: 0;
}

.epsylhom-tagline-text span {
    display: block;
    text-align: center;
}

/* Ligne des pavés */
.epsylhom-right {
    height: 118px;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 300;
}

/* ------------------------------------------------------------------
   Pavés
------------------------------------------------------------------- */

.epsylhom-tile {
    position: relative;
    width: 165px;
    height: 46px;
    border-radius: 14px;
    background: #4E8696;
    box-shadow: 0 10px 18px rgba(0,0,0,0.12);
    transition: transform 0.15s ease-out,
                box-shadow 0.15s ease-out,
                background 0.15s ease-out;
    overflow: visible;
    z-index: 301;
}

.epsylhom-tile-main-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 0.7rem;
    box-sizing: border-box;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.15;
    white-space: normal;
    position: relative;
    z-index: 2;
}

.epsylhom-tile-main-link:visited,
.epsylhom-tile-main-link:hover,
.epsylhom-tile-main-link:focus {
    color: #ffffff;
    text-decoration: none;
}

.epsylhom-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 22px rgba(0,0,0,0.15);
    background: #5D94A2;
}

/* ------------------------------------------------------------------
   Dropdown : opaque, au-dessus du contenu Elementor
------------------------------------------------------------------- */

.epsylhom-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    width: 100%;
    display: none;
    box-sizing: border-box;
    padding: 0.35rem 0 0.45rem;
    border-radius: 10px;

    background: #B5C7D3;
    background-color: #B5C7D3;
    opacity: 1;
    visibility: visible;

    border: 1px solid rgba(78, 134, 150, 0.12);
    box-shadow: 0 12px 20px rgba(0,0,0,0.18);

    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    isolation: isolate;

    z-index: 99999;
}

.epsylhom-dropdown::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #B5C7D3;
    border-radius: 10px;
    z-index: -1;
}

.epsylhom-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.35rem 0.45rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #234856;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    background: transparent;
}

.epsylhom-dropdown-item:visited,
.epsylhom-dropdown-item:hover,
.epsylhom-dropdown-item:focus {
    color: #234856;
    text-decoration: none;
}

.epsylhom-dropdown-item:hover {
    background: rgba(255,255,255,0.48);
}

.epsylhom-tile:hover .epsylhom-dropdown,
.epsylhom-tile:focus-within .epsylhom-dropdown {
    display: block;
}

/* ------------------------------------------------------------------
   Zone centrale WordPress
------------------------------------------------------------------- */

.epsylhom-page {
    margin-top: 5.3rem;
    min-height: auto;
    position: relative;
    z-index: 1;
}

.epsylhom-page-inner {
    max-width: 100%;
    min-height: auto;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.epsylhom-entry-content {
    width: 100%;
    max-width: 1280px;
    font-size: 1rem;
    line-height: 1.7;
    color: #355e69;
    padding-top: 0.4rem;
    padding-bottom: 0;
    position: relative;
    z-index: 1;
}

.epsylhom-entry-content .wp-block-columns {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.2rem;
    width: 100%;
}

.epsylhom-entry-content .wp-block-column {
    flex: 1;
}

.epsylhom-entry-content .wp-block-column:first-child {
    display: flex;
    justify-content: center;
}

.epsylhom-entry-content .wp-block-column img {
    max-width: 100%;
    height: auto;
}

.epsylhom-entry-content p {
    margin: 0 0 0.85rem;
}

.epsylhom-entry-content h1,
.epsylhom-entry-content h2,
.epsylhom-entry-content h3,
.epsylhom-entry-content h4 {
    color: #3C7482;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.epsylhom-entry-content ul,
.epsylhom-entry-content ol {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.epsylhom-entry-content .wp-block-image,
.epsylhom-entry-content figure {
    margin: 0 0 1rem;
}

.epsylhom-entry-content img,
.epsylhom-entry-content .wp-block-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.epsylhom-entry-content .wp-block-media-text {
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.2rem;
}

.epsylhom-entry-content .wp-block-button__link {
    background: #3C7482;
    border-radius: 12px;
}

/* Elementor : éviter que certains conteneurs passent devant le menu */
.elementor,
.elementor-section,
.elementor-container,
.elementor-widget,
.elementor-column,
.elementor-element {
    position: relative;
    z-index: 1;
}

.texte-justifie-epsylhom p {
    text-align: justify !important;
}
/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */

.epsylhom-footer {
    width: 100%;
    padding: 0.2rem 1.2rem;
    margin-top: 0.1rem;
    border-top: 1px solid rgba(60, 116, 130, 0.12);
    font-size: 12px;
    color: rgba(60, 116, 130, 0.72);
}

.epsylhom-footer-inner {
    max-width: 1520px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: center;
    flex-wrap: wrap;
}

.epsylhom-footer-inner span:last-child {
    text-align: right;
    padding-right: 0.8rem;
}

.epsylhom-footer a {
    color: rgba(60, 116, 130, 0.88);
    text-decoration: none;
}

.epsylhom-footer a:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------
   Popup administrateur
------------------------------------------------------------------- */

.admin-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.admin-modal-box {
    position: relative;
    width: 100%;
    max-width: 620px;
    background: #ffffff;
    color: #3C7482;
    border: 2px solid #8FD0D4;
    border-radius: 18px;
    padding: 1.6rem 1.3rem 1.2rem;
    box-shadow: 0 18px 40px rgba(0,0,0,0.14);
    font-family: Roboto, "Segoe UI", Arial, sans-serif;
    text-align: center;
}

.admin-modal-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.92rem;
}

.admin-modal-content a {
    color: #3C7482;
    font-weight: 700;
    text-decoration: underline;
}

.admin-modal-close {
    position: absolute;
    top: 0.45rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: #3C7482;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.admin-modal-close:hover {
    opacity: 0.75;
}
/* ------------------------------------------------------------------
   Menu mobile dédié
------------------------------------------------------------------- */

.epsylhom-mobile-menu {
    display: none;
}

@media (max-width: 900px) {
    .epsylhom-right {
        display: none;
    }

    .epsylhom-mobile-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 420px;
        margin: 0 auto;
        gap: 0.45rem;
    }

    .epsylhom-mobile-link,
    .epsylhom-mobile-sublink {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        text-decoration: none;
        border-radius: 14px;
    }

    .epsylhom-mobile-link {
        background: #4E8696;
        color: #ffffff;
        font-size: 0.82rem;
        font-weight: 700;
        text-transform: uppercase;
        padding: 0.95rem 1rem;
        box-shadow: 0 10px 20px rgba(0,0,0,0.10);
    }

    .epsylhom-mobile-sublink {
        background: #DCE9EF;
        color: #355e69;
        font-size: 0.78rem;
        font-weight: 700;
        padding: 0.7rem 0.9rem;
        border: 1px solid rgba(78, 134, 150, 0.10);
    }

    .epsylhom-tagline-text {
        width: 100%;
        max-width: 320px;
        height: auto;
        min-height: auto;
        margin: 0 auto 0.6rem;
        font-size: 16px;
    }

    .epsylhom-wrapper {
        flex-direction: column;
        align-items: center;
        padding: 0.75rem 0.85rem 0;
    }

    .epsylhom-left,
    .epsylhom-main-area {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .epsylhom-left {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .epsylhom-logo {
        max-width: 180px;
        margin: 0 auto 0.8rem;
    }

    .epsylhom-kpi-column {
        flex-direction: row;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 0.45rem;
        width: 100%;
        overflow-x: auto;
    }

    .epsylhom-kpi {
        width: 92px;
        flex: 0 0 auto;
    }

    .epsylhom-kpi:hover {
        transform: none;
        box-shadow: none;
    }

    .epsylhom-top-row {
        flex-direction: column;
        align-items: center;
        gap: 0.65rem;
        min-height: auto;
    }

    .epsylhom-main-area {
        padding-top: 0.45rem;
    }

    .epsylhom-page {
        margin-top: 1rem;
    }

    .epsylhom-entry-content {
        width: 100%;
        max-width: 100%;
        font-size: 0.98rem;
        line-height: 1.6;
    }

    .epsylhom-entry-content .wp-block-columns,
    .epsylhom-entry-content .wp-block-media-text {
        flex-direction: column;
        gap: 1rem;
    }

    .epsylhom-entry-content img,
    .epsylhom-entry-content .wp-block-image img {
        width: 100%;
        height: auto;
    }

    .epsylhom-footer {
        padding: 0.45rem 0.8rem;
    }

    .epsylhom-footer-inner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
    }

    .epsylhom-footer-inner span:last-child {
        text-align: center;
        padding-right: 0;
    }
}

@media (max-width: 640px) {
    .epsylhom-mobile-menu {
        max-width: 100%;
    }

    .epsylhom-mobile-link {
        font-size: 0.79rem;
        padding: 0.85rem 0.9rem;
    }

    .epsylhom-mobile-sublink {
        font-size: 0.76rem;
        padding: 0.65rem 0.8rem;
    }

    .epsylhom-logo {
        max-width: 170px;
    }

    .epsylhom-kpi {
        width: 88px;
    }

    .epsylhom-tagline-text {
        max-width: 290px;
        font-size: 15px;
    }
}