﻿/* ================================================
   Minimal refinements - loaded after Mycss.css
   ================================================ */

:root {
    --back: #fafafa;
    --head: #f2f2f2;
    --text: #0f0f0f;
    --muted: #6b6b6b;
    --hover: #1a1a1a;
    --border: #e6e6e6;
    --surface: #ffffff;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,.08);
    --shadow-lg: 0 20px 50px rgba(0,0,0,.12);
    --font-body: 'Vazir', 'Peyda', 'Yekan', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Peyda', 'Vazir', system-ui, sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background: var(--back);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.5rem, 3vw + .6rem, 2.6rem);
}

h2 {
    font-size: clamp(1.25rem, 2.5vw + .5rem, 2rem);
}

h3 {
    font-size: clamp(1.05rem, 1.5vw + .4rem, 1.4rem);
}

a {
    text-decoration: none;
    transition: color .2s;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============ HEADER ============ */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    padding: 10px 0;
    transition: background .3s, padding .3s, border-color .3s;
    background: rgba(255,255,255,.9);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

/* Home page (has .banner): transparent until scrolled */
body:has(.banner) .site-header:not(.sticky) {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom-color: transparent;
}

.site-header.sticky {
    padding: 6px 0 !important;
    height: auto !important;
    background: rgba(255,255,255,.92);
    border-bottom-color: var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 52px;
}

.site-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

    .site-logo img {
        width: 44px;
        height: 44px;
        object-fit: contain;
        transition: width .3s, height .3s;
    }

.site-header.sticky .site-logo img {
    width: 36px;
    height: 36px;
}

.desktop-nav {
    display: none;
    flex: 1;
    justify-content: center;
}

@media (min-width: 992px) {
    .desktop-nav {
        display: flex;
    }
}

.header-end {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
}

/* ============ MENU ============ */
.custom-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    padding: 0;
    margin: 0;
    list-style: none;
    position: static;
}

    .custom-menu > li {
        position: relative;
        padding: 0;
    }

        .custom-menu > li > a {
            display: inline-block;
            color: var(--text);
            font-family: var(--font-body);
            font-size: 14.5px;
            font-weight: 500;
            padding: 8px 14px;
            border-radius: 999px;
            line-height: 1.4;
            transition: background .2s, color .2s;
        }

/* Transparent (home) header: white text */
body:has(.banner) .site-header:not(.sticky) .custom-menu > li > a {
    color: #fff;
}

/* Hover */
.site-header .custom-menu > li:hover > a,
.site-header .custom-menu > li > a:hover {
    color: var(--text);
    background: var(--head);
    padding: 8px 14px;
}

body:has(.banner) .site-header:not(.sticky) .custom-menu > li:hover > a,
body:has(.banner) .site-header:not(.sticky) .custom-menu > li > a:hover {
    color: #fff;
    background: rgba(255,255,255,.18);
}

/* Arrow icons */
.custom-menu i {
    font-size: 10px;
    opacity: .6;
    margin-inline-start: 6px;
    vertical-align: middle;
}

/* Dropdowns */
.custom-menu > li > .sub-menu,
.custom-menu > li > .sub-menu li .nested-sub-menu {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s, visibility .18s, transform .18s;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 180px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    z-index: 20;
    top: calc(100% + 8px);
    line-height: 1.5;
    width: max-content;
}

.custom-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
}

.custom-menu > li > .sub-menu a,
.custom-menu > li > .sub-menu li .nested-sub-menu a {
    display: block;
    color: var(--text) !important;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    background: transparent !important;
    padding: 9px 14px !important;
}

    .custom-menu > li > .sub-menu a:hover,
    .custom-menu > li > .sub-menu li .nested-sub-menu a:hover {
        background: var(--head) !important;
        color: var(--text) !important;
    }

.custom-menu > li > .sub-menu > li {
    position: relative;
    padding: 0;
}

    .custom-menu > li > .sub-menu > li > .nested-sub-menu {
        top: 0;
        right: 100%;
        margin-inline-end: 6px;
        margin-top: 0;
    }

    .custom-menu > li > .sub-menu > li:hover > .nested-sub-menu {
        opacity: 1;
        visibility: visible;
    }

/* ============ AUTH PANEL ============ */
.panel {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 0;
    font-family: var(--font-body);
    font-size: 14px;
    text-align: start;
}

@media (min-width: 992px) {
    .panel {
        display: flex;
    }
}

.panel a, .panel button {
    color: var(--text);
    background: transparent;
    border: none;
    padding: 8px 14px !important;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, color .2s;
    margin: 0 !important;
}

body:has(.banner) .site-header:not(.sticky) .panel a,
body:has(.banner) .site-header:not(.sticky) .panel button {
    color: #fff;
}

.panel a:hover, .panel button:hover {
    background: var(--head) !important;
    color: var(--text) !important;
}

body:has(.banner) .site-header:not(.sticky) .panel a:hover,
body:has(.banner) .site-header:not(.sticky) .panel button:hover {
    background: rgba(255,255,255,.18) !important;
    color: #fff !important;
}

/* ============ BURGER ============ */
.burger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: 12px;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: background .2s, color .2s;
}

body:has(.banner) .site-header:not(.sticky) .burger-btn {
    color: #fff;
}

.burger-btn:hover {
    background: var(--head);
}

body:has(.banner) .site-header:not(.sticky) .burger-btn:hover {
    background: rgba(255,255,255,.18);
    color: #fff;
}

@media (min-width: 992px) {
    .burger-btn {
        display: none;
    }
}

/* ============ OFFCANVAS ============ */
.offcanvas {
    max-width: 88vw !important;
    width: 340px !important;
    border: none !important;
}

.offcanvas-header {
    padding: 14px 20px !important;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto !important;
}

.offcanvas-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.offcanvas-body,
.offcanvas-body.responsive-menu_list-body {
    background: var(--surface);
    padding: 12px 16px !important;
    height: calc(100% - 62px) !important;
    overflow-y: auto;
}

    .offcanvas-body > ul {
        padding: 0;
        margin: 0;
        list-style: none;
    }

        .offcanvas-body > ul > li {
            border-bottom: 1px solid var(--border);
            padding: 8px 0 !important;
            margin: 0 !important;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            font-size: 15px !important;
        }

            .offcanvas-body > ul > li:last-child {
                border-bottom: none;
            }

    .offcanvas-body a {
        color: var(--text);
        font-family: var(--font-body);
        font-size: 15px;
        font-weight: 500;
        margin: 0 !important;
        padding: 8px 6px !important;
        border-radius: 8px;
        flex: 1;
        display: inline-block;
    }

        .offcanvas-body a:hover {
            background: var(--head);
            color: var(--text);
        }

    .offcanvas-body i {
        font-size: 12px;
        color: var(--muted);
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        cursor: pointer;
        transition: background .2s, transform .3s;
        float: none !important;
        margin: 0 !important;
    }

        .offcanvas-body i:hover {
            background: var(--head);
        }

        .offcanvas-body i.rotate {
            transform: rotate(180deg);
        }

    .offcanvas-body ul li ul {
        width: 100%;
        background: var(--back);
        border-radius: var(--radius-sm);
        padding: 0 12px !important;
        margin: 0 !important;
        height: 0;
        overflow: hidden;
        opacity: 0;
        transition: height .3s, opacity .3s, margin .3s;
    }

        .offcanvas-body ul li ul.show {
            height: auto;
            opacity: 1;
            margin-top: 6px !important;
            padding: 8px 12px !important;
        }

        .offcanvas-body ul li ul li {
            padding: 8px 0 !important;
            margin: 0 !important;
            font-size: 14px !important;
            border-bottom: 1px solid rgba(0,0,0,.04);
        }

            .offcanvas-body ul li ul li:last-child {
                border-bottom: none;
            }

.mobile-auth {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ============ MAIN ============ */
.site-main {
    min-height: 80vh;
}

/* ============ SECTIONS ============ */
section {
    padding: 56px 0;
}

@media (max-width: 768px) {
    section {
        padding: 32px 0;
    }
}

section h1.text-center {
    position: relative;
    font-weight: 700;
}

    section h1.text-center::after {
        content: '';
        display: block;
        width: 44px;
        height: 3px;
        background: var(--text);
        border-radius: 3px;
        margin: 14px auto 0;
    }

.khat {
    border: none;
    border-top: 1px solid var(--border);
    width: 80px;
    margin: 40px auto;
    opacity: .7;
}

/* ============ HERO ============ */
.banner {
    height: 100vh;
    height: 100dvh; /* روی موبایل بهتره، آدرس‌بار رو حساب می‌کنه */
    max-height: 900px;
    position: relative;
    display: flex;
    align-items: center; /* ← عمودی وسط‌چین */
    justify-content: center; /* ← افقی وسط‌چین */
    padding-bottom: 110px; /* ← فاصله از موج پایین */
}

    .banner > .container {
        width: 100%;
    }

@media (max-width: 992px) {
    .banner {
        height: 72vh;
        height: 72dvh;
        min-height: 480px;
        max-height: none;
        padding-bottom: 80px;
    }
}
#text-container {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 24px;
    width: 100%;
}

    #text-container > div:first-child img,
    .banner img {
        width: 220px !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

@media (max-width: 576px) {
    .banner img,
    #text-container > div:first-child img {
        width: 140px !important;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .banner img,
    #text-container > div:first-child img {
        width: 170px !important;
    }
}

#text-container h3 {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
    text-align: center;
    font-family: var(--font-body);
    font-weight: 500;
    color: #fff;
    opacity: .95;
}

.divider svg {
    display: block;
}

/* ============ STATS ============ */
.record {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: 24px auto;
    padding: 24px 12px !important;
    box-shadow: var(--shadow-sm);
}

    .record h3 {
        font-weight: 700;
        margin: 0;
        padding: 0 !important;
        font-size: clamp(1.6rem, 4vw, 2.4rem);
        color: var(--text);
        font-family: var(--font-display);
    }

    .record p {
        margin: 0;
        padding: 4px 0 0 !important;
        font-size: 13px;
        color: var(--muted);
        font-family: var(--font-body);
    }

/* ============ CARDS ============ */
.card.projectItem {
    position: relative;
/*    width: 100% !important;
    height: auto !important;*/
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: var(--head);
    transition: transform .3s, box-shadow .3s;
    font-family: var(--font-body);
    cursor: pointer;
}

    .card.projectItem:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }

    .card.projectItem img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .5s;
        display: block;
    }

    .card.projectItem:hover img {
        transform: scale(1.06);
    }

    .card.projectItem .content {
        position: absolute;
        inset: auto 0 0 0;
        padding: 14px;
        background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
        color: #fff;
        bottom: -100%;
        transition: bottom .3s;
    }

        .card.projectItem .content h3 {
            font-size: 14px;
            font-weight: 500;
            margin: 0;
            color: #fff;
            text-align: center;
            font-family: var(--font-body);
        }

    .card.projectItem:hover .content {
        bottom: 0;
    }

/* Always show title on touch / small screens */
@media (hover: none), (max-width: 991px) {
    .card.projectItem .content {
        bottom: 0;
    }
}

/* ============ PROJECT SLIDER ============ */
.ProjectSlider {
    background: var(--surface) !important;
    border: 1px solid var(--border);
    padding: 24px !important;
    border-radius: var(--radius-lg) !important;
    margin-top: 24px;
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .ProjectSlider {
        padding: 12px !important;
        border-radius: var(--radius-md) !important;
    }

    #carousel > div:not(.moshahede) {
        flex-shrink: 0;
        padding: 0 6px;
    }

}

.ProjectSlider button {
    width: 38px !important;
    height: 38px !important;
    border: 1px solid var(--border) !important;
    background: #fff !important;
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 6px !important;
    transition: background .2s;
}

    .ProjectSlider button:hover {
        background: var(--text) !important;
    }

        .ProjectSlider button:hover i {
            color: #fff !important;
        }

.ProjectSlider i {
    font-size: 11px;
    color: var(--text) !important;
}

#carousel {
    gap: 12px;
    padding: 6px 2px;
}

.moshahede {
    box-shadow: none !important;
    border: 1px dashed var(--border) !important;
    background: var(--back) !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .moshahede .seeAll {
        margin: 0 !important;
        padding: 24px;
        font-weight: 600;
    }

/* ============ BRANDS ============ */
.Hamkaries .row {
    justify-content: center;
}

.Brands {
    width: 25% !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
}

@media (min-width: 576px) {
    .Brands {
        width: 20% !important;
    }
}

@media (min-width: 768px) {
    .Brands {
        width: 16.66% !important;
    }
}

@media (min-width: 1200px) {
    .Brands {
        width: 11% !important;
    }
}

.Brands img {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain;
    filter: grayscale(.1);
    opacity: .55;
    transition: filter .25s, opacity .25s, transform .25s;
    margin: 8px 0 !important;
}

    .Brands img:hover {
        filter: grayscale(0);
        opacity: 1;
        transform: scale(1.06);
    }

/* ============ CONTACT ============ */
.contect {
    margin-top: 0;
}

    .contect .icons {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }

        .contect .icons a {
            width: 52px;
            height: 52px;
            border-radius: 16px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: var(--surface);
            border: 1px solid var(--border);
            transition: transform .2s, background .2s;
            box-shadow: var(--shadow-sm);
        }

            .contect .icons a:hover {
                transform: translateY(-3px);
                background: var(--head);
            }

        .contect .icons i {
            font-size: 20px;
            margin: 0;
            color: var(--text);
        }

    .contect .info {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 999px;
        font-size: 14px !important;
        color: var(--text);
        margin: 4px 0;
        transition: background .2s, transform .2s;
    }

        .contect .info:hover {
            background: var(--head);
            transform: translateY(-1px);
        }

/* ============ FORMS ============ */
.form-control {
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 14.5px;
    background: var(--surface);
    color: var(--text);
    transition: border-color .2s, box-shadow .2s;
    box-shadow: none;
}

    .form-control:focus {
        border-color: var(--text);
        box-shadow: 0 0 0 3px rgba(0,0,0,.06);
        background: var(--surface);
    }

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.btn {
    border-radius: 999px;
    padding: 10px 26px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 14.5px;
    transition: all .2s;
}

.btn-outline-secondary {
    border-color: var(--text);
    color: var(--text);
}

    .btn-outline-secondary:hover {
        background: var(--text);
        color: #fff;
        border-color: var(--text);
    }

/* ============ FOOTER ============ */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 56px;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 32px 0 16px;
        margin-top: 32px;
    }
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--muted);
}

    .site-footer li i {
        width: 20px;
        color: var(--muted);
        font-size: 13px;
    }

    .site-footer li a {
        color: var(--muted);
        font-family: var(--font-body);
    }

        .site-footer li a:hover {
            color: var(--text);
        }

.tozih {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    border-right: none !important;
    border-left: none !important;
    padding: 16px 0;
    text-align: center;
    margin-bottom: 0 !important;
}

    .tozih h2 {
        font-family: var(--font-display);
        font-size: 1.4rem;
        margin: 0 0 12px;
        font-weight: 700;
    }

    .tozih h5 {
        font-family: var(--font-body) !important;
        font-weight: 400 !important;
        color: var(--muted) !important;
        font-size: 14px !important;
        line-height: 1.9 !important;
        margin: 0;
        padding: 0 !important;
    }

.logoF {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
}

    .logoF img {
        width: 72px;
        margin-bottom: 12px;
        border: none !important;
    }

    .logoF h6 {
        font-family: var(--font-body) !important;
        font-size: 13px !important;
        color: var(--muted) !important;
        line-height: 1.8 !important;
        margin: 0 !important;
        font-weight: 400;
    }

/* ============ TAGS ============ */
.custom-tag {
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    background: var(--head) !important;
    color: var(--text) !important;
    border: none !important;
    transition: background .2s, transform .2s, color .2s;
    margin: 2px;
}

    .custom-tag:hover {
        background: var(--text) !important;
        color: #fff !important;
        transform: translateY(-1px);
        font-size: 13px !important;
    }

/* ============ LOADING ============ */
.loading-overlay {
    background: rgba(250,250,250,.85);
}

/* ============ RESPONSIVE TUNING ============ */
@media (max-width: 576px) {
    .header-inner {
        gap: 12px;
    }

    .site-logo img {
        width: 40px;
        height: 40px;
    }

    .site-header.sticky .site-logo img {
        width: 34px;
        height: 34px;
    }

    #text-container h3 {
        font-size: 1rem;
    }
}

/* Prevent iOS zoom on focus */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 991px) {
    .header-inner {
        flex-direction: row-reverse; /* ترتیب رو برعکس می‌کنه: لوگو چپ، برگر راست */
        justify-content: space-between;
        gap: 12px;
    }

    .header-end {
        margin-inline-start: 0 !important;
    }
}
.form-control.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, .12) !important;
    background-image: none !important;
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 13px;
    margin-top: 4px;
}
/* ==================================================
   DARK MODE
   ================================================== */
[data-theme="dark"] {
    --back: #22252b; /* پس‌زمینه اصلی: خاکستری تیره با کمی آبی */
    --head: #2b2f37; /* سطوح بالاتر (کارت، هدر) */
    --surface: #2b2f37; /* سطح کارت‌ها و مدال */
    --text: #ecedf0; /* متن اصلی */
    --muted: #a0a4ad; /* متن کم‌رنگ */
    --hover: #f0f1f4; /* متن هاور */
    --border: #3a3e47; /* خطوط و مرزها */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.25);
    --shadow-md: 0 8px 24px rgba(0,0,0,.35);
    --shadow-lg: 0 20px 50px rgba(0,0,0,.5);
}

/* ترنزیشن نرم فقط بعد از رندر اولیه */
html.theme-ready,
html.theme-ready body,
html.theme-ready .site-header,
html.theme-ready .site-footer,
html.theme-ready .card.projectItem,
html.theme-ready .form-control,
html.theme-ready .record,
html.theme-ready .ProjectSlider,
html.theme-ready .contect .icons a,
html.theme-ready .contect .info,
html.theme-ready .panel a,
html.theme-ready .panel button {
    transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}

/* ---------- Header ---------- */
[data-theme="dark"] .site-header {
    background: rgba(34,37,43,.88);
    border-bottom-color: var(--border);
}

    [data-theme="dark"] .site-header.sticky {
        background: rgba(34,37,43,.92);
    }

body:has(.banner) [data-theme="dark"] .site-header:not(.sticky) {
    background: transparent;
    border-bottom-color: transparent;
}

/* ---------- Offcanvas ---------- */
[data-theme="dark"] .offcanvas-header,
[data-theme="dark"] .offcanvas-body {
    background: var(--surface) !important;
    border-color: var(--border);
}

    [data-theme="dark"] .offcanvas-body ul li ul {
        background: var(--head);
    }

/* ---------- Divider wave (SVG inline) ---------- */


/* ---------- Loading ---------- */
[data-theme="dark"] .loading-overlay {
    background: rgba(34,37,43,.82);
}
/* ---------- Card overlay ---------- */
[data-theme="dark"] .card.projectItem .content {
    background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
}

/* ---------- Project slider arrows ---------- */
[data-theme="dark"] .ProjectSlider button {
    background: var(--surface) !important;
    border-color: var(--border) !important;
}

    [data-theme="dark"] .ProjectSlider button:hover {
        background: var(--text) !important;
    }

/* ---------- Tags ---------- */
[data-theme="dark"] .custom-tag {
    background: var(--head) !important;
    color: var(--text) !important;
}

    [data-theme="dark"] .custom-tag:hover {
        background: var(--text) !important;
        color: var(--back) !important;
    }

/* ---------- Form controls ---------- */

[data-theme="dark"] .form-control {
    background-color: #343842 !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}
    [data-theme="dark"] .form-control::placeholder {
        color: var(--muted);
    }


    [data-theme="dark"] .form-control:focus {
        background-color: #343842 !important;
        border-color: var(--text) !important;
        box-shadow: 0 0 0 3px rgba(255,255,255,.08) !important;
    }
/* ---------- Buttons ---------- */
[data-theme="dark"] .btn-outline-secondary {
    border-color: var(--text);
    color: var(--text);
}

    [data-theme="dark"] .btn-outline-secondary:hover {
        background: var(--text);
        color: var(--back);
        border-color: var(--text);
    }

/* ---------- Alerts ---------- */
[data-theme="dark"] .alert-success {
    background: #143019;
    color: #8ae8a5;
    border-color: #1f4d29;
}

[data-theme="dark"] .alert-danger {
    background: #2e1414;
    color: #f0a4a4;
    border-color: #4d2020;
}

/* ---------- Bootstrap modal ---------- */
[data-theme="dark"] .modal-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: var(--border);
}

[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1);
}

/* ---------- Footer ---------- */
[data-theme="dark"] .site-footer {
    background: var(--surface);
    border-top-color: var(--border);
}

/* ---------- Banner: overlay ملایم در دارک‌مود ---------- */
[data-theme="dark"] .banner {
    position: relative;
}

    [data-theme="dark"] .banner::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient( 180deg, rgba(20,22,26,.42) 0%, rgba(20,22,26,.12) 45%, rgba(20,22,26,.42) 100% );
        z-index: 0;
        pointer-events: none;
    }

    [data-theme="dark"] .banner > .container {
        position: relative;
        z-index: 1;
    }

    [data-theme="dark"] .banner > .divider {
        z-index: 2;
    }

/* ---------- Theme toggle button ---------- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 999px;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    flex-shrink: 0;
}

    .theme-toggle:hover {
        background: var(--head);
    }

body:has(.banner) .site-header:not(.sticky) .theme-toggle {
    border-color: rgba(255,255,255,.3);
    color: #fff;
}

    body:has(.banner) .site-header:not(.sticky) .theme-toggle:hover {
        background: rgba(255,255,255,.18);
    }
.divider svg path {
    fill: var(--back);
    transition: fill .35s ease;
}

/* ==================================================
   HEADER – subtle micro-interactions
   ================================================== */

/* ---------- Sticky: سایه‌ی نرم + ترنزیشن یکدست ---------- */
.site-header {
    transition: background .35s ease, padding .35s ease, border-color .35s ease, box-shadow .35s ease;
}

    .site-header.sticky {
        box-shadow: 0 2px 14px rgba(0, 0, 0, .05);
    }

[data-theme="dark"] .site-header.sticky {
    box-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}

/* ---------- لوگو: بزرگ‌نمایی ظریف روی هاور ---------- */
.site-logo img {
    transition: transform .3s ease, width .3s, height .3s;
}

.site-logo:hover img {
    transform: scale(1.06);
}

/* ---------- آیتم‌های منو: بالا آمدن ۱ پیکسلی روی هاور ---------- */
.custom-menu > li > a {
    transition: background .2s ease, color .2s ease, transform .2s ease;
    will-change: transform;
}

.custom-menu > li:hover > a {
    transform: translateY(-1px);
}

/* ---------- Dropdown: اسلاید نرم از بالا ---------- */
.custom-menu > li > .sub-menu,
.custom-menu > li > .sub-menu li .nested-sub-menu {
    transform: translateY(-6px);
    transition: opacity .2s ease, visibility .2s ease, transform .25s cubic-bezier(.22,.9,.32,1);
    will-change: transform, opacity;
}

.custom-menu > li:hover > .sub-menu {
    transform: translateY(0);
}

.custom-menu > li > .sub-menu > li:hover > .nested-sub-menu {
    transform: translateY(0);
}

/* ---------- دکمه‌ی تم: چرخش روی هاور/کلیک ---------- */
.theme-toggle i {
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
    display: inline-block;
}

.theme-toggle:hover i {
    transform: rotate(20deg);
}

.theme-toggle:active i {
    transform: rotate(180deg) scale(.92);
}

/* ---------- برگر: بزرگ‌نمایی ملایم + چرخش آیکون ---------- */
.burger-btn i {
    transition: transform .3s ease;
    display: inline-block;
}

.burger-btn:hover i {
    transform: scale(1.08);
}

/* ---------- دکمه‌های پنل ---------- */
.panel a,
.panel button {
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

    .panel a:hover,
    .panel button:hover {
        transform: translateY(-1px);
    }

/* ---------- آیتم‌های offcanvas: ورود پله‌ای ---------- */
@keyframes ocItemIn {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.offcanvas.show .offcanvas-body > ul > li {
    animation: ocItemIn .35s ease-out both;
}

    .offcanvas.show .offcanvas-body > ul > li:nth-child(1) {
        animation-delay: .05s;
    }

    .offcanvas.show .offcanvas-body > ul > li:nth-child(2) {
        animation-delay: .10s;
    }

    .offcanvas.show .offcanvas-body > ul > li:nth-child(3) {
        animation-delay: .15s;
    }

    .offcanvas.show .offcanvas-body > ul > li:nth-child(4) {
        animation-delay: .20s;
    }

    .offcanvas.show .offcanvas-body > ul > li:nth-child(5) {
        animation-delay: .25s;
    }

/* ---------- احترام به prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .site-header,
    .site-logo img,
    .custom-menu > li > a,
    .custom-menu > li > .sub-menu,
    .custom-menu > li > .sub-menu li .nested-sub-menu,
    .theme-toggle i,
    .burger-btn i,
    .panel a,
    .panel button {
        transition: none !important;
        animation: none !important;
    }

    .offcanvas.show .offcanvas-body > ul > li {
        animation: none !important;
    }
}
/* ==================================================
   Dropdown transparency on transparent header
   ================================================== */
body:has(.banner) .site-header:not(.sticky) .custom-menu > li > .sub-menu,
body:has(.banner) .site-header:not(.sticky) .custom-menu > li > .sub-menu li .nested-sub-menu {
    background: rgba(0, 0, 0, .35);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

    /* لینک‌های داخل زیرمنو در این حالت: متن سفید */
    body:has(.banner) .site-header:not(.sticky) .custom-menu > li > .sub-menu a,
    body:has(.banner) .site-header:not(.sticky) .custom-menu > li > .sub-menu li .nested-sub-menu a {
        color: #fff !important;
        background: transparent !important;
    }

        /* هاور داخل زیرمنو: سطح روشن‌تر */
        body:has(.banner) .site-header:not(.sticky) .custom-menu > li > .sub-menu a:hover,
        body:has(.banner) .site-header:not(.sticky) .custom-menu > li > .sub-menu li .nested-sub-menu a:hover {
            background: rgba(255, 255, 255, .15) !important;
            color: #fff !important;
        }

    /* آیکون‌های فلش داخل زیرمنو هم سفید */
    body:has(.banner) .site-header:not(.sticky) .custom-menu > li > .sub-menu i {
        color: #fff;
        opacity: .7;
    }


a.glightbox.card {
    text-decoration: none;
    color: inherit;
    display: block;
}
/* اگه لوگوی سایت تیره ست و توی دارک‌مود دیده نمی‌شه، این خط رو از کامنت خارج کن: */
/* [data-theme="dark"] .site-logo img { filter: brightness(0) invert(1); } */
/* ==================================================
   Skeleton Loading for Images
   ================================================== */
img.skeleton-img {
    background-color: var(--head);
    background-image: linear-gradient( 90deg, var(--head) 25%, var(--border) 50%, var(--head) 75% );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

    img.skeleton-img.loaded {
        animation: none;
        background-image: none;
        background-color: transparent !important; /* پاک کردن پس‌زمینه بعد از لود */
        opacity: 1;
    }

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}


.share-buttons .share-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border-color: var(--border);
    color: var(--muted);
    transition: all 0.2s ease;
}

    .share-buttons .share-btn:hover {
        background-color: var(--head);
        color: var(--text);
        border-color: var(--text);
        transform: translateY(-2px);
    }

[data-theme="dark"] .share-buttons .share-btn {
    border-color: var(--border);
    color: var(--text);
}

.carousel-caption h5 {
color : #fff
}
/* ==================================================
   About Section Image Styling (CSS Only)
   ================================================== */
.row.align-items-center > .col-md-6:first-child img {
    border-radius: 24px; /* گوشه‌های گرد */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08); /* سایه نرم */
    transition: transform 0.4s cubic-bezier(0.22, 0.9, 0.32, 1), box-shadow 0.4s ease;
    object-fit: cover;
    border: 1px solid var(--border); /* قاب ظریف */
}

/* افکت حرکت موس */
.row.align-items-center > .col-md-6:first-child img:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

/* سازگاری با دارک‌مود */
[data-theme="dark"] .row.align-items-center > .col-md-6:first-child img {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
[data-theme="dark"] .row.align-items-center > .col-md-6:first-child img:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}