.terract-hap {
    --terract-green: #009b4e;
    --terract-green-dark: #003f2f;
    --terract-green-deep: #002f27;
    --terract-orange: #ff7900;
    --terract-orange-soft: #fff2e5;
    --terract-navy: #071b3a;
    --terract-muted: #5d697a;
    --terract-border: rgba(255, 121, 0, .42);
    width: 100%;
    margin: 0 0 42px;
    font-family: inherit;
}

.terract-hap * {
    box-sizing: border-box;
}

.terract-hap-grid {
    display: grid;
    grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
    gap: 0;
    min-height: 610px;
    border-radius: 28px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(7, 27, 58, .13);
}

.terract-hap-left,
.terract-hap-right {
    min-width: 0;
}

.terract-hap-slider,
.terract-hap-slides {
    position: relative;
    height: 100%;
    min-height: 610px;
    overflow: hidden;
    background: var(--terract-green-deep);
}

.terract-hap-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.035) translateX(24px);
    transition: opacity .75s ease, transform .9s cubic-bezier(.2,.8,.2,1);
    pointer-events: none;
    will-change: opacity, transform;
}

.terract-hap-slide.is-active {
    opacity: 1;
    transform: scale(1) translateX(0);
    pointer-events: auto;
    z-index: 2;
}

.terract-hap-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    transition: transform 7s linear;
}

.terract-hap-slide.is-active .terract-hap-bg {
    transform: scale(1.12);
}

.terract-hap-green-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 18%, rgba(255,255,255,.12), transparent 34%),
        linear-gradient(90deg, rgba(0, 35, 27, .98) 0%, rgba(0, 48, 38, .86) 52%, rgba(0, 52, 40, .48) 100%),
        linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.42));
}

.terract-hap-slide-content {
    position: relative;
    z-index: 3;
    height: 100%;
    min-height: 610px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 58px 138px;
    color: #ffffff;
}

.terract-hap-slide-top {
    position: absolute;
    top: 36px;
    left: 58px;
    right: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.terract-hap-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border-radius: 12px;
    padding: 12px 18px;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: .45px;
    text-transform: uppercase;
    box-shadow: 0 12px 25px rgba(0,0,0,.16);
}

.terract-hap-badge-article {
    background: linear-gradient(135deg, var(--terract-green), #00bc68);
}

.terract-hap-badge-project {
    background: linear-gradient(135deg, var(--terract-orange), #ff9c00);
}

.terract-hap-count {
    min-width: 76px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px;
    color: #ffffff;
    background: rgba(0, 55, 42, .44);
    backdrop-filter: blur(10px);
    font-size: 18px;
    font-weight: 950;
    text-align: center;
}

.terract-hap-slide h2,
.terract-hap-project h2 {
    margin: 0;
    font-weight: 1000;
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
}

.terract-hap-slide h2 {
    max-width: 620px;
    color: #ffffff !important;
    font-size: clamp(32px, 3.25vw, 58px);
    line-height: .98;
    text-shadow: 0 8px 24px rgba(0,0,0,.24);
}

.terract-hap-slide p {
    max-width: 580px;
    color: rgba(255,255,255,.94) !important;
    margin: 24px 0 0;
    font-size: clamp(16px, 1.15vw, 20px);
    line-height: 1.62;
    font-weight: 600;
}

.terract-hap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    min-height: 50px;
    margin-top: 30px;
    padding: 0 24px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 950;
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.terract-hap-btn:hover {
    transform: translateY(-2px);
}

.terract-hap-btn span {
    font-size: 21px;
    line-height: 1;
}

.terract-hap-btn-green {
    color: #ffffff;
    background: linear-gradient(135deg, var(--terract-green), #00b962);
    box-shadow: 0 14px 28px rgba(0,155,78,.32);
}

.terract-hap-btn-orange {
    color: #ffffff;
    background: linear-gradient(135deg, var(--terract-orange), #ff9f00);
    box-shadow: 0 14px 30px rgba(255,121,0,.28);
}

.terract-hap-nav {
    position: absolute;
    top: 50%;
    z-index: 7;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 45, 34, .72);
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 38px;
    line-height: 36px;
    font-weight: 300;
    transform: translateY(-50%);
    transition: .25s ease;
}

.terract-hap-nav:hover {
    background: var(--terract-green);
    transform: translateY(-50%) scale(1.06);
}

.terract-hap-prev { left: 22px; }
.terract-hap-next { right: 22px; }

.terract-hap-dots {
    position: absolute;
    z-index: 8;
    left: 50%;
    bottom: 126px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.terract-hap-dots button {
    width: 12px;
    height: 12px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    opacity: .9;
    transition: .25s ease;
}

.terract-hap-dots button.is-active {
    width: 34px;
    background: #ffffff;
}

.terract-hap-thumbs {
    position: absolute;
    z-index: 8;
    left: 54px;
    right: 54px;
    bottom: 38px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.terract-hap-thumbs button {
    height: 76px;
    padding: 0;
    border: 2px solid rgba(255,255,255,.28);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,.12);
    cursor: pointer;
    opacity: .72;
    transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.terract-hap-thumbs button.is-active {
    opacity: 1;
    border-color: var(--terract-green);
    box-shadow: 0 0 0 3px rgba(0,155,78,.28);
    transform: translateY(-2px) scale(1.01);
}

.terract-hap-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.terract-hap-project {
    position: relative;
    min-height: 610px;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr);
    align-items: center;
    gap: 22px;
    padding: 50px 44px 44px;
    border: 2px solid rgba(255,121,0,.44);
    border-left: 0;
    background:
        radial-gradient(circle at 82% 22%, rgba(255, 121, 0, .18), transparent 28%),
        radial-gradient(circle at 100% 80%, rgba(255, 121, 0, .12), transparent 32%),
        linear-gradient(135deg, #fffaf4 0%, #ffffff 55%, #fff1df 100%);
    overflow: hidden;
}

.terract-hap-project:before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,121,0,.22) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(90deg, transparent 0%, black 55%, black 100%);
    opacity: .34;
}

.terract-hap-project-content,
.terract-hap-project-visual {
    position: relative;
    z-index: 2;
}

.terract-hap-project h2 {
    max-width: 620px;
    margin-top: 30px;
    color: var(--terract-navy);
    font-size: clamp(31px, 3vw, 56px);
    line-height: 1.04;
}

.terract-hap-project p {
    max-width: 560px;
    margin: 24px 0 0;
    color: #22304a;
    font-size: clamp(15px, 1.05vw, 19px);
    line-height: 1.62;
    font-weight: 650;
}

.terract-hap-project-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 34px;
    max-width: 520px;
    padding: 18px;
    border: 1px solid rgba(255,121,0,.18);
    border-radius: 18px;
    background: rgba(255,255,255,.76);
    box-shadow: 0 18px 36px rgba(7,27,58,.06);
    backdrop-filter: blur(8px);
}

.terract-hap-project-meta div + div {
    border-left: 1px solid rgba(255,121,0,.24);
    padding-left: 16px;
}

.terract-hap-project-meta strong {
    display: block;
    color: var(--terract-navy);
    font-size: 16px;
    font-weight: 950;
}

.terract-hap-project-meta span {
    display: block;
    margin-top: 4px;
    color: var(--terract-muted);
    font-size: 12px;
    font-weight: 800;
}

.terract-hap-project-visual {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.terract-hap-project-visual img {
    position: relative;
    z-index: 2;
    width: min(100%, 420px);
    height: min(440px, 80%);
    object-fit: cover;
    border-radius: 44% 44% 22% 22%;
    box-shadow: 0 24px 55px rgba(7,27,58,.18);
}

.terract-hap-project-glow {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,121,0,.20), transparent 64%);
    border: 1px solid rgba(255,121,0,.22);
}

.terract-hap-pin {
    position: absolute;
    z-index: 4;
    right: 22px;
    top: 34%;
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--terract-orange);
    box-shadow: 0 16px 32px rgba(255,121,0,.30);
    font-size: 28px;
    font-weight: 900;
}

.terract-hap-ratio {
    display: grid;
    grid-template-columns: 45fr 24px 55fr;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
}

.terract-hap-ratio:before,
.terract-hap-ratio:after {
    content: "";
    height: 2px;
    background: currentColor;
    opacity: .72;
}

.terract-hap-ratio-green,
.terract-hap-ratio-orange {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 1000;
}

.terract-hap-ratio-green {
    justify-content: center;
    color: var(--terract-green);
}

.terract-hap-ratio-orange {
    justify-content: center;
    color: var(--terract-orange);
}

.terract-hap-ratio i {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0,155,78,.45);
    background: #fff;
    box-shadow: 0 0 0 5px rgba(255,121,0,.08);
}


/* Correctif visibilité : certains thèmes WordPress imposent une couleur aux titres h2. */
.terract-hap .terract-hap-slide h2,
.terract-hap .terract-hap-slide h2 a {
    color: #ffffff !important;
    text-shadow: 0 6px 22px rgba(0,0,0,.55);
}

.terract-hap .terract-hap-slide p {
    color: rgba(255,255,255,.95) !important;
    text-shadow: 0 4px 16px rgba(0,0,0,.42);
}

@media (max-width: 1180px) {
    .terract-hap-grid {
        grid-template-columns: 1fr;
    }

    .terract-hap-project {
        border-left: 2px solid rgba(255,121,0,.44);
        min-height: auto;
    }

    .terract-hap-ratio {
        display: none;
    }
}

@media (max-width: 820px) {
    .terract-hap-grid {
        border-radius: 22px;
    }

    .terract-hap-slider,
    .terract-hap-slides,
    .terract-hap-slide-content {
        min-height: 580px;
    }

    .terract-hap-slide-content {
        padding: 78px 26px 128px;
    }

    .terract-hap-slide-top {
        left: 26px;
        right: 26px;
        top: 26px;
    }

    .terract-hap-slide h2 {
        font-size: clamp(30px, 8vw, 44px);
    }

    .terract-hap-thumbs {
        left: 24px;
        right: 24px;
        bottom: 26px;
        gap: 8px;
    }

    .terract-hap-thumbs button {
        height: 58px;
        border-radius: 10px;
    }

    .terract-hap-dots {
        bottom: 98px;
    }

    .terract-hap-nav {
        width: 40px;
        height: 40px;
        font-size: 32px;
    }

    .terract-hap-prev { left: 10px; }
    .terract-hap-next { right: 10px; }

    .terract-hap-project {
        grid-template-columns: 1fr;
        padding: 32px 24px 28px;
    }

    .terract-hap-project h2 {
        font-size: clamp(29px, 8vw, 42px);
        margin-top: 22px;
    }

    .terract-hap-project-visual img {
        width: 100%;
        height: 280px;
        border-radius: 28px;
    }

    .terract-hap-pin {
        top: auto;
        right: 20px;
        bottom: 20px;
    }
}

@media (max-width: 560px) {
    .terract-hap {
        margin-bottom: 28px;
    }

    .terract-hap-badge {
        padding: 10px 12px;
        font-size: 11px;
    }

    .terract-hap-count {
        min-width: 62px;
        font-size: 14px;
        padding: 8px 10px;
    }

    .terract-hap-project-meta {
        grid-template-columns: 1fr;
    }

    .terract-hap-project-meta div + div {
        border-left: 0;
        border-top: 1px solid rgba(255,121,0,.24);
        padding-left: 0;
        padding-top: 12px;
    }
}
