:root {
    --max-width: 1100px;
    --gap: 20px;
    --brand: #0b66ff;
    --muted: #6b7280;
    --bg: #f7f8fb;
    --card: #ffffff;
    --radius: 8px;
    --text: #0f1724;
    --shadow: 0 6px 18px rgba(16,24,40,0.06);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%;
    margin: 0;
    color: var(--text);
    background: var(--bg)
}

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

.container {
    max-width: var(--max-width);
    margin: 28px auto;
    padding: 0 18px
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e6e9ef;
    position: sticky;
    top: 0;
    z-index: 80
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 12px 18px
}

.logo {
    font-weight: 700;
    color: var(--brand);
    font-size: 1.15rem
}

.main-nav ul {
    display: flex;
    gap: 16px;
    list-style: none;
    padding: 0;
    margin: 0
}

.main-nav a {
    padding: 8px 6px;
    border-radius: 6px;
    color: #111
}

    .main-nav a.active {
        background: rgba(11,102,255,0.08);
        color: var(--brand)
    }

.search {
    margin-left: auto;
    display: flex;
    gap: 8px
}

    .search input {
        padding: 8px;
        border: 1px solid #e3e7ee;
        border-radius: 6px
    }

    .search button {
        background: var(--brand);
        color: #fff;
        border: 0;
        padding: 8px 10px;
        border-radius: 6px
    }

/* Mobile toggle */
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    font-size: 20px;
    padding: 6px
}

/* Hero */
.hero {
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 18px 0;
    padding: 18px;
    background: linear-gradient(180deg,#fff,#fbfdff);
    border-radius: 10px;
    box-shadow: var(--shadow)
}

.hero-text {
    flex: 1
}

    .hero-text h1 {
        margin: 0 0 8px;
        font-size: 1.8rem
    }

.hero-media img {
    width: 420px;
    height: auto;
    border-radius: 8px;
    object-fit: cover
}

/* Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--gap);
    margin-top: 18px
}

.section-title {
    margin: 0 0 12px;
    font-size: 1.1rem
}

.cards {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr); /* two cards per row on desktop */
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow)
}

/* Card thumbnail: render at 354x236 on desktop, shrink responsively, no cropping */
.card > img {
    width: 354px;           /* target desktop width */
    height: 236px;          /* target desktop height */
    max-width: 100%;        /* allows shrinking on narrow containers */
    max-height: none;
    display: block;
    margin: 0 auto;         /* center inside the card */
    object-fit: contain;    /* preserve entire image, no cropping */
    background: #f5f7fa;    /* subtle neutral background if aspect differs */
}

/* revert to full-width natural height on narrower viewports */
@media (max-width: 900px) {
    .card > img {
        width: 100%;
        height: auto;
        object-fit: contain;
        margin: 0 0 12px 0;
    }
}

.card-body {
    padding: 12px 14px
}

/* Ensure consistent spacing on desktop and mobile by explicitly targeting card-body headings and paragraphs */
.card-body h3 {
    margin: 12px 0 8px; /* top 12px, bottom 8px */
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 600;
}

.card-body h3 a {
    color: inherit;
    text-decoration: none;
}

.card-body p {
    margin: 0 0 12px; /* bottom spacing before meta */
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.kicker {
    display: inline-block;
    color: var(--brand);
    font-size: 0.85rem;
    margin-bottom: 6px
}

/* meta unchanged */
.meta {
    color: var(--muted);
    font-size: 0.85rem;
    margin-top: 10px
}

/* Sidebar */
.side-col .widget {
    background: var(--card);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: var(--shadow)
}

.trending {
    padding-left: 18px;
    margin: 8px 0
}

/* Article media — responsive, non-cropping */
.article-media {
    margin: 16px 0;
    text-align: center;
}

/* Keep the full image visible (no cropping). Limit maximum rendered height to 500px on desktop,
   while keeping natural height on mobile. */
.article-media .article-image {
    width: 100%;
    max-width: 900px;
    height: auto;
    max-height: 500px;     /* desktop cap to 500px */
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 6px 18px rgba(16,24,40,0.06);
}

/* On small devices use full width with natural height */
@media (max-width: 720px) {
    .article-media .article-image {
        max-width: 100%;
        max-height: none;
        height: auto;
        object-fit: contain;
        border-radius: 6px;
    }
}

/* Footer */
.site-footer {
    margin-top: 28px;
    background: #0f1724;
    color: #fff;
    padding: 28px 0
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    gap: 20px
}

.site-footer h4 {
    margin: 0 0 8px
}

.site-footer p, .site-footer a {
    color: rgba(255,255,255,0.85)
}

/* Pagination: centered, desktop + mobile friendly */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem; /* space between links */
    margin: 2rem 0;
    flex-wrap: wrap; /* allow wrapping on narrow widths */
}

.pagination-link {
    text-decoration: none;
    color: #0a0a0a;
    background: #f4f4f4;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
    transition: background .15s ease, transform .08s ease;
    font-weight: 600;
    display: inline-block;
}

/* Slight hover/focus affordance */
.pagination-link:hover,
.pagination-link:focus {
    background: #e9e9e9;
    transform: translateY(-1px);
    outline: none;
}

/* Make links bigger and stacked on small screens for touch friendliness */
@media (max-width: 480px) {
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
        margin: 1.25rem 0;
    }

    .pagination-link {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
        font-size: 1rem;
    }
}

/* Footer social link + icon */
.footer-content { text-align: center; }

.social-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
}

.social-links li {
    display: inline;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
    text-decoration: none;
    padding: 0.25rem 0.35rem;
}

/* Reduce footer Facebook icon size (targets current markup) */
.site-footer .social-links img {
    height: 12px !important; /* smaller desktop size */
    width: auto;
    display: inline-block;
    object-fit: contain;
    vertical-align: middle;
}

/* Keep link spacing / alignment comfortable without enlarging the icon */
.site-footer .social-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.35rem;
}

/* Slightly increase on small screens for touch friendliness */
@media (max-width: 480px) {
    .site-footer .social-links img {
        height: 14px !important;
    }
    .site-footer .social-links a {
        padding: 0.45rem 0.6rem;
        font-size: 0.95rem;
    }
}

/* Responsive */
@media (max-width:900px) {
    .hero {
        flex-direction: column
    }

    .hero-media img {
        width: 100%
    }

    .content-grid {
        grid-template-columns: 1fr
    }

    .side-col {
        order: 2
    }

    /* revert cards to single column on narrower viewports */
    .cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width:720px) {
    .main-nav {
        display: none
    }

    .nav-toggle {
        display: inline-block;
        margin-left: auto
    }

    .header-inner {
        align-items: center
    }

    .search {
        display: none
    }

    .hero-text h1 {
        font-size: 1.4rem
    }
}

.nav-open .main-nav {
    display: block;
    background: #fff;
    position: absolute;
    left: 18px;
    right: 18px;
    top: 68px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: var(--shadow)
}

main h1 {
    font-size: 24px;
    line-height: 1.4;
    font-weight: 600;
}

@media (max-width: 768px) {
    main h1 {
        font-size: 20px;
    }
}