/*
 * SedaSend Features Section
 * Every selector is scoped to .sedasend-features to isolate this module.
 */

/* Transparent section shell with a bottom-to-top scroll reveal */
.sedasend-features {
    --features-orange: #e25541;
    --features-black: #000000;
    --features-white: #ffffff;
    padding: clamp(70px, 8vw, 112px) 20px;
    background: transparent;
    border: 0;
    opacity: 0;
    transform: translateY(72px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.sedasend-features.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Centered content wrapper */
.sedasend-features__container {
    width: min(1200px, 100%);
    margin: 0 auto;
}

/* Static section title */
.sedasend-features__title {
    margin: 0 0 clamp(38px, 5vw, 64px);
    color: var(--features-orange);
    font-size: clamp(2.8rem, 6vw, 5.8rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.055em;
    text-align: center;
}

/* Three-column desktop and tablet feature layout */
.sedasend-features__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: clamp(18px, 3vw, 34px);
    overflow: visible;
}

/* Each item holds a clickable box and timed description */
.sedasend-features__item {
    position: relative;
    z-index: 1;
    min-width: 0;
    text-align: center;
    transition: transform 350ms ease, z-index 0s linear 350ms;
}

/* Active item rises above and enlarges compared with neighboring boxes */
.sedasend-features__item.is-active {
    z-index: 3;
    transform: scale(1.08);
    transition-delay: 0s;
}

/* Compact inline card style shared across desktop, tablet, and mobile */
.sedasend-features__box {
    width: 100%;
    min-height: clamp(150px, 18vw, 210px);
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0;
    padding: clamp(12px, 2vw, 20px) clamp(6px, 1vw, 12px);
    color: var(--features-black);
    background: transparent;
    border: 0;
    border-radius: 14px;
    box-shadow: none;
    cursor: pointer;
    transition: color 350ms ease, background-color 350ms ease, box-shadow 350ms ease, transform 350ms ease;
}

.sedasend-features__box:hover,
.sedasend-features__box:focus-visible {
    transform: translateY(-7px);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.16);
}

.sedasend-features__box.is-active {
    color: var(--features-white);
    background-color: var(--features-orange);
    box-shadow: 0 18px 44px rgba(226, 85, 65, 0.32);
    transform: translateY(-8px);
}

/* Icon is hidden initially and smoothly scales into the selected box */
.sedasend-features__box img {
    width: min(170px, 94%);
    max-height: 150px;
    object-fit: contain;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.55);
    transition: opacity 420ms ease, visibility 420ms ease, transform 420ms ease, margin 420ms ease;
    margin: -75px 0;
}

.sedasend-features__box.is-active img {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    margin: 0 0 18px;
}

/* Title begins centered and moves beneath the revealed icon */
.sedasend-features__box-title {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 900;
    transition: transform 420ms ease, margin 420ms ease;
}

.sedasend-features__box.is-active .sedasend-features__box-title {
    margin-bottom: 14px;
}

/* Bold description is hidden initially and fades in for 5 seconds after click */
.sedasend-features__description {
    display: block;
    max-height: 0;
    margin: 0;
    color: inherit;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    overflow: hidden;
    transition: max-height 450ms ease, opacity 450ms ease, visibility 450ms ease, transform 450ms ease;
}

.sedasend-features__description.is-visible {
    max-height: 7em;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile retains the same compact inline card style */
@media (max-width: 700px) {
    .sedasend-features {
        padding-inline: 8px;
    }

    .sedasend-features__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .sedasend-features__box {
        min-height: clamp(138px, 40vw, 180px);
        padding: 10px 5px;
        border: 0;
        border-radius: 12px;
        box-shadow: none;
    }

    .sedasend-features__box img {
        width: min(128px, 96%);
        max-height: 114px;
        margin: -50px 0;
    }

    .sedasend-features__box.is-active img {
        margin: 0 0 8px;
    }

    .sedasend-features__box-title {
        font-size: clamp(0.68rem, 3vw, 0.9rem);
        line-height: 1.15;
    }

    .sedasend-features__item.is-active {
        transform: scale(1.1);
    }

    .sedasend-features__description {
        font-size: clamp(0.58rem, 2.2vw, 0.76rem);
        line-height: 1.3;
    }
}

/* Respect reduced-motion preferences while keeping all content visible */
@media (prefers-reduced-motion: reduce) {
    .sedasend-features,
    .sedasend-features__item,
    .sedasend-features__box,
    .sedasend-features__box img,
    .sedasend-features__description {
        transition-duration: 0.01ms !important;
    }

    .sedasend-features { opacity: 1; }
}
