/*
 * Page builder, widgets, header/footer options and ads.
 * Colours, fonts and corner radius come from Site Settings → Theme (CSS variables).
 */

/* ── Theme fonts ─────────────────────────────────────────── */
body,
.nepali-text {
    font-family: var(--kd-font-body);
}

h1, h2, h3, h4, h5, h6,
.kd-section-title,
.kd-lead-title,
.kd-card-title,
.post-title,
.widget-title {
    font-family: var(--kd-font-heading);
}

/* Theme colour tints (the base stylesheet hard-codes the default blue) */
.kd-chip {
    background: color-mix(in srgb, var(--primary-color) 10%, transparent);
    color: var(--primary-color);
}

.kd-chip--on-image {
    background: var(--primary-color);
    color: #fff;
}

.kd-ranked li::before {
    color: color-mix(in srgb, var(--primary-color) 40%, transparent);
}

.kd-navbar {
    background: var(--kd-header-bg) !important;
}

/* ── Top bar ─────────────────────────────────────────────── */
.kd-topbar {
    background: var(--kd-topbar-bg);
    color: rgba(255, 255, 255, .85);
    font-size: .85rem;
}

.kd-topbar-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 36px;
}

.kd-topbar a {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
}

.kd-topbar a:hover {
    color: #fff;
}

.kd-topbar-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.kd-topbar-social {
    display: flex;
    gap: .75rem;
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .kd-topbar-links {
        display: none;
    }
}

/* ── Newspaper (stacked) header ──────────────────────────── */
.kd-masthead {
    background: var(--kd-header-bg);
    border-bottom: 1px solid #e8edf3;
}

.kd-masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.kd-brand--large .kd-brand-logo {
    max-height: 84px;
    height: auto;
}

.kd-brand--large .kd-brand-name {
    font-size: 2rem;
}

.kd-masthead .kd-ad {
    margin: 0;
    max-width: 728px;
    flex: 1 1 auto;
}

.kd-masthead-tagline {
    color: var(--light-text, #7f8c8d);
    font-size: 1.05rem;
}

@media (max-width: 991.98px) {
    .kd-masthead {
        display: none;
    }
}

/* ── Third-level menus ───────────────────────────────────── */
.kd-dropdown-submenu {
    position: relative;
}

.kd-dropdown-sub {
    list-style: none;
    padding: .25rem 0;
    margin: 0;
}

.kd-sub-caret {
    font-size: .65rem;
    float: right;
    margin-top: .45rem;
}

@media (min-width: 992px) {
    .kd-dropdown-sub {
        display: none;
        position: absolute;
        left: 100%;
        top: -.35rem;
        min-width: 13rem;
        background: #fff;
        border-radius: var(--border-radius-sm);
        box-shadow: 0 12px 30px rgba(15, 35, 70, .12);
    }

    .kd-dropdown-submenu:hover > .kd-dropdown-sub,
    .kd-dropdown-submenu:focus-within > .kd-dropdown-sub {
        display: block;
    }
}

@media (max-width: 991.98px) {
    .kd-dropdown-sub .dropdown-item {
        padding-left: 2rem;
    }

    .kd-sub-caret {
        transform: rotate(90deg);
    }
}

/* ── Builder sections ────────────────────────────────────── */
.kd-builder {
    padding-top: .5rem;
}

.kd-section--filled {
    margin: 1rem 0;
}

.kd-section-col > .kd-widget + .kd-widget {
    margin-top: 1.5rem;
}

.kd-widget--section + .kd-widget--section {
    margin-top: 2rem;
}

.kd-widget-title-link {
    color: inherit;
    text-decoration: none;
}

.kd-widget-title-link:hover {
    color: var(--primary-color);
}

.kd-section-col .kd-widget--sidebar.sidebar-widget {
    margin-bottom: 0;
}

.kd-preview-bar {
    position: sticky;
    top: 0;
    z-index: 1080;
    background: #ffc107;
    color: #212529;
    text-align: center;
    padding: .45rem 1rem;
    font-size: .95rem;
}

.kd-preview-bar a {
    margin-left: .75rem;
    font-weight: 600;
    color: #212529;
}

/* ── Photo (overlay) cards & hero ────────────────────────── */
.kd-overlay-card {
    position: relative;
    display: block;
    height: 100%;
    min-height: 200px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--secondary-color);
    color: #fff;
    text-decoration: none;
}

.kd-overlay-card--large {
    min-height: 360px;
}

.kd-overlay-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.kd-overlay-card:hover img {
    transform: scale(1.04);
}

.kd-overlay-body {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    align-items: flex-start;
    background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0));
    padding-top: 3rem;
}

.kd-overlay-card--noimg .kd-overlay-body {
    position: static;
    background: none;
    padding-top: 1.25rem;
}

.kd-overlay-title {
    font-weight: 700;
    line-height: 1.45;
    font-size: 1.05rem;
    color: #fff;
}

.kd-overlay-card--large .kd-overlay-title {
    font-size: 1.5rem;
}

.kd-overlay-time {
    font-size: .8rem;
    opacity: .85;
}

.kd-hero-grid .col-lg-5 .kd-overlay-card {
    min-height: 172px;
}

.kd-hero-slider {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.kd-hero-slider .kd-overlay-card--large {
    min-height: 440px;
    border-radius: 0;
}

.kd-hero-slider .swiper-button-prev,
.kd-hero-slider .swiper-button-next {
    color: #fff;
    border: 0;
    background: none;
}

.kd-hero-slider .swiper-pagination-bullet-active {
    background: #fff;
}

@media (max-width: 767.98px) {
    .kd-overlay-card--large,
    .kd-hero-slider .kd-overlay-card--large {
        min-height: 260px;
    }

    .kd-overlay-card--large .kd-overlay-title {
        font-size: 1.2rem;
    }
}

/* ── Headline list ───────────────────────────────────────── */
.kd-compact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kd-compact-list li {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .6rem 0;
    border-bottom: 1px solid #edf0f3;
}

.kd-compact-list li:last-child {
    border-bottom: 0;
}

.kd-compact-list a {
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    line-height: 1.5;
}

.kd-compact-list a:hover {
    color: var(--primary-color);
}

/* ── Video ───────────────────────────────────────────────── */
.kd-video-frame,
.kd-video iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--border-radius);
    background: #111 center / cover no-repeat;
    position: relative;
    cursor: pointer;
}

.kd-video-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 1.4rem;
    transition: background .2s;
}

.kd-video-frame:hover .kd-video-play {
    background: var(--primary-color);
}

.kd-video-caption {
    margin-top: .5rem;
    font-weight: 600;
    color: var(--secondary-color);
}

/* ── Gallery & lightbox ──────────────────────────────────── */
.kd-gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.kd-gallery-item figcaption {
    font-size: .85rem;
    margin-top: .35rem;
}

.kd-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.kd-lightbox[hidden] {
    display: none;
}

.kd-lightbox img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 6px;
}

/* Wider screens: leave room at the sides for the previous / next buttons */
@media (min-width: 768px) {
    .kd-lightbox img {
        max-width: calc(100% - 9rem);
    }
}

.kd-lightbox-caption {
    color: #fff;
    margin-top: .75rem;
    text-align: center;
}

.kd-lightbox-close {
    position: absolute;
    top: .75rem;
    right: 1rem;
    z-index: 2;
    border: 0;
    background: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
}

/* "३ / १०" in the top-left corner */
.kd-lightbox-counter {
    position: absolute;
    top: 1.1rem;
    left: 1.25rem;
    color: rgba(255, 255, 255, .85);
    font-size: .95rem;
}

/* Previous / next: round buttons halfway down the sides */
.kd-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background .2s ease;
}

.kd-lightbox-nav:hover,
.kd-lightbox-nav:focus-visible {
    background: rgba(255, 255, 255, .3);
    outline: none;
}

.kd-lightbox-nav[hidden] {
    display: none;
}

.kd-lightbox-prev {
    left: 1rem;
}

.kd-lightbox-next {
    right: 1rem;
}

/* Phones: smaller buttons over the photo's edges, photo uses the full width */
@media (max-width: 767px) {
    .kd-lightbox {
        padding: 3rem .5rem 1rem;
    }

    .kd-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
        background: rgba(0, 0, 0, .45);
    }

    .kd-lightbox-prev {
        left: .4rem;
    }

    .kd-lightbox-next {
        right: .4rem;
    }
}

/* ── Small widgets ───────────────────────────────────────── */
.kd-image-widget img {
    border-radius: var(--border-radius-sm);
}

.kd-image-widget figcaption {
    font-size: .85rem;
    color: var(--light-text, #7f8c8d);
    margin-top: .35rem;
}

.kd-cta--accent {
    background: linear-gradient(120deg, var(--primary-color), var(--accent-color));
    color: #fff;
}

.kd-cta--accent .kd-box-title,
.kd-cta--accent .kd-box-title i {
    color: #fff;
}

.kd-social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.kd-social-button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .8rem;
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-size: .9rem;
    background: var(--secondary-color);
}

.kd-social-button--facebook { background: #1877f2; }
.kd-social-button--twitter { background: #000; }
.kd-social-button--youtube { background: #ff0000; }
.kd-social-button--instagram { background: #d62976; }
.kd-social-button--linkedin { background: #0a66c2; }
.kd-social-button--tiktok { background: #111; }

.kd-social-button:hover {
    color: #fff;
    opacity: .9;
}

.kd-epaper-cover {
    display: block;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.kd-epaper-cover img {
    width: 100%;
    display: block;
}

.kd-epaper-cover span {
    position: absolute;
    inset: auto 0 0 0;
    padding: .6rem;
    text-align: center;
    color: #fff;
    background: var(--primary-color);
    font-weight: 600;
}

.kd-text-widget p:last-child {
    margin-bottom: 0;
}

.kd-menu-widget-sub {
    list-style: none;
    padding-left: 1.5rem;
}

.kd-footer-logo-img {
    max-height: 48px;
    width: auto;
    margin-right: .5rem;
}

footer .social-links + * {
    margin-top: 1rem;
}

/* ── Article extras ──────────────────────────────────────── */
.kd-article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 1.5rem 0 .5rem;
}

.kd-article-tags > i {
    color: var(--primary-color);
}

.kd-related {
    margin: 2rem 0;
}

/* ── Advertisements ──────────────────────────────────────── */
.kd-ad {
    text-align: center;
    margin: 1rem auto;
}

.kd-ad-item + .kd-ad-item {
    margin-top: .75rem;
}

.kd-ad img {
    max-width: 100%;
    height: auto;
}

.kd-ad-label {
    display: block;
    font-size: .7rem;
    letter-spacing: .06em;
    color: #9aa5b1;
    margin-bottom: .2rem;
    text-transform: uppercase;
}

.kd-ad--below-menu,
.kd-ad--header-top {
    margin-top: .75rem;
    margin-bottom: .25rem;
}

.kd-widget--sidebar.kd-widget--advertisement {
    margin-bottom: 1.5rem;
}

.kd-mobile-sticky-ad {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .12);
    padding: .25rem 0 .35rem;
}

.kd-mobile-sticky-ad .kd-ad {
    margin: 0 auto;
}

.kd-sticky-close {
    position: absolute;
    top: -14px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
    line-height: 1;
}

/* Sticky sidebar (desktop): pins below the header when it is short; when it is
   taller than the screen it scrolls until its end is in view, then stays put.
   --kd-sticky-top is set by scripts.js from the sidebar and header heights. */
@media (min-width: 992px) {
    .kd-sticky-sidebar {
        position: sticky;
        top: var(--kd-sticky-top, 1rem);
    }
}

/* Page links of a widget jump back to it: keep its title clear of the sticky header */
.kd-widget {
    scroll-margin-top: 90px;
}

/* Social icons widget. The base .social-link style (styles.css) is made for the
   dark footer: a white icon on a faint circle, invisible on a white page. On
   light backgrounds each icon gets its brand colour; the footer keeps its look. */
.social-link--facebook { --kd-brand: #1877f2; }
.social-link--twitter { --kd-brand: #000; }
.social-link--youtube { --kd-brand: #ff0000; }
.social-link--instagram { --kd-brand: #d62976; }
.social-link--linkedin { --kd-brand: #0a66c2; }
.social-link--tiktok { --kd-brand: #111; }

.kd-widget .social-link {
    background: var(--kd-brand, var(--primary-color));
    color: #fff;
}

.kd-widget .social-link:hover,
.kd-widget .social-link:focus-visible {
    background: var(--kd-brand, var(--primary-color));
    color: #fff;
    filter: brightness(1.15);
}

footer .kd-widget .social-link {
    background: rgba(255, 255, 255, .1);
}

footer .kd-widget .social-link:hover,
footer .kd-widget .social-link:focus-visible {
    background: var(--primary-color);
    filter: none;
}

.kd-widget .social-links {
    flex-wrap: wrap;
}
