/* ═══════════════════════════════════════════════════════════════════
   Joy News — Prothom Alo Style Home Page
   Complete layout: Top bar → Header → Nav → Breaking → Hero → 
   Category Blocks → Ads → Infinite Scroll → Footer
═══════════════════════════════════════════════════════════════════ */
:root {
    --red: #e2231a;
    --dark-red: #c01a13;
    --black: #1a1a1a;
    --dark: #222;
    --mid: #444;
    --muted: #666;
    --light: #999;
    --border: #e0e0e0;
    --bg: #f5f5f5;
    --white: #fff;
    --tag-bg: #e2231a;
    --font-bn: 'Hind Siliguri', 'Noto Serif Bengali', sans-serif;
    --font-title: 'Noto Serif Bengali', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: var(--font-bn);
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
a:hover { color: var(--red); }
img { max-width: 100%; display: block; }

/* ===== TOP BAR ===== */
.jns-top-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 4px 0;
    font-size: 12px;
    color: var(--muted);
}
.jns-top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.jns-top-bar-left { display: flex; gap: 16px; align-items: center; }
.jns-top-bar-right { display: flex; gap: 12px; align-items: center; }
.jns-top-bar a { color: var(--muted); font-size: 12px; }
.jns-top-bar a:hover { color: var(--red); }
.jns-date-txt { color: var(--muted); font-size: 12px; }

/* ===== HEADER ===== */
.jns-header {
    background: var(--white);
    padding: 12px 0 0;
    border-bottom: 3px solid var(--red);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.jns-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
.jns-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.jns-logo-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.jns-logo {
    font-family: var(--font-title);
    font-size: 38px;
    font-weight: 700;
    color: var(--red);
    line-height: 1;
    letter-spacing: -1px;
}
.jns-logo span { color: var(--black); }
.jns-logo-tagline { font-size: 11px; color: var(--muted); margin-top: 2px; letter-spacing: 0.5px; }
.jns-header-actions { display: flex; gap: 12px; align-items: center; }
.jns-header-actions a {
    font-size: 13px;
    color: var(--mid);
    padding: 5px 10px;
    border-radius: 3px;
    transition: all 0.2s;
}
.jns-header-actions a:hover { color: var(--red); }
.jns-btn-login {
    background: var(--red);
    color: var(--white) !important;
    padding: 6px 16px !important;
    border-radius: 4px;
    font-size: 13px !important;
    font-weight: 500;
}
.jns-btn-login:hover { background: var(--dark-red); color: var(--white) !important; }
.jns-search-wrap { position: relative; }
.jns-search-wrap input {
    padding: 6px 30px 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-bn);
    font-size: 13px;
    width: 180px;
    color: var(--dark);
    outline: none;
}
.jns-search-wrap input:focus { border-color: var(--red); }
.jns-search-wrap button {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px;
}

/* ===== NAV ===== */
.jns-nav {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.jns-nav::-webkit-scrollbar { display: none; }
.jns-nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
    padding: 9px 14px;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    display: block;
}
.jns-nav a:hover, .jns-nav a.active {
    color: var(--red);
    border-bottom-color: var(--red);
}

/* ===== BREAKING NEWS ===== */
.jns-breaking {
    background: var(--black);
    color: var(--white);
    padding: 8px 0;
    overflow: hidden;
}
.jns-breaking-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.jns-breaking-label {
    background: var(--red);
    color: var(--white);
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 2px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.jns-breaking-ticker {
    overflow: hidden;
    flex: 1;
}
.jns-ticker-track {
    display: flex;
    animation: ticker 40s linear infinite;
    white-space: nowrap;
}
.jns-ticker-track:hover { animation-play-state: paused; }
.jns-ticker-track a {
    font-size: 13px;
    padding-right: 60px;
    cursor: pointer;
    color: var(--white);
    text-decoration: none;
    white-space: nowrap;
}
.jns-ticker-track a:hover { color: #ffd700; }
@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ===== MAIN LAYOUT ===== */
.jns-main-wrap {
    max-width: 1200px;
    margin: 16px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

/* ===== HERO SECTION ===== */
.jns-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    margin-bottom: 20px;
}
.jns-hero-card:nth-child(1) {
    grid-column: 1 / 3;
}
.jns-hero-card .jns-card-img {
    aspect-ratio: 16 / 9;
}

/* ===== ARTICLE CARD ===== */
.jns-card {
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.jns-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.jns-card-img {
    position: relative;
    overflow: hidden;
    background: var(--jns-surface, #f0f0f0);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}
.jns-card-img img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.jns-card-img .jns-img-placeholder {
    font-size: 32px;
    opacity: 0.3;
}
.jns-card:hover .jns-card-img img { transform: scale(1.04); }
.jns-card-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--red);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 2px;
}
.jns-card-body { padding: 12px; }
.jns-card-title {
    font-family: var(--font-title);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--dark);
    margin-bottom: 6px;
}
.jns-card-title:hover { color: var(--red); }
.jns-card-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.jns-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--light);
}
.jns-card-meta .jns-section { color: var(--red); font-weight: 600; }

/* ===== SECTION HEADER ===== */
.jns-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--red);
}
.jns-section-title {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.jns-section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background: var(--red);
    border-radius: 2px;
}
.jns-section-more {
    font-size: 12px;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 3px 10px;
    border-radius: 3px;
    transition: all 0.2s;
}
.jns-section-more:hover { background: var(--red); color: var(--white); }

/* ===== NEWS SECTION ===== */
.jns-news-section { margin-bottom: 24px; }

/* ===== HORIZONTAL NEWS LIST ===== */
.jns-h-news-list { background: var(--white); border-radius: 4px; }
.jns-h-news-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}
.jns-h-news-item:last-child { border-bottom: none; }
.jns-h-news-img { width: 100px; height: 72px; overflow: hidden; border-radius: 3px; flex-shrink: 0; }
.jns-h-news-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.jns-h-news-item:hover .jns-h-news-img img { transform: scale(1.06); }
.jns-h-news-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--dark);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.jns-h-news-title:hover { color: var(--red); }
.jns-h-news-meta { font-size: 11px; color: var(--light); }

/* ===== TABS ===== */
.jns-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 12px;
}
.jns-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font-bn);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    transition: all 0.2s;
}
.jns-tab-btn.active { color: var(--red); border-bottom-color: var(--red); }
.jns-tab-btn:hover { color: var(--red); }
.jns-tab-content { display: none; }
.jns-tab-content.active { display: block; }

/* ===== SIDEBAR ===== */
.jns-sidebar-widget {
    background: var(--white);
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
}
.jns-widget-header {
    background: var(--red);
    color: var(--white);
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-title);
}
.jns-widget-body { padding: 0; }
.jns-widget-item {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.jns-widget-item:last-child { border-bottom: none; }
.jns-widget-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--border);
    flex-shrink: 0;
    width: 24px;
    line-height: 1.2;
}
.jns-widget-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.5;
}
.jns-widget-title:hover { color: var(--red); }
.jns-widget-time { font-size: 11px; color: var(--light); margin-top: 2px; }

/* ===== AD BANNER ===== */
.jns-ad-banner {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 20px;
    color: var(--light);
    font-size: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.jns-ad-banner-label { font-size: 10px; color: #bbb; margin-bottom: 4px; text-transform: uppercase; }

/* ===== OPINION SECTION ===== */
.jns-opinion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.jns-opinion-card {
    background: var(--white);
    padding: 14px;
    border-radius: 4px;
    display: flex;
    gap: 12px;
}
.jns-author-img {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
}
.jns-author-img img { width: 100%; height: 100%; object-fit: cover; }
.jns-opinion-info { flex: 1; }
.jns-opinion-author { font-size: 12px; font-weight: 700; color: var(--red); margin-bottom: 3px; }
.jns-opinion-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--dark);
}
.jns-opinion-title:hover { color: var(--red); }

/* ===== VIDEO SECTION ===== */
.jns-video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.jns-video-card {
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
}
.jns-video-thumb {
    position: relative;
    overflow: hidden;
}
.jns-video-thumb img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s;
}
.jns-video-card:hover .jns-video-thumb img { transform: scale(1.05); }
.jns-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 42px; height: 42px;
    background: rgba(226,35,26,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    transition: background 0.2s;
}
.jns-video-card:hover .jns-play-btn { background: var(--red); }
.jns-video-duration {
    position: absolute;
    bottom: 6px; right: 6px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 11px;
    padding: 1px 5px;
    border-radius: 2px;
}
.jns-video-info { padding: 10px 12px; }
.jns-video-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.jns-video-meta { font-size: 11px; color: var(--light); }

/* ===== PHOTO GALLERY ===== */
.jns-photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.jns-photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}
.jns-photo-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.4s;
}
.jns-photo-item:hover img { transform: scale(1.08); }
.jns-photo-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 20px 8px 8px;
    color: white;
    font-size: 12px;
    line-height: 1.4;
    transform: translateY(100%);
    transition: transform 0.3s;
}
.jns-photo-item:hover .jns-photo-overlay { transform: translateY(0); }

/* ===== WEATHER WIDGET ===== */
.jns-weather-widget {
    background: linear-gradient(135deg, #1a6ba8, #0e4d79);
    color: white;
    padding: 14px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.jns-weather-header { font-size: 12px; opacity: 0.8; margin-bottom: 8px; }
.jns-weather-main { display: flex; justify-content: space-between; align-items: center; }
.jns-weather-temp { font-size: 32px; font-weight: 700; }
.jns-weather-icon { font-size: 36px; }
.jns-weather-city { font-size: 13px; opacity: 0.9; margin-top: 4px; }
.jns-weather-details { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; opacity: 0.8; }

/* ===== TRENDING TOPICS ===== */
.jns-trending-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.jns-trending-tag {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--mid);
    transition: all 0.2s;
    display: inline-block;
}
.jns-trending-tag:hover { background: var(--red); color: white; }

/* ===== INFINITE SCROLL CONTAINER ===== */
.jns-infinite-container {
    margin-top: 20px;
}
.jns-infinite-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    gap: 8px;
}
.jns-infinite-loading.hidden { display: none; }
.jns-loader-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    animation: jns-bounce 1.4s infinite;
}
.jns-loader-dot:nth-child(2) { animation-delay: 0.2s; }
.jns-loader-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes jns-bounce {
    0%, 80%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    40% { transform: scaleY(1); opacity: 1; }
}
.jns-infinite-done {
    text-align: center;
    padding: 24px;
    color: var(--light);
    font-size: 13px;
}

/* ===== INFINITE SCROLL AD ===== */
.jns-inf-ad-wrap {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    text-align: center;
    padding: 24px;
    margin: 20px 0;
    border-radius: 4px;
}
.jns-inf-ad-label { 
    display: block; 
    font-size: 10px; 
    color: #bbb; 
    margin-bottom: 8px; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

/* ===== SCROLL TOP ===== */
.jns-scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px; height: 40px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 999;
}
.jns-scroll-top.visible { opacity: 1; transform: translateY(0); }
.jns-scroll-top:hover { background: var(--dark-red); }

/* ===== LOADING SKELETON ===== */
.jns-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 3px;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.jns-skeleton-img { width: 100%; aspect-ratio: 16/9; border-radius: 3px; }
.jns-skeleton-text { height: 14px; margin-bottom: 6px; }
.jns-skeleton-text.short { width: 60%; }
.jns-skeleton-text.medium { width: 80%; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .jns-main-wrap { grid-template-columns: 1fr; }
    .jns-hero-grid { grid-template-columns: 1fr; }
    .jns-hero-card:nth-child(1) { grid-column: 1; }
}
@media (max-width: 900px) {
    .jns-hero-grid { grid-template-columns: 1fr; }
    .jns-hero-card:nth-child(1) { grid-column: 1; }
    .jns-opinion-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .jns-logo { font-size: 28px; }
    .jns-photo-grid { grid-template-columns: repeat(2, 1fr); }
    .jns-video-grid { grid-template-columns: 1fr; }
    .jns-top-bar { display: none; }
    .jns-btn-login { padding: 5px 10px !important; }
}

/* ===== ANIMATIONS ===== */
.jns-fade-in {
    animation: jnsFadeIn 0.4s ease-out;
}
@keyframes jnsFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
