/* Common safety rails */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

img {
    max-width: 100%;
}

/* Article images retain their natural proportions. */
.entry-content img,
.post-content img,
.td-post-content img {
    height: auto;
}

/* Card and hero images use a predictable newsroom frame. */
.home .read-img,
.archive .read-img,
.home .td-module-thumb,
.archive .td-module-thumb {
    overflow: hidden;
}

.home .read-img > img,
.archive .read-img > img,
.home .read-img > a > img,
.archive .read-img > a > img,
.home .td-module-thumb img,
.archive .td-module-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.home img.nnpg-portrait,
.archive img.nnpg-portrait {
    object-position: center 18%;
}

.home img.nnpg-contain,
.archive img.nnpg-contain {
    object-fit: contain;
    object-position: center center;
    background: #f3f4f6;
}

/* MoreNews sites: centred desktop canvas and compact hero. */
body.wp-theme-morenews .container-wrapper,
body.wp-theme-morenews .aft-main-banner-wrapper,
body.wp-theme-morenews .af-main-banner-editors-picks,
body.wp-theme-morenews .af-main-banner-latest-posts,
body.wp-theme-morenews .af-main-banner-trending-posts,
body.wp-theme-morenews .below-main-banner-section,
body.wp-theme-morenews .aft-main-banner-section .container-wrapper,
body.wp-theme-morenews #content.container-wrapper {
    width: min(1180px, calc(100% - 32px));
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

body.wp-theme-morenews .aft-main-banner-wrapper {
    padding-left: 0;
    padding-right: 0;
}

body.wp-theme-morenews.home .aft-slider-part .af-widget-carousel,
body.wp-theme-morenews.home .aft-slider-part .slick-wrapper,
body.wp-theme-morenews.home .aft-slider-part .slick-list,
body.wp-theme-morenews.home .aft-slider-part .slick-slide,
body.wp-theme-morenews.home .aft-slider-part .read-single,
body.wp-theme-morenews.home .aft-slider-part .read-img,
body.wp-theme-morenews.home .aft-slider-part .read-img img {
    height: clamp(320px, 30vw, 400px) !important;
}

/* Keep faces near the top of the hero and keep long Kannada headlines inside
 * the image frame instead of clipping below it. */
body.wp-theme-morenews.home .aft-slider-part .read-img img {
    object-position: center 22% !important;
}

body.wp-theme-morenews.home .aft-slider-part .read-details {
    box-sizing: border-box;
    max-height: 68%;
    overflow: hidden;
    padding: 18px 20px 20px;
}

body.wp-theme-morenews.home .aft-slider-part .read-title h3,
body.wp-theme-morenews.home .aft-slider-part .read-title h3 a {
    font-size: clamp(23px, 2.25vw, 34px) !important;
    line-height: 1.2 !important;
}

body.wp-theme-morenews.home .aft-slider-part .read-title h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    margin-bottom: 0;
}

body.wp-theme-morenews .slick-list,
body.wp-theme-morenews .slick-wrapper {
    max-width: 100%;
}

/* Prevent third-party wide creatives from creating horizontal scrolling. */
body.wp-theme-morenews .google-auto-placed,
body.wp-theme-morenews ins.adsbygoogle,
body.wp-theme-morenews [id^="aswift_"] {
    max-width: 100% !important;
}

@media (max-width: 1024px) {
    body.wp-theme-morenews .container-wrapper,
    body.wp-theme-morenews .aft-main-banner-wrapper,
    body.wp-theme-morenews #content.container-wrapper {
        width: min(100% - 24px, 1180px);
    }
}

@media (max-width: 767px) {
    body.wp-theme-morenews .container-wrapper,
    body.wp-theme-morenews .aft-main-banner-wrapper,
    body.wp-theme-morenews #content.container-wrapper {
        width: min(100% - 16px, 1180px);
    }

    body.wp-theme-morenews.home .aft-slider-part .af-widget-carousel,
    body.wp-theme-morenews.home .aft-slider-part .slick-wrapper,
    body.wp-theme-morenews.home .aft-slider-part .slick-list,
    body.wp-theme-morenews.home .aft-slider-part .slick-slide,
    body.wp-theme-morenews.home .aft-slider-part .read-single,
    body.wp-theme-morenews.home .aft-slider-part .read-img,
    body.wp-theme-morenews.home .aft-slider-part .read-img img {
        height: clamp(240px, 68vw, 300px) !important;
    }

    body.wp-theme-morenews.home .aft-slider-part .read-details {
        max-height: 76%;
        padding: 12px 14px 14px;
    }

    body.wp-theme-morenews.home .aft-slider-part .read-title h3,
    body.wp-theme-morenews.home .aft-slider-part .read-title h3 a {
        font-size: clamp(20px, 6vw, 27px) !important;
    }
}
