/* 1.9.0 used a setting named "animation", which Elementor reads as an entrance animation
   and hides the widget forever. Pages saved with it stay visible. A real entrance
   animation always has data-settings, so it is not affected. */
.elementor-widget-sqelm-phases.elementor-invisible:not([data-settings]) {
    visibility: visible;
}

.sqelm-ph {
    --sqelm-ph-filet-fort: #8C8A80;
    --sqelm-ph-filet: #E2DFD2;
    --sqelm-ph-pad-ouvert: 48px;
    --sqelm-ph-pad-compact: 28px;
    --sqelm-ph-ratio: 16 / 10;
    --sqelm-ph-radius: 16px;
    --sqelm-ph-gap: 24px;
    width: 100%;
}

.sqelm-ph .sqelm-ph__liste {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--sqelm-ph-filet-fort);
}

/* Row: 12-column grid. Status 2/12, text 4/12, image 5/12 (one empty column between) */
.sqelm-ph .sqelm-ph__item {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--sqelm-ph-gap);
    align-items: start;
    margin: 0;
    padding: var(--sqelm-ph-pad-compact) 0;
    border-bottom: 1px solid var(--sqelm-ph-filet);
}

.sqelm-ph .sqelm-ph__item--ouvert {
    padding: var(--sqelm-ph-pad-ouvert) 0;
}

.sqelm-ph__col-statut {
    grid-column: 1 / span 2;
    padding-top: 4px;
}

.sqelm-ph__corps {
    grid-column: 3 / -1;
    min-width: 0;
}

.sqelm-ph__item--image .sqelm-ph__corps {
    grid-column: 3 / span 4;
}

.sqelm-ph__visuel {
    grid-column: 8 / -1;
    min-width: 0;
}

/* Status pill */
.sqelm-ph .sqelm-ph__statut {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
}

.sqelm-ph .sqelm-ph__statut--prelocation {
    background: #3F5B5E;
    color: #FFFFFF;
}

.sqelm-ph .sqelm-ph__statut--livre {
    background: #F1EFE6;
    color: #1B1B1B;
}

.sqelm-ph .sqelm-ph__statut--a_venir {
    border-color: #CFCBB5;
    background: transparent;
    color: #55524A;
}

/* Text */
.sqelm-ph .sqelm-ph__phase {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.3;
    color: #55524A;
}

.sqelm-ph .sqelm-ph__nom {
    margin: 0;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.sqelm-ph .sqelm-ph__item--ouvert .sqelm-ph__nom {
    font-size: clamp(36px, 3.6vw, 56px);
    line-height: 1.05;
    color: #1B1B1B;
}

.sqelm-ph .sqelm-ph__item--compact .sqelm-ph__nom {
    font-size: clamp(26px, 2.2vw, 34px);
    line-height: 1.1;
    color: #6E6B60;
}

.sqelm-ph .sqelm-ph__description {
    margin: 24px 0 0;
    max-width: 46ch;
    font-size: 17px;
    line-height: 1.7;
    color: #3A3A35;
}

.sqelm-ph .sqelm-ph__details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 0;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    line-height: 1.4;
    color: #55524A;
}

.sqelm-ph .sqelm-ph__details li {
    margin: 0;
}

.sqelm-ph .sqelm-ph__details li + li::before {
    content: "\00B7";
    margin: 0 10px;
}

/* Image */
.sqelm-ph__visuel {
    aspect-ratio: var(--sqelm-ph-ratio);
    overflow: hidden;
    border-radius: var(--sqelm-ph-radius);
    background: #E4DDD0;
}

.sqelm-ph .sqelm-ph__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    border-radius: 0;
}

.sqelm-ph__aide {
    padding: 24px;
    border: 1px dashed #C4C4C4;
    text-align: center;
    font-size: 14px;
    color: #666666;
}

/* Tablet: status 3/12, text and image share the rest, image below */
@media (max-width: 1024px) {
    .sqelm-ph__col-statut {
        grid-column: 1 / span 3;
    }
    .sqelm-ph__corps,
    .sqelm-ph__item--image .sqelm-ph__corps {
        grid-column: 4 / -1;
    }
    .sqelm-ph__visuel {
        grid-column: 4 / -1;
        margin-top: 32px;
    }
}

/* Mobile: one column, status above the phase */
@media (max-width: 767px) {
    .sqelm-ph .sqelm-ph__item {
        grid-template-columns: minmax(0, 1fr);
    }
    .sqelm-ph__col-statut,
    .sqelm-ph__corps,
    .sqelm-ph__item--image .sqelm-ph__corps,
    .sqelm-ph__visuel {
        grid-column: 1 / -1;
    }
    .sqelm-ph__col-statut {
        padding-top: 0;
        margin-bottom: 14px;
    }
    .sqelm-ph__col-statut:empty {
        display: none;
    }
    .sqelm-ph__visuel {
        margin-top: 24px;
    }
    .sqelm-ph .sqelm-ph__description {
        margin-top: 16px;
    }
    /* Details stack, so no separator ends up starting a line */
    .sqelm-ph .sqelm-ph__details {
        flex-direction: column;
    }
    .sqelm-ph .sqelm-ph__details li + li::before {
        content: none;
    }
    /* Upcoming buildings: name on the left, status on the right, one compact block */
    .sqelm-ph .sqelm-ph__item--compact {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 16px;
        align-items: center;
    }
    .sqelm-ph__item--compact .sqelm-ph__corps {
        grid-column: 1;
        grid-row: 1;
    }
    .sqelm-ph__item--compact .sqelm-ph__col-statut {
        grid-column: 2;
        grid-row: 1;
        margin-bottom: 0;
    }
}

/* Reveal: only when JS is running and the visitor accepts motion */
@media (prefers-reduced-motion: no-preference) {
    .sqelm-ph.is-anim .sqelm-ph__item {
        opacity: 0;
        transform: translateY(16px);
        transition:
            opacity 0.7s ease,
            transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
        transition-delay: calc(var(--sqelm-ph-i, 0) * 90ms);
    }
    .sqelm-ph.is-anim .sqelm-ph__image {
        transform: scale(1.05);
        transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
        transition-delay: calc(var(--sqelm-ph-i, 0) * 90ms + 150ms);
    }
    .sqelm-ph.is-anim .sqelm-ph__item.is-visible {
        opacity: 1;
        transform: none;
    }
    .sqelm-ph.is-anim .sqelm-ph__item.is-visible .sqelm-ph__image {
        transform: none;
    }
}
