/*
Theme Name: Moeinex Blog
Theme URI: https://blog.moeinex.ir
Description: قالب بلاگ معینکس (فرزند Hello Elementor) هماهنگ با لندینگ moeinex.ir
Author: Moeinex
Template: hello-elementor
Version: 1.0.0
Text Domain: moeinex-blog
*/

@font-face { font-family: 'Vazirmatn'; src: url('assets/fonts/Vazirmatn-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('assets/fonts/Vazirmatn-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('assets/fonts/Vazirmatn-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('assets/fonts/Vazirmatn-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
    --mx-primary: #006540;
    --mx-primary-dark: #004d31;
    --mx-primary-soft: #e6f2ed;
    --mx-secondary: #F97316;
    --mx-secondary-soft: #fff1e6;
    --mx-text: #1f2937;
    --mx-muted: #6b7280;
    --mx-border: #e5e7eb;
    --mx-bg: #f8faf9;
    --mx-card: #ffffff;
    --mx-radius: 16px;
    --mx-shadow: 0 6px 24px rgba(0, 0, 0, .06);
    --mx-container: 1200px;
}

html { direction: rtl; }
body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--mx-text);
    background: var(--mx-bg);
    line-height: 1.9;
    margin: 0;
}
a { color: var(--mx-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--mx-secondary); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { font-family: 'Vazirmatn', Tahoma, sans-serif; color: #111827; line-height: 1.6; font-weight: 800; }

.mx-container { max-width: var(--mx-container); margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.mx-topbar { background: #004d31; color: #fff; font-size: 13px; }
.mx-topbar .mx-container { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; flex-wrap: wrap; }
.mx-topbar a { color: #fff; }
.mx-topbar a:hover { color: #ffd6b5; }

.mx-header { background: var(--mx-primary); border-bottom: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 10px 30px -18px rgba(0, 40, 24, .55); position: sticky; top: 0; z-index: 50; }
.mx-header .mx-container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.mx-logo { display: inline-flex; flex-shrink: 0; border-radius: 8px; transition: opacity .2s; }
.mx-logo:hover { opacity: .9; }
.mx-logo img { width: 104px; height: auto; display: block; }
.mx-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.mx-nav a { display: block; padding: 8px 12px; border-radius: 12px; color: rgba(255, 255, 255, .9); font-weight: 500; font-size: 14px; }
.mx-nav a:hover, .mx-nav .current-menu-item > a, .mx-nav .current_page_item > a { background: rgba(255, 255, 255, .1); color: #fff; }
.mx-header-actions { display: flex; align-items: center; gap: 8px; }
.mx-btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.mx-btn-primary { background: var(--mx-primary); color: #fff; }
.mx-header .mx-btn-primary { background: #fff; color: var(--mx-primary); }
.mx-header .mx-btn-primary:hover { background: var(--mx-primary-soft); color: var(--mx-primary); }
.mx-btn-primary:hover { background: var(--mx-primary-dark); color: #fff; }
.mx-btn-outline { border-color: var(--mx-border); color: var(--mx-text); background: #fff; }
.mx-btn-outline:hover { border-color: var(--mx-primary); color: var(--mx-primary); }
.mx-btn-accent { background: var(--mx-secondary); color: #fff; }
.mx-btn-accent:hover { background: #ea580c; color: #fff; }
.mx-menu-toggle { display: none; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.mx-menu-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; }

/* ---------- Hero ---------- */
.mx-hero { background: linear-gradient(135deg, var(--mx-primary) 0%, #00804f 60%, #0a9a62 100%); color: #fff; padding: 56px 0 72px; position: relative; overflow: hidden; }
.mx-hero::after { content: ''; position: absolute; left: -80px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; background: rgba(249, 115, 22, .25); }
.mx-hero h1 { color: #fff; font-size: clamp(26px, 4vw, 40px); margin: 0 0 8px; }
.mx-hero p { color: rgba(255, 255, 255, .88); margin: 0; font-size: 16px; max-width: 640px; }
.mx-search { margin-top: 24px; display: flex; gap: 8px; max-width: 560px; position: relative; z-index: 1; }
.mx-search input[type=search] { flex: 1; border: 0; border-radius: 12px; padding: 14px 16px; font-family: inherit; font-size: 15px; }
.mx-search button { border-radius: 12px; }

/* ---------- Category chips ---------- */
.mx-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -26px 0 24px; position: relative; z-index: 2; }
.mx-chip { background: #fff; border: 1px solid var(--mx-border); border-radius: 999px; padding: 8px 16px; font-size: 14px; color: var(--mx-text); box-shadow: var(--mx-shadow); }
.mx-chip:hover, .mx-chip.is-active { background: var(--mx-secondary); border-color: var(--mx-secondary); color: #fff; }

/* ---------- Layout ---------- */
.mx-main { padding: 32px 0 56px; }
.mx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.mx-section-title { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 0 0 18px; }
.mx-section-title::before { content: ''; width: 6px; height: 26px; border-radius: 4px; background: var(--mx-secondary); }

/* ---------- Post cards ---------- */
.mx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.mx-card { background: var(--mx-card); border-radius: var(--mx-radius); overflow: hidden; box-shadow: var(--mx-shadow); border: 1px solid var(--mx-border); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.mx-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 101, 64, .12); }
.mx-card-thumb { display: block; aspect-ratio: 16 / 9; background: var(--mx-primary-soft); overflow: hidden; }
.mx-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mx-card-thumb .mx-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--mx-primary), #0a9a62); }
.mx-card-thumb .mx-thumb-placeholder img { width: 45%; height: auto; object-fit: contain; opacity: .8; }
.mx-card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mx-card-cat { align-self: flex-start; background: var(--mx-secondary-soft); color: #c2410c; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 12px; }
.mx-card-title { font-size: 18px; margin: 0; line-height: 1.7; }
.mx-card-title a { color: #111827; }
.mx-card-title a:hover { color: var(--mx-primary); }
.mx-card-excerpt { color: var(--mx-muted); font-size: 14px; margin: 0; flex: 1; }
.mx-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--mx-muted); font-size: 13px; }
.mx-card-more { font-weight: 700; font-size: 14px; }

.mx-card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
.mx-card-featured .mx-card-thumb { aspect-ratio: auto; min-height: 280px; }
.mx-card-featured .mx-card-title { font-size: 24px; }

/* ---------- Sidebar ---------- */
.mx-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 96px; }
.mx-widget { background: #fff; border: 1px solid var(--mx-border); border-radius: var(--mx-radius); padding: 18px; box-shadow: var(--mx-shadow); }
.mx-widget h3, .mx-widget .widget-title, .mx-widget .wp-block-heading { font-size: 17px; margin: 0 0 12px; }
.mx-widget ul { list-style: none; margin: 0; padding: 0; }
.mx-widget li { padding: 8px 0; border-bottom: 1px dashed var(--mx-border); font-size: 14px; }
.mx-widget li:last-child { border-bottom: 0; }
.mx-cta { background: linear-gradient(135deg, var(--mx-secondary), #fb923c); color: #fff; border: 0; }
.mx-cta h3 { color: #fff; }
.mx-cta p { margin: 0 0 14px; font-size: 14px; color: rgba(255, 255, 255, .92); }
.mx-cta .mx-btn { background: #fff; color: #c2410c; width: 100%; box-sizing: border-box; }

/* ---------- Single ---------- */
.mx-article { background: #fff; border-radius: var(--mx-radius); border: 1px solid var(--mx-border); box-shadow: var(--mx-shadow); overflow: hidden; }
.mx-article-cover img { width: 100%; max-height: 460px; object-fit: cover; display: block; }
.mx-article-inner { padding: 28px 32px 36px; }
.mx-article h1 { font-size: clamp(24px, 3.4vw, 34px); margin: 8px 0 12px; }
.mx-breadcrumb { font-size: 13px; color: var(--mx-muted); margin-bottom: 8px; }
.mx-breadcrumb a { color: var(--mx-muted); }
.mx-content { font-size: 17px; line-height: 2.1; }
.mx-content h2 { font-size: 24px; margin-top: 36px; padding-right: 12px; border-right: 4px solid var(--mx-secondary); }
.mx-content h3 { font-size: 20px; margin-top: 28px; color: var(--mx-primary); }
.mx-content blockquote { margin: 24px 0; padding: 16px 20px; background: var(--mx-primary-soft); border-right: 4px solid var(--mx-primary); border-radius: 12px; }
.mx-content table { width: 100%; border-collapse: collapse; }
.mx-content th, .mx-content td { border: 1px solid var(--mx-border); padding: 8px 12px; }
.mx-content img { border-radius: 12px; }
.mx-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.mx-tags a { background: var(--mx-bg); border: 1px solid var(--mx-border); padding: 4px 12px; border-radius: 999px; font-size: 13px; color: var(--mx-text); }
.mx-share { display: flex; gap: 8px; align-items: center; margin-top: 20px; flex-wrap: wrap; font-size: 14px; }
.mx-share a { background: var(--mx-primary-soft); color: var(--mx-primary); padding: 6px 12px; border-radius: 10px; font-size: 13px; }
.mx-article-cta { margin-top: 32px; background: var(--mx-primary); color: #fff; border-radius: var(--mx-radius); padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mx-article-cta h3 { color: #fff; margin: 0 0 4px; font-size: 19px; }
.mx-article-cta p { margin: 0; color: rgba(255, 255, 255, .9); font-size: 14px; }
.mx-related { margin-top: 36px; }

/* ---------- Comments ---------- */
.mx-comments { margin-top: 28px; }
.mx-comments .comment-list { list-style: none; padding: 0; }
.mx-comments .comment-body { background: var(--mx-bg); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.mx-comments input[type=text], .mx-comments input[type=email], .mx-comments input[type=url], .mx-comments textarea { width: 100%; border: 1px solid var(--mx-border); border-radius: 12px; padding: 10px 12px; font-family: inherit; box-sizing: border-box; }
.mx-comments .submit { background: var(--mx-primary); color: #fff; border: 0; border-radius: 12px; padding: 10px 22px; font-family: inherit; font-weight: 700; cursor: pointer; }

/* ---------- Pagination ---------- */
.mx-pagination { margin-top: 32px; display: flex; justify-content: center; }
.mx-pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.mx-pagination .page-numbers { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #fff; border: 1px solid var(--mx-border); color: var(--mx-text); padding: 0 10px; }
.mx-pagination .page-numbers.current, .mx-pagination .page-numbers:hover { background: var(--mx-primary); color: #fff; border-color: var(--mx-primary); }

.mx-empty { background: #fff; border-radius: var(--mx-radius); padding: 48px 24px; text-align: center; border: 1px dashed var(--mx-border); }

/* ---------- Footer ---------- */
.mx-footer { background: var(--mx-primary); color: rgba(255, 255, 255, .85); padding: 48px 0 0; margin-top: 24px; }
.mx-footer a { color: rgba(255, 255, 255, .85); }
.mx-footer a:hover { color: var(--mx-secondary); }
.mx-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.mx-footer h4 { color: #fff; font-size: 16px; margin: 0 0 14px; }
.mx-footer ul { list-style: none; margin: 0; padding: 0; }
.mx-footer li { padding: 5px 0; font-size: 14px; }
.mx-footer p { font-size: 14px; margin: 0 0 10px; }
.mx-footer-logo { display: inline-block; margin-bottom: 14px; }
.mx-footer-logo img { width: 120px; height: auto; display: block; }
.mx-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 32px; padding: 16px 0; font-size: 13px; text-align: center; color: rgba(255, 255, 255, .75); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .mx-layout { grid-template-columns: 1fr; }
    .mx-sidebar { position: static; }
    .mx-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
    .mx-menu-toggle { display: block; }
    .mx-nav { display: none; position: absolute; top: 100%; right: 0; left: 0; background: var(--mx-primary); border-top: 1px solid rgba(255, 255, 255, .1); padding: 8px 16px 16px; box-shadow: var(--mx-shadow); }
    .mx-nav.is-open { display: block; }
    .mx-nav ul { flex-direction: column; }
    .mx-header .mx-container { position: relative; }
    .mx-header-actions .mx-btn-outline { display: none; }
    .mx-card-featured { grid-template-columns: 1fr; }
    .mx-card-featured .mx-card-thumb { min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
    .mx-grid { grid-template-columns: 1fr; }
    .mx-article-inner { padding: 20px 16px 28px; }
    .mx-footer-grid { grid-template-columns: 1fr; }
    .mx-topbar .mx-topbar-links { display: none; }
    .mx-search { flex-direction: column; }
}
