/* CPX Finance Light V0.1.19 layout polish */

/* Footer wordmark must contrast with the dark footer background. */
.site-footer .site-footer__wordmark {
    color: #fff;
}

.site-footer .site-footer__wordmark-suffix {
    color: var(--light-accent);
}

/* Sidebar comparison is an input panel only. Results open in the full homepage comparison. */
.light-content-sidebar .cpx-widget__status,
.light-content-sidebar .cpx-results,
.light-content-sidebar .cpx-load-more,
.light-content-sidebar .cpx-load-more-wrap,
.light-content-sidebar .cpx-modal {
    display: none !important;
}

.light-content-sidebar .cpx-widget__form {
    margin-bottom: 0;
}

/* Cleaner desktop hero with a real, non-interactive illustration. */
@media (min-width: 981px) {
    .light-hero {
        padding: 24px 0 20px;
    }

    .light-hero__grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
        gap: 48px;
        align-items: center;
    }

    .light-hero .eyebrow {
        margin-bottom: 8px;
    }

    .light-hero h1 {
        max-width: none;
        margin: 0;
        font-size: clamp(34px, 2.55vw, 46px);
        line-height: 1.02;
        letter-spacing: -.045em;
        white-space: nowrap;
    }

    .light-hero__copy > p {
        max-width: 560px;
        margin: 12px 0 0;
        font-size: 14px;
        line-height: 1.55;
    }

    .light-hero__checks {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 14px;
    }

    .light-hero__checks span {
        padding: 6px 9px;
        border: 1px solid color-mix(in srgb, var(--light-primary) 10%, #fff);
        border-radius: 999px;
        background: rgba(255,255,255,.72);
        font-size: 11px;
        font-weight: 700;
    }

    .light-hero__aside--image {
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .light-hero__image-wrap {
        position: relative;
        width: 100%;
        max-width: 610px;
        overflow: hidden;
        border: 1px solid color-mix(in srgb, var(--light-accent) 14%, #fff);
        border-radius: calc(var(--light-radius) + 8px);
        background: #fff;
        box-shadow: 0 18px 42px rgba(23,37,84,.09);
    }

    .light-hero__image-wrap::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: inherit;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.38);
    }

    .light-hero__image {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    .comparison-section {
        padding-top: 12px;
    }
}

@media (max-width: 1180px) and (min-width: 981px) {
    .light-hero__grid {
        grid-template-columns: minmax(0, 1fr) minmax(390px, .9fr);
        gap: 34px;
    }

    .light-hero h1 {
        font-size: 36px;
    }
}

@media (max-width: 980px) and (min-width: 561px) {
    .light-hero__aside--image {
        display: none;
    }

    .light-hero__grid {
        grid-template-columns: 1fr;
    }
}

/* V0.1.19.8 full hero background */

@media (min-width: 981px) {
    .light-hero {
        position: relative;
        min-height: 180px;
        padding: 0 !important;
        overflow: hidden;

        /* No old background-image implementation. */
        background-image: none !important;
        background-color: var(--light-bg);
    }

    /*
     * The illustration is a real hero background layer.
     * It fills the full height, so there are no top/bottom gaps.
     */
    .light-hero::after {
        content: "";
        position: absolute;
        z-index: 0;

        top: 0;
        bottom: 0;

        /* Align right edge with the same 1320px content shell. */
        right: max(32px, calc((100vw - 1320px) / 2));

        /* Much wider than the previous version. */
        width: min(760px, 55vw);

        background-image: url('images/hero-illustration.webp');
        background-repeat: no-repeat;
        background-position: center center;
        background-size: cover;
    }

    /*
     * Soft blend between text area and illustration.
     */
    .light-hero::before {
        content: "";
        position: absolute;
        z-index: 1;

        top: 0;
        bottom: 0;

        right: max(32px, calc((100vw - 1320px) / 2));
        width: min(760px, 55vw);

        pointer-events: none;

        background:
            linear-gradient(
                90deg,
                var(--light-bg) 0%,
                rgba(255,250,245,.96) 8%,
                rgba(255,250,245,.55) 20%,
                rgba(255,250,245,0) 42%
            );
    }

    .light-hero__grid {
        position: relative;
        z-index: 2;

        min-height: 180px;
        display: block;
    }

    .light-hero__copy {
        display: flex;
        min-height: 180px;
        max-width: 650px;
        flex-direction: column;
        justify-content: center;
    }

    .light-hero__copy .eyebrow {
        margin-bottom: 6px;
    }

    .light-hero h1 {
        margin: 0;
        max-width: 650px;
        font-size: clamp(31px, 2.3vw, 42px);
        line-height: 1.02;
        white-space: nowrap;
    }

    .light-hero__copy > p {
        max-width: 560px;
        margin: 7px 0 0;
        font-size: 14px;
        line-height: 1.42;
    }

    .light-hero__checks {
        margin-top: 9px;
    }

    .comparison-section {
        padding-top: 0;
    }

    .comparison-section .section-heading {
        margin-bottom: 12px;
    }

    .comparison-section .section-heading h2 {
        font-size: clamp(22px, 1.7vw, 30px);
        line-height: 1.08;
    }
}

@media (max-width: 1384px) and (min-width: 981px) {
    .light-hero::after,
    .light-hero::before {
        right: 32px;
        width: 52vw;
    }
}

/* V0.1.19.9 lender card cleanup */

/*
 * Provider logo already identifies the lender.
 * Remove the duplicated provider/product name block,
 * matching the cleaner standard CPX presentation.
 */
.comparison-card .cpx-offer__name {
    display: none;
}

/* Let the metrics use the freed horizontal space. */
.comparison-card .cpx-offer__main {
    align-items: center;
}

.comparison-card .cpx-offer__metrics {
    width: 100%;
}

/* V0.1.19.10 responsive lender card actions */

@media (max-width: 980px) {
    .comparison-card .cpx-offer__actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        align-items: start;
    }

    .comparison-card .cpx-offer__working {
        grid-column: 1 / -1;
    }

    .comparison-card .cpx-offer__more {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
    }

    .comparison-card .cpx-offer__actions > a {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
    }

    /*
     * JS moves the rating out of the logo area and directly
     * below "Uzzināt vairāk".
     */
    .comparison-card .cpx-offer__actions .cpx-provider-rating {
        display: flex !important;
        grid-column: 1;
        grid-row: 3;
        width: 100%;
        margin: 2px 0 0;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
    }

    .comparison-card .cpx-offer__actions .cpx-provider-rating__stars {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    /*
     * Shared CPX CSS hides ratings on phones.
     * Finance Light keeps it visible below "Uzzināt vairāk".
     */
    .comparison-card .cpx-provider-rating {
        display: flex !important;
    }

    .comparison-card .cpx-offer__actions {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 7px;
    }

    .comparison-card .cpx-offer__actions .cpx-provider-rating {
        grid-column: 1;
        grid-row: 3;
        margin-top: 1px;
    }

    .comparison-card .cpx-provider-rating__star {
        width: 20px !important;
        height: 20px !important;
        min-height: 20px !important;
        font-size: 17px !important;
    }

    .comparison-card .cpx-provider-rating__label,
    .comparison-card .cpx-provider-rating__summary,
    .comparison-card .cpx-provider-rating__status {
        font-size: 9px;
    }
}

/* V0.1.19.12 tablet lender card compact layout */

@media (min-width: 561px) and (max-width: 980px) {
    .comparison-card .cpx-offer {
        display: grid;
        grid-template-columns:
            minmax(120px, 1.15fr)
            repeat(3, minmax(0, 1fr));
        gap: 10px 8px;
        align-items: center;
        text-align: center;
    }

    .comparison-card .cpx-offer__brand {
        grid-column: 1;
        grid-row: 1;
        justify-content: flex-start;
        min-width: 0;
    }

    .comparison-card .cpx-offer__brand img {
        width: 120px;
        height: 52px;
        max-width: 120px;
        max-height: 52px;
        object-fit: contain;
        object-position: left center;
    }

    .comparison-card .cpx-offer__main {
        display: contents;
    }

    .comparison-card .cpx-offer__name {
        display: none;
    }

    .comparison-card .cpx-offer__metrics {
        display: contents;
    }

    .comparison-card .cpx-offer__metrics .cpx-offer__metric:nth-child(1) {
        grid-column: 2;
        grid-row: 1;
    }

    .comparison-card .cpx-offer__metrics .cpx-offer__metric:nth-child(2) {
        grid-column: 3;
        grid-row: 1;
    }

    .comparison-card .cpx-offer__metrics .cpx-offer__metric:nth-child(3) {
        grid-column: 4;
        grid-row: 1;
    }

    .comparison-card .cpx-offer__metric {
        min-width: 0;
        padding: 4px 6px;
        border-left: 1px solid
            color-mix(in srgb, var(--light-primary) 10%, transparent);
    }

    .comparison-card .cpx-offer__metric span {
        font-size: 10px;
        line-height: 1.15;
    }

    .comparison-card .cpx-offer__metric strong {
        font-size: 15px;
        line-height: 1.15;
    }

    .comparison-card .cpx-offer__actions {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
        min-width: 0;
    }

    .comparison-card .cpx-offer__working {
        grid-column: 1 / -1;
    }

    .comparison-card .cpx-offer__more,
    .comparison-card .cpx-offer__actions > a {
        width: 100%;
    }
}
