/**
 * How It Works page (Task 3).
 *
 * Visual direction mirrors page-corporate-gifting.css: editorial monochrome,
 * mono-font eyebrows + numbered sections, thin rules, strong typographic
 * hierarchy, restrained motion. WhatsApp green is reserved for the
 * WhatsApp CTA only — never as a generic accent.
 *
 * Loaded only when templates/page-how-it-works.php is active.
 */

/* --- Local tokens (page-scoped) ----------------------------------------
 * Same palette as corporate-gifting so the two marketing pages read as one
 * system. Values match css/tokens.css :root vars.
 */
.hiw-page {
    --hiw-ink:        #000000;
    --hiw-ink-soft:   #111111;
    --hiw-ink-alt:    #1a1a1a;
    --hiw-paper:      #ffffff;
    --hiw-paper-alt:  #fafafa;
    --hiw-rule:       #EBEBEB;
    --hiw-rule-strong:#dee2e6;
    --hiw-mute:       #555555;
    --hiw-mute-soft:  #888888;

    --hiw-on-dark:        #ffffff;
    --hiw-on-dark-mute:   rgba(255, 255, 255, 0.72);
    --hiw-on-dark-soft:   rgba(255, 255, 255, 0.55);
    --hiw-on-dark-rule:   rgba(255, 255, 255, 0.12);

    --hiw-wa:       #25D366;
    --hiw-wa-press: #1DA851;

    --hiw-pad-x: clamp(20px, 4vw, 64px);
    --hiw-pad-y: clamp(48px, 7vw, 80px);
    --hiw-max:   1280px;

    --hiw-display: 'Jost', 'Segoe UI', Tahoma, sans-serif;
    --hiw-mono:    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

.hiw-page,
.hiw-page *,
.hiw-page *::before,
.hiw-page *::after {
    box-sizing: border-box;
}

.hiw-page {
    font-family: var(--hiw-display);
    color: var(--hiw-ink);
    background: var(--hiw-paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reset parent-theme heading margins; let sections paint their own colors. */
.hiw-page h1,
.hiw-page h2,
.hiw-page h3 {
    margin: 0;
    letter-spacing: -0.01em;
}
.hiw-page p {
    margin: 0;
    color: var(--hiw-mute);
    line-height: 1.6;
}
.hiw-page a {
    color: inherit;
}

/* --- Eyebrow ----------------------------------------------------------- */
.hiw-eyebrow {
    font-family: var(--hiw-mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--hiw-mute-soft);
    margin: 0 0 16px;
}
.hiw-eyebrow--on-dark {
    color: var(--hiw-on-dark-soft);
}

/* --- Buttons (match cg-btn) ------------------------------------------- */
.hiw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    font-family: var(--hiw-display);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 50px;
    cursor: pointer;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
    white-space: nowrap;
}

/* Specificity note: bumped to .hiw-page .hiw-btn--* so these rules beat the
   .hiw-page a { color: inherit } rule above (which would otherwise force the
   anchor color back to the inherited #000 and hide the white pill label). */
.hiw-page .hiw-btn--primary {
    background: var(--hiw-ink);
    color: #fff;
    border-color: var(--hiw-ink);
}
.hiw-page .hiw-btn--primary:hover,
.hiw-page .hiw-btn--primary:focus-visible {
    background: #fff;
    color: var(--hiw-ink);
    border-color: var(--hiw-ink);
}

/* Matches the site footer's .cjw-footer__wa-btn so the WhatsApp pill has a
   single visual identity wherever it appears (footer, page CTAs). Padding,
   gap, icon size, and brightness hover follow css/custom-footer.css. */
.hiw-page .hiw-btn--whatsapp {
    background: var(--hiw-wa);
    color: #fff;
    border-color: var(--hiw-wa);
    padding: 11px 18px;
    gap: 10px;
    font-size: 14px;
    transition: filter 0.2s ease, transform 0.15s ease;
}
.hiw-page .hiw-btn--whatsapp:hover,
.hiw-page .hiw-btn--whatsapp:focus-visible {
    filter: brightness(1.08);
    background: var(--hiw-wa);
    border-color: var(--hiw-wa);
    color: #fff;
}
.hiw-page .hiw-btn--whatsapp .hiw-btn__icon {
    width: 18px;
    height: 18px;
}

.hiw-btn--lg {
    padding: 16px 34px;
    font-size: 15px;
}

.hiw-btn__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

/* --- 1. Hero -----------------------------------------------------------
 * Charcoal canvas + radial spotlights + film-grain noise. Identical
 * recipe to cg-hero so /how-it-works opens the same way visually.
 */
.hiw-hero {
    color: #fff;
    padding: clamp(80px, 14vw, 180px) var(--hiw-pad-x) clamp(64px, 10vw, 120px);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #131313;
}
.hiw-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 90% 60% at 70% 20%, rgba(255, 255, 255, 0.08), transparent 60%),
        radial-gradient(ellipse 60% 40% at 10% 90%, rgba(26, 94, 221, 0.10), transparent 70%),
        linear-gradient(180deg, #1f1f1f 0%, #131313 100%);
    pointer-events: none;
}
.hiw-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .12 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    opacity: 0.6;
    mix-blend-mode: overlay;
    pointer-events: none;
}

.hiw-hero__inner {
    position: relative;
    max-width: var(--hiw-max);
    margin: 0 auto;
}

.hiw-page .hiw-hero .hiw-eyebrow {
    color: var(--hiw-on-dark-soft);
    margin-bottom: 28px;
}

.hiw-page .hiw-hero__title {
    font-size: clamp(40px, 6.5vw, 88px);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.02em;
    color: #fff;
    max-width: 16ch;
    margin: 0 0 28px;
}
.hiw-page .hiw-hero__title em {
    font-style: italic;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.62);
    letter-spacing: -0.02em;
}

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

.hiw-page .hiw-hero__meta {
    font-family: var(--hiw-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--hiw-on-dark-soft);
    line-height: 1.6;
    max-width: 60ch;
}

.hiw-hero__rule {
    position: absolute;
    left: var(--hiw-pad-x);
    right: var(--hiw-pad-x);
    bottom: 0;
    height: 1px;
    background: var(--hiw-on-dark-rule);
}

/* --- Section scaffolding ---------------------------------------------- */
.hiw-section {
    max-width: var(--hiw-max);
    margin: 0 auto;
    padding: var(--hiw-pad-y) var(--hiw-pad-x);
}

.hiw-section__head {
    margin-bottom: clamp(40px, 5vw, 64px);
    max-width: 64ch;
}
.hiw-section__head--centered {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.hiw-page .hiw-section__title {
    font-size: clamp(28px, 4.2vw, 48px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--hiw-ink);
}

.hiw-section__lede {
    margin-top: 14px;
    font-size: 16px;
    color: var(--hiw-mute);
    max-width: 60ch;
}
.hiw-section__head--centered .hiw-section__lede {
    margin-left: auto;
    margin-right: auto;
}

/* Editorial split header — steps section uses this so the title doesn't sit
   alone in a wide column. Title hugs the left, lede sits to the right and
   aligns with the title baseline. Collapses to a single column on tablet. */
.hiw-steps .hiw-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 .hiw-section__head {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        align-items: end;
    }
    .hiw-steps .hiw-section__head .hiw-eyebrow {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }
    .hiw-steps .hiw-section__head .hiw-section__title {
        grid-column: 1;
        max-width: 18ch;
    }
    .hiw-steps .hiw-section__head .hiw-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-width
 * index column (number + line icon) and a flexible body column (title +
 * description). Thin rule between rows; first row carries a top rule so
 * the list opens with a hard horizontal line — a corporate-gifting cue.
 */
.hiw-steps__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--hiw-ink);
    border-bottom: 1px solid var(--hiw-ink);
    counter-reset: hiw-step;
}

/* Editorial timeline row.
   3-col grid: index rail (number + icon) | body (title + copy) | right meta rail
   (mono step counter, mirrors left rail). Symmetric framing fills the track so
   content reads as intentionally composed instead of left-anchored. */
.hiw-step {
    display: grid;
    grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) minmax(120px, 160px);
    column-gap: clamp(28px, 4vw, 64px);
    padding: clamp(24px, 3.4vw, 36px) 0;
    border-bottom: 1px solid var(--hiw-rule);
    align-items: start;
    transition: background 0.18s ease;
    counter-increment: hiw-step;
}

/* Right meta rail — mono counter, vertical hairline mirrors left rail. */
.hiw-step::after {
    content: counter(hiw-step, decimal-leading-zero) " / 05";
    grid-column: 3;
    align-self: stretch;
    justify-self: end;
    padding: 12px 0 0 clamp(20px, 3vw, 32px);
    border-left: 1px solid var(--hiw-rule);
    min-height: 120px;
    font-family: var(--hiw-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    color: var(--hiw-mute-soft);
    white-space: nowrap;
    transition: color 0.18s ease;
}
.hiw-step:hover::after {
    color: var(--hiw-ink);
}
.hiw-step:last-child {
    border-bottom: none;
}
.hiw-step:hover {
    background: var(--hiw-paper-alt);
}

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

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

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

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

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

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

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

/* --- 3. Warranty band ------------------------------------------------
 * Dark, full-bleed (within section padding). Two-column row: oversized
 * "18 / months" stat block on the left, headline + body + coverage list
 * on the right. Faint top spotlight gives the panel air without motion.
 */
.hiw-warranty {
    background: var(--hiw-ink-soft);
    color: #fff;
    padding: var(--hiw-pad-y) var(--hiw-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(--hiw-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(--hiw-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(--hiw-display);
    font-size: clamp(120px, 18vw, 220px);
    font-weight: 400;
    letter-spacing: -0.06em;
    line-height: 0.85;
    color: #fff;
    /* hairline outline-feel via thin stroke shadow */
}
.hiw-warranty__stat-unit {
    font-family: var(--hiw-mono);
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--hiw-on-dark-soft);
    margin-top: 14px;
    padding-left: 4px;
}

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

.hiw-page .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(--hiw-on-dark-mute);
    margin: 0 0 28px;
}

.hiw-warranty__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--hiw-on-dark-rule);
}
.hiw-warranty__list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--hiw-on-dark-rule);
    font-size: 14px;
    line-height: 1.5;
    color: var(--hiw-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(--hiw-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(120px, 160px) 1fr;
        column-gap: clamp(20px, 4vw, 40px);
    }
    .hiw-step::after { display: none; }
    .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) {
    .hiw-hero { padding: 96px var(--hiw-pad-x) 72px; }
    .hiw-page .hiw-hero__title { font-size: clamp(36px, 10vw, 52px); max-width: none; }

    .hiw-section__title { font-size: 28px; }

    .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(--hiw-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; }
    .hiw-page .hiw-step__body h3 { font-size: 22px; }

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

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

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .hiw-page * {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}
