/**
 * FuelGuard Stacking Cards Styles
 * Based on working stackingcardnew example
 */

.elementor-widget-fg-stacking-cards,
.elementor-widget-fg-stacking-cards .elementor-widget-container,
.fg-stacking-wrapper {
    overflow: visible !important;
}

.fg-stacking-wrapper * {
    box-sizing: border-box;
}

.card {
    position: sticky;
    top: 100px;
    z-index: 1;
}

.card__inner {
    will-change: transform;
    background: white;
    border-radius: 14px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px hsla(265.3, 20%, 10%, 35%);
    transform-origin: center top;
}

.cards {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--card-gap, 40px);
}

/* Horizontal layout - image on right */
.card__inner {
    flex-direction: row;
    align-items: center;
    height: 100%;
}

.card__content {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    order: 1;
    min-height: 0;
    align-self: center;
}

.card__title {
    padding: 0;
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 600;
    color: #16263a;
    line-height: 1.2;
}



.card__description-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.card__description {
    line-height: 1.5;
    color: #16263a;
    margin: 0;
}

.card__description p {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.card__description p:last-child {
    margin-bottom: 0;
}

.card__description ul,
.card__description ol {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.card__description li {
    margin-bottom: 4px;
}

/* Only last card has truncated text with read more on desktop */
.card:last-child .card__description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:last-child .card__description.is-expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.card__read-more {
    background: none;
    border: none;
    padding: 0;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #0056b3;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
    display: inline-block;
}

.card__read-more:hover {
    color: #003d82;
}

.card__read-more.is-hidden {
    display: none;
}

/* Only last card shows read more button on desktop */
@media (min-width: 769px) {
    .card:not(:last-child) .card__read-more {
        display: none;
    }
}

/* On mobile, all cards show read more and have truncated text */
@media (max-width: 768px) {
    .card__read-more {
        display: inline-block;
    }

    .card__description {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .card__description.is-expanded {
        -webkit-line-clamp: unset;
        display: block;
    }
}

.card__image-container {
    display: flex;
    width: 35%;
    flex-shrink: 0;
    order: 2;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Video support */
.fg-card-video-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.fg-card-video-wrap .card__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.fg-card-video-wrap .card__video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    z-index: 1;
}

.fg-card-video-wrap.has-thumb .card__video-thumb {
    display: block;
}

.fg-card-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.8);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.fg-card-video-play svg {
    display: block !important;
    width: 50px !important;
    height: 50px !important;
    fill: white !important;
    color: white !important;
    margin-left: 2px;
    flex-shrink: 0;
}

.fg-card-video-play:hover {
    background: rgba(0,0,0,0.9);
    transform: translate(-50%, -50%) scale(1.1);
    border-color: white;
}

.fg-card-video-play:hover svg {
    transform: scale(1.1);
}

.space {
    height: 90vh;
}

.space--small {
    height: 40vh;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .card__inner {
        flex-direction: column;
    }

    .card__content {
        padding: 12px 20px;
        order: 2;
    }

    .card__image-container {
        width: 100%;
        order: 1;
        min-height: 250px;
    }

    .card__image {
        aspect-ratio: 16 / 9;
    }

    .fg-card-video-wrap {
        aspect-ratio: 16 / 9;
    }

    .fg-card-video-play {
        width: 45px;
        height: 45px;
    }

    .fg-card-video-play svg {
        width: 18px !important;
        height: 18px !important;
        fill: white !important;
        color: white !important;
    }
}
