/*
 * Joy News Theme — Main CSS
 * Layout: Header | Breaking News | Content | Footer
 * Zero Astra conflict — this IS the theme
 */

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--jns-font, 'Hind Siliguri', sans-serif);
    font-size:   var(--jns-size, 16px);
    background:  var(--jns-bg-site, #f2f2f2);
    color:       var(--jns-text, #1a1a2e);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--jns-accent, #FD0000); text-decoration: none; }
a:hover { color: color-mix(in srgb, var(--jns-accent) 80%, black); }
img { max-width: 100%; height: auto; display: block; }
ul,ol { list-style: none; }

/* ── Site Wrapper ─────────────────────────────────────────────────────────── */
.jns-site-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.jns-site-content { flex: 1; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.jns-header {
    background: var(--jns-bg-card, #fff);
    border-bottom: 1px solid #eee;
    position: sticky; top: 0; z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.jns-header-top {
    display: flex; align-items: center; justify-content: space-between;
    max-width: 1400px; margin: 0 auto; padding: 10px 16px; flex-wrap: wrap; gap: 12px;
}
.jns-header-date { font-size: 13px; color: var(--jns-muted, #888); }
.jns-site-logo { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.jns-site-logo img { max-height: 70px; width: auto; }
.jns-site-logo .site-title { font-size: 28px; font-weight: 900; color: var(--jns-text, #1a1a2e); }
.jns-header-ad { flex-shrink: 0; }
.jns-header-ad img { max-height: 70px; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.jns-nav-wrap {
    background: var(--jns-secondary, #222);
    border-top: 2px solid var(--jns-accent, #FD0000);
}
.jns-nav-inner {
    max-width: 1400px; margin: 0 auto; padding: 0 16px;
    display: flex; align-items: center;
}
.jns-nav-inner ul { display: flex; flex-wrap: wrap; gap: 0; }
.jns-nav-inner ul li a {
    display: block; padding: 12px 16px;
    color: #fff; font-size: 14px; font-weight: 600;
    font-family: var(--jns-font, 'Hind Siliguri', sans-serif);
    transition: background .15s, color .15s;
}
.jns-nav-inner ul li a:hover,
.jns-nav-inner ul li.current-menu-item > a {
    background: var(--jns-accent, #FD0000); color: #fff;
}
/* Dropdown */
.jns-nav-inner ul li { position: relative; }
.jns-nav-inner ul li ul {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--jns-secondary, #222); min-width: 200px; z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,.2); flex-direction: column;
}
.jns-nav-inner ul li:hover > ul { display: flex; }
.jns-nav-inner ul li ul li a { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.07); }

/* ── Breaking News Ticker ─────────────────────────────────────────────────── */
.jns-breaking-bar {
    background: var(--jns-accent, #FD0000);
    display: flex; align-items: center;
    max-width: 1400px; margin: 0 auto; overflow: hidden;
}
.jns-breaking-label {
    background: #222; color: #fff; padding: 8px 16px;
    font-size: 13px; font-weight: 700; white-space: nowrap;
    flex-shrink: 0; font-family: var(--jns-font);
}
.jns-breaking-ticker { overflow: hidden; flex: 1; }
.jns-breaking-ticker ul {
    display: flex; animation: jnsTickerScroll 30s linear infinite; width: max-content;
}
.jns-breaking-ticker ul:hover { animation-play-state: paused; }
.jns-breaking-ticker ul li a {
    color: #fff; font-size: 13px; font-weight: 600; padding: 8px 24px;
    white-space: nowrap; font-family: var(--jns-font);
}
@keyframes jnsTickerScroll { from{transform:translateX(0)} to{transform:translateX(-50%)} }

/* ── Page Container ───────────────────────────────────────────────────────── */
.jns-container { max-width: 1400px; margin: 0 auto; padding: 20px 16px; }

/* ── Homepage Grid ────────────────────────────────────────────────────────── */
.jns-homepage-wrap {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 20px;
    align-items: start;
}
.jns-homepage-left   { /* left sidebar / popular */ }
.jns-homepage-main   { /* main content blocks */ min-width: 0; }
.jns-homepage-right  { /* right sidebar / ads */ position: sticky; top: 80px; }

/* ── Section title ────────────────────────────────────────────────────────── */
.jns-section-title {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 2px solid var(--jns-accent, #FD0000);
}
.jns-section-title-bar {
    width: 4px; height: 22px; background: var(--jns-accent, #FD0000);
    border-radius: 2px; display: block;
}
.jns-section-title h2 {
    font-size: 16px; font-weight: 800; color: var(--jns-text, #1a1a2e);
    font-family: var(--jns-font); margin: 0;
}
.jns-section-title a { color: inherit; text-decoration: none; }
.jns-section-title .jns-see-all {
    margin-left: auto; font-size: 12px; color: var(--jns-accent, #FD0000);
    font-weight: 600; border: 1px solid var(--jns-accent, #FD0000);
    padding: 3px 10px; border-radius: 3px; transition: all .15s;
}
.jns-section-title .jns-see-all:hover {
    background: var(--jns-accent, #FD0000); color: #fff;
}

/* ── Post Card ────────────────────────────────────────────────────────────── */
.jns-post-card {
    background: var(--jns-bg-card, #fff);
    border-radius: var(--jns-radius, 8px);
    overflow: hidden;
    box-shadow: var(--jns-shadow, 0 2px 12px rgba(0,0,0,.07));
    transition: transform .2s, box-shadow .2s;
}
.jns-post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--jns-shadow-lg, 0 6px 28px rgba(0,0,0,.13));
}
/* Image wrap — canvas extend (no crop) */
.jns-post-card-img {
    position: relative; overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--jns-surface, #f0f0f0);
}
.jns-post-card-img::before {
    content: ''; position: absolute; inset: -12px;
    background-image: var(--jns-bg-img); background-size: cover; background-position: center;
    filter: blur(14px) brightness(.5) saturate(1.2); z-index: 0;
}
.jns-post-card-img img {
    position: relative; z-index: 1; width: 100%; height: 100%;
    object-fit: contain; display: block; transition: transform .3s;
}
.jns-post-card:hover .jns-post-card-img img { transform: scale(1.04); }
.jns-post-card-cat {
    position: absolute; bottom: 8px; left: 8px; z-index: 2;
    background: var(--jns-accent, #FD0000); color: #fff;
    font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 3px; text-transform: uppercase; letter-spacing: .4px;
    font-family: var(--jns-font);
}
.jns-post-card-body { padding: 14px 16px; }
.jns-post-card-title {
    font-size: 15px; font-weight: 700; line-height: 1.45;
    color: var(--jns-text, #1a1a2e); margin: 0 0 8px;
    font-family: var(--jns-font);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.jns-post-card-title a { color: inherit; text-decoration: none; }
.jns-post-card-title a:hover { color: var(--jns-accent, #FD0000); }
.jns-post-card-excerpt {
    font-size: 13px; color: var(--jns-muted, #777); line-height: 1.6;
    margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-family: var(--jns-font);
}
.jns-post-card-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 11.5px; color: var(--jns-muted, #888); padding-top: 8px;
    border-top: 1px solid var(--jns-surface, #f5f5f5);
    font-family: var(--jns-font);
}
.jns-post-card-meta svg { width: 12px; height: 12px; }

/* ── Card Grid ────────────────────────────────────────────────────────────── */
.jns-card-grid { display: grid; gap: 16px; }
.jns-card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.jns-card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.jns-card-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* ── Homepage hero: 1 big + 2 small ──────────────────────────────────────── */
.jns-hero-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.jns-hero-main { grid-row: 1 / -1; }
.jns-hero-main .jns-post-card-img { aspect-ratio: auto; height: 100%; min-height: 260px; }
.jns-hero-main .jns-post-card-title { font-size: 20px; -webkit-line-clamp: 4; }

/* ── Sidebar Widget ───────────────────────────────────────────────────────── */
.jns-sidebar-widget {
    background: var(--jns-bg-card, #fff); border-radius: var(--jns-radius, 8px);
    padding: 16px; box-shadow: var(--jns-shadow, 0 2px 12px rgba(0,0,0,.07));
    margin-bottom: 16px;
}
.jns-sidebar-title {
    font-size: 15px; font-weight: 800; margin: 0 0 14px; padding-bottom: 10px;
    border-bottom: 2px solid var(--jns-accent, #FD0000);
    font-family: var(--jns-font); color: var(--jns-text, #1a1a2e);
}
/* Popular list */
.jns-popular-list { display: flex; flex-direction: column; }
.jns-popular-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--jns-surface, #f5f5f5); align-items: flex-start; }
.jns-popular-item:last-child { border-bottom: none; }
.jns-popular-num { font-size: 20px; font-weight: 800; color: var(--jns-accent, #FD0000); opacity: .55; min-width: 28px; }
.jns-popular-thumb { flex: 0 0 60px; height: 45px; overflow: hidden; border-radius: 4px; background: var(--jns-surface); }
.jns-popular-thumb img { width: 100%; height: 100%; object-fit: contain; }
.jns-popular-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; margin: 0 0 3px; font-family: var(--jns-font); }
.jns-popular-title a { color: var(--jns-text, #1a1a2e); }
.jns-popular-title a:hover { color: var(--jns-accent, #FD0000); }
.jns-popular-date { font-size: 11px; color: var(--jns-muted, #888); }

/* ── Ad slots ─────────────────────────────────────────────────────────────── */
.jns-ad-slot { text-align: center; margin: 16px 0; }
.jns-ad-label { display: block; font-size: 10px; color: #bbb; letter-spacing: .5px; margin-bottom: 4px; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.jns-pagination { display: flex; justify-content: center; margin: 28px 0; flex-wrap: wrap; gap: 5px; }
.jns-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1.5px solid #e0e0e0; border-radius: 6px;
    background: var(--jns-bg-card, #fff); color: var(--jns-text, #1a1a2e);
    font-size: 14px; font-weight: 600; transition: all .15s;
    font-family: var(--jns-font);
}
.jns-pagination .page-numbers:hover,
.jns-pagination .page-numbers.current {
    background: var(--jns-accent, #FD0000); border-color: var(--jns-accent, #FD0000); color: #fff;
}
.jns-pagination .page-numbers.dots { border: none; background: none; color: var(--jns-muted, #888); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.jns-footer {
    background: var(--jns-secondary, #222);
    color: rgba(255,255,255,.8);
    margin-top: 32px;
}
.jns-footer-widgets {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
    max-width: 1400px; margin: 0 auto; padding: 32px 16px;
}
.jns-footer-widget-title { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.15); }
.jns-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    text-align: center; padding: 14px; font-size: 13px; color: rgba(255,255,255,.55);
}
.jns-footer-bottom a { color: var(--jns-accent, #FD0000); }

/* ── Mobile hamburger ─────────────────────────────────────────────────────── */
.jns-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: #fff; }
.jns-hamburger svg { width: 24px; height: 24px; }
.jns-mobile-nav {
    display: none; background: var(--jns-secondary, #222);
    position: absolute; top: 100%; left: 0; right: 0; z-index: 999;
    padding: 8px 0; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.jns-mobile-nav.open { display: block; }
.jns-mobile-nav ul li a {
    display: block; padding: 12px 20px; color: #fff;
    font-size: 15px; font-family: var(--jns-font); border-bottom: 1px solid rgba(255,255,255,.07);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .jns-homepage-wrap { grid-template-columns: 1fr 260px; }
    .jns-homepage-left { display: none; }
    .jns-card-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .jns-homepage-wrap { grid-template-columns: 1fr; }
    .jns-homepage-right { display: none; }
    .jns-hero-grid { grid-template-columns: 1fr; }
    .jns-hero-main { grid-row: auto; }
    .jns-card-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .jns-card-grid--2 { grid-template-columns: 1fr; }
    .jns-footer-widgets { grid-template-columns: 1fr; }
    .jns-nav-inner ul { display: none; }
    .jns-hamburger { display: block; }
    .jns-nav-wrap { position: relative; }
    .jns-nav-inner { justify-content: flex-end; padding: 0 12px; }
}
@media (max-width: 480px) {
    .jns-card-grid--3 { grid-template-columns: 1fr; }
    .jns-header-top { padding: 8px 12px; }
    .jns-site-logo img { max-height: 50px; }
}
