/* ===== ۱. متغیرهای قالب ===== */
:root {
  --cassiopeia-font-family-body: 'Vazirmatn', Tahoma, Arial, sans-serif;
  --cassiopeia-font-family-headings: 'Vazirmatn', Tahoma, Arial, sans-serif;
  --cassiopeia-color-primary: #1a5276;
  --cassiopeia-color-hover: #154360;
}

/* ===== ۲. تنظیمات پایه و راست‌چین ===== */
html, body {
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  direction: rtl;
  font-family: var(--cassiopeia-font-family-body);
  font-size: 14px;
  line-height: 1.6;
  background: linear-gradient(160deg, #87CEEB, #B0E0FF) !important;
}

/* ===== ۳. تیترها ===== */
h3, .h3 {
  font-size: 1.25rem !important;
}

/* ===== ۴. جستجوی هوشمند ===== */
.js-finder-search-query, 
div.awesomplete > input#mod-finder-searchword209 {
  transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out !important;
}

/* ===== ۵. منوی اصلی (ریسپانسیو پایه) ===== */
@media (max-width: 991.98px) {
  .navigation .mod-menu__heading, 
  .navigation .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.navbar-nav .nav-link {
  font-family: var(--cassiopeia-font-family-body);
}

/* ===== ۶. ستون کناری ===== */
.sidebar-right {
  border-right: none;
  border-left: 1px solid #dee2e6;
  padding-left: 15px;
}

/* ===== ۷. کارت‌های تگ ===== */
.custom-tag-card {
  transition: transform 0.25s;
  background: #ffffff;
}

.custom-tag-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.img-hover-zoom {
  transition: transform 0.5s ease;
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  contain: paint;
}

.custom-tag-card:hover .img-hover-zoom {
  transform: scale(1.08);
}

.hover-primary-color {
  transition: color 0.2s ease-in-out;
}

.custom-tag-card:hover .hover-primary-color {
  color: var(--cassiopeia-color-primary, #0d6efd) !important;
}

.custom-tag-card .btn-outline-primary {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.custom-tag-card:hover .btn-outline-primary {
  background-color: var(--cassiopeia-color-primary, #0d6efd);
  color: #fff;
}

/* ===== ۸. منوی عمودی hajj-vmenu ===== */
ul.hajj-vmenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.hajj-vmenu a {
    display: block;
    cursor: pointer;
    position: relative;
    z-index: 1;
    text-decoration: none !important;
}

ul.hajj-vmenu > li {
    margin-bottom: 6px;
    min-height: 40px;
}

ul.hajj-vmenu > li > a {
    background: rgba(20, 35, 70, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 0 15px;
    margin: 0 auto;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff !important;
    height: 34px;
    min-height: 34px;
    line-height: 34px;
    border-radius: 12px;
    text-align: center;
    transition: background 0.3s, box-shadow 0.3s;
    display: block;
}

ul.hajj-vmenu > li > a:hover {
    background: rgba(15, 25, 55, 0.95);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff !important;
    box-shadow: 0 6px 18px rgba(0, 160, 255, 0.5);
    transform: translateY(-2px);
}

/* =============================================
   منوی اصلی (هدر)
   ============================================= */

.header,
.container-header,
.navbar {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.container-header .container,
.container-header .container-fluid,
header .container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

/* حالت دسکتاپ – ارتفاع ثابت */
.container-header,
.navbar {
    background: rgba(20, 35, 70, 0.92) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    border-radius: 0 0 22px 22px;
    height: 72px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-wrap: nowrap;
}

.navbar-nav,
.container-header .mod-menu {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    gap: 0.6rem;
    list-style: none;
    margin: 0 !important;
    padding: 0.5rem 0;
    white-space: nowrap;
    float: none !important;
    height: 72px;
}

.navbar-nav > li,
.container-header .mod-menu > li {
    float: none !important;
    display: flex;
    align-items: center;
    height: 72px;
}

.container-header .mod-menu > li > a,
.container-header .mod-menu > li > span,
.navbar-nav .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.6rem 1.6rem;
    color: #ffffff !important;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.03em;
    text-decoration: none !important;
    border-radius: 14px;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
    background: transparent;
    border: 1px solid transparent;
    white-space: nowrap;
}

.container-header .mod-menu > li.active > a,
.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
    box-shadow: 0 4px 18px rgba(0, 160, 255, 0.3);
}

.container-header .mod-menu > li > a:hover,
.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 22px rgba(0, 160, 255, 0.45);
    transform: translateY(-2px);
    color: #ffffff !important;
}

.container-header .mod-menu > li > a::after,
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 5px;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #00b4ff, #0091ff);
    border-radius: 3px;
    transition: width 0.35s ease;
    transform: translateX(-50%);
    pointer-events: none;
}

.container-header .mod-menu > li > a:hover::after,
.navbar-nav .nav-link:hover::after {
    width: calc(100% - 1.8rem);
}

.navbar-toggler {
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 12px;
    padding: 0.4rem 0.7rem;
    background: rgba(255,255,255,0.1);
    z-index: 15;
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}
.navbar-toggler-icon {
    filter: invert(1);
}

/* موبایل – رفع مشکل نصف دیده شدن منو */
@media (max-width: 991.98px) {
    /* اجازه به هدر برای افزایش ارتفاع هنگام باز شدن منو */
    .container-header,
    .navbar {
        height: auto;
        min-height: 72px;
    }

    .navbar-toggler {
        position: absolute;
        left: 1rem;
        top: 1rem;
        transform: none;
        margin: 0;
    }

    .navbar-nav,
    .container-header .mod-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 1.5rem 0.8rem !important;
        background: rgba(20, 35, 70, 0.95);
        border-radius: 20px;
        margin: 4rem auto 1rem auto !important;
        width: 90%;
        white-space: normal;
        justify-content: flex-start;
        height: auto;                /* ارتفاع خودکار برای نمایش کامل آیتم‌ها */
    }

    .container-header .mod-menu > li > a,
    .navbar-nav .nav-link {
        border: 1px solid rgba(255,255,255,0.2);
        margin-bottom: 6px;
        text-align: center;
        white-space: normal;
        height: auto;
        min-height: 44px;
    }

    .navbar-nav > li,
    .container-header .mod-menu > li {
        height: auto;                /* تطابق با والد */
    }

    .container-header .mod-menu > li > a::after {
        display: none;
    }
}

/* ===== ۹. ماژول‌های عمومی ===== */
.card,
.moduletable,
.module,
[class*="moduletable"],
.sidebar-right .moduletable,
.sidebar-left .moduletable {
    border-radius: 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.25s;
}

.card:hover,
.moduletable:hover,
[class*="moduletable"]:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.moduletable h3,
.card-header,
.module h3 {
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    min-height: 2rem;
}

/* =============================================
   Container‌های اصلی صفحه
   ============================================= */

div.grid-child.container-component {
    min-height: 400px;
    position: relative;
}

div.grid-child.container-bottom-b {
    min-height: 250px;
    position: relative;
}

div.main-top.card {
    min-height: 320px;
}

div.bottom-b.card {
    min-height: 250px;
}

div.bottom-b.card.haj-vmenu {
    min-height: 280px;
    width: 100%;
    box-sizing: border-box;
}

/* =============================================
   فوتر
   ============================================= */
.footer {
    background: rgba(20, 35, 70, 0.92) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    border-radius: 28px 28px 0 0;
    margin-top: 2em;
    padding: 2rem 1.5rem 1.5rem;
    color: #ffffff !important;
    background-image: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box;
}

.footer > .container,
.footer > .container-fluid {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    text-align: center !important;
}

.footer * {
    text-align: center !important;
    float: none !important;
}

.footer .moduletable {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    display: block;
    min-height: unset;
}

.footer p {
    font-size: 0.95rem;
    line-height: 1.9;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    min-height: 1.9em;
}

.footer a {
    color: #80d0ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer a:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0, 160, 255, 0.7);
}

.footer strong {
    color: #ffd966 !important;
}

.footer img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    vertical-align: middle;
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.footer img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(0, 160, 255, 0.6);
}

.footer a[href^="tel:"] {
    direction: ltr;
    display: inline-block;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

@media (max-width: 991.98px) {
    .footer {
        padding: 1.5rem 1rem;
        border-radius: 22px 22px 0 0;
    }
    .footer p {
        font-size: 0.9rem;
    }
}

/* =============================================
   صفحه‌بندی
   ============================================= */

.pagination,
.pagination__list {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 1.5rem;
    min-height: 60px;
}

.page-item {
    margin: 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #ffffff !important;
    text-decoration: none !important;
    background: rgba(20, 35, 70, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.page-link [class*="icon-"],
.page-link .fa,
.page-link svg {
    fill: currentColor;
    width: 1rem;
    height: 1rem;
}

.page-link:hover,
.page-link:focus {
    background: rgba(0, 80, 160, 0.85);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 20px rgba(0, 160, 255, 0.5);
    transform: translateY(-3px);
    color: #ffffff !important;
}

.active > .page-link,
.page-item.active .page-link {
    background: rgba(0, 140, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 18px rgba(0, 160, 255, 0.6);
    font-weight: 600;
}

.disabled > .page-link,
.page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
    background: rgba(20, 35, 70, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    transform: none;
}

.pagination .page-link .sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

@media (max-width: 576px) {
    .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
        border-radius: 10px;
    }
    .pagination {
        gap: 0.3rem;
        min-height: 50px;
    }
}

/* =============================================
   تایپوگرافی عمومی
   ============================================= */
.com-content, .blog, .blog-featured, .category-list,
.category-blog, .item-page, .article, .contentpane,
.main-content, #content, #system-message, .component,
.com-contact, .com-users, .com-search, .com-tags,
.com-finder {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

p, span, div, a, li, td, th, h1, h2, h3, h4, h5, h6,
input, textarea, select, button, label, blockquote, pre, code {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

.navbar-nav .nav-link, .moduletable, .module, .card,
.card-body, .list-group-item, .breadcrumb, .page-header,
.article-info, .article-intro, .article-full, .tags,
.tagspopular, .categories-module, .latestnews, .mostread,
.relateditems, .weblinks, .newsflash, .syndicate, .stats,
.archive, .mod-articles-category, .mod-articles-latest,
.mod-articles-news, .mod-articles-popular, .mod-tags-popular,
.mod-tags-similar, .mod-related-items, .finder,
.search-results, .pagination, .form-control, .btn,
.alert, .badge {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

.editor-content, .wf-editor, .jce-editor, .ck-editor__editable {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

/* =============================================
   گالری کارگزاری‌ها
   ============================================= */

.hajj-agents-gallery {
    text-align: center;
    margin: 2rem auto;
    max-width: 1300px;
    padding: 0 1rem;
    min-height: 200px;
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
}

.gallery-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cassiopeia-color-primary);
    margin-bottom: 1.8rem;
    position: relative;
    display: inline-block;
    line-height: 1.4;
    min-height: 2rem;
}

.gallery-title::after {
    content: '';
    display: block;
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--cassiopeia-color-primary), #00b4ff);
    margin: 0.6rem auto 0;
    border-radius: 3px;
}

.gallery-wrapper {
    display: inline-block;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255,255,255,0.6);
    border-radius: 24px;
    padding: 1.5rem;
    margin: 0 auto;
    transition: box-shadow 0.3s ease;
    contain: paint;
}

.gallery-grid-cards {
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 1.5rem;
    justify-content: center;
    align-items: start;
}

.agent-card {
    display: block;
    width: fit-content;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.4);
    transition: transform 0.25s;
    text-decoration: none !important;
}

.agent-card:hover {
    transform: translate3d(0, -6px, 0);
}

/* اندازه کادر متناسب با ابعاد واقعی عکس (بدون نسبت ثابت) */
.agent-card img {
    display: block;
    max-width: 100%;
    height: auto;
}

@media (max-width: 991.98px) {
    .gallery-grid-cards {
        grid-template-columns: repeat(2, auto);
        gap: 1.2rem;
    }
    .gallery-wrapper {
        padding: 1rem;
        border-radius: 20px;
    }
}

@media (max-width: 576px) {
    .gallery-grid-cards {
        grid-template-columns: auto;
        gap: 1rem;
    }
    .gallery-wrapper {
        width: 100%;
        padding: 0.8rem;
        border-radius: 16px;
    }
}

/* =============================================
   فرم RSForm
   ============================================= */

form#userForm {
    background: rgba(255, 255, 255, 0.75) !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 18px !important;
    padding: 2rem !important;
    margin: 1.5rem auto !important;
    max-width: 800px;
    box-sizing: border-box;
    min-height: 420px;
}

form#userForm:hover {
    box-shadow:
        0 12px 36px rgba(0, 160, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.82) !important;
}

@media (max-width: 768px) {
    form#userForm {
        padding: 1.2rem !important;
        border-radius: 14px !important;
        margin: 1rem 0.5rem !important;
        max-width: 100% !important;
    }

    form#userForm .rsform-input-box,
    form#userForm .rsform-text-box,
    form#userForm .rsform-select-box,
    form#userForm .rsform-captcha-box,
    form#userForm input[type="text"],
    form#userForm textarea,
    form#userForm select {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        font-size: 16px;
    }
}

/* =============================================
   تصاویر مقالات – نسبت ثابت 16:9
   ============================================= */
.item-page img,
.com-content img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
}