/*
Theme Name: Mahdisan Sanat Niroo
Theme URI: https://msniroo.ir
Author: InCloud ITES
Author URI: https://cloudpulse.io
Description: قالب اختصاصی وب‌سایت مهدیسان صنعت نیرو — اورهال، تأمین قطعات و خدمات مهندسی نیروگاه‌های گازی. راست‌چین، سبک و بدون وابستگی به افزونه.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mahdisan
Tags: rtl-language-support, custom-logo, custom-menu, one-column, two-columns
*/

/* ---------- tokens ---------- */
:root {
  --navy: #0F2A44;
  --navy-2: #16375A;
  --yellow: #F5B400;
  --yellow-2: #D99F00;
  --gray: #8A939B;
  --light: #DCE1E6;
  --paper: #FFFFFF;
  --tint: #F4F6F8;
  --ink: #1C2733;
  --muted: #5C6873;
  --max: 1160px;
  --radius: 6px;
}

/* ---------- fonts ---------- */
@font-face { font-family: 'Vazirmatn'; src: url('assets/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('assets/fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('assets/fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Montserrat'; src: url('assets/fonts/Montserrat-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--navy); }
a:hover { color: var(--navy-2); }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.45; margin: 0 0 0.5em; color: var(--navy); }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 32px); }
h3 { font-size: 21px; }
h4 { font-size: 18px; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.4em; }
strong { font-weight: 700; }
.ltr { direction: ltr; unicode-bidi: embed; font-family: 'Montserrat', 'Segoe UI', sans-serif; font-weight: 600; letter-spacing: 0.02em; }
.container { max-width: var(--max); margin-inline: auto; padding-inline: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: -999px; top: 12px; z-index: 200; background: var(--yellow); color: var(--navy); padding: 8px 16px; border-radius: var(--radius); }
.skip-link:focus { inset-inline-start: 16px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--light); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand-mark svg { width: 52px; height: 52px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 19px; }
.brand-latin { font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 0.28em; color: var(--gray); direction: ltr; text-align: right; margin-top: 4px; }
.custom-logo-link img, .custom-logo { max-height: 60px; width: auto; display: block; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.nav-list li { position: relative; }
.nav-list a { display: block; text-decoration: none; font-weight: 500; color: var(--ink); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-list a:hover, .nav-list .current-menu-item > a, .nav-list .current_page_item > a, .nav-list .current-menu-ancestor > a { color: var(--navy); border-bottom-color: var(--yellow); }
.nav-list .sub-menu { display: none; }
.nav-cta { background: var(--navy); color: #fff; text-decoration: none; padding: 10px 18px; border-radius: var(--radius); font-weight: 500; font-size: 15px; white-space: nowrap; }
.nav-cta:hover { background: var(--navy-2); color: #fff; }
.nav-toggle { display: none; background: none; border: 1px solid var(--light); border-radius: var(--radius); width: 44px; height: 44px; padding: 0; cursor: pointer; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { display: block; width: 20px; height: 2px; background: var(--navy); position: absolute; left: 11px; top: 21px; content: ""; transition: transform .2s; }
.nav-toggle-bar::before { top: -6px; left: 0; }
.nav-toggle-bar::after { top: 6px; left: 0; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; inset-inline: -24px; top: 100%; background: var(--paper); flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 20px; border-bottom: 1px solid var(--light); box-shadow: 0 12px 24px rgba(15, 42, 68, 0.08); }
  .site-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a { padding: 12px 0; border-bottom: 1px solid var(--light); }
  .nav-list a:hover, .nav-list .current-menu-item > a { border-bottom-color: var(--yellow); }
  .nav-cta { text-align: center; margin-top: 16px; }
  .brand-name { font-size: 17px; }
}

/* ---------- buttons ---------- */
.wp-block-button .wp-block-button__link, .ms-btn, .ms-form button {
  background: var(--yellow); color: var(--navy); border: 0; border-radius: var(--radius);
  padding: 13px 26px; font-family: inherit; font-weight: 700; font-size: 17px; line-height: 1.6;
  text-decoration: none; display: inline-block; cursor: pointer; transition: background .15s;
}
.wp-block-button .wp-block-button__link:hover, .ms-btn:hover, .ms-form button:hover { background: var(--yellow-2); color: var(--navy); }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.ms-more { font-weight: 500; text-decoration: none; color: var(--navy); border-bottom: 2px solid var(--yellow); padding-bottom: 2px; }
.ms-more:hover { color: var(--navy-2); }

/* ---------- home sections ---------- */
.ms-inner { max-width: var(--max); margin-inline: auto; padding-inline: 24px; }
.ms-hero {
  background: var(--navy) url('assets/img/silhouette.svg') no-repeat;
  background-size: 760px 760px; background-position: left -200px top -180px;
  color: #fff; padding: 96px 0 108px; position: relative; overflow: hidden;
}
.ms-hero h1 { color: #fff; max-width: 780px; margin-bottom: 0.6em; }
.ms-hero p { max-width: 720px; font-size: 18px; color: #D5DCE3; }
.ms-hero .ms-kicker { color: var(--yellow); font-weight: 500; font-size: 17px; margin-bottom: 14px; }
.ms-hero .wp-block-buttons { margin-top: 30px; }
.ms-stats-wrap { padding: 0 24px; }
.ms-stats { max-width: var(--max); margin: -52px auto 0; background: var(--paper); border: 1px solid var(--light); border-radius: 8px; position: relative; z-index: 2; padding: 22px 12px; display: flex; flex-wrap: wrap; box-shadow: 0 16px 40px rgba(15, 42, 68, 0.08); }
.ms-stats .wp-block-column { flex: 1 1 200px; text-align: center; padding: 10px 16px; border-inline-start: 1px solid var(--light); }
.ms-stats .wp-block-column:first-child { border-inline-start: 0; }
.ms-stat-n { font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.3; margin: 0; }
.ms-stat-l { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.ms-section { padding: 88px 0; }
.ms-section-head { max-width: 720px; margin-bottom: 44px; }
.ms-section-head p { color: var(--muted); font-size: 18px; }
.ms-alt { background: var(--tint); }
.ms-services { display: flex; flex-wrap: wrap; gap: 24px; }
.ms-services .wp-block-column { flex: 1 1 280px; background: var(--paper); border: 1px solid var(--light); border-radius: 8px; padding: 32px 28px; }
.ms-services .wp-block-column::before { content: ""; display: block; width: 36px; height: 4px; background: var(--yellow); border-radius: 2px; margin-bottom: 22px; }
.ms-services h3 { font-size: 20px; }
.ms-services p { color: var(--muted); font-size: 16px; }
.ms-services p:last-child { margin-bottom: 0; }
.ms-about { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.ms-about > .wp-block-column { flex: 1 1 320px; }
.ms-about p { font-size: 18px; }
.ms-card { background: var(--paper); border: 1px solid var(--light); border-radius: 8px; padding: 32px 30px; border-top: 4px solid var(--yellow); }
.ms-card h3 { font-size: 19px; margin-bottom: 14px; }
.ms-card ul { margin: 0; padding-inline-start: 1.2em; }
.ms-card li { margin-bottom: 8px; }
.ms-cta { background: var(--navy); color: #fff; padding: 72px 0; text-align: center; }
.ms-cta h2 { color: #fff; max-width: 760px; margin-inline: auto; }
.ms-cta p { color: #D5DCE3; max-width: 640px; margin-inline: auto; }
.ms-cta .wp-block-buttons { justify-content: center; margin: 28px 0 22px; }
.ms-cta .ms-phone { font-family: 'Montserrat', sans-serif; font-weight: 600; direction: ltr; font-size: 22px; letter-spacing: 0.04em; color: var(--yellow); margin: 0 auto; }
@media (max-width: 900px) {
  .ms-hero { padding: 64px 0 84px; background-size: 520px 520px; background-position: left -220px top -140px; }
  .ms-section { padding: 64px 0; }
  .ms-stats .wp-block-column { border-inline-start: 0; border-top: 1px solid var(--light); }
  .ms-stats .wp-block-column:first-child { border-top: 0; }
}

/* ---------- inner pages ---------- */
.page-hero { background: var(--navy); color: #fff; padding: 64px 0 56px; }
.page-hero h1 { color: #fff; margin: 0; }
.page-hero .ms-rule { width: 48px; height: 4px; background: var(--yellow); border-radius: 2px; margin-top: 18px; }
.page-hero .page-sub { color: #C9D1D9; margin: 12px 0 0; font-size: 17px; max-width: 720px; }
.page-body { padding: 64px 0 88px; }
.entry-content { max-width: 860px; }
.page-contact .entry-content, .page-services .entry-content { max-width: none; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { margin-top: 2em; font-size: 26px; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content ul, .entry-content ol { margin: 0 0 1.4em; }
.entry-content li { margin-bottom: 0.45em; }
.entry-content img { border-radius: 8px; }
.entry-content .wp-block-buttons { margin-top: 32px; }
.ms-lead { font-size: 19px; color: var(--muted); max-width: 760px; margin-bottom: 2em; }
.ms-priority { display: inline-block; background: #FFF3CF; color: #7A5A00; font-size: 13px; font-weight: 500; padding: 1px 12px; border-radius: 999px; margin: 2.2em 0 0; line-height: 1.9; }
.ms-priority + h2 { margin-top: 0.4em; }
.ms-service-block { border-inline-start: 4px solid var(--yellow); padding-inline-start: 24px; margin-bottom: 40px; }

/* services page layout */
.page-services .ms-service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; margin-top: 8px; }
.page-services .ms-service-grid > .wp-block-group { background: var(--tint); border-radius: 8px; padding: 32px 30px; border-top: 4px solid var(--yellow); }
.page-services .ms-service-grid h2 { margin-top: 0; font-size: 22px; }
.page-services .ms-service-grid .ms-priority { margin: 0 0 12px; }
.page-services .ms-service-grid ul { margin-bottom: 0; }

/* contact */
.ms-contact-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.5fr); gap: 48px; align-items: start; }
.ms-contact-info dl { margin: 0; }
.ms-contact-info dt { font-weight: 700; color: var(--navy); margin-top: 18px; font-size: 15px; }
.ms-contact-info dt:first-child { margin-top: 0; }
.ms-contact-info dd { margin: 2px 0 0; color: var(--muted); }
.ms-contact-info dd .ltr { color: var(--ink); }
.ms-contact-info dd a { text-decoration: none; }
.ms-form { background: var(--tint); padding: 34px 32px; border-radius: 8px; border-top: 4px solid var(--yellow); }
.ms-form h3 { margin-bottom: 18px; }
.ms-form .field { margin-bottom: 18px; }
.ms-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ms-form label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 15px; }
.ms-form label .req { color: #B42318; }
.ms-form input, .ms-form select, .ms-form textarea { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--light); border-radius: var(--radius); padding: 11px 14px; }
.ms-form input:focus, .ms-form select:focus, .ms-form textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(245, 180, 0, 0.25); }
.ms-form textarea { min-height: 150px; resize: vertical; }
.ms-form .ltr-input { direction: ltr; text-align: left; }
.ms-form .ms-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.ms-form button { width: 100%; }
.ms-form .ms-privacy { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.ms-notice { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 22px; font-weight: 500; }
.ms-notice-ok { background: #E4F4E9; color: #1D6B38; }
.ms-notice-err { background: #FCE8E6; color: #A11F1F; }
@media (max-width: 820px) {
  .ms-contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .ms-form .row { grid-template-columns: 1fr; }
  .ms-form { padding: 26px 22px; }
}

/* ---------- blog fallback ---------- */
.post-list { display: grid; gap: 32px; }
.post-card { border-bottom: 1px solid var(--light); padding-bottom: 28px; }
.post-card h2 { font-size: 24px; }
.post-card h2 a { text-decoration: none; }
.post-meta { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.pagination { margin-top: 32px; display: flex; gap: 8px; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--light); border-radius: var(--radius); text-decoration: none; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }
.error-404 .search-form { display: flex; gap: 8px; max-width: 420px; }
.error-404 .search-form input[type="search"] { flex: 1; font: inherit; padding: 10px 14px; border: 1px solid var(--light); border-radius: var(--radius); }
.error-404 .search-form input[type="submit"] { background: var(--navy); color: #fff; border: 0; border-radius: var(--radius); padding: 10px 16px; font: inherit; cursor: pointer; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #C9D1D9; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr; gap: 40px; padding: 64px 24px 44px; }
.site-footer h2 { color: #fff; font-size: 17px; margin-bottom: 14px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.footer-brand .brand-mark svg { width: 56px; height: 56px; display: block; }
.footer-name { color: #fff; font-weight: 700; font-size: 20px; margin: 14px 0 4px; }
.footer-desc { font-size: 15px; color: #B7C0CA; max-width: 340px; margin: 0; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-contact p { margin: 0 0 8px; }
.footer-contact .lbl { color: #B7C0CA; }
.footer-contact .ltr { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 18px 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; color: #B7C0CA; }
.footer-latin { font-family: 'Montserrat', sans-serif; font-weight: 600; letter-spacing: 0.18em; direction: ltr; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; padding-top: 48px; } }

/* ---------- WordPress core classes ---------- */
.alignright { float: right; margin: 0 0 1em 1.5em; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.aligncenter { display: block; margin: 0 auto 1em; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .wp-element-caption { font-size: 14px; color: var(--muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sticky { display: block; }
.bypostauthor { display: block; }
.gallery-caption { display: block; }
