/**
 * How It Works page — page-unique sections only.
 *
 * Shared editorial primitives live in css/editorial.css (.cjw-ed). This sheet
 * keeps the hero type scale, the 5-step editorial timeline, the warranty band,
 * and the closing CTA — plus the WhatsApp button sizing for this page.
 *
 * Scope: .cjw-ed--hiw. Tokens come from the --ed-* aliases in editorial.css.
 * Loaded only when templates/page-how-it-works.php is active.
 */

/* --- Hero (per-page type scale) ---------------------------------------- */
.cjw-ed--hiw .cjw-hero__title {
    font-size: clamp(40px, 6.5vw, 88px);
    line-height: 1.02;
    letter-spacing: -0.02em;
    max-width: 16ch;
}
.cjw-ed--hiw .cjw-hero__title em {
    font-style: italic;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: -0.02em;
}

.cjw-ed--hiw .cjw-hero__subtitle {
    font-size: clamp(16px, 1.5vw, 22px);
    line-height: 1.55;
    max-width: 52ch;
    margin: 0 0 20px;
}
.cjw-ed--hiw .cjw-hero__subtitle em {
    font-style: normal;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 1px;
}

/* WhatsApp pill — footer-matching sizing (brand color in css/buttons.css). */
.cjw-ed--hiw .cjw-btn--whatsapp {
    padding: 11px 18px;
    gap: 10px;
    font-size: 14px;
}

/* Editorial split header — the steps section title hugs the left, lede sits
   to the right and aligns with the title baseline. Single column on tablet. */
.hiw-steps .cjw-section__head {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr;
    column-gap: clamp(40px, 6vw, 96px);
    row-gap: 18px;
}
@media (min-width: 900px) {
    .hiw-steps .cjw-section__head {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        align-items: end;
    }
    .hiw-steps .cjw-section__head .cjw-eyebrow {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }
    .hiw-steps .cjw-section__head .cjw-section__title {
        grid-column: 1;
        max-width: 18ch;
    }
    .hiw-steps .cjw-section__head .cjw-section__lede {
        grid-column: 2;
        justify-self: end;
        margin-top: 0;
        padding-bottom: 8px;
        font-size: 17px;
        max-width: 44ch;
    }
}

/* --- 2. The 5-step process -------------------------------------------
 * Editorial vertical timeline. Each step is a row split into a fixed index
 * column (number + line icon) and a flexible body column. Thin rules; first
 * row carries a top rule so the list opens with a hard horizontal line.
 */
.hiw-steps__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--ed-ink);
    border-bottom: 1px solid var(--ed-ink);
}

/* 3-col grid: index rail (number + icon) | body | step photo (right rail). */
.hiw-step {
    display: grid;
    grid-template-columns: minmax(140px, 190px) minmax(0, 1fr) clamp(280px, 30vw, 420px);
    column-gap: clamp(28px, 4vw, 64px);
    padding: clamp(24px, 3.4vw, 36px) 0;
    border-bottom: 1px solid var(--ed-rule);
    align-items: start;
    transition: background 0.18s ease;
}

/* Right-rail step photo. Monochrome at rest to honor the site's mono palette,
   warming to full color on row hover; thin frame + editorial plate-number chip
   top-left mirrors the mono counter it replaces. */
.hiw-step__media {
    grid-column: 3;
    align-self: start;
    justify-self: stretch;
    position: relative;
    margin: 0;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border: 1px solid var(--ed-rule);
    background: var(--ed-paper-alt);
}
.hiw-step__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.02);
    transform: scale(1.01);
    transition: filter 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hiw-step:hover .hiw-step__img {
    filter: grayscale(0);
    transform: scale(1.05);
}
.hiw-step__plate {
    position: absolute;
    top: 0;
    left: 0;
    padding: 7px 11px;
    background: var(--ed-ink);
    color: #fff;
    font-family: var(--ed-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    line-height: 1;
}
.hiw-step:last-child {
    border-bottom: none;
}
.hiw-step:hover {
    background: var(--ed-paper-alt);
}

.hiw-step__index {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    color: var(--ed-ink);
    position: relative;
    padding-right: clamp(20px, 3vw, 40px);
    border-right: 1px solid var(--ed-rule);
    min-height: 120px;
}

.hiw-step__num {
    font-family: var(--ed-mono);
    font-size: clamp(40px, 5.4vw, 64px);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 0.9;
    color: var(--ed-ink);
}

.hiw-step__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 1px solid var(--ed-ink);
    border-radius: 50%;
    color: var(--ed-ink);
    background: var(--ed-paper);
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease;
}
.hiw-step:hover .hiw-step__icon {
    background: var(--ed-ink);
    color: #fff;
}
.hiw-step__icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.hiw-step__body {
    max-width: 58ch;
    padding-top: 8px;
}

.cjw-ed--hiw .hiw-step__body h3 {
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
    margin: 0 0 14px;
}

.hiw-step__opt {
    font-family: var(--ed-mono);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ed-mute-soft);
    margin-left: 8px;
    vertical-align: 0.2em;
}

.hiw-step__body p {
    font-size: 16px;
    line-height: 1.65;
    color: var(--ed-mute);
}

/* --- 3. Warranty band ------------------------------------------------
 * Dark, full-bleed (within section padding). Oversized stat block left,
 * headline + body + coverage list right. Faint top spotlight.
 */
.hiw-warranty {
    background: var(--ed-ink-soft);
    color: #fff;
    padding: var(--ed-pad-y) var(--ed-pad-x);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.hiw-warranty::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 480px at 50% 0%, rgba(255, 255, 255, 0.06), transparent 60%),
        radial-gradient(ellipse 50% 60% at 100% 100%, rgba(26, 94, 221, 0.08), transparent 70%);
    pointer-events: none;
}

.hiw-warranty__inner {
    max-width: var(--ed-max);
    margin: 0 auto;
}

.hiw-warranty__row {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: clamp(40px, 6vw, 96px);
    align-items: start;
    padding-top: clamp(24px, 4vw, 40px);
    border-top: 1px solid var(--ed-on-dark-rule);
}

.hiw-warranty__stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}
.hiw-warranty__stat-num {
    font-family: var(--ed-display);
    font-size: clamp(120px, 18vw, 220px);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 0.85;
    color: #fff;
}
.hiw-warranty__stat-unit {
    font-family: var(--ed-mono);
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ed-on-dark-soft);
    margin-top: 14px;
    padding-left: 4px;
}

.hiw-warranty__copy {
    max-width: 56ch;
}

.cjw-ed--hiw .hiw-warranty__title {
    font-size: clamp(26px, 3.4vw, 40px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0 0 18px;
}

.hiw-warranty__body {
    font-size: clamp(15px, 1.4vw, 18px);
    line-height: 1.6;
    color: var(--ed-on-dark-mute);
    margin: 0 0 28px;
}

.hiw-warranty__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--ed-on-dark-rule);
}
.hiw-warranty__list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--ed-on-dark-rule);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ed-on-dark-mute);
    position: relative;
    padding-left: 22px;
}
.hiw-warranty__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22px;
    width: 12px;
    height: 1px;
    background: var(--ed-on-dark-soft);
}

/* --- 4. Closing CTA --------------------------------------------------- */
.hiw-cta {
    text-align: center;
}
.hiw-cta__buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

/* --- Responsive ------------------------------------------------------- */
@media (max-width: 1024px) {
    .hiw-step {
        grid-template-columns: minmax(110px, 150px) minmax(0, 1fr) clamp(220px, 30vw, 320px);
        column-gap: clamp(20px, 4vw, 40px);
    }
    .hiw-step__index {
        gap: 14px;
        min-height: 100px;
        padding-right: 20px;
    }
    .hiw-step__num { font-size: clamp(34px, 5vw, 48px); }
    .hiw-step__icon { width: 48px; height: 48px; }
    .hiw-step__icon svg { width: 22px; height: 22px; }

    .hiw-warranty__row {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 720px) {
    .cjw-ed--hiw .cjw-hero__title { font-size: clamp(36px, 10vw, 52px); max-width: none; }

    .hiw-step {
        grid-template-columns: 1fr;
        row-gap: 18px;
        padding: 28px 0;
    }
    .hiw-step__index {
        flex-direction: row;
        align-items: center;
        gap: 18px;
        min-height: 0;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--ed-rule);
        padding-bottom: 18px;
    }
    .hiw-step__num { font-size: 32px; }
    .hiw-step__icon { width: 40px; height: 40px; }
    .hiw-step__icon svg { width: 20px; height: 20px; }
    .hiw-step__body { padding-top: 0; }
    .cjw-ed--hiw .hiw-step__body h3 { font-size: 22px; }
    
    .hiw-step__media {
        grid-column: 1;
        aspect-ratio: 16 / 10;
    }
    .hiw-step__img { filter: none; transform: none; }

    .hiw-warranty__stat-num { font-size: clamp(96px, 32vw, 160px); }

    .hiw-cta__buttons .cjw-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hiw-step__img {
        transform: none;
        transition: filter 0.3s ease;
    }
    .hiw-step:hover .hiw-step__img { transform: none; }
}
