:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --text: #111111;
    --muted: #707070;
    --border: #e7e7e4;
    --accent: #635bff;
    --accent-dark: #5148e8;
    --dark: #111111;
    --radius: 18px;
    --container: 1240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "DM Sans", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    width: 100%;
    display: block;
    object-fit: cover;
}

button,
input {
    font: inherit;
}

.container {
    width: min(var(--container), calc(100% - 40px));
    margin: auto;
}

/* =========================
   HEADER
========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(247, 247, 245, .92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.navbar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.logo {
    font-family: "Manrope", sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1.5px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: .2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 17px;
    transition: .2s;
}

.icon-btn:hover {
    border-color: var(--text);
    transform: translateY(-2px);
}

.mobile-menu-btn {
    display: none;
}

/* =========================
   CATEGORY BAR
========================= */

.category-bar {
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.categories {
    display: flex;
    gap: 10px;
    padding: 13px 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category {
    white-space: nowrap;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 7px 15px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    transition: .2s;
}

.category:hover,
.category.active {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}

/* =========================
   HERO
========================= */

.hero {
    padding: 54px 0 40px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.65fr .8fr;
    gap: 22px;
}

.featured {
    position: relative;
    min-height: 510px;
    overflow: hidden;
    border-radius: 24px;
    background: #222;
    color: white;
}

.featured img {
    height: 100%;
    position: absolute;
    inset: 0;
}

.featured::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.85),
        rgba(0,0,0,.05) 70%
    );
}

.featured-content {
    position: absolute;
    z-index: 2;
    left: 34px;
    right: 34px;
    bottom: 32px;
}

.badge {
    display: inline-flex;
    background: var(--accent);
    color: white;
    padding: 6px 11px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 14px;
}

.featured h1 {
    font-family: "Manrope", sans-serif;
    font-size: clamp(32px, 4vw, 56px);
    line-height: 1.04;
    letter-spacing: -2.5px;
    max-width: 800px;
    margin-bottom: 15px;
}

.featured p {
    color: rgba(255,255,255,.78);
    max-width: 650px;
    margin-bottom: 18px;
}

.meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
}

.featured .meta {
    color: rgba(255,255,255,.7);
}

.meta strong {
    color: inherit;
}

.side-trending {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trending-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.section-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    font-weight: 800;
}

.view-link {
    font-size: 12px;
    color: var(--accent);
    font-weight: 700;
}

.trend-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 14px;
    transition: .25s;
}

.trend-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.trend-card img {
    height: 100px;
    border-radius: 12px;
}

.trend-card .category-small {
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.trend-card h3 {
    font-family: "Manrope", sans-serif;
    font-size: 15px;
    line-height: 1.25;
    margin-bottom: 7px;
}

/* =========================
   SECTIONS
========================= */

.section {
    padding: 35px 0;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 22px;
}

.section-title {
    font-family: "Manrope", sans-serif;
    font-size: 29px;
    letter-spacing: -1.3px;
}

/* =========================
   RECOMMENDED
========================= */

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: .25s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,.07);
}

.article-image {
    height: 210px;
    overflow: hidden;
}

.article-card:hover .article-image img {
    transform: scale(1.04);
}

.article-image img {
    height: 100%;
    transition: .4s;
}

.article-body {
    padding: 17px;
}

.article-category {
    color: var(--accent);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .7px;
    font-weight: 800;
    margin-bottom: 7px;
}

.article-title {
    font-family: "Manrope", sans-serif;
    font-size: 17px;
    line-height: 1.3;
    margin-bottom: 11px;
}

.article-description {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
}

/* =========================
   LATEST
========================= */

.latest-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 50px;
}

.latest-list {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.latest-card {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px;
    transition: .25s;
}

.latest-card:hover {
    transform: translateX(4px);
}

.latest-card img {
    height: 165px;
    border-radius: 13px;
}

.latest-content {
    padding: 7px 7px 7px 0;
}

.latest-content h3 {
    font-family: "Manrope", sans-serif;
    font-size: 22px;
    line-height: 1.25;
    margin: 7px 0 10px;
}

.latest-content p {
    color: var(--muted);
    font-size: 13px;
    max-width: 600px;
    margin-bottom: 14px;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.sidebar-box h3 {
    font-family: "Manrope", sans-serif;
    margin-bottom: 15px;
}

.popular-item {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.popular-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.popular-number {
    font-family: "Manrope", sans-serif;
    font-size: 22px;
    color: #bbb;
}

.popular-item h4 {
    font-size: 13px;
    line-height: 1.4;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag {
    padding: 7px 10px;
    border-radius: 7px;
    background: var(--bg);
    font-size: 11px;
    font-weight: 600;
}

/* =========================
   NEWSLETTER
========================= */

.newsletter {
    margin: 55px 0;
    background: var(--dark);
    color: white;
    border-radius: 24px;
    padding: 55px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.newsletter h2 {
    font-family: "Manrope", sans-serif;
    font-size: 32px;
    letter-spacing: -1.4px;
    margin-bottom: 7px;
}

.newsletter p {
    color: #aaa;
    font-size: 14px;
}

.newsletter-form {
    display: flex;
    gap: 8px;
    min-width: 420px;
}

.newsletter-form input {
    flex: 1;
    border: 0;
    outline: 0;
    border-radius: 9px;
    padding: 14px;
}

.newsletter-form button {
    border: 0;
    background: var(--accent);
    color: white;
    border-radius: 9px;
    padding: 0 22px;
    font-weight: 700;
    cursor: pointer;
}

.newsletter-form button:hover {
    background: var(--accent-dark);
}

/* =========================
   FOOTER
========================= */

.footer {
    background: var(--dark);
    color: white;
    padding: 55px 0 25px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    padding-bottom: 45px;
}

.footer-brand p {
    color: #999;
    max-width: 350px;
    margin-top: 15px;
    font-size: 13px;
}

.footer h4 {
    margin-bottom: 15px;
    font-size: 13px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.footer-links a {
    color: #999;
    font-size: 13px;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #2b2b2b;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    color: #777;
    font-size: 11px;
}

/* =========================
   SEARCH MODAL
========================= */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 130px;
}

.search-overlay.active {
    display: flex;
}

.search-box {
    width: min(700px, calc(100% - 30px));
    background: white;
    border-radius: 20px;
    padding: 12px;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    border: 0;
    outline: 0;
    padding: 14px;
    font-size: 18px;
}

.search-close {
    width: 45px;
    border: 0;
    background: var(--bg);
    border-radius: 12px;
    cursor: pointer;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 1000px) {

    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: grid;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .side-trending {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .trending-title {
        grid-column: 1 / -1;
    }

    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .latest-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .newsletter {
        flex-direction: column;
        align-items: flex-start;
    }

    .newsletter-form {
        width: 100%;
        min-width: 0;
    }

    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

@media (max-width: 650px) {

    .container {
        width: min(100% - 24px, var(--container));
    }

    .navbar {
        height: 66px;
    }

    .logo {
        font-size: 23px;
    }

    .hero {
        padding-top: 25px;
    }

    .featured {
        min-height: 460px;
        border-radius: 18px;
    }

    .featured-content {
        left: 22px;
        right: 22px;
        bottom: 22px;
    }

    .featured h1 {
        font-size: 32px;
        letter-spacing: -1.5px;
    }

    .side-trending {
        grid-template-columns: 1fr;
    }

    .recommended-grid {
        grid-template-columns: 1fr;
    }

    .article-image {
        height: 230px;
    }

    .latest-card {
        grid-template-columns: 110px 1fr;
        gap: 13px;
    }

    .latest-card img {
        height: 110px;
    }

    .latest-content h3 {
        font-size: 16px;
        margin-top: 3px;
    }

    .latest-content p {
        display: none;
    }

    .latest-content .meta {
        font-size: 10px;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .newsletter {
        padding: 30px 20px;
        border-radius: 18px;
    }

    .newsletter h2 {
        font-size: 26px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        height: 46px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
    }
}

/* =========================
   ADDED: single article page, pagination, misc CMS bits
========================= */

.article-page {
    padding: 40px 0 20px;
}

.article-page-header {
    max-width: 820px;
    margin: 0 auto 30px;
}

.article-page-header .badge {
    background: var(--accent);
}

.article-page-header h1 {
    font-family: "Manrope", sans-serif;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin: 16px 0 14px;
}

.article-page-header .meta {
    margin-top: 6px;
}

.article-page-cover {
    max-width: 980px;
    margin: 0 auto 34px;
    border-radius: 20px;
    overflow: hidden;
    max-height: 480px;
}

.article-page-cover img {
    height: 100%;
    max-height: 480px;
}

.article-page-body {
    max-width: 760px;
    margin: 0 auto;
    font-size: 17px;
    color: #262626;
}

.article-page-body p {
    margin-bottom: 18px;
}

.article-page-body h2,
.article-page-body h3 {
    font-family: "Manrope", sans-serif;
    letter-spacing: -0.5px;
    margin: 30px 0 14px;
}

.article-page-body img {
    border-radius: 14px;
    margin: 20px 0;
}

.article-page-body ul,
.article-page-body ol {
    margin: 0 0 18px 22px;
}

.static-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 50px 0;
    font-size: 16px;
}

.static-page h1 {
    font-family: "Manrope", sans-serif;
    font-size: 36px;
    letter-spacing: -1.5px;
    margin-bottom: 22px;
}

.static-page p {
    margin-bottom: 16px;
    color: #333;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    background: var(--surface);
}

.pagination a:hover {
    border-color: var(--text);
}

.pagination .active {
    background: var(--dark);
    color: white;
    border-color: var(--dark);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.subscribe-msg {
    font-size: 13px;
    margin-top: 10px;
    color: #2e8b57;
    font-weight: 600;
}

.subscribe-msg.error {
    color: #d24141;
}

.breadcrumb {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 16px;
}

.breadcrumb a:hover {
    color: var(--text);
}
