/*
Theme Name: IAAS Nepal News
Theme URI: https://smiledigitalsolution.com/
Author: Your Name
Author URI: https://example.com/
Description: A lightweight and fast news blog theme inspired by major news portals, with full Customizer options. This theme is a combination of the Smile Digital Solution and IAAS Nepal Pro themes.
Version: 1.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: blog, news, two-columns, right-sidebar, custom-header, custom-menu, theme-options, featured-images, web-stories
Text Domain: iaas-nepal-news
*/

/* --- Global Styles & Reset --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}
body.mobile-menu-open { overflow: hidden; }
.page-container { display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
.main-content { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 30px 20px; box-sizing: border-box; }
a { text-decoration: none; color: #0073aa; transition: color 0.2s ease-in-out; }
a:hover { text-decoration: underline; color: #005177; }
img { max-width: 100%; height: auto; display: block; }
.screen-reader-text { clip: rect(1px, 1px, 1px, 1px); position: absolute !important; height: 1px; width: 1px; overflow: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }


/* --- Header Styles --- */
.header-top { background-color: #f8f9fa; color: #555; padding: 8px 20px; font-size: 0.85em; border-bottom: 1px solid #e9ecef; }
.header-top-container { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; flex-wrap: wrap; gap: 10px; }
.header-top-right { display: flex; align-items: center; gap: 15px; }
.social-icons { display: flex; align-items: center; gap: 15px; }
.social-icons a { color: #555; text-decoration: none; }
.social-icons svg { width: 18px; height: 18px; fill: currentColor; }
.subscribe-btn { background-color: #0073aa; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-weight: bold; text-decoration: none; }
.site-header { background-color: #ffffff; padding: 30px 20px; text-align: center; border-bottom: 1px solid #eee;}
.site-branding .site-title a { color: #111; font-size: 1.8em; font-weight: 700; text-decoration: none; }
.site-branding .site-description { margin: 5px 0 0; font-size: 1em; color: #555; }

/* Navigation from Smile Digital Solution */
.primary-navigation-bar {
    background-color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid #e9ecef;
}
.primary-nav-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; min-height: 60px; position: relative; }
#primary-menu-wrap { flex-grow: 1; display: flex; justify-content: center; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-navigation ul li a { display: block; padding: 20px 15px; color: #333; text-decoration: none; font-weight: 500; white-space: nowrap; font-size: 0.95em; text-transform: uppercase; }
.main-navigation ul li.current-menu-item > a { color: #0073aa; box-shadow: inset 0 -2px 0 #0073aa; }
.nav-right-items { display: flex; align-items: center; gap: 15px; }
.nav-search-form { display: flex; }
.nav-search-form input[type="search"] { border: 1px solid #ddd; padding: 8px; border-radius: 4px 0 0 4px; }
.nav-search-form input[type="submit"] { background-color: #0073aa; color: #fff; border: 1px solid #0073aa; padding: 8px 12px; border-radius: 0 4px 4px 0; cursor: pointer; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 15px; z-index: 1001; }
.hamburger-icon { width: 24px; height: 2px; background-color: #333; display: block; position: relative; transition: background-color 0.3s ease; }
.hamburger-icon::before, .hamburger-icon::after { content: ''; width: 100%; height: 2px; background-color: #333; position: absolute; left: 0; transition: all 0.3s ease; }
.hamburger-icon::before { top: -7px; }
.hamburger-icon::after { bottom: -7px; }


/* --- Homepage Redesign --- */
.main-content-area-home { padding: 30px 20px; }
.posts-column-home { max-width: 1200px; margin: 0 auto; }
.home-section { margin-bottom: 50px; }
.section-title { font-size: 1.8em; font-weight: 700; color: #000; margin: 0 0 25px 0; padding-bottom: 10px; border-bottom: 3px solid #0073aa; }
.section-title-sidebar { font-size: 1.2em; font-weight: bold; margin: 0 0 15px 0; padding-bottom: 10px; border-bottom: 1px solid #eee; color: #000; }
.top-news-section { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; justify-content: center; }
.hero-card { background: #fff; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.07); overflow: hidden; }
.hero-card .post-thumbnail img { border-radius: 8px 8px 0 0; }
.hero-card .card-content { padding: 25px; }
.hero-card .card-content .entry-title { font-size: 2.2em; line-height: 1.2; margin: 0 0 10px 0; font-weight: 700; }
.hero-card .card-content .entry-title a { color: #000; text-decoration: none; }
.hero-card .post-meta { font-size: 0.9em; margin-bottom: 15px; color: #777; }
.hero-card .entry-excerpt { color: #555; margin: 0; font-size: 1.05em; }

/* Top Headlines Clipping Fix & Scrolling Animation */
.top-stories-list { box-sizing: border-box; width: 100%; }
.top-stories-scroll-container {
    height: 480px;
    overflow: hidden;
    position: relative;
}
#top-headlines-scroll {
    list-style: none; margin: 0; padding: 0;
    position: absolute;
    width: 100%;
    animation: scroll-up 30s linear infinite;
}
#top-headlines-scroll:hover {
    animation-play-state: paused;
}
@keyframes scroll-up {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}
.top-stories-list li { border-bottom: 1px solid #eee; }
.top-stories-list li:last-child { border-bottom: none; }
.top-stories-list a { display: flex; align-items: center; gap: 15px; padding: 15px 0; text-decoration: none; }
.top-stories-list img { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.top-stories-list h3 { font-size: 1em; line-height: 1.3; margin: 0; font-weight: 700; color: #000; }

/* Trending Section Ticker Styles */
.trending-section {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    line-height: 1.2;
    margin-top: -10px;
    margin-bottom: 30px;
}
.trending-label {
    background-color: #0073aa;
    color: #fff;
    padding: 8px 15px;
    font-weight: bold;
    font-size: 0.9em;
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.trending-posts-container {
    flex-grow: 1;
    overflow: hidden;
    margin-left: 15px;
    position: relative;
    height: 1.2em;
}
.trending-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    width: 100%;
    height: 100%;
}
.trending-posts-list li {
    position: absolute;
    width: 100%;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.5s ease, opacity 0.5s ease;
}
.trending-posts-list li.is-visible {
    opacity: 1;
    transform: translateX(0);
}
.trending-posts-list li.is-leaving {
    transform: translateX(-100%);
}
.trending-posts-list li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.multi-column-grid.four-columns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card-style-one { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.card-style-one .post-thumbnail img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-style-one .card-content { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.card-style-one .card-content .entry-title { margin: 0 0 8px 0; font-size: 1.1em; line-height: 1.4; font-weight: 700; }
.card-style-one .card-content .entry-title a { color: #000; text-decoration: none; }
.card-style-one .post-meta { font-size: 0.8em; color: #888; }
.card-style-one .entry-excerpt { flex-grow: 1; }
.ad-space-widget { display: flex; justify-content: center; align-items: center; min-height: 120px; background-color: #e9ecef; border-radius: 8px; }
.ad-space-widget .ad-widget { width: 100%; max-width: 728px; text-align: center; }

/* --- Archive & Category Page Styles --- */
.main-content-area-full { max-width: 1200px; margin: 0 auto; padding: 30px 20px; }

.archive-top-story {
    position: relative;
    margin-bottom: 50px;
    border-radius: 8px;
    overflow: hidden;
    color: #fff;
}
.archive-top-story .post-thumbnail img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}
.archive-top-story .entry-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 30px;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    border-radius: 0 0 8px 8px;
}
.archive-top-story .entry-title { font-size: 2.2em; line-height: 1.2; margin: 0 0 10px 0; }
.archive-top-story .entry-title a { color: #fff; text-decoration: none; }
.archive-top-story .entry-meta { font-size: 0.9em; color: #eee; }
.archive-top-story .entry-excerpt { display: none; }

.archive-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.read-more-btn {
    display: inline-block;
    background-color: #0073aa;
    color: #fff !important;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    align-self: flex-start;
}
.read-more-btn:hover {
    background-color: #005177;
    text-decoration: none;
}

/* --- Full-width Recent Posts Section --- */
.full-width-section {
    width: 100%;
    padding: 50px 0;
    box-sizing: border-box;
}
.recent-posts-section {
    background-color: #fff;
    margin-top: 50px;
    border-top: 1px solid #e9ecef;
}
.recent-posts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Layout */
.main-content-area { display: grid; grid-template-columns: 1fr 320px; gap: 30px; }
.posts-column { min-width: 0; }
.sidebar-column { min-width: 0; }

/* --- Single Post & Page Styles --- */
.single-post, .page-content-area { background-color: #fff; padding: 30px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); border-radius: 8px; }
.entry-header { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.entry-title, .page-title { font-size: 2.5em; margin: 0 0 15px 0; line-height: 1.2; }
.entry-meta { font-size: 0.9em; color: #555; margin-bottom: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 15px; }
.entry-meta .byline a { color: #0073aa; font-weight: bold; }
/* Improved Share Buttons */
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-buttons a { display: inline-block; border-radius: 50%; border: 1px solid #ddd; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: #555; transition: all 0.2s ease; }
.share-buttons a:hover { color: #fff; border-color: transparent; }
.share-buttons a.share-facebook:hover { background-color: #1877F2; }
.share-buttons a.share-twitter:hover { background-color: #1DA1F2; }
.share-buttons a.share-pinterest:hover { background-color: #E60023; }
.share-buttons a.share-linkedin:hover { background-color: #0A66C2; }
.share-buttons a.share-whatsapp:hover { background-color: #25D366; }
.share-buttons a.share-email:hover { background-color: #EA4335; }
.share-buttons a.share-print:hover { background-color: #666; }
.share-buttons a.share-more:hover { background-color: #0073aa; }
.share-buttons svg { width: 20px; height: 20px; }

.featured-image { margin-bottom: 25px; }
.featured-image img { border-radius: 8px; }
.wp-caption-text { font-size: 0.85em; color: #777; text-align: center; margin-top: 8px; }
/* Readability Improvement */
.entry-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 1.5em;
}
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4, .entry-content h5, .entry-content h6 { font-weight: bold; margin-top: 1.5em; margin-bottom: 0.5em; line-height: 1.3; }
.entry-content h1 { font-size: 2em; }
.entry-content h2 { font-size: 1.75em; }
.entry-content h3 { font-size: 1.5em; }
.entry-content blockquote { border-left: 3px solid #0073aa; padding-left: 15px; margin: 1.5em 0; font-style: italic; color: #555; }
.entry-content .wp-block-embed { margin: 25px 0; }

/* Styling for X (Twitter) Embeds */
.entry-content .twitter-tweet {
    border: none !important;
    padding: 0 !important;
    margin: 2em auto !important;
}

.last-updated { text-align: center; font-style: italic; color: #888; margin-top: 30px; font-size: 0.9em; border-top: 1px solid #eee; padding-top: 20px; }

/* Sidebar "Most Read" Section */
.most-read-widget { margin-bottom: 30px; }
.most-read-widget .sidebar-widget-title { font-size: 1.2em; font-weight: bold; margin: 0 0 15px 0; padding-bottom: 10px; border-bottom: 1px solid #eee; color: #000; }
.most-read-widget ul { list-style: none; padding: 0; margin: 0; }
.most-read-widget li { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.most-read-widget li:last-child { margin-bottom: 0; }
.most-read-widget .post-thumbnail img { width: 75px; height: 55px; object-fit: cover; border-radius: 4px; }
.most-read-widget .entry-title { font-size: 0.95em; line-height: 1.3; font-weight: bold; margin: 0; }
.most-read-widget .entry-title a { color: #333; text-decoration: none; }

/* Improved Contact Form UI */
.entry-content form {
    margin-top: 1.5em;
}
.entry-content form p {
    margin-bottom: 20px;
}
.entry-content form label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}
.entry-content form input[type="text"],
.entry-content form input[type="email"],
.entry-content form textarea {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    font-size: 1em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.entry-content form input[type="text"]:focus,
.entry-content form input[type="email"]:focus,
.entry-content form textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
    outline: none;
}
.entry-content form textarea {
    min-height: 150px;
    resize: vertical;
}
.entry-content form input[type="submit"] {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.entry-content form input[type="submit"]:hover {
    background-color: #005177;
}


/* --- Footer --- */
.site-footer {
    padding-top: 60px;
    font-size: 0.95rem;
    background-color: #47ad84;
    color: #fff;
    margin-top: auto;
}
.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    padding-bottom: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-about .footer-logo img {
    height: 80px;
    width: auto;
    margin-bottom: 20px;
}
.footer-widget h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #fff;
}
.footer-widget p { color: #fff; }
.footer-widget ul { list-style: none; padding: 0; margin: 0; }
.footer-widget li { margin-bottom: 12px; }
.footer-widget a { color: #fff; transition: color 0.3s ease; }
.footer-widget a:hover { text-decoration: underline; }
.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}
.footer-socials a {
    display: inline-block;
    transition: transform 0.2s ease;
}
.footer-socials a:hover { transform: scale(1.1); }
.footer-socials svg { width: 28px; height: 28px; fill: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px 0;
}
.footer-bottom-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-bottom p { margin: 0; }

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    .site-branding .site-title a { font-size: 1.5em; }
    .main-content-area, .top-news-section { display: block; }
    .sidebar-column, .top-stories-list { margin-top: 30px; }

    .posts-column-home, .archive-posts-grid { grid-template-columns: 1fr; }
    .multi-column-grid.four-columns { grid-template-columns: repeat(2, 1fr); }
    .menu-toggle { display: block; order: -1; }
    .primary-nav-container { justify-content: space-between; }
	#primary-menu-wrap {
        display: none;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100%;
        width: 280px;
        background: #fff;
        z-index: 1000;
        overflow-y: auto;
        padding-top: 80px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        transition: left 0.3s ease-in-out;
    }
    body.mobile-menu-open #primary-menu-wrap {
        display: block;
        left: 0;
    }
    .mobile-menu-open .menu-toggle {
        position: fixed;
        top: 15px;
        left: 220px;
    }
    .mobile-menu-open .hamburger-icon {
        background-color: transparent;
    }
    .mobile-menu-open .hamburger-icon::before {
        transform: rotate(45deg);
        top: 0;
    }
    .mobile-menu-open .hamburger-icon::after {
        transform: rotate(-45deg);
        bottom: 0;
    }
    .main-navigation ul {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    .main-navigation ul li a {
        padding: 15px;
        border-bottom: 1px solid #f1f1f1;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
    }
    .main-navigation ul li.current-menu-item > a { box-shadow: inset 2px 0 0 #0073aa; }
    .nav-right-items { margin-left: auto; }
}

@media (max-width: 768px) {
    .multi-column-grid.four-columns { grid-template-columns: 1fr; }
    .archive-posts-grid { grid-template-columns: 1fr; }
    .entry-title, .page-title { font-size: 2em; }
    .header-top-container { justify-content: center; text-align: center; }
    .date-time { width: 100%; margin-bottom: 10px; }
    .footer-main { grid-template-columns: 1fr; }

    /* Form Input Responsive Fix (for Comments, Contact Forms, etc.) */
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea,
    .entry-content form input[type="text"],
    .entry-content form input[type="email"],
    .entry-content form input[type="url"],
    .entry-content form input[type="search"],
    .entry-content form input[type="tel"],
    .entry-content form input[type="password"],
    .entry-content form textarea {
        width: 100%;
        box-sizing: border-box; /* Ensures padding and border are included in the width */
    }
}

@media (max-width: 480px) {
    .site-branding .site-title a { font-size: 1.2em; }
    .single-post, .page-content-area {
        padding: 15px;
    }
    .main-content { padding: 20px 15px; }
    .entry-title, .page-title { font-size: 1.8em; }
    .entry-content p { font-size: 1rem; }
    .trending-label span { display: none; }
    .trending-label { padding: 8px 10px; }
}
<?php
/**
 * The header for our theme
 * @package IAASNepalNews
 */
?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>

<div id="page" class="page-container">

    <header id="top-header" class="header-top">
        <div class="header-top-container">
            <div class="date-time" id="date-time-display"></div>
            <div class="header-top-right">
                <div class="social-icons">
                    <?php
                    if ( function_exists( 'smile_digital_solution_social_icons' ) ) {
                        smile_digital_solution_social_icons();
                    }
                    ?>
                </div>
                 <a href="<?php echo esc_url( get_theme_mod( 'sds_subscribe_button_url', '#' ) ); ?>" class="subscribe-btn"><?php echo esc_html( get_theme_mod( 'sds_subscribe_button_text', 'Subscribe' ) ); ?></a>
            </div>
        </div>
    </header>
/* --- Final Header Layout with Customizer Options --- */

.site-header {
    padding: 20px;
}
.site-branding-container {
    display: flex;
    align-items: center;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 60px;
}
.site-title-container {
    text-align: center;
}
.site-logo {
    z-index: 2;
}
.site-title {
    margin: 0;
}
.site-title a {
    font-size: 2em; /* Reduced site title size */
    font-weight: 700;
    color: #111;
    text-decoration: none;
    line-height: 1;
}
.site-description {
    margin: 5px 0 0;
    font-size: 1.1em;
    color: #555;
}

/* --- Logo Position: Left (Default) --- */
.logo-left .site-title-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* --- Logo Position: Center --- */
.logo-center .site-branding-container {
    flex-direction: column;
    gap: 15px;
}
.logo-center .site-logo {
    order: 1; /* Logo comes first */
}
.logo-center .site-title-container {
    order: 2; /* Title/tagline comes after */
}

/* --- Logo Position: Right --- */
.logo-right .site-logo {
    order: 2; /* Logo comes after the title block */
    margin-left: auto; /* Pushes the logo to the right */
}
.logo-right .site-title-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}