* { box-sizing: border-box; }
body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    margin: 0;
    color: #1f2937;
    background: #f4f7fb;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== نوار بالای هدر ===== */
.topbar { background: #0d2d4e; color: #cbd5e1; font-size: 12px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.topbar-login { color: #cbd5e1; }
.topbar-login:hover { color: #fff; }

/* ===== هدر اصلی ===== */
.site-header { background: #1668b8; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.1); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: bold; font-size: 16px; color: #fff; white-space: nowrap; }
.logo-img { width: 50px; height: 50px; object-fit: contain; }

/* ===== منو ===== */
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav > a, .nav-item > a {
    display: block;
    padding: 10px 12px;
    color: #eaf2fc;
    font-size: 14px;
    border-radius: 6px;
    white-space: nowrap;
}
.main-nav > a:hover, .nav-item > a:hover { background: rgba(255,255,255,.15); color: #fff; }

.nav-item { position: relative; }
.nav-item .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    color: #1f2937;
    min-width: 220px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    padding: 8px 0;
    z-index: 50;
}
.nav-item:hover .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 18px; color: #1f2937; font-size: 13.5px; }
.dropdown a:hover { background: #f0f6fd; color: #1668b8; }

/* ===== جستجو ===== */
.site-search input {
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 20px;
    padding: 8px 16px;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    width: 180px;
}
.site-search input::placeholder { color: #dbe8fa; }

/* ===== محتوا ===== */
.page-main { padding-top: 24px; padding-bottom: 40px; min-height: 50vh; }

/* ===== ردیف بالای صفحه اصلی: شهردار (راست) + اسلایدر (چپ) ===== */
.hero-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: stretch;
}

.mayor-card {
    flex: 0 0 260px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
}
.mayor-photo-wrap { position: relative; width: 100%; overflow: hidden; border-radius: 14px; }
.mayor-photo-wrap img { width: 100%; height: auto; display: block; }

.mayor-caption {
    position: absolute;
    bottom: 16px;
    right: 0;
    max-width: 85%;
    background: rgba(13, 45, 78, .88);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px 0 0 10px;
    transform: translateX(115%);
    opacity: 0;
    transition: transform .55s ease, opacity .55s ease;
    transition-delay: 0s;
}
.mayor-photo-wrap:hover .mayor-caption {
    transform: translateX(0);
    opacity: 1;
    transition-delay: 1.4s;
}
.mayor-caption h3 { margin: 0; font-size: 15px; white-space: nowrap; }
.mayor-caption p { margin: 2px 0 0; font-size: 12px; opacity: .85; white-space: nowrap; }

.hero {
    background: linear-gradient(135deg, #1668b8, #0d3f73);
    color: #fff;
    padding: 46px 30px;
    text-align: center;
    border-radius: 14px;
    flex: 1;
}
.hero h1 { margin: 0 0 10px; font-size: 24px; }
.hero p { margin: 0; opacity: .9; }

/* ===== اسلایدر تصاویر ===== */
.hero-slider {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 380px;
    border-radius: 14px;
    overflow: hidden;
    background: #0d2d4e;
}
.hero-slider .slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
}
.hero-slider .slide.active { opacity: 1; pointer-events: auto; }
.hero-slider .slide a { display: block; width: 100%; height: 100%; }
.hero-slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-caption {
    position: absolute;
    right: 0; left: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
    padding: 40px 24px 18px;
}
.slide-caption span { color: #fff; font-size: 18px; font-weight: bold; }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.4);
    color: #fff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    z-index: 5;
}
.slider-arrow:hover { background: rgba(0,0,0,.65); }
.slider-arrow.prev { right: 14px; }
.slider-arrow.next { left: 14px; }

.slider-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.slider-dots .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.slider-dots .dot.active { background: #fff; }

@media (max-width: 800px) {
    .hero-row { flex-direction: column; }
    .mayor-card { flex: none; }
    .hero-slider { height: 220px; }
}

.news-section h2, h1 { margin-top: 20px; color: #0d2d4e; }

/* ===== بنر تبلیغاتی افقی ===== */
.banner-slider {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 30px;
    background: #eef2f7;
    line-height: 0;
}
.banner-slide { display: none; }
.banner-slide.active { display: block; }
.banner-slide a { display: block; }
.banner-slide img { width: 100%; height: auto; display: block; }
.banner-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.banner-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.25); cursor: pointer; }
.banner-dots .dot.active { background: #1668b8; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 20px 0; }
.news-card { background: #fff; border: 1px solid #e6ecf3; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: box-shadow .2s; }
.news-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.news-card img { width: 100%; height: 160px; object-fit: cover; }
.news-card h3, .news-card p { padding: 0 14px; }
.news-card h3 { margin-top: 12px; font-size: 15px; }
.news-card h3 a:hover { color: #1668b8; }
.news-card p { color: #6b7280; font-size: 13px; padding-bottom: 14px; }

.news-detail, .static-page { background: #fff; border-radius: 12px; padding: 24px 28px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.news-detail-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 10px; margin: 16px 0; cursor: zoom-in; }
.news-meta { color: #6b7280; font-size: 13px; }
.news-body, .page-body { line-height: 1.9; margin-top: 16px; }

.news-gallery { margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px; }
.news-gallery h3 { margin: 0 0 14px; font-size: 16px; color: #0d2d4e; }
.news-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.news-gallery-grid img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; cursor: zoom-in; transition: transform .15s; }
.news-gallery-grid img:hover { transform: scale(1.03); }

.pagination { display: flex; gap: 6px; margin: 20px 0; }
.pagination a { padding: 6px 12px; border: 1px solid #ddd; border-radius: 6px; background: #fff; }
.pagination a.active { background: #1668b8; color: #fff; border-color: #1668b8; }

.site-footer { background: #0d2d4e; color: #b9c6d6; padding: 24px 0; margin-top: 0; font-size: 13px; text-align: center; }
.site-footer a { color: #cbd5e1; }
.footer-credit { margin: 6px 0 0; font-size: 10.5px; color: rgba(185,198,214,.45); }

/* ===== سازمان‌های تابع / مراکز تحت پوشش ===== */
.org-section { background: #f4f7fb; padding: 40px 0 10px; }
.org-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; }
.org-tab {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid #dbe6f2; color: #1668b8;
    padding: 10px 22px; border-radius: 8px; font-family: inherit; font-size: 14px; cursor: pointer;
}
.org-tab.active { background: #e6f0fb; border-color: #1668b8; font-weight: bold; }
.org-tab-icon { font-size: 16px; }

.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 30px; }
.org-card {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border: 1px solid #e6ecf3; border-radius: 10px; padding: 16px 20px;
    color: #1f2937; font-size: 14px; font-weight: bold;
    transition: box-shadow .2s;
}
.org-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.org-card img { width: 38px; height: 38px; object-fit: contain; }
.org-empty { color: #9ca3af; font-size: 13px; }

/* ===== نوار اطلاعات (زیر سازمان‌ها، بالای فوتر) ===== */
.info-bar { background: #12314f; padding: 0; }
.info-bar-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.info-box { padding: 22px 16px; text-align: center; border-right: 1px solid rgba(255,255,255,.08); color: #fff; }
.info-box:last-child { border-right: none; }
.info-box h4 { margin: 0 0 8px; font-size: 14px; color: #a9c3de; font-weight: normal; }
.info-box p { margin: 0; font-size: 14px; word-break: break-word; }

@media (max-width: 700px) {
    .info-bar-grid { grid-template-columns: repeat(2, 1fr); }
    .info-box { border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
}

.error-404 { text-align: center; padding: 80px 0; }
.error-404 h1 { font-size: 60px; margin: 0; color: #1668b8; }

.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; font-family: inherit; text-decoration: none; }
.btn-primary { background: #1668b8; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #111827; }

/* ===== شهرداران سابق ===== */
.mayors-timeline { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.mayor-item { background: #f9fbfd; border: 1px solid #e6ecf3; border-radius: 12px; padding: 16px; text-align: center; }
.mayor-item img { width: 100%; height: 170px; object-fit: contain; background: #eef2f7; border-radius: 8px; margin-bottom: 10px; cursor: zoom-in; }
.mayor-item-noimg { width: 100%; height: 130px; border-radius: 8px; background: #e6ecf3; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 10px; }
.mayor-item h4 { margin: 0 0 4px; font-size: 14px; color: #0d2d4e; }
.mayor-item p { margin: 0; font-size: 12px; color: #6b7280; }

/* ===== چارت سازمانی (درختی) ===== */
.org-chart-wrap { margin-top: 26px; overflow-x: auto; padding-bottom: 10px; }
.org-tree { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.org-tree li { text-align: center; list-style: none; position: relative; padding: 24px 14px 0; }
.org-tree.org-tree-root { padding-top: 0; }
.org-tree li::before {
    content: ''; position: absolute; top: 0; right: 50%; width: 1px; height: 24px; background: #cfe0f2;
}
.org-tree-root > li::before { display: none; }
.org-tree li .org-tree { padding-top: 0; }
.org-node {
    display: inline-flex; flex-direction: column; align-items: center;
    background: #fff; border: 1px solid #e6ecf3; border-radius: 10px; padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04); min-width: 120px;
}
.org-node img { width: 84px; height: 100px; object-fit: contain; background: #eef2f7; border-radius: 6px; margin-bottom: 6px; cursor: zoom-in; }
.org-node-noimg { width: 64px; height: 64px; border-radius: 6px; background: #e6ecf3; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 6px; }
.org-node-name { font-size: 13px; font-weight: bold; color: #0d2d4e; }
.org-node-title { font-size: 11px; color: #6b7280; margin-top: 2px; }

/* ===== کتابخانه اسناد (قوانین، بخشنامه‌ها و ...) ===== */
.doc-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.doc-card { background: #f9fbfd; border: 1px solid #e6ecf3; border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .2s, transform .15s; }
.doc-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.doc-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.doc-card-noimg { width: 100%; height: 150px; background: #e6ecf3; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.doc-card-info { padding: 12px 14px; }
.doc-card-subtitle { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.doc-card-info h4 { margin: 0 0 6px; font-size: 14px; color: #0d2d4e; }
.doc-card-meta { font-size: 11.5px; color: #6b7280; }

.pdf-viewer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.75);
    display: none; align-items: center; justify-content: center;
    z-index: 1100; padding: 20px;
}
.pdf-viewer-overlay.open { display: flex; }
.pdf-viewer-box { background: #fff; border-radius: 10px; width: 100%; max-width: 900px; height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.pdf-viewer-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #eee; background: #f9fbfd; }
.pdf-viewer-toolbar span { font-size: 14px; font-weight: bold; color: #0d2d4e; }
.pdf-viewer-actions { display: flex; gap: 8px; }
.pdf-viewer-actions .btn { padding: 6px 14px; font-size: 12.5px; cursor: pointer; }
.pdf-viewer-box iframe { flex: 1; width: 100%; border: none; }

/* ===== لایت‌باکس (نمایش بزرگ عکس با کلیک) ===== */
.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.85);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 24px; cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 92%; max-height: 92%; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox-close {
    position: absolute; top: 18px; left: 24px; color: #fff; font-size: 30px;
    background: none; border: none; cursor: pointer; line-height: 1;
}

/* ===== دکمه همبرگری (فقط موبایل) ===== */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: #fff; border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .site-search { display: none; }

    .header-inner { flex-wrap: wrap; }

    .main-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        background: #0d3f73;
        border-radius: 10px;
        margin-top: 12px;
        padding: 6px;
        gap: 0;
    }
    .main-nav.open { display: flex; }
    .main-nav > a, .nav-item > a { padding: 12px 14px; border-radius: 6px; }
    .main-nav > a:hover, .nav-item > a:hover { background: rgba(255,255,255,.1); }

    .nav-item .dropdown {
        position: static;
        display: none;
        box-shadow: none;
        background: rgba(0,0,0,.15);
        border-radius: 6px;
        margin: 0 10px 6px;
        padding: 4px 0;
        min-width: 0;
    }
    .nav-item.open .dropdown { display: block; }
    .nav-item .dropdown a { color: #eaf2fc; padding: 10px 16px; }
    .nav-item .dropdown a:hover { background: rgba(255,255,255,.1); color: #fff; }
}
