/*
Theme Name:   Medical Directory Child
Theme URI:    https://example.com
Description:  قالب فرزند Hello Elementor برای سایت‌های پزشکی — با ساختار لینک‌سازی داخلی پیشرفته
Author:       Medical Directory
Author URI:   https://example.com
Template:     hello-elementor
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  med-directory-child
Tags: medical, directory, internal-linking, rtl, persian
*/

/* ═══════════════════════════════════════════════════════════════
   Medical Directory — Global Styles v2
   تم: آبی روشن + سفید | فونت: Vazirmatn
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    --med-font: 'Vazirmatn', Tahoma, 'Segoe UI', Arial, sans-serif;
    --med-primary:      #0284C7;
    --med-primary-dark: #0369A1;
    --med-primary-deep: #1E3A8A;
    --med-primary-lite: #E0F2FE;
    --med-accent:       #38BDF8;
    --med-border:       #BFDBFE;
    --med-text:         #1E293B;
    --med-text-2:       #475569;
    --med-text-3:       #94A3B8;
    --med-bg:           #F8FAFF;
    --med-surface:      #FFFFFF;
    --med-radius:       10px;
    --med-shadow:       0 2px 10px rgba(2,132,199,0.08);
}

/* ── Base Typography ─────────────────────────────────────────── */
body {
    font-family: var(--med-font) !important;
    color: var(--med-text) !important;
    line-height: 1.85 !important;
    -webkit-font-smoothing: antialiased;
    background-color: #FAFCFF;
}

/* ── Headings Global ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--med-font) !important;
    color: var(--med-primary-deep) !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}

/* ── Links ───────────────────────────────────────────────────── */
a { color: var(--med-primary) !important; transition: color .15s !important; }
a:hover { color: var(--med-primary-dark) !important; }

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #93C5FD; border-radius: 3px; }

/* ── Selection ───────────────────────────────────────────────── */
::selection { background: #BFDBFE; color: #1E3A8A; }

/* ── Medical Single — خواناتر کردن متن ─────────────────────────── */
.med-single .med-content p {
    margin-bottom: 14px !important;
    line-height: 2.1 !important;
}
.med-single .med-content strong,
.med-single .med-content b {
    color: #1E3A8A !important;
    font-weight: 700 !important;
}
.med-single .med-content table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--med-shadow);
}
.med-single .med-content th {
    background: #DBEAFE !important;
    color: #1E3A8A !important;
}
.med-single .med-content blockquote {
    border-right: 4px solid #0284C7;
    background: #EFF6FF;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin: 16px 0;
    color: #334155;
    font-style: normal;
}

/* ── Medical Archive Cards ───────────────────────────────────────── */
.med-art-row,
.med-art-card {
    transition: transform .2s, box-shadow .2s !important;
}
.med-art-row:hover,
.med-art-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(2,132,199,0.12) !important;
}

/* ── Chips ───────────────────────────────────────────────────── */
.med-chip, .chip {
    font-family: var(--med-font) !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
}

/* ── Stats Bar ───────────────────────────────────────────────── */
.med-stats-bar .med-stat-n {
    font-family: var(--med-font) !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}

/* ── Pagination ──────────────────────────────────────────────── */
.med-pagination .page-numbers {
    font-family: var(--med-font) !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: all .15s !important;
}
.med-pagination .page-numbers.current {
    background: #0284C7 !important;
    border-color: #0284C7 !important;
}

/* ══════════════════════════════════════════════════════════════
   Medical Directory v3 — Menu + Category Sections
   ══════════════════════════════════════════════════════════════ */

/* ─── Anchor Tabs (crawlable) ───────────────────────────────── */
.med-anchor-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:20px;padding:12px;background:#F8FAFF;border:1px solid #DBEAFE;border-radius:10px}
.med-anchor-tab{padding:5px 14px;border-radius:20px;font-size:12px;text-decoration:none !important;background:#fff;border:1px solid #BFDBFE;color:#1E3A8A !important;font-weight:500;transition:all .15s}
.med-anchor-tab:hover{background:#0284C7;color:#fff !important;border-color:#0284C7}
.med-anchor-tab.ct{background:#fffbeb;border-color:#fde68a;color:#78350f !important}
.med-anchor-tab.ct:hover{background:#f59e0b;color:#fff !important;border-color:#f59e0b}
.med-anchor-tab span{background:#DBEAFE;color:#1D4ED8;font-size:9px;padding:1px 5px;border-radius:10px;margin-right:3px}

/* ─── Category Section با مقالات ───────────────────────────── */
.med-cat-section{margin-bottom:24px;border:1px solid #E2E8F0;border-radius:12px;overflow:hidden}
.med-cat-section-head{display:flex;justify-content:space-between;align-items:center;padding:10px 14px;background:#EFF6FF;border-bottom:1px solid #DBEAFE}
.med-cat-section-head a:first-child{font-size:14px;font-weight:700;color:#1E3A8A !important;text-decoration:none !important}
.med-see-all{font-size:11px;color:#0284C7 !important;text-decoration:none !important;background:#fff;border:1px solid #BFDBFE;padding:3px 10px;border-radius:20px}
.med-see-all:hover{background:#0284C7;color:#fff !important}
.med-cat-articles{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:0}
.med-mini-art{display:flex;flex-direction:column;gap:5px;padding:10px 14px;border-bottom:1px dashed #E2E8F0;border-left:1px dashed #E2E8F0;text-decoration:none !important;transition:background .15s}
.med-mini-art:hover{background:#F8FAFF}
.med-mini-art-title{font-size:12px;color:#1E293B !important;line-height:1.5;font-weight:500}
.med-mini-art:hover .med-mini-art-title{color:#0284C7 !important}
.med-mini-art-meta{display:flex;gap:5px;align-items:center;flex-wrap:wrap}

/* ══════════════════════════════════════════════════════════════
   Medical Directory v3.1 — Sections Redesign
   ══════════════════════════════════════════════════════════════ */

/* ─── Category Section کلی ─────────────────────────────────── */
.med-cat-section {
    margin-bottom: 20px;
    background: #fff;
    border: 1.5px solid #DBEAFE;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(2,132,199,0.06);
}
.med-cat-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to left, #EFF6FF, #DBEAFE);
    border-bottom: 1.5px solid #BFDBFE;
}
.med-cat-section-head a:first-child {
    font-size: 14px;
    font-weight: 700;
    color: #1E3A8A !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
.med-cat-section-head a:first-child::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #0284C7;
    border-radius: 4px;
    display: inline-block;
}
.med-see-all {
    font-size: 11px;
    color: #0284C7 !important;
    text-decoration: none !important;
    background: #fff;
    border: 1.5px solid #BFDBFE;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
    transition: all .15s;
}
.med-see-all:hover {
    background: #0284C7 !important;
    color: #fff !important;
    border-color: #0284C7;
}

/* ─── Article List Clean ────────────────────────────────────── */
.med-art-list-clean {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.med-art-list-clean li {
    border-bottom: 1px dashed #E2E8F0;
}
.med-art-list-clean li:last-child { border-bottom: none; }
.med-art-list-clean li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    text-decoration: none !important;
    transition: background .15s;
}
.med-art-list-clean li a:hover {
    background: #F8FAFF;
}
.med-art-num {
    min-width: 24px;
    height: 24px;
    background: #0284C7;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.med-art-name {
    font-size: 13px;
    color: #1E293B !important;
    line-height: 1.5;
    font-weight: 500;
    flex: 1;
}
.med-art-list-clean li a:hover .med-art-name {
    color: #0284C7 !important;
}
.med-art-arrow {
    font-size: 12px;
    color: #CBD5E1;
    flex-shrink: 0;
    transition: color .15s, transform .15s;
}
.med-art-list-clean li a:hover .med-art-arrow {
    color: #0284C7;
    transform: translateX(-3px);
}

/* ─── Anchor Tabs بهبود یافته ──────────────────────────────── */
.med-anchor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #F8FAFF;
    border: 1.5px solid #DBEAFE;
    border-radius: 12px;
}
.med-anchor-tab {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none !important;
    background: #fff;
    border: 1.5px solid #BFDBFE;
    color: #1E3A8A !important;
    font-weight: 600;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.med-anchor-tab:hover {
    background: #0284C7 !important;
    color: #fff !important;
    border-color: #0284C7;
}
.med-anchor-tab span {
    background: #DBEAFE;
    color: #1D4ED8;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}
.med-anchor-tab.ct {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e !important;
}
.med-anchor-tab.ct:hover {
    background: #d97706 !important;
    color: #fff !important;
    border-color: #d97706;
}
.med-anchor-tab.ct span {
    background: #fef3c7;
    color: #92400e;
}

@media (max-width: 600px) {
    .med-art-list-clean { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   Medical Directory v3.2 — Fixes
   ══════════════════════════════════════════════════════════════ */

/* ─── ul بدون شماره پیش‌فرض ────────────────────────────────── */
.med-art-list-clean {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.med-art-list-clean li { list-style: none !important; }

/* ─── Pagination بهبود یافته ────────────────────────────────── */
.med-pagination,
.page-numbers-wrapper,
nav.pagination,
.nav-links {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 24px 0 !important;
    padding: 0 !important;
    direction: rtl !important;
}
.page-numbers,
.med-pagination a,
.med-pagination span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 12px !important;
    border: 1.5px solid #BFDBFE !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    font-weight: 500 !important;
    color: #0284C7 !important;
    background: #fff !important;
    text-decoration: none !important;
    transition: all .15s !important;
}
.page-numbers:hover,
.med-pagination a:hover {
    background: #0284C7 !important;
    color: #fff !important;
    border-color: #0284C7 !important;
}
.page-numbers.current,
.page-numbers.current:hover {
    background: #0284C7 !important;
    color: #fff !important;
    border-color: #0284C7 !important;
    cursor: default !important;
}
.page-numbers.dots {
    border: none !important;
    background: transparent !important;
    color: #94A3B8 !important;
}
.prev.page-numbers::before { content: '→ '; }
.next.page-numbers::after  { content: ' ←'; }

/* ─── Archive header بهبود ─────────────────────────────────── */
.med-arc-header {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE) !important;
    border: 1.5px solid #BFDBFE !important;
    border-right: 5px solid #0284C7 !important;
}

/* ─── Sort bar fix ─────────────────────────────────────────── */
.med-sort-bar { margin-bottom: 14px; }
.med-count-text { font-size: 12px; color: #64748B; }

/* ══════════════════════════════════════════════════════════════
   Medical Directory v3.3 — Tabs + Thumbnails
   ══════════════════════════════════════════════════════════════ */

/* ─── Tab System ────────────────────────────────────────────── */
.med-tabset { border: 1.5px solid #DBEAFE; border-radius: 14px; overflow: hidden; }

.med-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #EFF6FF;
    border-bottom: 1.5px solid #BFDBFE;
    padding: 10px 12px;
    gap: 6px;
}
.med-tab-btn {
    padding: 7px 16px;
    border: 1.5px solid #BFDBFE;
    border-radius: 20px;
    background: #fff;
    color: #1E3A8A;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.med-tab-btn:hover { background: #DBEAFE; }
.med-tab-btn.active {
    background: #0284C7;
    color: #fff;
    border-color: #0284C7;
    box-shadow: 0 2px 8px rgba(2,132,199,0.3);
}
.med-tab-btn.ct { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.med-tab-btn.ct:hover { background: #fef3c7; }
.med-tab-btn.ct.active { background: #d97706; color: #fff; border-color: #d97706; }

/* Tab Panels */
.med-tab-panel { display: none; }
.med-tab-panel.active { display: block; }

.med-tab-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to left, #F8FAFF, #EFF6FF);
    border-bottom: 1px solid #E2E8F0;
}
.med-tab-panel-head a:first-child {
    font-size: 14px;
    font-weight: 700;
    color: #1E3A8A !important;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
.med-tab-panel-head a:first-child::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #0284C7;
    border-radius: 4px;
}

/* ─── Article in Tab ────────────────────────────────────────── */
.med-tab-articles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0;
}
.med-tab-art {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #F1F5F9;
    border-left: 1px solid #F1F5F9;
    text-decoration: none !important;
    transition: background .15s;
    background: #fff;
}
.med-tab-art:hover { background: #F8FAFF; }

/* Thumbnail */
.med-tab-art-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #DBEAFE;
}
.med-tab-art-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.med-tab-art-emoji { font-size: 24px; }

/* Article body */
.med-tab-art-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.med-tab-art-title {
    font-size: 13px;
    font-weight: 600;
    color: #1E293B !important;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.med-tab-art:hover .med-tab-art-title { color: #0284C7 !important; }
.med-tab-art-city {
    font-size: 11px;
    color: #F59E0B;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: 1px 8px;
    width: fit-content;
    font-weight: 500;
}
.med-tab-art-cat {
    font-size: 11px;
    color: #1D4ED8;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 20px;
    padding: 1px 8px;
    width: fit-content;
    font-weight: 500;
}
.med-tab-art-arrow {
    font-size: 14px;
    color: #CBD5E1;
    flex-shrink: 0;
    transition: all .15s;
}
.med-tab-art:hover .med-tab-art-arrow { color: #0284C7; transform: translateX(-4px); }

@media (max-width: 600px) {
    .med-tab-articles { grid-template-columns: 1fr; }
    .med-tab-nav { gap: 5px; }
}

/* ══════════════════════════════════════════════════════════════
   Medical Directory v3.5 — Tab Fix + Card Design + Footer
   ══════════════════════════════════════════════════════════════ */

/* ─── Fix: Tab Panels Hidden ────────────────────────────────── */
.med-tabset .med-tab-panel {
    display: none !important;
}
.med-tabset .med-tab-panel.active {
    display: block !important;
}

/* ─── Article Cards در تب‌ها ─────────────────────────────────── */
.med-tab-articles {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 14px !important;
    padding: 16px !important;
    background: #F8FAFF !important;
}
.med-tab-art {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1.5px solid #DBEAFE !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    text-decoration: none !important;
    transition: all .2s !important;
    box-shadow: 0 2px 8px rgba(2,132,199,0.06) !important;
}
.med-tab-art:hover {
    border-color: #0284C7 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(2,132,199,0.15) !important;
}

/* Thumbnail */
.med-tab-art-thumb {
    width: 100% !important;
    height: 130px !important;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border-bottom: 1px solid #DBEAFE !important;
}
.med-tab-art-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.med-tab-art-emoji {
    font-size: 40px !important;
    opacity: 0.6 !important;
}

/* Body */
.med-tab-art-body {
    padding: 10px 12px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}
.med-tab-art-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    line-height: 1.5 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.med-tab-art:hover .med-tab-art-title { color: #0284C7 !important; }
.med-tab-art-city,
.med-tab-art-cat {
    display: inline-block !important;
    font-size: 10px !important;
    padding: 2px 8px !important;
    border-radius: 20px !important;
    font-weight: 500 !important;
    width: fit-content !important;
}
.med-tab-art-city {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #92400e !important;
}
.med-tab-art-cat {
    background: #EFF6FF !important;
    border: 1px solid #BFDBFE !important;
    color: #1D4ED8 !important;
}

/* Arrow - hidden on card style */
.med-tab-art-arrow { display: none !important; }

/* ─── Footer استاندارد ───────────────────────────────────────── */
.med-footer-bottom-bar {
    max-width: 1160px;
    margin: 16px auto 0;
    padding-top: 14px;
    border-top: 1px solid #374151;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.med-footer-bottom-bar span {
    font-size: 11px;
    color: #6B7280;
}
.med-footer-bottom-bar div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.med-footer-bottom-bar a {
    font-size: 10px !important;
    color: #4B5563 !important;
    text-decoration: none !important;
}
.med-footer-bottom-bar a:hover { color: #93C5FD !important; }

@media(max-width:600px) {
    .med-tab-articles { grid-template-columns: 1fr 1fr !important; }
    .med-tab-art-thumb { height: 100px !important; }
}

/* ─── Footer Links (global) ─────────────────────────────────── */
.med-footer-links {
    background: #1f2937;
    padding: 28px 20px 16px;
    margin-top: 20px;
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.med-footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}
.med-footer-col-title {
    font-size: 12px;
    font-weight: bold;
    color: #d1d5db;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #374151;
}
.med-footer-links .med-footer-col a {
    display: block !important;
    font-size: 11px !important;
    color: #9ca3af !important;
    text-decoration: none !important;
    margin-bottom: 5px !important;
    transition: color .15s !important;
}
.med-footer-links .med-footer-col a:hover { color: #93C5FD !important; }
