/* MBP HP.6.9.2 - Premium Mobile Design */
/* Preserve desktop and Design Manager settings. */

@media screen and (max-width: 767px) {

    body {
        --mbp-mobile-nav-height: 64px;
        padding-bottom: calc(
            var(--mbp-mobile-nav-height) +
            env(safe-area-inset-bottom, 0px)
        );
    }

    /* Homepage container */

    body.home .home-main {
        width: calc(100% - 24px);
        min-width: 0;
        --mbp-editorial-section-gap: 28px;
    }

    /* Header */

    body .site-header .branding {
        grid-template-columns:
            44px minmax(0, 1fr) 44px;
        padding-block: 12px;
        align-items: center;
    }

    body .site-header .branding > .mobile-menu-toggle {
        width: 44px;
        min-height: 44px;
        border-radius: 5px;
        font-size: 22px;
    }

    body .site-header .branding .logo-image {
        max-width: 340px !important;
        height: auto !important;
    }

    body .site-header .main-nav .mbp-primary-menu {
        max-height: min(65vh, 600px);
        overscroll-behavior-y: contain;
    }

    /* Breaking news */

    body.home .home-main .mbp-ticker {
        min-height: 44px;
        margin: 10px 0 14px !important;
        border-radius: 4px;
        font-size: 13px;
    }

    body.home .mbp-ticker .mbp-ticker-label {
        padding-inline: 10px;
        font-size: 13px;
    }

    body.home .mbp-ticker .mbp-ticker-pause {
        min-width: 44px;
        min-height: 44px;
    }

    /* Hero lead story */

    body.home .home-main .hero-grid {
        min-width: 0;
    }

    body.home .home-main .hero-grid
    .hero-main .hero-link {
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        height: auto;
        min-height: 0;
        aspect-ratio: auto;
        border-radius: 4px;
        overflow: hidden;
        background: #171717;
    }

    body.home .home-main .hero-grid
    .hero-main .hero-link > img,
    body.home .home-main .hero-grid
    .hero-main .hero-link > .image-placeholder {
        position: relative;
        inset: auto;
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 10;
        object-fit: cover;
    }

    body.home .home-main .hero-grid
    .hero-main .hero-link > .image-placeholder {
        display: flex;
    }

    body.home .home-main .hero-grid
    .hero-main .hero-overlay {
        position: relative;
        inset: auto;
        margin-top: -36px;
        padding: 28px 14px 15px;
        background: linear-gradient(
            to bottom,
            transparent 0,
            #171717 36px
        );
        color: #fff;
    }

    body.home .home-main .hero-grid
    .hero-main .hero-overlay h1 {
        font-size: clamp(22px, 5.8vw, 26px);
        font-weight: 700;
        line-height: 1.4;
        margin-block: 7px;
        overflow-wrap: anywhere;
    }

    body.home .hero-grid .hero-overlay .tag {
        font-size: 12px;
        padding: 3px 8px;
        border-radius: 2px;
    }

    body.home .hero-grid .hero-overlay > span:last-child {
        font-size: 12px;
        color: #ddd;
    }

    /* Hero secondary news */

    body.home .hero-grid .hero-side {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        grid-auto-rows: auto;
        gap: 12px;
        margin-top: 16px;
    }

    body.home .hero-grid .hero-side > .news-card.compact {
        display: grid;
        grid-template-columns:
            clamp(96px, 30vw, 130px)
            minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        padding-bottom: 12px;
        min-width: 0;
        height: auto;
    }

    body.home .hero-grid .hero-side .compact .thumb {
        width: 100%;
        aspect-ratio: 4 / 3;
        border-radius: 3px;
    }

    body.home .hero-grid .hero-side .compact .card-content {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 0;
    }

    body.home .hero-grid .hero-side .compact h3 {
        order: -1;
        margin: 0;
        font-size: 17px;
        line-height: 1.45;
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    body.home .hero-grid .hero-side .compact .meta {
        font-size: 11px;
        line-height: 1.5;
    }

    /* Upazila navigation */

    body.home .home-main > .section > .area-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
        scroll-snap-type: none;
        padding-bottom: 0;
    }

    body.home .home-main > .section
    > .area-grid > .area-link {
        min-width: 0;
        min-height: 86px;
        padding: 9px 4px;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: 1px solid #e5e5e5;
        border-radius: 4px;
        background: #fafafa;
        font-size: 15px;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    body.home .area-grid .area-link > span {
        font-size: 21px;
        line-height: 1.2;
    }

    body.home .area-grid .area-link > small {
        font-size: 10px;
    }

    /* Latest news only.
       Category Design Manager styles are not overridden. */

    body.home .home-main > #mbp-latest-news {
        margin-block: 28px;
    }

    body.home #mbp-latest-news > .section-title {
        font-size: 22px;
        margin-bottom: 14px;
    }

    body.home #mbp-latest-news > .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 12px;
    }

    body.home #mbp-latest-news > .card-grid > .news-card {
        min-width: 0;
        height: auto;
    }

    body.home #mbp-latest-news > .card-grid > .news-card h3 {
        font-size: 17px;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    body.home #mbp-latest-news > .card-grid
    > .news-card:first-child h3 {
        font-size: 22px;
        line-height: 1.4;
    }

    body.home #mbp-latest-news > .card-grid
    > .news-card:nth-child(n+2):nth-child(-n+4) {
        grid-template-columns:
            clamp(96px, 30vw, 130px)
            minmax(0, 1fr);
        gap: 12px;
    }

    /* Category safety rules.
       No color, grid, image ratio or layout overrides. */

    body.home .home-main .mbp-category-section,
    body.home .home-main .mbp-category-section .card-grid,
    body.home .home-main .mbp-category-section .news-card,
    body.home .home-main .mbp-category-section .card-content,
    body.home .home-main .mbp-category-section .section-heading {
        min-width: 0;
    }

    body.home .home-main .mbp-category-section
    .section-heading > a {
        min-height: 44px;
        flex-shrink: 0;
    }

    /* Footer */

    body .site-footer {
        margin-top: 30px;
        padding-block: 26px 18px;
    }

    body .site-footer .footer-inner > div {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    body .site-footer .mbp-footer-contact {
        font-size: 16px;
        line-height: 1.85;
        gap: 8px;
    }

    body .site-footer .copyright {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
        font-size: 13px;
    }

    /* Bottom navigation */

    body .mobile-bottom {
        min-height: calc(
            var(--mbp-mobile-nav-height) +
            env(safe-area-inset-bottom, 0px)
        );
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -3px 18px #0000000d;
    }

    body .mobile-bottom > a,
    body .mobile-bottom > button {
        min-height: var(--mbp-mobile-nav-height);
        min-width: 44px;
        font-size: 25px;
        gap: 5px;
    }

    body .mobile-bottom span {
        font-size: 12px;
        line-height: 1.2;
        font-weight: 600;
    }

    /* Mobile search */

    body .mbp-mobile-search-panel {
        bottom: calc(
            var(--mbp-mobile-nav-height) +
            env(safe-area-inset-bottom, 0px)
        );
        max-height: 70vh;
        overflow-y: auto;
    }

    body .mbp-mobile-search-panel .search-form {
        min-width: 0;
    }

    body .mbp-mobile-search-panel input[type="search"],
    body .mbp-mobile-search-panel input[name="s"] {
        min-height: 46px;
        font-size: 16px;
        min-width: 0;
    }

    body .mbp-mobile-search-panel button[type="submit"] {
        min-height: 46px;
    }

    body .mbp-mobile-search-panel .mbp-mobile-search-close {
        width: 44px;
        min-height: 44px;
        top: 4px;
        right: 6px;
    }
}

/* Narrow mobile screens */

@media screen and (max-width: 360px) {

    body .site-header .branding {
        gap: 4px !important;
    }

    body.home .home-main
    .hero-grid .hero-side .compact h3 {
        font-size: 16px;
    }

    body.home #mbp-latest-news
    > .card-grid > .news-card h3 {
        font-size: 16px;
    }

    body.home #mbp-latest-news
    > .card-grid > .news-card:first-child h3 {
        font-size: 22px;
    }

    body.home .home-main > .section
    > .area-grid > .area-link {
        font-size: 14px;
    }
}

/* Reduced motion */

@media screen and (max-width: 767px)
and (prefers-reduced-motion: reduce) {

    body.home .home-main .news-card .thumb img {
        transition: none;
        transform: none;
    }
}
