/* Final responsive corrections shared by every page. Keep content in flow;
   do not mask layout overflow at the document edge. */
main :is(h1, h2, h3, h4, p, li, a, button, label),
.nx-footer {
    overflow-wrap: anywhere;
}

:is(.nx-container, .nx-split, .nx-footer__main, .nx-footer__cols)>* {
    min-width: 0;
}

.nx-crumb,
.nx-blog-crumb {
    flex-wrap: wrap;
}

.nx-title--nowrap {
    white-space: normal;
}

.page-blog .nx-blog-excerpt {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

@media (max-width: 900px) {
    .nx-btn {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }

    .nx-mobile__list a {
        gap: .6rem;
        overflow-wrap: anywhere;
    }

    .nx-mobile__list > li > :is(a, span) {
        font-size: 1rem;
        padding-inline: .6rem;
    }

    .nx-mobile__list > li > span {
        display: block;
        padding-block: 1rem;
    }

    .nx-mobile__list > li > a:is(:hover, .active) {
        padding-left: .6rem;
    }

    .nx-mobile__sublist a {
        font-size: .9rem;
    }

    .nx-mobile__list a i {
        flex-shrink: 0;
    }

    .nx-mobile__foot {
        flex-shrink: 0;
    }

    .nx-form :is(input, select, textarea) {
        min-width: 0;
        max-width: 100%;
        font-size: 16px;
    }

    /* Card backs determine height, including at larger text sizes. */
    .page-about .nx-value-flip {
        aspect-ratio: auto;
    }

    .page-about .nx-value-flip__inner {
        display: grid;
        height: auto;
        min-height: 340px;
    }

    .page-about .nx-value-flip__face {
        position: relative;
        inset: auto;
        grid-area: 1 / 1;
    }

    .page-about .nx-value-flip__back {
        overflow: visible;
    }

    .page-about .nx-value-flip__icon {
        flex-shrink: 0;
    }

    .nx-topic-flip__back {
        overflow-y: auto;
        justify-content: flex-start;
    }

    .nx-topic-flip__back>* {
        flex-shrink: 0;
    }
}

@media (max-width: 767px) {

    /* Use the available phone width to enlarge all six focus graphs. */
    .nx-mens-graph.nx-container {
        width: 100%;
        padding-inline: 0;
    }

    /* Longer vertical titles wrap within the shared 420px card height. */
    .nx-focus-editorial .nx-topic-flip__caption {
        max-height: calc(100% - 48px);
        white-space: normal;
        text-wrap: balance;
        line-height: 1.15;
    }

    /* Let the portrait set its own height above the topic cards. */
    .nx-mens-topics__video {
        min-height: 0;
    }

    .nx-mens-topics__video img {
        height: auto;
    }

    /* A fixed image layer also works on mobile browsers that ignore
       background-attachment: fixed. Clip it to the Careers section. */
    .page-about .nx-about-careers {
        clip-path: inset(0);
    }

    /* Leave a full mobile screen of image between the founders and copy. */
    #main section.nx-about-careers:not(section section) {
        display: block;
        min-height: 0;
        padding-top: 50svh;
        padding-bottom: 0;
    }

    .page-about .nx-about-careers__bg {
        position: fixed;
        inset: 0;
        background-attachment: scroll;
        background-position: 68% center;
    }

    .page-about .nx-about-careers__copy {
        background: linear-gradient(90deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .85) 65%, rgba(255, 255, 255, .65));
        padding: 2rem 1.5rem;
    }

    .page-about .nx-about-careers__heading {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 0;
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .page-about .nx-about-careers__heading h2 {
        margin-bottom: 0;
    }

    .page-about .nx-about-careers__copy>h3 {
        margin: 0;
        padding: 0 0 1rem;
        background: transparent;
    }

    .page-about .nx-about-careers__copy>p {
        max-width: none;
        padding: 0;
        background: transparent;
    }

    .page-about .nx-about-careers__inner {
        width: 100%;
        max-width: none;
        margin-inline: 0;
        background: transparent;
    }

    .page-about .nx-about-careers__inner::before {
        display: none;
    }

    #main .nx-about-careers__inner {
        min-height: 0;
        align-items: center;
    }

    .page-about .nx-about-nisce {
        display: flex;
        align-items: center;
    }

    .page-about .nx-about-nisce__mark {
        display: none;
    }

    .page-about .nx-about-nisce__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-about .nx-about-nisce__copy {
        text-align: center;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .page-about .nx-value-flip__front img {
        object-position: center top;
    }

    .page-about .nx-about-formulations__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-about .nx-about-formulations__bg {
        order: -1;
        width: 100%;
        height: auto;
    }

    /* Keep the About headline in normal flow below its breadcrumb. The
       desktop translateY and explicit break otherwise push its last lines
       outside the hero on phones. */
    .page-about .nx-hero--video {
        min-height: 24rem;
        height: auto;
        padding: 10rem 0 3rem;
    }

    .page-about .nx-hero--video .nx-hero__video {
        object-position: center;
    }

    .page-about .nx-hero--video .nx-hero__copy {
        transform: none;
        width: 100%;
        max-width: 100%;
    }

    .page-about .nx-hero--video .nx-hero__title {
        margin: 0;
        line-height: 1.18;
        letter-spacing: -.02em;
        text-align: left;
        overflow-wrap: normal;
    }

    .page-about .nx-hero__title>br {
        display: none;
    }

    .page-about .nx-hero__title>span {
        white-space: normal;
        text-wrap: balance;
    }

    .nx-reachexpand .nx-section__bg::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(16, 43, 78, .78);
    }

    body[class] .nx-subhero--plain {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
        padding: 6.5rem 0 2rem;
        gap: 1.5rem;
    }

    body[class] .nx-subhero--plain .nx-subhero__inner {
        order: 1;
    }

    body[class] .nx-subhero--plain .nx-subhero__bg {
        position: relative;
        inset: auto;
        order: 2;
    }

    body[class] .nx-subhero--plain .nx-subhero__bg::after {
        display: none;
    }

    body[class] .nx-subhero--plain .nx-subhero__framevideo {
        position: relative;
        inset: auto;
        transform: none;
        width: min(100%, 540px);
        height: auto;
        margin-inline: auto;
    }


    .nx-challenge--seq .nx-stats .nx-stat {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
        padding: 1.5rem;
    }

    .nx-challenge--seq .nx-stat__media {
        align-items: flex-start;
        text-align: left;
    }

    .nx-hero--video :is(.nx-hero__title-navy, .nx-hero__title-red),
    .page-contact .nx-contact-hero .nx-mens-hero__title {
        white-space: normal;
    }

    /* These sections contain unique information and must remain available. */
    .nx-quality,
    .nx-quality-verified {
        display: block;
    }

    .nx-quality-verified .nx-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .nx-quality-verified .nx-split__copy {
        max-width: 100%;
    }

    /* Let panel copy size the card instead of clipping it inside a ratio. */
    .nx-mens-standard__panel {
        aspect-ratio: auto;
        min-height: 280px;
    }

    .nx-mens-standard__panel img {
        position: absolute;
        inset: 0;
    }

    .nx-mens-standard__overlay {
        position: relative;
        max-width: 100%;
    }

    .nx-mens-standard__tabs {
        flex-wrap: wrap;
        overflow: visible;
    }

    .nx-mens-standard__tab {
        flex: 1 1 auto;
    }

    .nx-quality-commitment__mobile-video {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .nx-quality-commitment__mobile-video video {
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .page-about .nx-core-values__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .page-about .nx-value-flip__inner {
        min-height: 360px;
    }

    .page-about .nx-value-flip__text {
        font-size: 1rem;
    }

    .nx-table tbody td {
        flex-wrap: wrap;
        overflow-wrap: anywhere;
    }

    .nx-footer__col--contact {
        grid-column: 1 / -1;
    }
}
/* Shared mobile banner height. */
@media (max-width: 767px) {
    body[class] :is(.nx-hero--video, .nx-subhero, .nx-mens-hero, .nx-blog-hero) {
        height: 70svh;
        min-height: 70svh;
        max-height: 70svh;
    }

    /* Match Men's Health's visible banner height below the fixed header.
       Keep the six Area of Focus page layouts unchanged. */
    body[class]:not(.page-focus) :is(.nx-hero--video, .nx-subhero, .nx-mens-hero, .nx-blog-hero) {
        margin-top: 76px;
    }

    body[class] .nx-subhero--plain {
        gap: 1rem;
        padding-bottom: 3rem;
    }

    body[class] .nx-subhero--plain .nx-subhero__inner {
        flex: 0 0 auto;
    }

    body[class] .nx-subhero--plain .nx-subhero__bg {
        flex: 1 1 0;
        min-height: 0;
    }

    body[class] .nx-subhero--plain .nx-subhero__framevideo {
        height: 100%;
        max-width: 100%;
        aspect-ratio: 965 / 600;
        width: auto;
    }
}
