﻿/* =========================================================
   NiqfaCMS Public Theme
   ظاهر اجزای سایت بر اساس CSS Variables
   ========================================================= */


/* =========================================================
   1. Base
   ========================================================= */

html,
body {
    font-family: var(--theme-font-family);
}

body {
    background-color: var(--theme-background);
    color: var(--theme-text);
}

.site-container {
    max-width: var(--theme-content-width);
}

.site-content {
    background-color: var(--theme-background);
    color: var(--theme-text);
}

a {
    color: var(--theme-link);
}


/* =========================================================
   2. Typography
   ========================================================= */

.page-heading,
.page-block-heading,
.public-gallery-title,
.cms-slider-title,
.statistics-heading h2,
.contact-info-heading,
.cards-block-heading,
.button-block-title {
    color: var(--theme-text);
}

.page-summary,
.cards-block-description,
.button-block-description,
.statistics-description,
.contact-info-description,
.public-card-description,
.public-card-caption {
    color: var(--theme-muted);
}

.page-block-content {
    color: var(--theme-text);
}


/* =========================================================
   3. Header
   ========================================================= */

.site-header {
    background-color: var(--theme-header-background);
    color: var(--theme-header-text);
}

    .site-header strong,
    .site-brand,
    .site-brand a {
        color: var(--theme-header-text);
    }

        .site-brand img,
        .site-header .site-brand-logo {
            max-height: var(--theme-header-logo-height);
            width: auto;
        }

.site-header-inner {
    min-height: var(--theme-header-height);
}

.site-header .public-menu-link,
.site-header .public-menu-heading,
.site-header .public-menu-toggle {
    color: var(--theme-header-text);
}

    .site-header .public-menu-link:hover,
    .site-header .public-menu-heading:hover,
    .site-header .public-menu-item:focus-within > .public-menu-link {
        color: var(--theme-header-hover);
    }


/* =========================================================
   4. Main Content Blocks
   ========================================================= */

.page-block {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
    border-radius: var(--theme-border-radius);
    box-shadow: var(--theme-shadow);
    margin-bottom: var(--theme-section-spacing);
}

.page-block-heading {
    color: var(--theme-text);
}

.page-block-content {
    color: var(--theme-text);
}


/* =========================================================
   5. Gallery
   ========================================================= */

.public-gallery-title {
    color: var(--theme-text);
}

.public-gallery-item {
    background-color: var(--theme-surface);
    border-radius: var(--theme-border-radius);
}

.public-gallery-caption {
    color: var(--theme-text);
    background-color: var(--theme-surface);
}


/* =========================================================
   6. Slider
   ========================================================= */

.cms-slider-title {
    color: var(--theme-text);
}

.cms-slider-stage {
    background-color: var(--theme-surface);
    border-radius: var(--theme-border-radius);
}


/* =========================================================
   7. Statistics
   ========================================================= */

.statistics-block {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-radius: var(--theme-border-radius);
}

.statistics-heading h2 {
    color: var(--theme-text);
}

.statistics-description {
    color: var(--theme-muted);
}

.statistics-item {
    background-color: var(--theme-background);
    color: var(--theme-text);
    border: var(--theme-card-border);
    border-radius: var(--theme-card-radius);
    box-shadow: var(--theme-card-shadow);
}

.statistics-value {
    color: var(--theme-primary);
}

.statistics-label {
    color: var(--theme-text);
}

.statistics-caption {
    color: var(--theme-muted);
}


/* =========================================================
   8. Contact Info
   ========================================================= */

.contact-info-block {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-radius: var(--theme-border-radius);
}

.contact-info-heading {
    color: var(--theme-text);
}

.contact-info-description,
.contact-info-label {
    color: var(--theme-muted);
}

.contact-info-item {
    background-color: var(--theme-background);
    color: var(--theme-text);
    border: var(--theme-card-border);
    border-radius: var(--theme-card-radius);
    box-shadow: var(--theme-card-shadow);
}

    .contact-info-item:hover {
        border-color: var(--theme-primary);
    }

.contact-info-icon {
    background-color: var(--theme-surface);
    color: var(--theme-primary);
}

.contact-info-content a,
.contact-info-content span,
.contact-info-text {
    color: var(--theme-text);
}

    .contact-info-content a:hover {
        color: var(--theme-link);
    }


/* =========================================================
   9. Cards
   ========================================================= */

.cards-block-heading {
    color: var(--theme-text);
}

.cards-block-description {
    color: var(--theme-muted);
}

.public-card {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border: var(--theme-card-border);
    border-radius: var(--theme-card-radius);
    box-shadow: var(--theme-card-shadow);
}

.public-card-title {
    color: var(--theme-text);
}

.public-card-description {
    color: var(--theme-muted);
}

.public-card-icon {
    color: var(--theme-primary);
}

.public-card-link {
    color: var(--theme-link);
}

    .public-card-link:hover {
        color: var(--theme-primary);
    }


/* =========================================================
   10. Buttons
   ========================================================= */

.button-block-title {
    color: var(--theme-text);
}

.button-block-description {
    color: var(--theme-muted);
}

.button-block .btn {
    border-radius: var(--theme-button-radius);
}

.btn-primary {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

    .btn-primary:hover,
    .btn-primary:focus {
        background-color: var(--theme-secondary);
        border-color: var(--theme-secondary);
    }

.btn-outline-primary {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

    .btn-outline-primary:hover {
        background-color: var(--theme-primary);
        border-color: var(--theme-primary);
    }


/* =========================================================
   11. Forms
   ========================================================= */

.form-label {
    color: var(--theme-text);
}

.form-control,
.form-select,
textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="search"] {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
    border-radius: var(--theme-border-radius);
}

    .form-control::placeholder,
    textarea::placeholder,
    input::placeholder {
        color: var(--theme-muted);
        opacity: .8;
    }

    .form-control:focus,
    .form-select:focus,
    textarea:focus,
    input:focus {
        background-color: var(--theme-surface);
        color: var(--theme-text);
        border-color: var(--theme-primary);
        box-shadow: 0 0 0 .2rem rgba(82, 105, 220, .15);
    }


/* =========================================================
   12. Main Navigation
   ========================================================= */

.site-header .public-menu-link,
.site-header .public-menu-heading {
    color: var(--theme-header-text);
}

    .site-header .public-menu-link:hover,
    .site-header .public-menu-heading:hover {
        color: var(--theme-header-hover);
    }

.site-header .public-menu-submenu {
    background-color: var(--theme-surface);
    border: 1px solid var(--theme-border);
    box-shadow: var(--theme-shadow);
}

    .site-header .public-menu-submenu .public-menu-link,
    .site-header .public-menu-submenu .public-menu-heading {
        color: var(--theme-text);
    }

        .site-header .public-menu-submenu .public-menu-link:hover {
            color: var(--theme-primary);
            background-color: var(--theme-background);
        }


/* =========================================================
   13. Footer
   ========================================================= */

.site-footer {
    background-color: var(--theme-footer-background);
    color: var(--theme-footer-text);
    padding-top: var(--theme-footer-padding);
}

    .site-footer h5,
    .site-footer h6,
    .site-footer p,
    .site-footer small {
        color: var(--theme-footer-text);
    }

    .site-footer a,
    .site-footer .public-menu-link,
    .site-footer .public-menu-heading,
    .site-footer .public-footer-social-links a {
        color: var(--theme-footer-link);
    }

        .site-footer a:hover,
        .site-footer .public-menu-link:hover,
        .site-footer .public-footer-social-links a:hover {
            color: var(--theme-footer-text);
        }

    .site-footer .public-footer-menu .public-menu-submenu {
        background-color: var(--theme-surface);
        border: 1px solid var(--theme-border);
        box-shadow: var(--theme-shadow);
    }

        .site-footer .public-footer-menu .public-menu-submenu a,
        .site-footer .public-footer-menu .public-menu-submenu .public-menu-link {
            color: var(--theme-text);
        }


/* =========================================================
   14. Dark Theme Component Fixes
   ========================================================= */

html[data-theme-mode="dark"] .page-heading,
html[data-theme-mode="dark"] .page-block-heading,
html[data-theme-mode="dark"] .public-gallery-title,
html[data-theme-mode="dark"] .cms-slider-title,
html[data-theme-mode="dark"] .statistics-heading h2,
html[data-theme-mode="dark"] .contact-info-heading,
html[data-theme-mode="dark"] .cards-block-heading,
html[data-theme-mode="dark"] .button-block-title,
html[data-theme-mode="dark"] .public-card-title {
    color: var(--theme-text);
}

html[data-theme-mode="dark"] .page-summary,
html[data-theme-mode="dark"] .cards-block-description,
html[data-theme-mode="dark"] .button-block-description,
html[data-theme-mode="dark"] .statistics-description,
html[data-theme-mode="dark"] .contact-info-description,
html[data-theme-mode="dark"] .public-card-description,
html[data-theme-mode="dark"] .statistics-caption {
    color: var(--theme-muted);
}

html[data-theme-mode="dark"] .page-block,
html[data-theme-mode="dark"] .public-card,
html[data-theme-mode="dark"] .statistics-block,
html[data-theme-mode="dark"] .statistics-item,
html[data-theme-mode="dark"] .contact-info-block,
html[data-theme-mode="dark"] .contact-info-item {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

html[data-theme-mode="dark"] .contact-info-content a,
html[data-theme-mode="dark"] .contact-info-content span,
html[data-theme-mode="dark"] .contact-info-text,
html[data-theme-mode="dark"] .statistics-label {
    color: var(--theme-text);
}

html[data-theme-mode="dark"] .form-control,
html[data-theme-mode="dark"] .form-select,
html[data-theme-mode="dark"] textarea,
html[data-theme-mode="dark"] input {
    background-color: var(--theme-surface);
    color: var(--theme-text);
    border-color: var(--theme-border);
}

    html[data-theme-mode="dark"] .form-control::placeholder,
    html[data-theme-mode="dark"] textarea::placeholder,
    html[data-theme-mode="dark"] input::placeholder {
        color: var(--theme-muted);
    }

html[data-theme-mode="dark"] .site-header .public-menu-submenu,
html[data-theme-mode="dark"] .site-footer .public-menu-submenu {
    background-color: var(--theme-surface);
    border-color: var(--theme-border);
}

    html[data-theme-mode="dark"] .site-header .public-menu-submenu a,
    html[data-theme-mode="dark"] .site-footer .public-menu-submenu a {
        color: var(--theme-text);
    }


/* =========================================================
   15. Layout and Component Appearance
   ========================================================= */

.page-block,
.public-card,
.statistics-item,
.contact-info-item {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* =========================================================
   16. Dynamic Header Appearance
   ========================================================= */

.site-header {
    position: var(--theme-header-position, relative);
    top: 0;
    z-index: 1030;
    background-color: var(--theme-header-background);
    color: var(--theme-header-text);
    box-shadow: var(--theme-header-shadow, none);
}

html body .site-header .site-header-inner {
    min-height: var(--theme-header-height);
    gap: var(--theme-header-gap, 30px);
    flex-direction: var(--theme-header-direction, row);
    align-items: var(--theme-header-align, center);
}

.site-header .site-brand img,
.site-header .site-brand-logo {
    max-height: var(--theme-header-logo-height);
    width: auto;
}

html body .site-header .public-menu {
    justify-content: var(--theme-menu-justify, flex-start);
}

    html body .site-header .public-menu > .public-menu-list {
        justify-content: var(--theme-menu-justify, flex-start);
    }

/* حالت وسط‌چین */

@media (min-width: 769px) {

    html body .site-header .site-header-inner {
        flex-direction: var(--theme-header-direction, row);
    }

    @media (min-width: 769px) {
        .site-header .site-brand {
            text-align: center;
        }

        .site-header .public-menu {
            width: 100%;
        }
    }

    .site-header .site-brand {
        text-align: center;
    }

    .site-header .public-menu {
        width: 100%;
    }
}

/* حفظ چیدمان موبایل */

@media (max-width: 768px) {

    html body .site-header .site-header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    html body .site-header .public-menu {
        width: 100%;
    }

        html body .site-header .public-menu > .public-menu-list {
            flex-direction: column !important;
            align-items: stretch;
        }
}



/* =========================================================
   Header Submenus - Theme Color Compatibility
   ========================================================= */

/* پس‌زمینه و رنگ متن زیرمنو */
.site-header .public-menu-submenu {
    background-color: var(--theme-surface, #FFFFFF);
    color: var(--theme-text, #263247);
    border: 1px solid var(--theme-border, #E5E7EB);
}

    /* لینک‌ها و عنوان‌های داخل زیرمنو */
    .site-header .public-menu-submenu .public-menu-link,
    .site-header .public-menu-submenu .public-menu-heading,
    .site-header .public-menu-submenu .public-menu-item-inner {
        color: var(--theme-text, #263247);
    }

        /* آیکون‌های زیرمنو */
        .site-header .public-menu-submenu .public-menu-link i,
        .site-header .public-menu-submenu .public-menu-heading i {
            color: inherit;
        }

        /* حالت قرار گرفتن نشانگر روی آیتم */
        .site-header .public-menu-submenu .public-menu-link:hover,
        .site-header .public-menu-submenu .public-menu-heading:hover {
            color: var(--theme-primary, #5269DC);
            background-color: var(--theme-background, #F5F7FB);
        }

    /* زیرمنوهای چندسطحی */
    .site-header .public-menu-submenu .public-menu-submenu {
        background-color: var(--theme-surface, #FFFFFF);
        color: var(--theme-text, #263247);
    }

    /* حفظ رفتار زیرمنوی بسته */
    .site-header .public-menu-submenu[hidden] {
        display: none !important;
    }



/* =========================================================
   16. Fix submenu colors in light and dark themes
   ========================================================= */

/* پس‌زمینه خود زیرمنو */
html body .site-header .public-menu .public-menu-submenu {
    background-color: var(--theme-surface, #FFFFFF) !important;
    color: var(--theme-text, #263247) !important;
    border-color: var(--theme-border, #E5E7EB) !important;
}

    /* پس‌زمینه محدوده داخلی هر آیتم */
    html body .site-header .public-menu .public-menu-submenu .public-menu-item-inner {
        background-color: transparent !important;
        color: var(--theme-text, #263247) !important;
    }

        /* لینک و عنوان آیتم‌های زیرمنو */
        html body .site-header .public-menu .public-menu-submenu .public-menu-item-inner > .public-menu-link,
        html body .site-header .public-menu .public-menu-submenu .public-menu-item-inner > .public-menu-heading {
            color: var(--theme-text, #263247) !important;
            background-color: transparent !important;
            text-decoration: none;
        }

    /* آیکون‌ها */
    html body .site-header .public-menu .public-menu-submenu .public-menu-link i,
    html body .site-header .public-menu .public-menu-submenu .public-menu-heading i {
        color: inherit !important;
    }

    /* حالت Hover */
    html body .site-header .public-menu .public-menu-submenu .public-menu-item-inner > .public-menu-link:hover,
    html body .site-header .public-menu .public-menu-submenu .public-menu-item-inner > .public-menu-heading:hover {
        color: var(--theme-header-hover, var(--theme-primary, #5269DC)) !important;
        background-color: var(--theme-background, #F5F7FB) !important;
    }

    /* دکمه باز کردن زیرمنوی تو در تو */
    html body .site-header .public-menu .public-menu-submenu .public-menu-toggle {
        color: var(--theme-text, #263247) !important;
        background-color: transparent !important;
    }

    /* جلوگیری از نمایش ناخواسته زیرمنوی بسته */
    html body .site-header .public-menu .public-menu-submenu[hidden] {
        display: none !important;
    }


.blog-breadcrumb .breadcrumb-item.active {
    color: var(--bs-body-color);
    opacity: 1;
}