/*
 * SedaSend How It Works Section
 * All selectors are scoped to .sedasend-how to isolate this module.
 */

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

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

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

/* Centered section heading */
.sedasend-how__header {
    max-width: 720px;
    margin: 0 auto clamp(40px, 6vw, 70px);
    text-align: center;
}

.sedasend-how__title {
    margin: 0;
    color: var(--how-orange);
    font-size: clamp(2.6rem, 5vw, 5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
}

.sedasend-how__intro {
    margin: 20px 0 0;
    color: var(--how-black);
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    font-weight: 800;
    line-height: 1.6;
}

/* Desktop and tablet show three evenly aligned steps in one row */
.sedasend-how__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: clamp(20px, 3vw, 38px);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Each step reveals upward after the section enters view */
.sedasend-how__step {
    min-width: 0;
    text-align: center;
    padding: clamp(18px, 2.5vw, 28px);
    background: var(--how-white);
    border-radius: 22px;
    opacity: 0;
    transform: translateY(44px);
    transition: opacity 650ms ease, transform 450ms ease, background-color 450ms ease, box-shadow 450ms ease;
}

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

/* Image placeholder and animated number badge */
.sedasend-how__visual {
    position: relative;
    min-height: clamp(210px, 24vw, 300px);
    display: grid;
    place-items: center;
    margin-bottom: 28px;
}

.sedasend-how__visual img {
    display: block;
    width: min(260px, 82%);
    max-height: 230px;
    object-fit: contain;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity 450ms ease, visibility 450ms ease, transform 450ms ease;
}

/* Slight pulse draws attention while keeping the step number readable */
.sedasend-how__number {
    position: absolute;
    top: 10px;
    left: 50%;
    width: clamp(48px, 5vw, 64px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--how-white);
    background: var(--how-orange);
    border-radius: 50%;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    font-weight: 900;
    box-shadow: 0 0 0 0 rgba(226, 85, 65, 0.4);
    animation: sedasend-how-number-pulse 2.2s ease-in-out infinite;
}

.sedasend-how__step:nth-child(2) .sedasend-how__number {
    animation-delay: 300ms;
}

.sedasend-how__step:nth-child(3) .sedasend-how__number {
    animation-delay: 600ms;
}

@keyframes sedasend-how-number-pulse {
    0%, 100% {
        transform: translateX(-50%) translateY(0) scale(1);
        box-shadow: 0 0 0 0 rgba(226, 85, 65, 0.38);
    }
    50% {
        transform: translateX(-50%) translateY(-6px) scale(1.06);
        box-shadow: 0 0 0 10px rgba(226, 85, 65, 0);
    }
}

/* Step title and smaller supporting description */
.sedasend-how__step-title {
    margin: 0;
    color: var(--how-black);
    font-size: clamp(1.3rem, 2vw, 1.65rem);
    font-weight: 900;
    line-height: 1.25;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 450ms ease, visibility 450ms ease, transform 450ms ease;
}

.sedasend-how__description {
    margin: 14px auto 0;
    color: var(--how-black);
    font-size: clamp(0.95rem, 1.3vw, 1.05rem);
    line-height: 1.65;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 450ms ease, visibility 450ms ease, transform 450ms ease;
}

/* Stage three reveals the title and description after the image */
.sedasend-how__step.is-content-visible .sedasend-how__step-title,
.sedasend-how__step.is-content-visible .sedasend-how__description {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Tablet retains the three-column layout with proportionally smaller images */
@media (max-width: 900px) {
    .sedasend-how__steps {
        gap: 18px;
    }

    .sedasend-how__visual {
        min-height: 190px;
    }

    .sedasend-how__visual img {
        width: min(210px, 84%);
        max-height: 185px;
    }
}

/* Mobile keeps three compact static steps side by side */
@media (max-width: 680px) {
    .sedasend-how {
        padding-inline: 8px;
    }

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

    .sedasend-how__step {
        padding: 10px 5px;
        border-radius: 14px;
    }

    .sedasend-how__visual {
        min-height: 120px;
        margin-bottom: 12px;
    }

    .sedasend-how__visual img {
        width: min(100px, 90%);
        max-height: 90px;
    }

    .sedasend-how__number {
        top: 0;
        width: 34px;
        font-size: 1rem;
    }

    .sedasend-how__step-title {
        font-size: clamp(0.72rem, 3vw, 0.92rem);
    }

    .sedasend-how__description {
        margin-top: 8px;
        font-size: clamp(0.58rem, 2.25vw, 0.75rem);
        line-height: 1.35;
    }
}

/* Respect reduced-motion preferences while keeping all content visible */
@media (prefers-reduced-motion: reduce) {
    .sedasend-how,
    .sedasend-how__step,
    .sedasend-how__visual img,
    .sedasend-how__number {
        opacity: 1;
        transform: none;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

}
