/**
 * Mobile / tablet upper footer redesign (≤1024px).
 * Desktop appearance stays on existing .op-footer-* rules (+ backup address markup).
 */

/* --- Desktop defaults: wrappers transparent; hide mobile-only chrome --- */
.footer-mobile-brand,
.footer-mobile-funding {
    display: contents;
}

.footer-mobile-brand__tagline,
.footer-mobile-funding__label,
.footer-mobile-divider,
.footer-mobile-contact-card__hours,
.footer-mobile-company-card {
    display: none !important;
}

.footer-desktop-address {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.footer-mobile-icon {
    display: contents;
}

.footer-mobile-icon > svg {
    display: block;
    min-width: 22px;
}

/* Email reveal — keep readable on desktop too (matches pre-redesign button look) */
.op-footer-email-reveal {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 700;
    font-size: clamp(0.875rem, calc(0.8260188088rem + 0.0020898642 * 100vw), 1rem);
    color: #667085;
    cursor: pointer;
    text-align: left;
    position: relative;
}

.op-footer-email-reveal:focus-visible {
    outline: 2px solid #086cdc;
    outline-offset: 3px;
    border-radius: 4px;
}

.op-footer-email-link {
    font-weight: 700;
    color: #0a2f9a;
    word-break: break-all;
}

/* --- Mobile / tablet upper footer --- */
@media (max-width: 1024px) {
    .footer-desktop-address {
        display: none !important;
    }

    .footer-mobile-company-card {
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
    }
    .op-footer-wrap {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
        padding-top: 28px;
        padding-bottom: 24px;
    }

    .op-footer-wrap__top {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
        padding-right: 0;
        margin-bottom: 24px;
        width: 100%;
    }

    .footer-mobile-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
        text-align: center;
    }

    .footer-mobile-brand .op-footer-wrap__top--logo {
        max-width: 260px;
        padding-top: 0;
    }

    .footer-mobile-brand .op-footer-wrap__top--logo img {
        width: 240px;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }

    .footer-mobile-brand__tagline {
        display: block;
        margin: 0;
        max-width: 28rem;
        color: #5b6b8c;
        font-size: 15px;
        line-height: 1.4;
        font-weight: 500;
    }

    .footer-mobile-funding {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 14px 16px 16px;
        border-radius: 20px;
        border: 1px solid #e4eef8;
        background: #f7fafc;
        box-sizing: border-box;
    }

    .footer-mobile-funding__label {
        display: block;
        margin: 0;
        width: 100%;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        font-size: 12px;
        font-weight: 700;
        color: #6b7a99;
        line-height: 1.3;
    }

    .op-footer-wrap__top--gallery.footer-mobile-funding__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        max-width: none;
    }

    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item {
        max-width: none !important;
        width: 100% !important;
        height: 58px;
        padding: 10px 12px;
        border-radius: 16px;
        border: 1px solid #d7e6f7;
        background: #fff;
        box-shadow: 0 4px 12px rgba(10, 47, 154, 0.05);
        /* Same muted → full-color interaction as desktop gallery */
        -webkit-filter: saturate(0);
        filter: saturate(0);
        -webkit-transition: filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
        -o-transition: filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
        transition: filter 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
        box-sizing: border-box;
        cursor: pointer;
    }

    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item:hover,
    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item:focus-visible,
    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item:active {
        -webkit-filter: saturate(1);
        filter: saturate(1);
        border-color: #b8d4f0;
        box-shadow: 0 6px 16px rgba(10, 47, 154, 0.12);
    }

    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item:first-child img,
    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item:nth-child(2) img,
    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item:nth-child(3) img {
        transform: none;
        -webkit-transform: none;
        -ms-transform: none;
    }

    .op-footer-wrap__top--gallery.footer-mobile-funding__grid .op-item img {
        max-height: 34px;
        max-width: 100%;
        width: auto;
        object-fit: contain;
    }

    .op-footer-wrap__nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-right: 0;
        margin-bottom: 0;
        width: 100%;
    }

    /*
     * Kill legacy ≤720px half-width rules from style.min.css:
     *   .op-item:first-child { width: calc((100%-15px)/2) }
     *   .contacts-row { max-width: calc((100%-15px)/2) }
     */
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100% !important;
        max-width: 100% !important;
        padding-bottom: 0 !important;
        border-bottom: 0;
        margin-bottom: 0;
        align-items: stretch;
        justify-content: stretch;
        flex-wrap: nowrap;
        box-sizing: border-box;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-company-card,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-contact-card,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .op-item:first-child,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .op-footer-wrap__nav--contacts-row {
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        min-height: 0;
        height: auto;
        box-sizing: border-box;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-company-card,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-contact-card {
        margin: 0;
        padding: 12px 10px;
        border-radius: 18px;
        border: 1px solid #d7e6f7;
        background: #fff;
        box-shadow: 0 6px 18px rgba(10, 47, 154, 0.07);
        color: #667085;
    }

    /*
     * Office card: [icon] text — icon top-aligned with first text line
     * (not centered against full card height when grid stretches cards).
     */
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-company-card.op-item {
        display: flex !important;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
        -webkit-box-align: start;
        -ms-flex-align: start;
        align-items: flex-start;
        -webkit-box-pack: start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        gap: 8px;
    }

    .footer-mobile-company-card__body,
    .footer-mobile-company-card .op-item-text {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        min-width: 0;
        max-width: none !important;
        width: auto;
        font-size: 12px;
        line-height: 1.35;
    }

    /* Name sits on the same vertical centerline as the location icon badge */
    .footer-mobile-company-card__name {
        display: flex;
        align-items: center;
        min-height: 34px;
        font-size: 11.5px;
        font-weight: 700;
        color: #0a2f9a;
        line-height: 1.15;
        letter-spacing: -0.035em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        text-decoration: none;
        cursor: pointer;
    }

    a.footer-mobile-company-card__name:hover,
    a.footer-mobile-company-card__name:focus-visible {
        color: #086cdc;
        text-decoration: underline;
        text-underline-offset: 2px;
    }

    .footer-mobile-company-card__line {
        color: #667085;
        font-weight: 400;
        font-size: 12px;
        line-height: 1.35;
    }

    .footer-mobile-company-card__regs {
        display: block;
        width: 100%;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #e6eef8;
        font-size: 11px;
        line-height: 1.4;
        color: #5b6b8c;
    }

    .footer-mobile-company-card__regs b {
        font-weight: 700;
        color: #0a2f9a;
    }

    .footer-mobile-icon {
        display: inline-flex !important;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        min-width: 34px;
        border-radius: 50%;
        background: #e7f1fb;
    }

    .footer-mobile-icon > svg {
        width: 17px;
        height: 17px;
        min-width: 17px;
    }

    /* Contact card: stretch rows to fill equal-height card (space between phone / email / hours) */
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-contact-card {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        justify-content: space-between;
        gap: 0;
        height: 100%;
        min-height: 100%;
        box-sizing: border-box;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid .footer-mobile-contact-card .op-item {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 0;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        color: #667085;
    }

    .footer-mobile-contact-card .op-item-text {
        -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        width: auto;
        font-size: 12px;
        line-height: 1.35;
    }

    .footer-mobile-contact-card__phone {
        align-items: center !important;
        text-decoration: none !important;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item
    .op-item-text {
        flex: 0 0 auto !important;
        width: max-content;
        max-width: 100%;
        font-size: 12.5px !important;
        font-weight: 700 !important;
        color: #092b96 !important;
        white-space: nowrap;
        letter-spacing: -0.015em;
        -webkit-font-smoothing: antialiased;
        text-rendering: geometricPrecision;
        text-decoration: none !important;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item:hover
    .op-item-text,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item:focus-visible
    .op-item-text {
        text-decoration: underline !important;
        text-underline-offset: 2px;
        text-decoration-thickness: 1px;
    }

    /* Kill theme full-width ::after underline (it followed flex-grow, not glyph width) */
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item
    .op-item-text::after,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item:hover
    .op-item-text::after,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item:focus
    .op-item-text::after,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item:active
    .op-item-text::after {
        content: none !important;
        display: none !important;
        width: 0 !important;
        max-width: 0 !important;
        background: transparent !important;
    }

    .footer-mobile-contact-card__email {
        align-items: center !important;
    }

    .footer-mobile-contact-card__email .op-footer-email-reveal {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        max-width: 100%;
        min-width: 0;
        min-height: 28px;
        padding: 3px 10px;
        border: 1.5px solid #0a2f9a;
        border-radius: 999px;
        color: #0a2f9a;
        font-size: 10.5px;
        font-weight: 700;
        line-height: 1.1;
        background: #fff;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box;
        text-decoration: none !important;
    }

    .footer-mobile-contact-card__email .op-footer-email-reveal:hover,
    .footer-mobile-contact-card__email .op-footer-email-reveal:focus-visible {
        background: #f3f8fd;
    }

    .footer-mobile-contact-card__email .op-footer-email-link {
        display: inline-block;
        flex: 0 0 auto !important;
        width: max-content;
        max-width: 100%;
        min-width: 0;
        font-size: 12px;
        font-weight: 700;
        color: #0a2f9a;
        overflow-wrap: anywhere;
        word-break: break-word;
        text-decoration: none !important;
    }

    .footer-mobile-contact-card__email .op-footer-email-link:hover,
    .footer-mobile-contact-card__email .op-footer-email-link:focus-visible {
        text-decoration: underline !important;
        text-underline-offset: 2px;
        text-decoration-thickness: 1px;
    }

    .footer-mobile-contact-card__email .op-footer-email-link::after {
        content: none !important;
        display: none !important;
        width: 0 !important;
    }

    .footer-mobile-contact-card__hours {
        display: flex !important;
        align-items: flex-start !important;
    }

    .footer-mobile-contact-card__hours-text {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
        max-width: 100%;
        line-height: 1.25;
    }

    .footer-mobile-contact-card__hours-days {
        display: block;
        font-size: 13px;
        font-weight: 700;
        color: #0a2f9a;
        line-height: 1.25;
    }

    .footer-mobile-contact-card__hours-time {
        display: block;
        font-size: 12px;
        font-weight: 500;
        color: #667085;
        line-height: 1.3;
    }

    .footer-mobile-socials {
        grid-column: 1 / -1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100% !important;
        max-width: none !important;
        margin-top: 12px;
        padding-top: 4px;
        text-align: center;
    }

    .footer-mobile-socials__title,
    .op-footer-wrap__nav--contacts-title.footer-mobile-socials__title {
        margin: 0 !important;
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        color: #0a2f9a;
    }

    .footer-mobile-socials .op-footer-wrap__nav--contacts-socials {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }

    .footer-mobile-socials .op-footer-wrap__nav--contacts-socials .op-item {
        width: 46px !important;
        height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .footer-mobile-socials .op-footer-wrap__nav--contacts-socials .op-item:hover,
    .footer-mobile-socials .op-footer-wrap__nav--contacts-socials .op-item:focus-visible {
        opacity: 1;
        transform: translateY(-1px);
    }

    .footer-mobile-socials .op-footer-wrap__nav--contacts-socials .op-item svg {
        width: 46px;
        height: 46px;
        display: block;
    }

    .footer-mobile-divider {
        grid-column: 1 / -1;
        display: block;
        width: 100%;
        height: 1px;
        margin: 24px 0 20px;
        background: #d7e6f7;
    }

    .op-footer-wrap__nav > .op-footer-wrap__nav--menu:first-of-type {
        margin-top: 0;
    }
}

/* Keep two columns on all mobile widths; tighten density on very narrow screens */
@media (max-width: 375px) {
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-company-card,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-contact-card {
        padding: 10px 8px;
    }

    .footer-mobile-company-card__name {
        font-size: 10.5px;
        letter-spacing: -0.04em;
        min-height: 32px;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item
    .op-item-text {
        font-size: 11.5px !important;
        letter-spacing: -0.02em;
    }

    .footer-mobile-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .footer-mobile-icon > svg {
        width: 16px;
        height: 16px;
        min-width: 16px;
    }

    .footer-mobile-contact-card__email .op-footer-email-reveal {
        min-height: 26px;
        padding: 2px 9px;
        font-size: 10px;
    }

    .footer-mobile-brand .op-footer-wrap__top--logo img {
        width: 200px;
    }
}

@media (min-width: 376px) and (max-width: 430px) {
    .footer-mobile-brand .op-footer-wrap__top--logo img {
        width: 220px;
    }

    .footer-mobile-socials .op-footer-wrap__nav--contacts-socials .op-item,
    .footer-mobile-socials .op-footer-wrap__nav--contacts-socials .op-item svg {
        width: 44px;
        height: 44px;
    }
}

/* Tablet: roomier 2-col — card type ~+3px vs previous tablet sizes */
@media (min-width: 768px) and (max-width: 1024px) {
    .footer-mobile-brand .op-footer-wrap__top--logo img {
        width: 280px;
    }

    .footer-mobile-funding {
        max-width: 560px;
        padding: 16px 18px 18px;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid {
        gap: 14px;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-company-card,
    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-contact-card {
        padding: 16px 14px;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-company-card {
        gap: 12px;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid > .footer-mobile-contact-card {
        gap: 0;
        justify-content: space-between;
    }

    .footer-mobile-company-card__name {
        font-size: 21px;
        letter-spacing: -0.02em;
        min-height: 44px;
    }

    .footer-mobile-company-card__line,
    .footer-mobile-company-card .op-item-text {
        font-size: 16px;
        line-height: 1.4;
    }

    .footer-mobile-company-card__regs {
        font-size: 14px;
        line-height: 1.45;
        margin-top: 10px;
        padding-top: 10px;
    }

    .footer-mobile-contact-card .op-item-text {
        font-size: 15px;
        line-height: 1.4;
    }

    .op-footer-wrap__nav--contacts.footer-mobile-company-grid
    .footer-mobile-contact-card__phone.op-item
    .op-item-text {
        font-size: 22px !important;
        font-weight: 700 !important;
        letter-spacing: -0.01em;
    }

    .footer-mobile-contact-card__hours-days {
        font-size: 17px;
    }

    .footer-mobile-contact-card__hours-time {
        font-size: 16px;
    }

    .footer-mobile-contact-card__email .op-footer-email-reveal {
        font-size: 19.5px;
        min-height: 40px;
        padding: 7px 16px;
    }

    .footer-mobile-contact-card__email .op-footer-email-link {
        font-size: 20px;
    }

    .footer-mobile-icon {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    .footer-mobile-icon > svg {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
}

/* 721–1024: same row as Privacy/Terms (not under them), copyright stays one line */
@media (min-width: 721px) and (max-width: 1024px) {
    .op-footer-wrap__bottom {
        -webkit-box-orient: horizontal !important;
        -webkit-box-direction: normal !important;
        -ms-flex-direction: row !important;
        flex-direction: row !important;
        -webkit-box-align: center !important;
        -ms-flex-align: center !important;
        align-items: center !important;
        -webkit-box-pack: justify !important;
        -ms-flex-pack: justify !important;
        justify-content: space-between !important;
        -ms-flex-wrap: nowrap !important;
        flex-wrap: nowrap !important;
        gap: 10px;
    }

    .op-footer-wrap__bottom--copyright {
        -webkit-box-ordinal-group: 2 !important;
        -ms-flex-order: 1 !important;
        order: 1 !important;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        width: auto !important;
        max-width: none !important;
        white-space: nowrap !important;
        font-size: 11px;
        line-height: 1.3;
        letter-spacing: -0.015em;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .op-footer-wrap__bottom--nav {
        -webkit-box-ordinal-group: 3 !important;
        -ms-flex-order: 2 !important;
        order: 2 !important;
        -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        width: auto !important;
        min-width: 0;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .op-footer-wrap__bottom--nav ul {
        -webkit-box-pack: end;
        -ms-flex-pack: end;
        justify-content: flex-end;
        -ms-flex-wrap: nowrap !important;
        flex-wrap: nowrap !important;
        gap: 0;
    }

    .op-footer-wrap__bottom--nav ul li::after {
        margin: 0 10px;
    }
}
