/* Card hover demos (assets/js/card-motion.js): on hover the card's icon box (or number badge) stretches into a small
   screen that plays an animation of the card's point, then shrinks back. Tall cards get a small screen that fades in.
   On touch screens it plays when the card is in view. */
.service-two-item[data-card-anim] .icon {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    -webkit-transition: width 0.55s cubic-bezier(.2, .8, .2, 1), background 0.5s, border-color 0.5s;
    transition: width 0.55s cubic-bezier(.2, .8, .2, 1), background 0.5s, border-color 0.5s;
}
.service-two-item[data-card-anim] .icon i {
    display: inline-block;
    -webkit-transition: opacity 0.3s, -webkit-transform 0.4s;
    transition: opacity 0.3s, transform 0.4s;
}
[data-card-anim] .card-anim {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.35s 0.15s;
    transition: opacity 0.35s 0.15s;
}
.service-two-item[data-card-anim].is-playing .icon { width: 100%; background: white; }
.service-two-item[data-card-anim].is-playing .icon i { opacity: 0; -webkit-transform: scale(0.6); transform: scale(0.6); }
[data-card-anim].is-playing .card-anim { opacity: 1; }

/* Plain icon cards (no .style-two): the icon gets a box to stretch from, the same height as the icon line */
.service-two-item[data-card-anim]:not(.style-two) .icon { width: 64px; height: 55px; border-radius: 8px; }
.service-two-item[data-card-anim]:not(.style-two).is-playing .icon { width: 100%; }

/* Step cards: the round number badge stretches into the screen */
.work-process-item-two[data-card-anim] .number {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    vertical-align: top;
    -webkit-transition: width 0.55s cubic-bezier(.2, .8, .2, 1), border-radius 0.45s, background 0.5s, border-color 0.5s, color 0.3s;
    transition: width 0.55s cubic-bezier(.2, .8, .2, 1), border-radius 0.45s, background 0.5s, border-color 0.5s, color 0.3s;
}
.work-process-item-two[data-card-anim].is-playing .number { width: 100%; border-radius: 8px; background: white; border-color: white; color: transparent; }
/* on light sections the white strip keeps a light border so it reads as a screen */
section:not(.text-white) .work-process-item-two[data-card-anim].is-playing .number { border-color: var(--ridda-border-color); }

/* Tall step cards (Our Philosophy): a small screen fades in over the free space under the heading */
/* room at the bottom for the screen, so the (centred) heading never sits under it, even on narrow cards that do not widen */
.work-step-item[data-card-anim] { position: relative; padding-bottom: 104px; }
.work-step-item[data-card-anim] .card-anim-box {
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: 24px;
    height: 70px;
    overflow: hidden;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--ridda-border-color);
    opacity: 0;
    pointer-events: none;
    -webkit-transform: translateY(10px);
    transform: translateY(10px);
    -webkit-transition: opacity 0.4s, -webkit-transform 0.5s cubic-bezier(.2, .8, .2, 1);
    transition: opacity 0.4s, transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
.work-step-item[data-card-anim].is-playing .card-anim-box { opacity: 1; -webkit-transform: none; transform: none; }

/* Row cards (.service-item.style-two): the 55 px icon square itself becomes a tiny screen, in place (the title sits beside it) */
.service-item[data-card-anim] .icon { position: relative; overflow: hidden; }
.service-item[data-card-anim] .icon i {
    display: inline-block;
    -webkit-transition: opacity 0.3s, -webkit-transform 0.4s;
    transition: opacity 0.3s, transform 0.4s;
}
body .service-item.style-two[data-card-anim].is-playing .icon { background: white; }
.service-item[data-card-anim].is-playing .icon i { opacity: 0; -webkit-transform: scale(0.6); transform: scale(0.6); }
