/**
 * components.css — Composants réutilisables
 * Hors-Champ Studio 3.0
 */

/* ═══════════════════════════════════════════════
   RESET GLOBAL HOVER LIENS
   Neutralise a:hover { color: var(--contrast) }
   injecté par GeneratePress et ses modules.
═══════════════════════════════════════════════ */

a:hover,
a:focus,
a:active {
    color: inherit !important;
}


/* ═══════════════════════════════════════════════
   BOUTON ANIMÉ — animated-btn
═══════════════════════════════════════════════ */

.animated-btn {
    font-family: var(--font-sans) !important;
    font-size: var(--text-lg) !important;
    font-weight: var(--weight-semi) !important;
    line-height: 1.4em !important;
    text-decoration: none;
    letter-spacing: var(--tracking-tight);
    margin-bottom: 0 !important;
    color: var(--color-light-100);
    border-radius: var(--radius-pill);
    cursor: pointer;
    padding: 0.5em 2em;
    height: 50px;
    border: none;
    background-color: var(--color-accent);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    width: fit-content;
    max-width: 100%;
    transition: background-color var(--duration-normal) var(--ease-smooth);
}

.animated-btn:hover,
.animated-btn:focus,
.animated-btn:active {
    color: var(--color-light-100) !important;
    background-color: var(--color-accent-hover) !important;
}

/* Texte animé (généré par animations.js) */
.animated-btn .text {
    display: flex;
    overflow: hidden;
}

.animated-btn .text:first-child  { position: relative; }
.animated-btn .text:last-child   { position: absolute; }

.animated-btn .text:last-child span {
    transform: translateY(-1.2em);
}

.animated-btn:hover .text:first-child span {
    transform: translateY(1.2em);
}

.animated-btn:hover .text:last-child span {
    transform: translateY(0);
}

.animated-btn .text span {
    transition: transform var(--duration-fast);
}

/* Délais progressifs par lettre */
.animated-btn .text span:nth-child(2)  { transition-duration: 0.3s; }
.animated-btn .text span:nth-child(3)  { transition-duration: 0.4s; }
.animated-btn .text span:nth-child(4)  { transition-duration: 0.5s; }
.animated-btn .text span:nth-child(5)  { transition-duration: 0.6s; }
.animated-btn .text span:nth-child(6)  { transition-duration: 0.7s; }
.animated-btn .text span:nth-child(7)  { transition-duration: 0.8s; }
.animated-btn .text span:nth-child(8)  { transition-duration: 0.9s; }
.animated-btn .text span:nth-child(9)  { transition-duration: 1.0s; }
.animated-btn .text span:nth-child(10) { transition-duration: 1.1s; }

/* — Responsive bouton — */
@media screen and (max-width: 1024px) {
    .animated-btn {
        font-size: 1.3em !important;
        padding: 0.5em 1.8em;
        height: 45px;
    }
}

@media screen and (max-width: 768px) {
    .animated-btn {
        font-size: 1.1em !important;
        padding: 0.5em 1.5em;
        height: 42px;
    }
}

@media screen and (max-width: 480px) {
    .animated-btn {
        font-size: var(--text-base) !important;
        padding: 0.5em 1.2em;
        height: 40px;
        border-radius: var(--radius-pill);
    }
}


/* ═══════════════════════════════════════════════
   PASTILLES — CATÉGORIE & LABEL PROJET
═══════════════════════════════════════════════ */

.Category-cellule-projet {
    display: inline-block;
    padding: var(--space-3) var(--space-5) !important;
    border-radius: var(--radius-pill);
    background-color: var(--color-dark-800);
    font-size: 0.8em !important;
    font-weight: var(--weight-medium);
    text-decoration: none;
    line-height: var(--leading-normal);
    color: var(--color-light-100);
    transition: all var(--duration-normal) ease;
}

.Category-cellule-projet:hover {
    background-color: var(--color-teal) !important;
    color: var(--color-light-100) !important;
    transform: translateY(-2px);
}

.label-cellule-projet {
    display: inline-block;
    padding: var(--space-3) var(--space-5) !important;
    border-radius: var(--radius-pill);
    background-color: var(--color-light-300);
    font-size: 0.8em !important;
    font-weight: var(--weight-medium);
    text-decoration: none;
    white-space: nowrap;
    line-height: var(--leading-normal);
    color: var(--color-dark-900);
}


/* ═══════════════════════════════════════════════
   CAROUSEL — SWIPER TAILLES CUSTOM
═══════════════════════════════════════════════ */

.carousel-custom-size .swiper-slide {
    width: 27% !important;
}

.carousel-custom-size .swiper-slide:nth-child(3n) {
    width: 40% !important;
}


/* ═══════════════════════════════════════════════
   WORK RESIZE — CARD RÉALISATIONS
═══════════════════════════════════════════════ */

.work-resize {
    transition: all 1s ease !important;
    display: flex;
    overflow: hidden;
}

@media (min-width: 768px) {
    .work-resize:hover {
        width: 90%;
    }
}

@media (max-width: 767px) {
    .work-resize {
        width: 100% !important;
    }
}


/* ═══════════════════════════════════════════════
   PÔLES — WRAPPER ACCORDÉON HORIZONTAL
═══════════════════════════════════════════════ */

.pol-wrapper {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: stretch;
    height: 400px;
}

.pole_item {
    flex: 25%;
    min-width: 150px;
    transition: flex var(--duration-normal) var(--ease-smooth),
                background-color var(--duration-normal) var(--ease-smooth);
    overflow: hidden;
    padding: var(--space-5) 50px;
    background-color: var(--color-light-400);
    border-radius: var(--radius-md);
    position: relative;
}

.pole_item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-repeat: no-repeat;
    border-radius: var(--radius-md);
    opacity: 1;
    transition: opacity var(--duration-normal) ease;
    z-index: 0;
    pointer-events: none;
}

.bg_yellow::before {
    background-image: image-set(
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-4.webp') type('image/webp'),
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-4.png')  type('image/png')
    );
    /* Fallback navigateurs anciens sans image-set() */
    background-image: url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-4.png');
    background-position: bottom 20px center;
    background-size: 70%;
}

.bg_blue::before {
    background-image: image-set(
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-3.webp') type('image/webp'),
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-3.png')  type('image/png')
    );
    background-image: url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-3.png');
    background-position: bottom 20px center;
    background-size: 60%;
}

.bg_pink::before {
    background-image: image-set(
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-9.webp') type('image/webp'),
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-9.png')  type('image/png')
    );
    background-image: url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-9.png');
    background-position: bottom 0px center;
    background-size: 80%;
}

.bg_red::before {
    background-image: image-set(
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-8.webp') type('image/webp'),
        url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-8.png')  type('image/png')
    );
    background-image: url('https://www.horschampstudio.com/wp-content/uploads/2026/02/Plan-de-travail-8.png');
    background-position: bottom 10px center;
    background-size: 80%;
}

.compact_content,
.extend_content {
    position: relative;
    z-index: 1;
}

.pole_titre {
    font-size: 2em;
    font-family: var(--font-serif);
    position: relative;
}

.pole_item:hover {
    flex: 2;
    background-color: var(--color-light-200);
}

.pol-wrapper:hover .pole_item:not(:hover) {
    flex: 0.6;
}

.pole_item:hover::before {
    opacity: 0;
}

.extend_content {
    opacity: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    transform: translateX(20px);
    transition: all var(--duration-xslow) ease;
}

.extend_content p {
    font-size: 0.9em;
    font-family: var(--font-sans);
    font-weight: var(--weight-regular);
    margin: 0;
}

.cell2 {
    display: flex;
    gap: 50px;
    width: 100%;
    padding-top: 1em;
}

.expl-txt {
    width: 400px;
    min-width: 300px;
    white-space: normal;
}

.pole_item:hover .extend_content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media screen and (max-width: 768px) {
    .pol-wrapper {
        flex-direction: column;
        gap: 10px;
        height: auto;
    }

    .pole_item { flex-direction: column; }

    .pole_titre {
        font-size: 1.2em;
        transform: none;
        opacity: 1;
        transition: all var(--duration-normal) ease;
    }

    .pole_item:hover .pole_titre {
        opacity: 0;
        transform: translateY(-10px);
    }

    .extend_content {
        opacity: 0;
        transform: translateY(20px);
        transition: all var(--duration-xslow) ease;
        height: 0;
        width: 100%;
    }

    .pole_item:hover .extend_content {
        opacity: 1;
        transform: translateY(0);
        height: auto;
    }

    .cell2 {
        flex-direction: column;
        gap: 1em;
    }

    .expl-txt { width: 100%; }
}


/* ═══════════════════════════════════════════════
   ANIMATIONS AU SCROLL — IntersectionObserver
   (voir animations.js)
═══════════════════════════════════════════════ */

[data-hcs-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--duration-slow) var(--ease-out),
                transform var(--duration-slow) var(--ease-out);
}

[data-hcs-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

[data-hcs-reveal][data-delay="1"] { transition-delay: 0.1s; }
[data-hcs-reveal][data-delay="2"] { transition-delay: 0.2s; }
[data-hcs-reveal][data-delay="3"] { transition-delay: 0.3s; }
[data-hcs-reveal][data-delay="4"] { transition-delay: 0.4s; }
[data-hcs-reveal][data-delay="5"] { transition-delay: 0.5s; }
