/*
 * index.php's "How it works" section — the three numbered step cards and their button.
 *
 * WHY A FILE OF ITS OWN
 *
 * .process-steps, .step, .step-icon and .step-number appear on index.php and nowhere
 * else. #how-it-works is shared - nonprofits.php and volunteers.php have a section with
 * that id too - but theirs is an ordered list that css/styles.css already styles, and
 * nothing here reaches it, because this file is loaded only by index.php through
 * extra_css. That is also why the #how-it-works rules below still win: extra_css is
 * emitted after css/styles.css, exactly as the inline block was.
 *
 * WHAT WAS WRONG WITH IT
 *
 * Four rgba(244, 75, 166, …) - the retired brand pink, and four of the seven that were
 * left on the whole site. A hex replace does not look inside an rgba(), which is how
 * they survived the brand sweep. Two are a wash behind the step icon and are now
 * --primary-tint and --primary-tint-strong, added to css/styles.css for the purpose;
 * two are button shadows and are now --shadow-brand.
 *
 * Three hand-rolled neutral shadows, now the ramp. Two literal `white`. Two breakpoints
 * outside the style guide's set - 992 and 576 - now 1024 and 480. And one !important
 * that was never needed: .step-icon i is (0,1,1) against .fa-3x at (0,1,0), so it wins
 * on specificity alone.
 */

#how-it-works {
    padding: 80px 20px;
    background-color: var(--background-color);
    text-align: center;
}

#how-it-works h2 {
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: var(--text-color);
    position: relative;
}

#how-it-works h2:after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 15px auto 0;
    border-radius: 2px;
}

.process-steps {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto 50px;
    gap: 30px;
}

.step {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    padding: 30px 20px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.step:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.step-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.step-icon i {
    color: var(--brand-mark);
    background: var(--primary-tint);
    padding: 25px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.step:hover .step-icon i {
    background: var(--primary-tint-strong);
    transform: scale(1.1);
}

.step-number {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--primary-color);
    color: var(--on-brand);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    border: 3px solid var(--white);
}

.step h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.step p {
    color: var(--gray);
    line-height: 1.6;
}

#how-it-works .cta-button {
    display: inline-block;
    padding: 15px 35px;
    background: var(--gradient-primary);
    color: var(--on-brand);
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-brand);
    margin-top: 20px;
}

/* The shadow does not change on hover, and that is deliberate. The ramp reserves
   --shadow-brand for gradient buttons, and there is no second brand shadow to step up
   to; the lift and the gradient swap are the feedback. Inventing a fourth shadow to
   keep a hover state busy is what produced 66 distinct shadows for four jobs. */
#how-it-works .cta-button:hover {
    transform: translateY(-5px);
    background: var(--gradient-secondary);
}

@media (max-width: 1024px) {
    .process-steps {
        gap: 20px;
    }

    .step {
        padding: 25px 15px;
    }
}

@media (max-width: 768px) {
    #how-it-works {
        padding: 60px 15px;
    }

    #how-it-works h2 {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .process-steps {
        align-items: center;
    }

    .step {
        width: 100%;
        max-width: 450px;
        margin-bottom: 30px;
    }

    .step:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    #how-it-works {
        padding: 50px 10px;
    }

    #how-it-works h2 {
        font-size: 1.8rem;
    }

    .step {
        padding: 20px 15px;
        min-width: 250px;
    }

    .step-icon i {
        padding: 20px;
        /* No !important. .step-icon i is (0,1,1) and .fa-3x is (0,1,0). */
        font-size: 2rem;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        top: -10px;
        right: -10px;
    }

    #how-it-works .cta-button {
        padding: 12px 30px;
    }
}
