/* =============================================================
   RTS Gallery - two-row scrolling carousel with flip-to-testimonial
   ============================================================= */

/* Force GPU compositing & prevent sub-pixel shimmer */
.rts-carousel-wrap .splide__track {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.rts-carousel-wrap .splide__track .splide__list .splide__slide {
    width: 300px !important;
    height: 230px !important;
    border-radius: 12px !important;
    overflow: visible !important; /* must be visible for 3D flip to work */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    perspective: 800px;
}

/* Section spacing */
.rts-carousel-wrap.rts-carousel-top {
    margin-top: 50px !important;
    margin-bottom: 0 !important;
}
.rts-carousel-wrap.rts-carousel-bottom,
.rts-carousel-wrap.rts-carousel-third,
.rts-carousel-wrap.rts-carousel-fourth {
    margin-top: 35px !important;
    margin-bottom: 15px !important;
}

/* -- Flip card wrapper ---------------------------------------- */
.rts-flip-card {
    width: 300px;
    height: 230px;
    border-radius: 12px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

/* Flip only the individual card being hovered */
.rts-flip-card:hover {
    transform: rotateY(180deg);
}

/* -- Front face (image) --------------------------------------- */
.rts-flip-card__front,
.rts-flip-card__back {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
}

.rts-flip-card__front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

/* -- Back face (testimonial) ---------------------------------- */
.rts-flip-card__back {
    transform: rotateY(180deg);
    background: #ffffff;
    border: 2px solid var(--global-palette1, #F37A1F);
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* -- Testimonial typography ----------------------------------- */
.rts-flip-card__back blockquote {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    font-size: 17px !important;
    line-height: 1.5 !important;
    color: var(--global-palette4, #2E3235) !important;
}

.rts-flip-card__back cite {
    font-weight: bold;
    font-style: normal;
    font-size: 15px;
    color: var(--global-palette3, #2E3235);
}

.rts-flip-card__back a.rts-read-story {
    display: block;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none;
    margin-top: auto;
    padding-top: 8px;
    color: var(--global-palette1, #F37A1F);
}

.rts-flip-card__back a.rts-read-story:hover {
    text-decoration: underline;
}

/* -- "read full" inline button -------------------------------- */
.rts-read-full {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: inherit;
    font-weight: normal;
    color: var(--global-palette1, #F37A1F);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.rts-read-full:hover {
    color: var(--global-palette1, #F37A1F);
    font-weight: bold;
    background: transparent;
}

/* -- Modal ---------------------------------------------------- */
.rts-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rts-modal[hidden] {
    display: none;
}

.rts-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.rts-modal__box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 36px 40px 32px;
    max-width: 520px;
    width: calc(100% - 40px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: rts-modal-in 0.22s ease;
}

@keyframes rts-modal-in {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.rts-modal__close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0;
}
.rts-modal__close:hover {
    color: #333;
}

.rts-modal__quote {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
    font-size: 18px !important;
    line-height: 1.6 !important;
    color: var(--global-palette4, #2E3235) !important;
}

.rts-modal__cite {
    display: block;
    font-weight: bold;
    font-style: normal;
    font-size: 15px;
    color: var(--global-palette3, #2E3235);
}
