/* Main portal home only. Shared product/editoria templates keep their own layout. */
body.is-cm-main-home {
    --cm-home-section-gutter: 24px;
    --cm-home-section-space: 32px;
    --cm-home-content-gap: 20px;
    --cm-home-header-height: 104px;
    --cm-home-navigation-height: 68px;
}

body.is-cm-main-home .main-content > :is(.cm-home-columnists, .magnavita-wrapper, .cm-home-reels, .cm-regional-tabs-section, .cm-section-showcase, .culture-section, .video-section) {
    box-sizing: border-box;
    width: calc(100% - 2 * var(--cm-home-section-gutter)) !important;
    max-width: 1680px !important;
    margin: var(--cm-home-section-space) auto !important;
    padding: 24px !important;
    scroll-margin-top: calc(var(--cm-home-header-height) + var(--cm-home-navigation-height) + 16px);
}

body.is-cm-main-home .main-content > :is(.cm-home-columnists, .cm-regional-tabs-section, .cm-section-showcase) > .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
}

body.is-cm-main-home .main-content > .magnavita-wrapper {
    padding: 0 !important;
}

body.is-cm-main-home .main-content :is(.cm-home-section-heading, .cm-section-showcase-header) {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px !important;
    margin-bottom: 20px !important;
    padding-left: 0 !important;
    border-left: 0 !important;
}

body.is-cm-main-home .main-content :is(.cm-home-section-heading, .cm-section-showcase-header) > :first-child {
    flex: 1 1 200px;
    min-width: 0;
}

body.is-cm-main-home .main-content :is(.cm-home-section-heading, .cm-section-showcase-header) h2 {
    margin: 0 !important;
    font-size: clamp(1.45rem, 1.8vw, 2rem) !important;
    line-height: 1.15 !important;
    overflow-wrap: break-word;
}

body.is-cm-main-home .main-content :is(.cm-home-section-link, .cm-section-showcase-link) {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    max-width: 100%;
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
    letter-spacing: 0.03em !important;
}

body.is-cm-main-home .main-content .cm-section-showcase-main {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.95fr) minmax(280px, 1fr) !important;
    gap: var(--cm-home-content-gap) !important;
}

body.is-cm-main-home .main-content .cm-section-showcase-lead h3 {
    font-size: clamp(1.5rem, 1.8vw, 2.1rem) !important;
    line-height: 1.18 !important;
    overflow-wrap: break-word;
}

body.is-cm-main-home .main-content .cm-section-showcase-side-link {
    grid-template-columns: 104px minmax(0, 1fr) !important;
    gap: 12px !important;
}

body.is-cm-main-home .main-content .cm-section-showcase-side-link img {
    width: 104px !important;
    height: 72px !important;
}

body.is-cm-main-home .main-content :is(.cm-section-showcase-side h4, .cm-section-showcase-bottom-item h4) {
    font-size: 1.05rem !important;
    line-height: 1.3 !important;
    overflow-wrap: break-word;
}

body.is-cm-main-home .main-content .cm-regional-tab {
    min-height: 44px;
    letter-spacing: 0.03em;
}

body.is-cm-main-home .main-content :is(.cm-regional-tabs-layout, .cm-regional-tabs-featured-link) {
    min-height: 0;
}

body.is-cm-main-home .main-content .cm-regional-tabs-featured-copy h3 {
    line-height: 1.2;
    overflow-wrap: break-word;
}

body.is-cm-main-home .main-content :is(.cm-section-showcase, .cm-regional-tabs-section, .cm-home-columnists, .magnavita-wrapper, .culture-section, .cm-home-reels, .video-section) a:focus-visible {
    outline: 2px solid #172438;
    outline-offset: 3px;
}

@media (max-width: 1279px) and (min-width: 769px) {
    body.is-cm-main-home .main-content .cm-section-showcase-main {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.is-cm-main-home .main-content .cm-section-showcase-lead {
        border-right: 0 !important;
    }

    body.is-cm-main-home .main-content .cm-section-showcase-lead-link {
        padding-right: 0 !important;
    }

    body.is-cm-main-home .main-content .cm-section-showcase-side {
        grid-column: 1 / -1 !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0 20px !important;
        padding-top: 16px !important;
        border-top: 1px solid #e4e7eb !important;
    }

    body.is-cm-main-home .main-content .cm-section-showcase-bottom {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px 0 !important;
    }

    body.is-cm-main-home .main-content .cm-section-showcase-bottom-item:nth-child(odd) {
        border-left: 0 !important;
        padding-left: 0 !important;
    }
}

@media (max-width: 768px) {
    body.is-cm-main-home {
        --cm-home-section-gutter: 12px;
        --cm-home-section-space: 24px;
        --cm-home-content-gap: 16px;
    }

    body.is-cm-main-home .main-content > :is(.cm-home-columnists, .cm-regional-tabs-section, .cm-section-showcase, .culture-section, .video-section) {
        padding: 16px 0 !important;
    }

    body.is-cm-main-home .main-content > .cm-home-reels {
        padding: 20px 14px 16px !important;
    }

    body.is-cm-main-home .main-content :is(.cm-home-section-heading, .cm-section-showcase-header) {
        gap: 8px 12px !important;
        margin-bottom: 16px !important;
    }

    body.is-cm-main-home .main-content :is(.cm-home-section-heading, .cm-section-showcase-header) > :first-child {
        flex-basis: 150px;
    }

    body.is-cm-main-home .main-content :is(.cm-section-showcase-main, .cm-section-showcase-side, .cm-section-showcase-bottom) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.is-cm-main-home .main-content .cm-section-showcase-lead h3 {
        font-size: 1.5rem !important;
    }

    body.is-cm-main-home .main-content .cm-regional-tabs-nav {
        max-width: 100%;
        scroll-padding-inline: 4px;
    }
}

/* Page navigation is below the lead stories, so the first headline stays first. */
body.is-cm-main-home .cm-home-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10002;
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 16px;
    border: 2px solid #172438;
    background: #fff;
    color: #172438;
    transform: translateY(calc(-100% - 24px));
}

body.is-cm-main-home .cm-home-skip-link:focus { transform: none; }

body.is-cm-main-home .cm-home-section-nav {
    position: sticky;
    top: var(--cm-home-header-height);
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 20px;
    box-sizing: border-box;
    width: calc(100% - 2 * var(--cm-home-section-gutter));
    max-width: 1680px;
    margin: 24px auto;
    padding: 10px 20px;
    border-top: 2px solid #b20c17;
    border-bottom: 1px solid #dfe4eb;
    background: #fff;
    color: #172438;
}

body.is-cm-main-home .cm-home-section-nav.is-pinned {
    box-shadow: 0 4px 12px rgb(23 36 56 / 8%);
}

body.is-cm-main-home .cm-home-section-nav-label {
    flex: 0 0 auto;
    font: 700 0.72rem/1.3 var(--font-sans, sans-serif);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.is-cm-main-home .cm-home-section-nav ul {
    display: flex;
    gap: 4px;
    min-width: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 8px;
    scrollbar-width: thin;
    list-style: none;
}

body.is-cm-main-home .cm-home-section-nav li { flex: 0 0 auto; }
body.is-cm-main-home .cm-home-section-nav li[hidden] { display: none; }

body.is-cm-main-home .cm-home-section-nav a {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    min-height: 44px;
    padding: 8px 12px;
    border-bottom: 2px solid transparent;
    color: #425168;
    font: 600 0.85rem/1.2 var(--font-sans, sans-serif);
    text-decoration: none;
    white-space: nowrap;
}

body.is-cm-main-home .cm-home-section-nav a:is(:hover, [aria-current="location"]) {
    border-bottom-color: #b20c17;
    background: #fbf0f1;
    color: #a30d18;
}

body.is-cm-main-home .cm-home-section-nav a:focus-visible {
    outline: 2px solid #172438;
    outline-offset: -3px;
}

body.is-cm-main-home :is(#cm-home-highlights, #cm-home-reels-title) {
    scroll-margin-top: calc(var(--cm-home-header-height) + var(--cm-home-navigation-height) + 16px);
}

/* A clear reading order and fewer framed boxes in the regional news blocks. */
body.is-cm-main-home .main-content .cm-regional-tabs-layout {
    align-items: start;
}

body.is-cm-main-home .main-content .cm-regional-tabs-featured-link {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

body.is-cm-main-home .main-content .cm-regional-tabs-featured-media { min-height: 0; }

body.is-cm-main-home .main-content .cm-regional-tabs-featured-copy {
    min-width: 0;
    padding: 20px;
}

body.is-cm-main-home .main-content .cm-regional-tabs-featured-copy h3 {
    display: block;
    margin: 0;
    max-height: none;
    overflow: visible;
    -webkit-line-clamp: unset;
    font-size: clamp(1.4rem, 1.8vw, 1.9rem);
    line-height: 1.2;
}

body.is-cm-main-home .main-content :is(.cm-regional-tabs-side, .cm-regional-tabs-support) {
    gap: 16px;
    align-content: start;
}

body.is-cm-main-home .main-content :is(.cm-regional-tabs-side-link, .cm-regional-tabs-support-link) {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-height: 0;
    padding-bottom: 16px;
    border: 0;
    border-bottom: 1px solid #e4e7eb;
    background: transparent;
}

body.is-cm-main-home .main-content :is(.cm-regional-tabs-side-media, .cm-regional-tabs-support-media) {
    width: 112px;
    height: 84px;
    min-height: 0;
    aspect-ratio: 4 / 3;
}

body.is-cm-main-home .main-content :is(.cm-regional-tabs-side-copy, .cm-regional-tabs-support-copy) {
    padding: 0;
}

body.is-cm-main-home .main-content :is(.cm-regional-tabs-side-copy h4, .cm-regional-tabs-support-copy h4) {
    display: block;
    max-height: none;
    overflow: visible;
    -webkit-line-clamp: unset;
    font-size: 1.05rem;
    line-height: 1.3;
    overflow-wrap: break-word;
}

body.is-cm-main-home .main-content .cm-regional-tabs-nav {
    gap: 8px;
    padding-bottom: 10px;
    scrollbar-color: #9da9b9 #edf0f4;
}

body.is-cm-main-home .main-content .cm-regional-tab:focus-visible {
    outline: 2px solid #172438;
    outline-offset: -4px;
}

body.is-cm-main-home .main-content .magnavita-featured-content .headline-title { margin: 0; }

@media (max-width: 1279px) {
    body.is-cm-main-home .main-content .cm-regional-tabs-featured-link {
        grid-template-columns: minmax(0, 1fr);
    }

    body.is-cm-main-home .main-content .cm-regional-tabs-featured-media {
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 768px) {
    body.is-cm-main-home { --cm-home-header-height: 74px; }

    body.is-cm-main-home .cm-home-section-nav {
        gap: 8px;
        margin-block: 20px;
        padding: 4px 8px;
    }

    body.is-cm-main-home .cm-home-section-nav-label {
        max-width: 44px;
        font-size: 0.65rem;
    }

    body.is-cm-main-home .cm-home-section-nav a { padding-inline: 10px; }

    body.is-cm-main-home .main-content .cm-regional-tabs-featured-copy { padding: 16px; }

    body.is-cm-main-home .main-content .cm-regional-tabs-featured-copy h3 {
        font-size: 1.45rem;
    }

    body.is-cm-main-home .main-content :is(.cm-regional-tabs-side-link, .cm-regional-tabs-support-link) {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
        padding-bottom: 12px;
    }

    body.is-cm-main-home .main-content :is(.cm-regional-tabs-side-media, .cm-regional-tabs-support-media) {
        width: 96px;
        height: 76px;
    }
}

/* CM News TV: one channel feature and three distinct programs, without stale live labels. */
body.is-cm-main-home .main-content .cm-home-tv {
    border-top: 3px solid #b20c17;
    background: #fff;
}

body.is-cm-main-home .main-content .cm-tv-heading {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e4e7eb;
}

body.is-cm-main-home .cm-tv-heading > div { min-width: 0; flex: 1 1 320px; }

body.is-cm-main-home .cm-tv-eyebrow {
    color: #a30d18;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.is-cm-main-home .cm-tv-heading h2 {
    margin: 8px 0;
    color: #172438;
    font-family: var(--font-serif);
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    line-height: 1.15;
}

body.is-cm-main-home .cm-tv-heading p,
body.is-cm-main-home .cm-tv-featured-copy p {
    margin: 0;
    color: #526174;
    font-size: 0.95rem;
    line-height: 1.5;
}

body.is-cm-main-home .cm-tv-channel-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #d1d8e1;
    color: #a30d18;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

body.is-cm-main-home .cm-tv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr);
    align-items: start;
    gap: 28px;
}

body.is-cm-main-home :is(.cm-tv-featured, .cm-tv-program) {
    min-width: 0;
    color: #172438;
    text-decoration: none;
}

body.is-cm-main-home .cm-tv-featured { display: block; border: 1px solid #e4e7eb; }

body.is-cm-main-home .cm-tv-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #172438;
}

body.is-cm-main-home .cm-tv-media > img,
body.is-cm-main-home .cm-tv-program-image > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.is-cm-main-home .cm-tv-play {
    position: absolute;
    inset: 50% auto auto 50%;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgb(255 255 255 / 60%);
    border-radius: 50% !important;
    background: rgb(23 36 56 / 85%);
    color: #fff;
    font-size: 1.4rem;
    transform: translate(-50%, -50%);
}

body.is-cm-main-home .cm-tv-featured-copy { padding: 20px; }

body.is-cm-main-home .cm-tv-featured-copy h3 {
    margin: 0 0 10px;
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 1.7vw, 1.9rem);
    line-height: 1.2;
}

body.is-cm-main-home .cm-tv-watch {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    margin-top: 8px;
    color: #a30d18;
    font-size: 0.8rem;
    font-weight: 600;
}

body.is-cm-main-home .cm-tv-programs { min-width: 0; }

body.is-cm-main-home .cm-tv-programs > h3 {
    margin: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e4e7eb;
    color: #526174;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.is-cm-main-home .cm-tv-program {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding-block: 20px;
    border-bottom: 1px solid #e4e7eb;
}

body.is-cm-main-home .cm-tv-program-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #edf0f4;
}

body.is-cm-main-home .cm-tv-program-image > i {
    position: absolute;
    right: 8px;
    bottom: 8px;
    color: #fff;
    font-size: 1.2rem;
    text-shadow: 0 1px 4px #172438;
}

body.is-cm-main-home .cm-tv-program-copy { min-width: 0; }

body.is-cm-main-home .cm-tv-program-copy > span:first-child {
    color: #526174;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
}

body.is-cm-main-home .cm-tv-program h4 {
    margin: 6px 0;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.3;
    overflow-wrap: break-word;
}

body.is-cm-main-home .cm-tv-program-action { color: #a30d18; font-size: 0.75rem; }
body.is-cm-main-home :is(.cm-tv-program:hover h4, .cm-tv-featured:hover h3) { color: #a30d18; }

@media (max-width: 1023px) {
    body.is-cm-main-home .cm-tv-layout { grid-template-columns: minmax(0, 1fr); }
    body.is-cm-main-home .cm-tv-programs-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
    body.is-cm-main-home .cm-tv-program { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
    body.is-cm-main-home .cm-tv-heading { gap: 12px; margin-bottom: 16px; padding-bottom: 16px; }
    body.is-cm-main-home .cm-tv-channel-link { width: 100%; }
    body.is-cm-main-home .cm-tv-layout { gap: 24px; }
    body.is-cm-main-home .cm-tv-featured-copy { padding: 16px; }
    body.is-cm-main-home .cm-tv-programs-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
    body.is-cm-main-home .cm-tv-program { grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding-block: 16px; }
}
