/*
Theme Name: KhojNepal
Theme URI: https://khojnepalonline.com/
Author: Alen Pariyar
Author URI: https://alenpariyar.com.np/
Description: KhojNepal is a professional, high-performance news and magazine theme for khojnepalonline.com.
Version: 1.4.0
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: khojnepal
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

body {
    font-family: var(--kn-body-font, 'Public Sans', sans-serif);
}

h1, h2, h3, .branding {
    font-family: 'Work Sans', 'Poppins', sans-serif;
}

.label-text {
    font-family: 'Inter', sans-serif;
}

.article-body p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: var(--kn-article-size, 1.125rem);
}

/* Pagination Styling */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 0.125rem;
    background: white;
    color: var(--on-surface);
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    border: 1px solid #e5e2e1;
    transition: all 0.2s ease;
}

.page-numbers.current {
    background: var(--kn-primary, #0f4fa8);
    color: white;
    border-color: var(--kn-primary, #0f4fa8);
}

.page-numbers:hover:not(.current) {
    border-color: var(--kn-primary, #0f4fa8);
    color: var(--kn-primary, #0f4fa8);
}

.page-numbers.prev, .page-numbers.next {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1.25rem;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Comments Section Styling */
.comment-list .comment-body {
    padding: 2rem;
    background: #fcf9f8;
    border: 1px solid #f0eded;
    border-radius: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
}

.comment-list .comment-body:hover {
    border-color: var(--kn-primary, #0f4fa8);
    box-shadow: 0 10px 30px -10px rgba(187, 0, 19, 0.1);
}

.comment-list .vcard {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-list .vcard img {
    border-radius: 9999px;
    border: 3px solid white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.comment-list .fn {
    font-weight: 700;
    color: #1c1b1b;
    font-size: 1.125rem;
}

.comment-list .comment-metadata {
    font-size: 0.75rem;
    color: #43474e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.comment-list .comment-metadata a {
    color: inherit;
    transition: color 0.2s;
}

.comment-list .comment-metadata a:hover {
    color: var(--kn-primary, #0f4fa8);
}

.comment-list .comment-content {
    color: #1c1b1b;
    line-height: 1.7;
    font-size: 1rem;
}

.comment-list .reply {
    margin-top: 1.5rem;
}

.comment-list .comment-reply-link {
    display: inline-flex;
    align-items: center;
    background: var(--kn-primary, #0f4fa8);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
}

.comment-list .comment-reply-link:hover {
    background: var(--kn-primary-dark, #0b3b7e);
    transform: translateY(-2px);
}

.comment-list .children {
    margin-left: 3rem;
    margin-top: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid #c3c6cf;
}

/* Dynamic Widget Styling */
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0eded;
    font-size: 0.875rem;
    color: #43474e;
    transition: all 0.2s;
}

.widget ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.widget ul li a {
    color: #1c1b1b;
    font-weight: 600;
    transition: color 0.2s;
}

.widget ul li a:hover {
    color: var(--kn-primary, #0f4fa8);
}

/* Search Overlay Animations */
@keyframes fadeInZoom {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-search-in {
    animation: fadeInZoom 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Base custom resets for wp blocks and content */
.article-body img {
    height: auto;
    max-width: 100%;
}

/* ── Scrollbar hide utility (replaces missing Tailwind plugin) ── */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}
.no-scrollbar::-webkit-scrollbar {
    display: none;             /* Chrome, Safari, Opera */
}

/* ── Desktop nav: allow items to wrap if there are too many categories ── */
#main-nav ul {
    flex-wrap: wrap;
}

/* ==========================================================================
   Header (moved from the inline <style> in header.php)
   ========================================================================== */

#page,
html,
body {
    overflow-x: visible;
}

/* Nepali headings use Mukta. */
h1, h2, h3, h4, h5, h6,
.font-headline {
    font-family: var(--kn-heading-font, 'Mukta', sans-serif) !important;
}

#main-nav {
    transition: all 0.3s ease;
}

#main-nav.is-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    animation: slideDown 0.3s ease-out;
}

body.admin-bar #main-nav.is-sticky {
    top: 32px;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

@media (max-width: 767px) {
    header.mobile-header-fixed {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 60 !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

/* ==========================================================================
   News ticker
   ========================================================================== */

.kn-ticker-viewport {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}

.kn-ticker-track {
    animation: kn-ticker var(--kn-ticker-speed, 60s) linear infinite;
}

.kn-ticker-viewport:hover .kn-ticker-track,
.kn-ticker-viewport:focus-within .kn-ticker-track {
    animation-play-state: paused;
}

@keyframes kn-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .kn-ticker-track {
        animation: none;
    }
    .kn-ticker-viewport {
        overflow-x: auto;
    }
}

/* ==========================================================================
   Article body
   ========================================================================== */

.article-body h2,
.article-body h3 {
    font-weight: 800;
    line-height: 1.4;
    margin: 2rem 0 1rem;
}

.article-body h2 { font-size: 1.6rem; }
.article-body h3 { font-size: 1.35rem; }

.article-body a {
    color: var(--kn-primary, #0f4fa8);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body blockquote {
    border-left: 4px solid var(--kn-primary, #0f4fa8);
    background: #f6f3f2;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.5rem 1.5rem;
    line-height: 1.8;
    font-size: 1.125rem;
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }

.article-body iframe {
    max-width: 100%;
}

.article-body figure figcaption,
.article-body .wp-caption-text {
    font-size: 0.875rem;
    color: #43474e;
    margin-top: 0.5rem;
}

.screen-reader-text:focus {
    background-color: #fff;
    clip: auto;
    clip-path: none;
    color: var(--kn-primary, #0f4fa8);
    display: block;
    font-weight: 700;
    height: auto;
    left: 8px;
    padding: 12px 20px;
    top: 8px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   Theme options
   ========================================================================== */

.kn-top-bar {
    background-color: var(--kn-top-bar-bg, #1c1b1b);
}

.site-footer {
    background-color: var(--kn-footer-bg, var(--kn-primary, #0f4fa8));
}

/* Core WordPress widgets in the sidebar get the same card look as the
   KhojNepal widgets, which draw their own cards. */
.kn-sidebar .widget:not(.khojnepal-widget) {
    background: #fff;
    border: 1px solid rgb(229 226 225 / 0.6);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.kn-sidebar .widget select,
.kn-sidebar .widget input[type="search"] {
    width: 100%;
    border-radius: 0.375rem;
}

/* Keep the mobile sticky ad from covering the back-to-top button. */
@media (max-width: 767px) {
    body:has(#kn-mobile-sticky-ad) #back-to-top {
        bottom: 5.5rem;
    }
}

/* Festival mode: floating kite above the back-to-top button. */
#kn-festival {
    position: fixed;
    right: 1rem;
    bottom: 5rem;
    z-index: 85;
    width: 96px;
    pointer-events: none;
    animation: kn-kite-float 4s ease-in-out infinite;
    filter: drop-shadow(0 6px 10px rgb(0 0 0 / 0.15));
}

#kn-festival img {
    display: block;
    width: 100%;
    height: auto;
}

@keyframes kn-kite-float {
    0%, 100% { transform: translate(0, 0) rotate(-6deg); }
    50% { transform: translate(-6px, -14px) rotate(6deg); }
}

@media (max-width: 767px) {
    #kn-festival {
        width: 64px;
        bottom: 4.5rem;
    }

    body:has(#kn-mobile-sticky-ad) #kn-festival {
        bottom: 9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #kn-festival {
        animation: none;
    }
}

/* ==========================================================================
   Footer widgets (Footer Column 1-4)
   ========================================================================== */

.site-footer .widget,
.site-footer .widget p {
    color: rgb(255 255 255 / 0.8);
    font-size: 0.875rem;
    line-height: 1.7;
}

.site-footer .widget ul li {
    border-bottom: 1px solid rgb(255 255 255 / 0.12);
    color: rgb(255 255 255 / 0.8);
    padding: 0.5rem 0;
}

.site-footer .widget ul li:last-child {
    border-bottom: none;
}

.site-footer .widget ul li a,
.site-footer .widget a:not([class]) {
    color: rgb(255 255 255 / 0.9);
    font-weight: 500;
}

.site-footer .widget ul li a:hover,
.site-footer .widget a:not([class]):hover {
    color: #fff;
    text-decoration: underline;
}

/* Navigation Menu widget: nested items indented. */
.site-footer .widget_nav_menu .sub-menu {
    margin: 0.5rem 0 0 1rem;
}

.site-footer .widget select,
.site-footer .widget input {
    color: #1c1b1b;
    width: 100%;
    border-radius: 0.375rem;
}
