/*
Theme Name: Nirnay TV Theme
Theme URI: https://update.nirnaytv.com
Author: Antigravity
Description: Premium modern news portal theme for Nirnay TV.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: nirnaytv
*/

/* --- CSS Reset & Base Variables --- */
:root {
    --primary: #D50000;
    --dark: #111111;
    --light: #FFFFFF;
    --gray-bg: #F8F9FA;
    --gray-border: #EEEEEE;
    --text-primary: #111111;
    --text-muted: #666666;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1340px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--gray-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

li {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
}

/* --- Utility Classes --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
}

.col {
    flex: 1;
}

.text-center { text-align: center; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Ad Zone Styling */
.ad-zone {
    background: #EAEAEA;
    border: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin: 15px auto;
    text-align: center;
}

.ad-header-banner {
    width: 728px;
    height: 90px;
    max-width: 100%;
}

.ad-sidebar-top, .ad-sidebar-middle, .ad-sidebar-bottom {
    width: 300px;
    height: 250px;
    max-width: 100%;
}

.ad-in-article-banner {
    width: 100%;
    height: 90px;
    max-height: 90px;
}

/* --- Header Section --- */
.top-bar {
    background-color: var(--dark);
    color: var(--light);
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid #222;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.live-tv-btn {
    background-color: var(--primary);
    color: var(--light);
    padding: 4px 10px;
    border-radius: 3px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.live-tv-btn::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--light);
    border-radius: 50%;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.social-links {
    display: flex;
    gap: 12px;
    font-size: 14px;
}

/* Main Header */
.main-header {
    background-color: var(--light);
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-border);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
}

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

.logo-main .tv-box {
    background-color: var(--primary);
    color: var(--light);
    padding: 0 8px;
    margin-left: 4px;
    border-radius: 3px;
}

.logo-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: bold;
    margin-top: 3px;
    letter-spacing: 0.5px;
}

/* Navigation bar */
.nav-bar {
    background-color: var(--primary);
    color: var(--light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu-toggle {
    background: none;
    border: none;
    color: var(--light);
    font-size: 20px;
    cursor: pointer;
    padding: 12px;
    display: none;
}

.nav-menu-list {
    display: flex;
    align-items: center;
}

.nav-menu-list li a {
    display: block;
    padding: 14px 16px;
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--light);
    letter-spacing: 0.2px;
}

.nav-menu-list li a:hover, .nav-menu-list li.current-menu-item a {
    background-color: rgba(0, 0, 0, 0.15);
}

.nav-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle, .dark-mode-toggle {
    background: none;
    border: none;
    color: var(--light);
    font-size: 16px;
    cursor: pointer;
    padding: 10px;
}

/* Breaking News Ticker */
.breaking-bar {
    background-color: var(--light);
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    align-items: stretch;
    height: 44px;
}

.breaking-title {
    background-color: var(--primary);
    color: var(--light);
    font-weight: 900;
    font-size: 13px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.breaking-ticker {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.ticker-wrap {
    display: flex;
    white-space: nowrap;
    animation: ticker 25s linear infinite;
}

.ticker-wrap:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.ticker-item::after {
    content: "•";
    color: var(--primary);
    margin-left: 40px;
}

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* --- Hero Grid Section --- */
.hero-section {
    padding: 25px 0;
    background-color: var(--light);
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    height: 480px;
}

.hero-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: var(--dark);
}

.hero-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-item:hover img {
    transform: scale(1.05);
}

.hero-item::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 2;
    color: var(--light);
}

.category-tag {
    background-color: var(--primary);
    color: var(--light);
    font-size: 11px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.hero-item.large {
    grid-row: span 2;
}

.hero-item.large .hero-title {
    font-size: 24px;
    font-weight: 900;
}

.post-meta {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    display: flex;
    gap: 12px;
    align-items: center;
}

/* --- Main Content Layout --- */
.main-layout {
    padding: 30px 0;
}

.main-layout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Category Blocks */
.category-block {
    background-color: var(--light);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--gray-border);
    margin-bottom: 20px;
    padding-bottom: 8px;
}

.block-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--dark);
    text-transform: uppercase;
    position: relative;
}

.block-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: var(--primary);
}

.block-viewmore {
    font-size: 12px;
    font-weight: bold;
    color: var(--primary);
}

/* Two Column Categories Grid */
.categories-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.category-items-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Horizontal News Card */
.news-card-horizontal {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.news-card-horizontal .thumb {
    width: 110px;
    height: 75px;
    flex-shrink: 0;
    border-radius: 3px;
    overflow: hidden;
    background-color: #EEE;
}

.news-card-horizontal .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-horizontal .details {
    flex-grow: 1;
}

.news-card-horizontal .title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.news-card-horizontal .meta {
    font-size: 11px;
    color: var(--text-muted);
}

/* Sidebar Widgets */
.sidebar-widget {
    background-color: var(--light);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 16px;
    font-weight: 900;
    border-bottom: 2px solid var(--gray-border);
    padding-bottom: 8px;
    margin-bottom: 15px;
    text-transform: uppercase;
    position: relative;
}

.widget-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary);
}

/* Trending Now List */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.trending-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--light);
    font-weight: 900;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trending-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

/* --- Video Section --- */
.video-section {
    background-color: var(--dark);
    color: var(--light);
    padding: 40px 0;
    margin-top: 30px;
}

.video-section .block-title {
    color: var(--light);
}

.video-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.video-featured {
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background-color: #000;
    aspect-ratio: 16/9;
}

.video-featured iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 450px;
    padding-right: 5px;
}

.video-card-side {
    display: flex;
    gap: 12px;
    cursor: pointer;
}

.video-card-side .thumb {
    width: 120px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    background-color: #222;
}

.video-card-side .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-side .thumb::before {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background-color: rgba(213,0,0,0.9);
    color: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 1;
}

.video-card-side .title {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.3;
}

/* --- Footer Section --- */
.main-footer {
    background-color: var(--dark);
    color: #CCCCCC;
    padding: 60px 0 20px 0;
    border-top: 4px solid var(--primary);
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    color: var(--light);
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
    position: relative;
}

.footer-col h3::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary);
}

.footer-col p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links li a:hover {
    color: var(--light);
    padding-left: 5px;
}

.footer-social-icons {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.footer-social-icons a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    transition: var(--transition);
}

.footer-social-icons a:hover {
    background-color: var(--primary);
}

.copyright-bar {
    border-top: 1px solid #222;
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #888888;
}

/* --- Mobile Bottom Navigation --- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--dark);
    border-top: 2px solid var(--primary);
    height: 56px;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.mobile-bottom-menu {
    display: flex;
    height: 100%;
    align-items: center;
}

.mobile-bottom-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--light);
    font-size: 10px;
    font-weight: bold;
    gap: 4px;
}

.mobile-bottom-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.mobile-bottom-item.active {
    color: var(--primary);
}

.mobile-live-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -18px;
    box-shadow: 0 4px 10px rgba(213,0,0,0.4);
    border: 3px solid var(--dark);
}

.mobile-live-btn svg {
    width: 20px;
    height: 20px;
}

/* --- Responsive Media Queries --- */

/* Desktop Resolutions (1920px, 1440px, 1366px) */
@media (min-width: 1200px) {
    .container {
        max-width: var(--max-width);
    }
}

/* Desktop Medium / Laptop (1024px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    .hero-grid {
        height: 400px;
    }
    .ad-header-banner {
        display: none; /* Hide header banner on smaller screens */
    }
}

/* Tablet Resolutions (768px to 1023px) */
@media (max-width: 1023px) {
    .container {
        max-width: 720px;
    }
    .nav-bar .container {
        padding: 0;
    }
    .nav-menu-toggle {
        display: block;
    }
    .nav-menu-list {
        display: none; /* Use mobile drawer list instead */
    }
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        height: auto;
    }
    .hero-item.large {
        grid-column: span 2;
        aspect-ratio: 16/9;
    }
    .hero-item {
        aspect-ratio: 4/3;
    }
    .main-layout-grid {
        grid-template-columns: 1fr;
    }
    .categories-two-col {
        grid-template-columns: 1fr;
    }
    .video-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* Mobile Devices (max-width: 767px) - covers 430px, 390px, 375px, 360px */
@media (max-width: 767px) {
    body {
        padding-bottom: 56px; /* Space for fixed bottom navigation bar */
    }
    .container {
        padding: 0 15px;
    }
    .top-bar {
        display: none; /* Hide top bar on mobile */
    }
    .main-header {
        padding: 10px 0;
    }
    .main-header .container {
        display: flex;
        justify-content: space-between;
    }
    .logo-main {
        font-size: 24px;
    }
    .logo-sub {
        display: none; /* Hide tagline under logo on mobile */
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .hero-item.large {
        grid-column: span 1;
    }
    .hero-item {
        aspect-ratio: 16/10;
    }
    .hero-item:not(.large) {
        display: none; /* Hide secondary hero items on mobile, making it a single hero slider */
    }
    .hero-slider-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
    }
    .hero-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #CCC;
    }
    .hero-dot.active {
        background-color: var(--primary);
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .mobile-bottom-nav {
        display: block;
    }
}

/* Phase 5 - Category Page Layout Responsiveness */
@media (max-width: 1023px) {
    .cat-layout-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .top-stories-layout-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .more-stories-layout-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .featured-story-block {
        grid-template-columns: 1fr !important;
    }
    .featured-img-box {
        min-height: 200px !important;
    }
    .top-stories-layout-grid {
        grid-template-columns: 1fr !important;
    }
    .more-stories-layout-grid {
        grid-template-columns: 1fr !important;
    }
    .feed-item-card {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .feed-item-card div:first-child {
        width: 100% !important;
        height: 150px !important;
    }
}

