/* ============================== DVIR+ Inspection Workflow ==============================
   Card visuals (mock-ups, glows, card background) are one image per card per breakpoint,
   exported from Figma with the text removed. The text is real markup on top of it.
   Pills / tags styling follows pages/cargo-sensors/components/monitor-what-matters. */

.dvir-inspection-workflow {
    position: relative;
    isolation: isolate;
    padding: 0 58px 60px;
}

/* Decorative rings, exported from the design; pinned to the left edge next to the heading */
.dvir-inspection-workflow__orbit {
    position: absolute;
    z-index: -1;
    top: 69px;
    left: 0;
    pointer-events: none;
}

.dvir-inspection-workflow__orbit-image {
    display: block;
    width: 378px;
    height: 550px;
    max-width: none;
}

.dvir-inspection-workflow__inner {
    max-width: var(--container-lg);
    margin-inline: auto;
}

/* ---------- Header ---------- */

.dvir-inspection-workflow__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    text-align: center;
}

.dvir-inspection-workflow__title {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 56px;
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.56px;
}

.dvir-inspection-workflow__title-accent {
    color: var(--color-primary-hover);
}

.dvir-inspection-workflow__description {
    margin: 0;
    color: var(--color-muted-blue-gray);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
}

/* ---------- Grid ---------- */

.dvir-inspection-workflow__grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

/* ---------- Card ---------- */

.dvir-inspection-workflow-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    /* With aspect-ratio + min-height the browser derives the width from the height
       (480px tall -> 654px wide) and the card spills out of its grid track.
       Pin the width to the track; the height then follows the aspect ratio. */
    width: 100%;
    min-width: 0;
    min-height: 480px;
    border-radius: var(--radius-lg);
    background-color: var(--color-primary-lighter);
}

.dvir-inspection-workflow-card--wide {
    grid-column: span 3;
    aspect-ratio: 654 / 480;
}

.dvir-inspection-workflow-card--narrow {
    grid-column: span 2;
    aspect-ratio: 431 / 480;
}

.dvir-inspection-workflow-card__media {
    position: absolute;
    z-index: 0;
    inset: 0;
}

.dvir-inspection-workflow-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left bottom;
}

.dvir-inspection-workflow-card--narrow .dvir-inspection-workflow-card__image {
    object-position: center bottom;
}

.dvir-inspection-workflow-card__copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 38px;
}

.dvir-inspection-workflow-card__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--color-primary-5);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.dvir-inspection-workflow-card__eyebrow-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary);
}

.dvir-inspection-workflow-card__title {
    margin: 0 0 10px;
    color: var(--color-text-primary);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.5px;
}

.dvir-inspection-workflow-card__description {
    margin: 0 0 24px;
    color: color-mix(in srgb, var(--color-text-primary) 70%, transparent);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

.dvir-inspection-workflow-card__description strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

.dvir-inspection-workflow-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dvir-inspection-workflow-card--wide .dvir-inspection-workflow-card__tags {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.dvir-inspection-workflow-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 48px;
    background: var(--color-primary-5);
    color: color-mix(in srgb, var(--color-text-primary) 90%, transparent);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
    white-space: nowrap;
}

.dvir-inspection-workflow-card__tag-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primary-20);
    color: var(--color-primary);
}

.dvir-inspection-workflow-card__tag-icon svg {
    width: 8px;
    height: 8px;
}

/* ---------- Small desktop (section-specific) ----------
   Below the 1440 design width three cards per row get too narrow: the tags wrap and run into the
   mock-up baked into the card image. Switch to two per row; the fifth card sits
   centred on its own row. */
@media (max-width: 1439px) {
    .dvir-inspection-workflow__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dvir-inspection-workflow-card--wide,
    .dvir-inspection-workflow-card--narrow {
        grid-column: span 1;
    }

    .dvir-inspection-workflow-card--narrow:last-child {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 8px);
    }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
    .dvir-inspection-workflow {
        /* the logo strip above already provides the 80px gap from the design */
        padding: 0 24px 40px;
    }

    .dvir-inspection-workflow__orbit {
        top: -210px;
    }

    .dvir-inspection-workflow__orbit-image {
        width: 309px;
        height: 702px;
    }

    .dvir-inspection-workflow__description {
        font-size: 18px;
        line-height: 1.44;
    }

    .dvir-inspection-workflow__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dvir-inspection-workflow-card--wide,
    .dvir-inspection-workflow-card--narrow,
    .dvir-inspection-workflow-card--narrow:last-child {
        grid-column: auto;
        width: 100%;
        min-height: 420px;
        aspect-ratio: 742 / 420;
    }

    .dvir-inspection-workflow-card--narrow .dvir-inspection-workflow-card__image {
        object-position: left bottom;
    }

    .dvir-inspection-workflow-card--narrow .dvir-inspection-workflow-card__tags {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 576px) {
    .dvir-inspection-workflow {
        /* the logo strip above already provides the 60px gap from the design */
        padding: 0 8px 0;
    }

    .dvir-inspection-workflow__orbit {
        display: none;
    }

    .dvir-inspection-workflow__header {
        gap: 6px;
        margin-bottom: 32px;
    }

    .dvir-inspection-workflow__title {
        font-size: 32px;
        line-height: 1.18;
        letter-spacing: -0.16px;
    }

    .dvir-inspection-workflow__description {
        font-size: 14px;
        line-height: 1.5;
    }

    .dvir-inspection-workflow__grid {
        gap: 24px;
    }

    .dvir-inspection-workflow__break {
        display: none;
    }

    .dvir-inspection-workflow-card--wide,
    .dvir-inspection-workflow-card--narrow,
    .dvir-inspection-workflow-card--narrow:last-child {
        min-height: 400px;
        aspect-ratio: 377 / 400;
        border-radius: var(--radius-sm);
    }

    .dvir-inspection-workflow-card__image,
    .dvir-inspection-workflow-card--narrow .dvir-inspection-workflow-card__image {
        object-position: center bottom;
    }

    .dvir-inspection-workflow-card__copy {
        padding: 24px 8px 24px 16px;
    }

    .dvir-inspection-workflow-card__eyebrow {
        padding: 6px 16px;
        font-size: 10px;
    }

    .dvir-inspection-workflow-card__title {
        margin-bottom: 8px;
        font-size: 24px;
        line-height: 1.24;
        letter-spacing: -0.3px;
    }

    .dvir-inspection-workflow-card__description {
        margin-bottom: 14px;
        font-size: 13px;
        line-height: 1.54;
    }

    .dvir-inspection-workflow-card__tags,
    .dvir-inspection-workflow-card--wide .dvir-inspection-workflow-card__tags,
    .dvir-inspection-workflow-card--narrow .dvir-inspection-workflow-card__tags {
        flex-direction: row;
        gap: 8px;
    }

    /* Slightly tighter than the mock (14px) so two tags fit on one row at 375px */
    .dvir-inspection-workflow-card__tag {
        padding: 10px 12px;
        font-size: 12px;
        line-height: 1.5;
    }

    .dvir-inspection-workflow-card__tag-icon {
        width: 12px;
        height: 12px;
    }

    .dvir-inspection-workflow-card__tag-icon svg {
        width: 7px;
        height: 7px;
    }
}
