/**
 * piimarket — How it Works template styles.
 * Loaded only on pages using the "How it Works" template.
 */

/*--------------------------------------------------------------
  First section — heading
--------------------------------------------------------------*/
.hiw-first {
    padding: 3rem 0 3.5rem;
}

.hiw-title {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    font-weight: 400;
    color: var(--color-text);
}

/*--------------------------------------------------------------
  Second section — full-bleed light band, image + copy
--------------------------------------------------------------*/
.hiw-second {
    background: #f6f6f6;
}

.hiw-second-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4rem;
    padding: 4rem 0;
}

.hiw-photo {
    flex: 1 1 48%;
    max-width: 48%;
}

.hiw-photo img {
    display: block;
    width: 100%;
    height: auto;
}

.hiw-content {
    flex: 1 1 45%;
    max-width: 45%;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.7;
}

.hiw-content p {
    margin: 0 0 1.25rem;
}

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

/*--------------------------------------------------------------
  Third section — alternating zig-zag rows
--------------------------------------------------------------*/
.hiw-third {
    padding: 4rem 0 5rem;
}

.hiw-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 3rem;
}

.hiw-row:last-child {
    margin-bottom: 0;
}

/* Alternate: even rows put the image on the left */
.hiw-row:nth-child(even) {
    flex-direction: row-reverse;
}

.hiw-row-text {
    flex: 1 1 42%;
    max-width: 42%;
    text-align: center;
}

.hiw-row-media {
    flex: 1 1 50%;
    max-width: 50%;
}

.hiw-row-media img {
    display: block;
    width: 100%;
    height: auto;
}

.hiw-row-title {
    margin: 0 0 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000097;
}

.hiw-row-desc {
    color: var(--color-text);
    line-height: 1.7;
}

.hiw-row-desc p {
    margin: 0;
}

/*--------------------------------------------------------------
  Responsive
--------------------------------------------------------------*/
@media (max-width: 782px) {
    .hiw-first {
        padding: 2rem 0 2.5rem;
    }

    .hiw-second-inner {
        flex-direction: column;
        gap: 2rem;
        padding: 3rem 0;
    }

    .hiw-photo,
    .hiw-content {
        flex-basis: auto;
        max-width: 100%;
    }

    .hiw-row,
    .hiw-row:nth-child(even) {
        flex-direction: column;
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }

    .hiw-row-text,
    .hiw-row-media {
        flex-basis: auto;
        max-width: 100%;
    }
}
