/*
Theme Name: Nagarsandesh
Theme URI: https://rcnepal.com
Author: Antigravity AI
Author URI: https://deepmind.google
Description: Nagarsandesh - A modern WordPress news theme for Nepali news websites.
Version: 1.0.0
Text Domain: nagarsandesh
*/

:root {
    --primary-color: #e63946;
    --text-color: #1d3557;
    --bg-color: #f1faee;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

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

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

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Breaking News Marquee */
.breaking-news-bar {
    background: linear-gradient(135deg, var(--primary-color), #c81d25);
    color: white;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: relative;
}

.breaking-news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.breaking-news-label {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.breaking-news-label svg {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.breaking-news-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
}

.breaking-news-scroll {
    display: flex;
    gap: 30px;
    animation: scroll-left 30s linear infinite;
    white-space: nowrap;
}

.breaking-news-scroll:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.breaking-news-item {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.3s ease;
    display: inline-block;
}

.breaking-news-item:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.breaking-news-separator {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
}

/* Header Socials */
.header-socials {
    display: flex;
    gap: 15px;
}

.header-socials a {
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

/* Footer Contact */
.footer-column h3 {
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

/* Page Layout (Sidebar) */
@media (min-width: 900px) {
    .page-layout {
        display: grid;
        grid-template-columns: 3fr 1fr;
        gap: 40px;
    }
}

.sidebar-area {
    margin-top: 20px;
}

/* Recent Posts Widget */
.recent-news-widget {
    background: #fff;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.recent-news-widget:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.recent-post-item {
    display: flex;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: transform 0.2s ease;
    align-items: center;
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-post-item:hover {
    transform: translateX(5px);
}

.recent-post-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.recent-post-thumbnail:hover {
    transform: scale(1.05);
}

.recent-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-content {
    flex: 1;
    min-width: 0;
}

.recent-post-title {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recent-post-title a {
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.2s ease;
}

.recent-post-title a:hover {
    color: var(--primary-color);
}

.recent-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.75rem;
    color: #666;
}

.recent-post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.recent-post-meta svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.recent-post-category a {
    color: var(--primary-color);
    font-weight: 500;
    transition: opacity 0.2s ease;
}
.custom-logo-link img{
	    max-width: 80%;
   		height: 100px;
}
.recent-post-category a:hover {
    opacity: 0.8;
}

/* Ad Widgets and Containers */
.ad-widget {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #eee;
}

.before-footer-ad {
    background: #f5f5f5;
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
}

.before-footer-ad .container {
    display: flex;
    justify-content: center;
}

/* Native Ad Card - Blends with news grid */
.native-ad-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

/* Ad Section (existing top ads) */
.ad-section {
    margin: 20px 0;
    text-align: center;
}

/* Social Share Buttons */
.social-share-buttons {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
    border: 1px solid #eee;
}

.social-share-buttons h4 {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.share-buttons-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.share-facebook {
    background: #1877f2;
    color: white;
}

.share-facebook:hover {
    background: #166fe5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.share-twitter {
    background: #1da1f2;
    color: white;
}

.share-twitter:hover {
    background: #1a94da;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.share-whatsapp {
    background: #25d366;
    color: white;
}

.share-whatsapp:hover {
    background: #20bd5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.share-copy {
    background: #6c757d;
    color: white;
}

.share-copy:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.share-btn svg {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .share-buttons-wrapper {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
    }
}

/* Facebook Page Widget */
.facebook-page-widget {
    background: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fb-page-container {
    overflow: hidden;
    border-radius: 8px;
}

.fb-page {
    width: 100% !important;
}


/* Header Search */
.header-search {
    margin-left: 20px;
}

.search-form {
    display: flex;
}

.search-field {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-submit {
    padding: 5px 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Grid Layouts */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.news-card {
    background: #fff;
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 5px;
    transition: transform 0.2s;
}

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

.news-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.news-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.section-title {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
    padding-bottom: 10px;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Single Post */
.content-area .single-article {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 40px;
}

/* Remove max-width constraint to allow 75% width */

.entry-header {
    text-align: center;
    margin-bottom: 30px;
}

.entry-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.entry-meta {
    color: #666;
    font-size: 0.9rem;
}

.entry-meta span {
    margin: 0 10px;
}

.featured-image {
    margin-bottom: 30px;
}

.featured-image img {
    width: 100%;
    border-radius: 8px;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.category-badge a {
    background: var(--primary-color);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
}

/* Main Navigation */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    font-size: 1.1rem;
    padding: 5px 0;
    display: block;
    transition: color 0.3s ease;
}

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

/* Submenu/Dropdown support */
.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 100;
    padding: 10px 0;
    border-radius: 4px;
}

.main-navigation li:hover>.sub-menu {
    display: block;
}

.main-navigation .sub-menu li {
    padding: 0 15px;
}

.main-navigation .sub-menu a {
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.main-navigation .sub-menu li:last-child a {
    border-bottom: none;
}


/* ========================================
   MOBILE MENU SYSTEM
   ======================================== */



/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: linear-gradient(135deg, var(--primary-color), #c81d25);
    border: none;
    cursor: pointer;
    padding: 10px 12px;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
    transition: all 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.3);
    position: relative;
    width: 50px;
    height: 46px;
}

.mobile-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.4);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hamburger Animation - Transforms to X */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
}


/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Tablet & Mobile - Below 900px */
@media (max-width: 900px) {
    .site-header .container {
        position: relative;
    }

    /* Hide search on smaller tablets */
    .header-search {
        display: none;
    }
}

/* Mobile - Below 768px */
@media (max-width: 768px) {

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Navigation Wrapper - Slide-in Panel */
    .nav-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
        z-index: 1000;
        overflow-y: auto;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        padding: 0;
    }

    /* Add gradient header to mobile menu */
    .nav-wrapper::before {
        content: '';
        display: block;
        height: 60px;
        background: linear-gradient(135deg, var(--primary-color), #c81d25);
        margin-bottom: 20px;
    }

    .nav-wrapper.active {
        right: 0;
    }

    /* Overlay handled by base styles and visibility toggle */

    /* Mobile Navigation Styles */
    .main-navigation {
        width: 100%;
        margin-bottom: 30px;
        padding: 0 20px;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation li {
        border-bottom: 1px solid #e8e8e8;
        transition: background-color 0.2s ease;
    }

    .main-navigation li:hover {
        background-color: #f5f5f5;
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        padding: 16px 12px;
        font-size: 1rem;
        display: block;
        font-weight: 600;
        color: var(--text-color);
        transition: all 0.3s ease;
        position: relative;
    }

    .main-navigation a:hover {
        color: var(--primary-color);
        padding-left: 20px;
    }

    .main-navigation a::before {
        content: '›';
        position: absolute;
        left: 6px;
        opacity: 0;
        transition: all 0.3s ease;
        color: var(--primary-color);
        font-size: 1.3rem;
        font-weight: bold;
    }

    .main-navigation a:hover::before {
        opacity: 1;
    }

    /* Mobile Submenu */
    .main-navigation .sub-menu {
        position: static;
        display: block !important;
        box-shadow: none;
        padding: 8px 0 8px 20px;
        background: linear-gradient(to right, #f0f4f8, #fafbfc);
        border-radius: 0;
        border-left: 3px solid var(--primary-color);
        margin-left: 12px;
    }

    .main-navigation .sub-menu li {
        border-bottom: 1px solid #dde3e8;
    }

    .main-navigation .sub-menu li:hover {
        background-color: rgba(230, 57, 70, 0.05);
    }

    .main-navigation .sub-menu a {
        font-size: 0.9rem;
        padding: 12px 10px;
        font-weight: 500;
    }

    /* Header Actions in Mobile Menu */
    .header-actions {
        flex-direction: column;
        gap: 20px !important;
        align-items: flex-start !important;
        padding: 20px;
        margin-top: 15px;
        border-top: 3px solid var(--primary-color);
        background: linear-gradient(to bottom, #fafbfc, #ffffff);
    }

    .header-socials {
        justify-content: flex-start;
        width: 100%;
        gap: 12px;
    }

    .header-socials a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, #f8f9fa, #e9ecef);
        border-radius: 50%;
        transition: all 0.3s ease;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }

    .header-socials a:hover {
        background: linear-gradient(135deg, var(--primary-color), #c81d25);
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
    }

    .header-socials a:hover svg {
        stroke: white;
    }

    .header-search {
        display: block;
        width: 100%;
        margin: 0;
    }

    .search-form {
        width: 100%;
        display: flex;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        overflow: hidden;
    }

    .search-field {
        flex: 1;
        border: none;
        padding: 12px 16px;
        font-size: 0.95rem;
        transition: border-color 0.3s ease;
        background: white;
        border-radius: 8px 0 0 8px;
    }

    .search-field:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: -2px;
    }

    .search-submit {
        padding: 12px 20px;
        background: linear-gradient(135deg, var(--primary-color), #c81d25);
        color: white;
        font-weight: 600;
        transition: all 0.3s ease;
        border-radius: 0 8px 8px 0;
        border: none;
        cursor: pointer;
    }

    .search-submit:hover {
        background: linear-gradient(135deg, #c81d25, #a01820);
        box-shadow: 0 2px 8px rgba(230, 57, 70, 0.4);
    }

    /* Adjust Header Container */
    .site-header .container {
        padding: 15px 20px;
    }

    /* Breaking News - Smaller on Mobile */
    .breaking-news-label {
        font-size: 0.75rem;
        padding: 5px 12px;
    }

    .breaking-news-item {
        font-size: 0.85rem;
    }

    /* News Grid - Single Column */
    .news-grid {
        grid-template-columns: 1fr;
    }

    /* Single Post Adjustments */
    .content-area .single-article {
        padding: 20px;
    }

    .entry-title {
        font-size: 1.8rem;
    }

    .entry-content {
        font-size: 1rem;
    }

    /* Share Buttons - Already handled above */
}

/* Small Mobile - Below 480px */
@media (max-width: 480px) {
    .nav-wrapper {
        width: 85%;
        max-width: 320px;
    }

    .site-branding h1 {
        font-size: 1.2rem;
    }

    .container {
        width: 95%;
    }

    .entry-title {
        font-size: 1.5rem;
    }

    .breaking-news-container {
        padding: 0 10px;
        gap: 10px;
    }
}

/* Desktop - Above 768px */
@media (min-width: 769px) {

    /* Keep navigation visible on desktop */
    .nav-wrapper {
        display: flex;
        align-items: center;
        gap: 30px;
        flex: 1;
    }

    .main-navigation {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .header-actions {
        flex: 0;
        white-space: nowrap;
    }
}