/**
 * Espace Romand Core
 * Homepage premium
 *
 * @since 2.0.0
 */


/* ==========================================================
   BASE
   ========================================================== */

.erc-home,
.erc-home *,
.erc-home *::before,
.erc-home *::after {
    box-sizing: border-box;
}

.erc-home {
    /*
     * Kubio limite son contenu à 840px.
     * Ces propriétés doivent donc avoir priorité afin que le portail
     * puisse utiliser sa largeur desktop réelle tout en restant centré.
     */
    width: min(1180px, calc(100vw - 48px)) !important;
    max-width: 1180px !important;

    margin-left: 50% !important;
    margin-right: 0 !important;

    padding: 28px 0 34px;

    transform: translateX(-50%) !important;
}


/* ==========================================================
   PORTAILS
   ========================================================== */

.erc-home-portals {
    width: 100%;
}

.erc-home-portals__grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 24px;

    width: 100%;

    align-items: stretch;
}


/* ==========================================================
   CARTES
   ========================================================== */

.erc-home-portal {
    display: flex;
    flex-direction: column;

    min-width: 0;
    height: 100%;

    overflow: hidden;

    background: #ffffff;

    border: 1px solid #e3eaf2;
    border-radius: 22px;

    box-shadow:
        0 8px 24px rgba(27, 49, 75, 0.06),
        0 18px 48px rgba(27, 49, 75, 0.07);

    transition:
        transform 180ms ease,
        box-shadow 180ms ease;
}

.erc-home-portal:hover {
    transform: translateY(-5px);

    box-shadow:
        0 12px 28px rgba(27, 49, 75, 0.09),
        0 24px 58px rgba(27, 49, 75, 0.11);
}


/* ==========================================================
   PHOTOS
   ========================================================== */

.erc-home-portal__visual {
    position: relative;

    height: 185px;
    flex: 0 0 185px;

    overflow: visible;
}

.erc-home-portal__image {
    display: block;

    width: 100%;
    height: 100%;

    margin: 0 !important;

    object-fit: cover;

    border: 0;
}


/* ==========================================================
   ICÔNES DES CARTES
   ========================================================== */

.erc-home-portal__icon {
    position: absolute;

    left: 50%;
    bottom: -29px;
    z-index: 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 60px;
    height: 60px;

    transform: translateX(-50%);

    border: 4px solid #ffffff;
    border-radius: 50%;

    background: #edf6ff;
    color: #2477c9;

    box-shadow:
        0 6px 18px rgba(26, 51, 78, 0.14);
}

.erc-home-portal__icon svg {
    display: block;

    width: 26px;
    height: 26px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================================
   CONTENU DES CARTES
   ========================================================== */

.erc-home-portal__body {
    display: grid;

    grid-template-rows:
        minmax(64px, auto)
        minmax(72px, auto)
        auto;

    flex: 1 1 auto;

    padding:
        40px
        20px
        20px;

    text-align: center;
}

.erc-home-portal__content {
    display: contents;
}


/* Natural action height keeps both links inside the card. */
.erc-home-portal__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    padding: 6px;
}

/* Titre */

.erc-home-portal__title {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-width: 0;

    margin: 0 !important;
    padding: 0 !important;

    color: #102747 !important;

    font-size: 20px !important;
    font-weight: 750 !important;
    line-height: 1.2 !important;

    letter-spacing: -0.025em;

    text-align: center;

    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
}


/* Description */

.erc-home-portal__description {
    display: flex;

    align-items: flex-start;
    justify-content: center;

    width: 100%;
    max-width: 245px;

    margin: 0 auto !important;
    padding: 5px 0 0 !important;

    color: #60728a !important;

    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;

    text-align: center;
}


/* ==========================================================
   BOUTONS
   ========================================================== */

.erc-home-portal__button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    align-self: center;
    justify-self: center;

    gap: 9px;

    width: auto;
    max-width: 100%;
    min-height: 44px;

    margin: 0;
    padding: 11px 17px;

    border: 0;
    border-radius: 11px;

    background: #2477c9;
    color: #ffffff !important;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;

    text-align: center;
    text-decoration: none !important;

    white-space: normal;
    overflow-wrap: anywhere;

    box-shadow:
        0 5px 14px rgba(36, 119, 201, 0.18);

    transition:
        transform 160ms ease,
        filter 160ms ease,
        box-shadow 160ms ease;
}

.erc-home-portal__button:hover,
.erc-home-portal__button:focus {
    color: #ffffff !important;
    text-decoration: none !important;

    filter: brightness(0.94);

    box-shadow:
        0 7px 18px rgba(30, 50, 75, 0.20);
}

.erc-home-portal__button:focus-visible {
    outline:
        3px solid rgba(36, 119, 201, 0.25);

    outline-offset: 3px;
}

.erc-home-portal__arrow {
    display: inline-block;

    flex: 0 0 auto;

    font-size: 17px;
    line-height: 1;

    transition:
        transform 160ms ease;
}

.erc-home-portal__button:hover
.erc-home-portal__arrow {
    transform: translateX(3px);
}


/* ==========================================================
   COULEURS DES UNIVERS
   ========================================================== */

/* Petites-annonces */

.erc-home-portal--annonces
.erc-home-portal__icon {
    background: #edf6ff;
    color: #2477c9;
}

.erc-home-portal--annonces
.erc-home-portal__button {
    background:
        linear-gradient(
            135deg,
            #2589dc,
            #1768b6
        );
}


/* Immobilier */

.erc-home-portal--immobilier
.erc-home-portal__icon {
    background: #eaf9f4;
    color: #169779;
}

.erc-home-portal--immobilier
.erc-home-portal__button {
    background:
        linear-gradient(
            135deg,
            #1ca985,
            #12866c
        );
}


/* Annuaire */

.erc-home-portal--annuaire
.erc-home-portal__icon {
    background: #f4edff;
    color: #7447b8;
}

.erc-home-portal--annuaire
.erc-home-portal__button {
    background:
        linear-gradient(
            135deg,
            #8756c6,
            #693ca7
        );
}


/* Devis */

.erc-home-portal--devis
.erc-home-portal__icon {
    background: #fff1e7;
    color: #dd6a14;
}

.erc-home-portal--devis
.erc-home-portal__button {
    background:
        linear-gradient(
            135deg,
            #ef811e,
            #d45d0b
        );
}


/* ==========================================================
   BANDE DE CONFIANCE
   ========================================================== */

.erc-home-benefits {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    width: 100%;

    margin-top: 34px;

    padding:
        24px
        20px;

    overflow: hidden;

    background:
        linear-gradient(
            120deg,
            rgba(238, 247, 255, 0.97),
            rgba(250, 252, 255, 0.99)
        );

    border: 1px solid #e1edf8;
    border-radius: 18px;

    box-shadow:
        0 10px 30px rgba(37, 71, 105, 0.06);
}


/* Une caractéristique */

.erc-home-benefit {
    position: relative;

    display: grid;

    grid-template-columns:
        56px
        minmax(0, 1fr);

    align-items: center;

    column-gap: 13px;

    min-width: 0;

    padding:
        3px
        18px;
}


/* Séparateurs */

.erc-home-benefit:not(:last-child)::after {
    content: "";

    position: absolute;

    top: 8%;
    right: 0;

    width: 1px;
    height: 84%;

    background: #d8e6f3;
}


/* Icône */

.erc-home-benefit__icon {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 56px;
    height: 56px;

    border: 2px solid #cde5fa;
    border-radius: 50%;

    background: #f7fbff;
    color: #237bc8;
}

.erc-home-benefit__icon svg {
    display: block;

    width: 25px;
    height: 25px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.erc-home-benefit--swiss
.erc-home-benefit__icon svg {
    width: 24px;
    height: 24px;
}

.erc-home-benefit--swiss
.erc-home-benefit__icon svg path {
    fill: currentColor;
    stroke: none;
}


/* Texte */

.erc-home-benefit__content {
    min-width: 0;
}

.erc-home-benefit__title {
    margin: 0 0 3px !important;
    padding: 0 !important;

    color: #073c82 !important;

    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;

    white-space: nowrap;
}

.erc-home-benefit__description {
    margin: 0 !important;
    padding: 0 !important;

    color: #51677e !important;

    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}


/* Couleurs */

.erc-home-benefit--everyone
.erc-home-benefit__icon {
    border-color: #ccebe2;
    color: #15977a;
}

.erc-home-benefit--secure
.erc-home-benefit__icon {
    border-color: #e0d4f4;
    color: #7447b8;
}

.erc-home-benefit--region
.erc-home-benefit__icon {
    border-color: #f5d8c1;
    color: #df6811;
}


/* ==========================================================
   TABLETTE
   ========================================================== */

@media (max-width: 900px) {

    .erc-home {
        width: min(760px, calc(100vw - 36px)) !important;
    }

    .erc-home-portals__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .erc-home-benefits {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        row-gap: 24px;
    }

    .erc-home-benefit:nth-child(2)::after {
        display: none;
    }

}


/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 600px) {

    .erc-home {
        width: calc(100vw - 28px) !important;

        padding:
            18px
            0
            26px;
    }

    .erc-home-portals__grid {
        grid-template-columns: 1fr;

        gap: 18px;
    }

    .erc-home-portal__visual {
        height: 200px;
        flex-basis: 200px;
    }

    .erc-home-portal__body {
        grid-template-rows:
            auto
            auto
            auto;

        padding:
            44px
            20px
            20px;
    }

    .erc-home-portal__title {
        min-height: 50px;
    }

    .erc-home-portal__description {
        min-height: 64px;

        padding-top: 4px !important;
    }

    .erc-home-portal__button {
        margin-top: 10px;
    }

    .erc-home-benefits {
        grid-template-columns: 1fr;

        margin-top: 26px;

        padding:
            14px
            18px;
    }

    .erc-home-benefit {
        padding:
            14px
            4px;
    }

    .erc-home-benefit:not(:last-child)::after {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;
        height: 1px;
    }

}


/* ==========================================================
   ACCESSIBILITÉ
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    .erc-home-portal,
    .erc-home-portal__button,
    .erc-home-portal__arrow {
        transition: none;
    }

    .erc-home-portal:hover {
        transform: none;
    }

}

/* Echange & Troc : rubrique prochainement disponible */
.erc-home-portal--echange-troc .erc-home-portal__button--coming-soon {
    background: #e5e7eb;
    color: #334155;
    cursor: default;
    box-shadow: none;
    pointer-events: none;
}

.erc-home-portal--echange-troc .erc-home-portal__button--coming-soon:hover {
    background: #e5e7eb;
    color: #64748b;
    box-shadow: none;
    transform: none;
}

/* ERC-HOME-BUTTONS-V1 */
/* Dimensions identiques et publication plus claire. */
.erc-home .erc-home-portal__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.erc-home .erc-home-portal__actions .erc-home-portal__button {
    box-sizing: border-box;
    width: min(100%, 210px);
    min-height: 46px;
    margin: 0 !important;
    padding: 10px 14px;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
}

/* Deuxieme action : publication, lorsqu'elle existe. */
.erc-home .erc-home-portal__actions
.erc-home-portal__button:nth-child(2) {
    background-image: linear-gradient(
        rgba(255,255,255,.22),
        rgba(255,255,255,.22)
    ) !important;
    background-color: #428fce;
}

/* Couleurs secondaires par rubrique. */
.erc-home .erc-home-portal--immobilier
.erc-home-portal__actions .erc-home-portal__button:nth-child(2) {
    background-color: #38b79b;
}

.erc-home .erc-home-portal--annuaire
.erc-home-portal__actions .erc-home-portal__button:nth-child(2) {
    background-color: #9470cb;
}

.erc-home .erc-home-portal--devis
.erc-home-portal__actions .erc-home-portal__button:nth-child(2) {
    background-color: #e99a59;
}
/* ERC-SERVICES-COLOR-V1 */
/* Identite turquoise pour les boutons Services. */
.erc-home .erc-home-portal--services
.erc-home-portal__actions .erc-home-portal__button:first-child {
    background: #087f91 !important;
    color: #ffffff !important;
}

.erc-home .erc-home-portal--services
.erc-home-portal__actions .erc-home-portal__button:nth-child(2) {
    background: #399eac !important;
    color: #ffffff !important;
}
/* ERC-HOME-EVENTS-CSS-V1 */
.erc-home-events {
    max-width: 1200px;
    margin: 35px auto 45px;
    padding: 28px;
    border-radius: 16px;
    background: #f7f9fc;
}

.erc-home-events__heading {
    text-align: center;
    margin-bottom: 25px;
}

.erc-home-events__heading h2 {
    font-size: 28px;
    font-weight: 700;
    color: #173b60;
    margin: 0 0 8px;
}

.erc-home-events__heading p {
    color: #64748b;
    margin: 0;
}

.erc-home-events__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.erc-home-events__card {
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.07);
    transition: transform .2s ease;
}

.erc-home-events__card:hover {
    transform: translateY(-3px);
}

.erc-home-events__card a {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.erc-home-events__card img {
    width: 100%;
    height: 165px;
    object-fit: cover;
}

.erc-home-events__content {
    padding: 18px;
}

.erc-home-events__content h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #173b60;
}

.erc-home-events__content p {
    margin: 5px 0;
    color: #475569;
    font-size: 14px;
}

.erc-home-events__footer {
    text-align: center;
    margin: 25px 0 0;
}

.erc-home-events__footer a {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    background: #173b60;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.erc-home-events__footer a:hover {
    background: #245783;
    color: #fff;
}

.erc-home-events__empty {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

@media (max-width: 900px) {
    .erc-home-events__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .erc-home-events {
        padding: 18px;
        margin: 20px auto 30px;
    }

    .erc-home-events__grid {
        grid-template-columns: 1fr;
    }

    .erc-home-events__heading h2 {
        font-size: 23px;
    }
}
/* ERC-HOME-BANNER-SIZE-V1 */
body.home #header-image {
    height: 300px !important;
    min-height: 300px !important;
    background-size: cover;
    background-position: center center;
}