/*
 * GD Sector Solutions
 * Grid of GD Sector Solution Cards (gd-sector-solution-card.css).
 */

/*
 * Columns, gap, max card width and image height are
 * set by the widget's Layout controls (Elementor selectors); these are the defaults.
 */
.gd-sector-solutions {
    --gd-ss-image-height: var(--gd-card-image-height);
    --gd-ss-columns: 3;
    --gd-ss-gap: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gd-ss-gap);
}

/* Each card takes one column slot; incomplete rows (e.g. 1 or 2 cards of 3) are centered */
.gd-sector-solutions > .gd-ss-card {
    box-sizing: border-box;
    flex: 0 0 calc((100% - (var(--gd-ss-columns) - 1) * var(--gd-ss-gap)) / var(--gd-ss-columns));
    /* height: 100% (single card) blocks align-items: stretch; auto lets cards in a row match height */
    height: auto;
}

/* Cards beyond "Max items before 'Show all'": hidden until the button is clicked */
.gd-sector-solutions .gd-ss-card--extra {
    display: none;
}

/* Revealed cards fade and slide up one after the other (delay set per card by the script) */
.gd-sector-solutions.is-expanded .gd-ss-card--extra {
    display: flex;
    animation: gd-ss-reveal 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    animation-delay: var(--gd-ss-reveal-delay, 0s);
}

@keyframes gd-ss-reveal {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gd-sector-solutions__show-all {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    transition: opacity 0.25s ease;
}

.gd-sector-solutions__show-all.is-hiding {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .gd-sector-solutions.is-expanded .gd-ss-card--extra {
        animation: none;
    }

    .gd-sector-solutions__show-all {
        transition: none;
    }
}

.gd-sector-solutions__show-all[hidden] {
    display: none;
}

/* Fixed image height: the card height does not depend on the card width */
.gd-sector-solutions .gd-ss-card__image {
    height: var(--gd-ss-image-height);
    aspect-ratio: auto;
    flex-shrink: 0;
}
