
/* =========================================================
   MNewsTV English - Main Stylesheet
   Responsive news website
========================================================= */

:root {
    --primary: #a81720;
    --primary-dark: #801019;
    --text: #202124;
    --muted: #777;
    --border: #e5e5e5;
    --background: #f5f6f7;
    --white: #fff;
    --container: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

img {
    display: block;
    max-width: 100%;
}

.container {
    width: min(var(--container), calc(100% - 40px));
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   HEADER
========================================================= */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.header-main {
    min-height: 105px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.brand-name {
    display: inline-block;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    color: #171717;
}

.brand-name span {
    color: var(--primary);
}

.brand-tagline {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-date {
    color: var(--muted);
    font-size: 13px;
}

.header-search {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 700;
}

.header-search:hover {
    color: var(--white);
    background: var(--primary);
    border-color: var(--primary);
}


/* =========================================================
   NAVIGATION
========================================================= */

.main-navigation {
    background: #191919;
    color: var(--white);
}

.nav-inner {
    display: flex;
    align-items: stretch;
    min-height: 47px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.nav-link,
.nav-home {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: background .2s ease;
}

.nav-home {
    background: var(--primary);
}

.nav-link:hover,
.nav-home:hover {
    color: #fff;
    background: var(--primary-dark);
}


/* =========================================================
   BREAKING NEWS
========================================================= */

.breaking-section {
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.breaking-inner {
    min-height: 49px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.breaking-label {
    flex: 0 0 auto;
    padding: 5px 11px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .7px;
}

.breaking-items {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
}

.breaking-items a {
    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   MAIN LAYOUT
========================================================= */

.main-container {
    padding-top: 30px;
    padding-bottom: 55px;
}

section {
    min-width: 0;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.section-heading h1,
.section-heading h2 {
    flex: 0 0 auto;
    margin: 0;
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.heading-line {
    height: 1px;
    flex: 1;
    background: var(--border);
}


/* =========================================================
   TOP STORIES
========================================================= */

.top-stories {
    margin-bottom: 38px;
}

.top-stories-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
    gap: 25px;
}

.lead-story {
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--border);
}

.lead-image-link {
    display: block;
    overflow: hidden;
    background: #ddd;
}

.lead-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform .35s ease;
}

.lead-image-link:hover .lead-image {
    transform: scale(1.025);
}

.lead-story-content {
    padding: 20px 23px 22px;
}

.story-label {
    display: inline-block;
    margin-bottom: 9px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}

.lead-story h2 {
    margin: 0 0 12px;
    font-size: clamp(23px, 3vw, 31px);
    line-height: 1.28;
    letter-spacing: -.7px;
}

.lead-story h2 a:hover {
    color: var(--primary);
}

.story-excerpt {
    margin: 0 0 15px;
    color: #666;
    font-size: 14px;
    line-height: 1.75;
}

.story-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   SECONDARY STORIES
========================================================= */

.secondary-stories {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border);
}

.secondary-story {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 15px;
    align-items: center;
    padding: 13px;
    border-bottom: 1px solid var(--border);
}

.secondary-story:last-child {
    border-bottom: 0;
}

.secondary-image-link {
    display: block;
    overflow: hidden;
    background: #eee;
}

.secondary-story img {
    width: 116px;
    height: 82px;
    object-fit: cover;
    transition: transform .3s ease;
}

.secondary-image-link:hover img {
    transform: scale(1.05);
}

.secondary-story h3 {
    margin: 0 0 8px;
    font-size: 14px;
    line-height: 1.45;
}

.story-date {
    color: var(--muted);
    font-size: 11px;
}


/* =========================================================
   FEATURED NEWS
========================================================= */

.featured-section {
    margin-bottom: 42px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.featured-card {
    min-width: 0;
    overflow: hidden;
    background: var(--white);
    border: 1px solid var(--border);
}

.featured-card > a {
    display: block;
    overflow: hidden;
    background: #eee;
}

.featured-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform .3s ease;
}

.featured-card > a:hover img {
    transform: scale(1.04);
}

.featured-card-content {
    padding: 15px 16px 17px;
}

.featured-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.45;
}


/* =========================================================
   LATEST NEWS + SIDEBAR
========================================================= */

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 35px;
    align-items: start;
}

.latest-section {
    min-width: 0;
}

.latest-list {
    background: var(--white);
    border: 1px solid var(--border);
}

.latest-item {
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.latest-item:last-child {
    border-bottom: 0;
}

.latest-image {
    display: block;
    overflow: hidden;
    background: #eee;
}

.latest-image img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    transition: transform .3s ease;
}

.latest-image:hover img {
    transform: scale(1.04);
}

.latest-content {
    min-width: 0;
}

.latest-category {
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.latest-content h3 {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.4;
}

.latest-content p {
    margin: 0 0 12px;
    color: #666;
    font-size: 13px;
    line-height: 1.65;
}


/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 0;
}

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--border);
}

.sidebar-heading {
    padding: 14px 17px;
    border-bottom: 2px solid var(--primary);
}

.sidebar-heading h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.popular-list {
    padding: 5px 16px;
}

.popular-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.popular-item:last-child {
    border-bottom: 0;
}

.popular-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    background: #f1f1f1;
    color: #555;
    font-size: 13px;
    font-weight: 800;
}

.popular-item:first-child .popular-number {
    background: var(--primary);
    color: #fff;
}

.popular-content h3 {
    margin: 0 0 5px;
    font-size: 13px;
    line-height: 1.5;
}

.popular-views {
    color: var(--muted);
    font-size: 11px;
}

.sidebar-categories {
    margin: 0;
    padding: 5px 17px;
    list-style: none;
}

.sidebar-categories li {
    border-bottom: 1px solid var(--border);
}

.sidebar-categories li:last-child {
    border-bottom: 0;
}

.sidebar-categories a {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-categories a span {
    color: var(--muted);
}


/* =========================================================
   EMPTY AND ERROR STATES
========================================================= */

.empty-message {
    padding: 20px;
    color: var(--muted);
    font-size: 13px;
}

.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    background: var(--background);
}

.error-content {
    width: min(500px, 100%);
    padding: 45px 30px;
    background: var(--white);
    border: 1px solid var(--border);
    text-align: center;
}

.error-content h1 {
    margin: 0 0 15px;
    font-size: 36px;
    font-weight: 900;
}

.error-content p {
    color: var(--muted);
}


/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    padding: 35px 0 25px;
    background: #191919;
    color: #ddd;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 25px;
    align-items: center;
}

.footer-brand .brand-name {
    color: #fff;
    font-size: 30px;
}

.footer-brand p {
    margin: 9px 0 0;
    color: #aaa;
    font-size: 12px;
}

.footer-links {
    display: flex;
    gap: 22px;
    font-size: 13px;
}

.footer-links a {
    color: #ddd;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    grid-column: 1 / -1;
    padding-top: 18px;
    border-top: 1px solid #383838;
    color: #999;
    font-size: 12px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .top-stories-grid {
        grid-template-columns: minmax(0, 1.3fr) minmax(250px, 1fr);
        gap: 16px;
    }

    .secondary-story {
        grid-template-columns: 90px minmax(0, 1fr);
        gap: 11px;
        padding: 10px;
    }

    .secondary-story img {
        width: 90px;
        height: 70px;
    }

    .content-layout {
        grid-template-columns: minmax(0, 1fr) 270px;
        gap: 22px;
    }

    .latest-item {
        grid-template-columns: 165px minmax(0, 1fr);
        gap: 15px;
        padding: 15px;
    }

    .latest-image img {
        height: 125px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 650px) {

    .container {
        width: calc(100% - 28px);
    }

    .header-main {
        min-height: 80px;
    }

    .brand-name {
        font-size: 34px;
    }

    .brand-tagline {
        font-size: 9px;
        letter-spacing: .5px;
    }

    .header-right {
        gap: 8px;
    }

    .header-date {
        display: none;
    }

    .header-search {
        padding: 7px 10px;
        font-size: 12px;
    }

    .nav-inner {
        width: 100%;
        padding-left: 14px;
    }

    .nav-link,
    .nav-home {
        padding: 0 13px;
        font-size: 12px;
    }

    .breaking-inner {
        gap: 10px;
        min-height: 44px;
    }

    .breaking-label {
        padding: 5px 7px;
        font-size: 9px;
    }

    .breaking-items {
        gap: 20px;
    }

    .breaking-items a {
        font-size: 11px;
    }

    .main-container {
        padding-top: 22px;
    }

    .section-heading {
        margin-bottom: 14px;
    }

    .section-heading h1,
    .section-heading h2 {
        font-size: 20px;
    }

    .top-stories-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .lead-story-content {
        padding: 16px;
    }

    .lead-story h2 {
        font-size: 23px;
    }

    .story-excerpt {
        font-size: 13px;
    }

    .secondary-stories {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .secondary-story {
        display: block;
        padding: 10px;
        border-right: 1px solid var(--border);
    }

    .secondary-story img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        margin-bottom: 9px;
    }

    .secondary-story h3 {
        font-size: 12px;
    }

    .featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .featured-card-content {
        padding: 11px;
    }

    .featured-card h3 {
        font-size: 13px;
        line-height: 1.4;
    }

    .content-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .latest-item {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .latest-image img {
        height: 90px;
    }

    .latest-content h3 {
        font-size: 14px;
        line-height: 1.4;
    }

    .latest-content p {
        display: none;
    }

    .latest-category {
        font-size: 10px;
    }

    .story-meta {
        font-size: 10px;
        gap: 9px;
    }

    .sidebar {
        gap: 18px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-links {
        gap: 18px;
    }

    .footer-copy {
        grid-column: auto;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .container {
        width: calc(100% - 22px);
    }

    .brand-name {
        font-size: 30px;
    }

    .secondary-story {
        padding: 8px;
    }

    .secondary-story h3 {
        font-size: 11px;
    }

    .latest-item {
        grid-template-columns: 95px minmax(0, 1fr);
        gap: 10px;
    }

    .latest-image img {
        height: 78px;
    }

    .latest-content h3 {
        font-size: 13px;
    }

}
