/*
Theme Name: EHMC
Description: پوسته اختصاصی راست‌چین برای راهنمای مراکز درمانی و پزشکان ایران
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: ehmc
*/
@font-face {
  font-family: Vazirmatn;
  src: url("assets/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ink: #142c40;
  --text: #25394a;
  --muted: #526474;
  --green: #216451;
  --green-dark: #164938;
  --mint: #e8f3ef;
  --line: #dfe8e8;
  --surface: #f7f9f9;
  --white: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--surface); color: var(--text); font: 400 1rem/1.85 Vazirmatn, Tahoma, sans-serif; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.55; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--green); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
svg { display: block; flex: none; }
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; }
.wrap { width: min(100% - 72px, 1200px); margin-inline: auto; }
.screen-reader-text { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.screen-reader-text:focus { clip-path: none; width: auto; height: auto; padding: 10px 16px; inset: 10px auto auto 10px; background: var(--white); color: var(--ink); z-index: 5; }
.site-header { background: var(--white); border-top: 4px solid var(--green); border-bottom: 1px solid var(--line); }
.site-header, .site-footer { direction: rtl; }
.header-inner { display: flex; align-items: center; min-height: 82px; gap: clamp(18px, 3vw, 46px); }
.brand { flex: none; }
.brand img { width: 168px; max-height: 58px; object-fit: contain; }
.primary-nav { flex: 1; }
.primary-nav ul { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 19px; list-style: none; padding: 0; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding-block: 5px; font-size: .86rem; font-weight: 600; }
.primary-nav a[aria-current="page"], .current-menu-item > a { color: var(--green); }
.primary-nav .sub-menu { position: absolute; inset-inline-start: 0; top: 100%; z-index: 3; display: none; width: max-content; max-width: 240px; padding: 8px 14px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.header-search, .menu-toggle { display: inline-flex; gap: 7px; align-items: center; min-height: 42px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--green); font-size: .82rem; font-weight: 700; white-space: nowrap; }
.header-search svg, .menu-toggle svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
.home-intro { background: #eaf3f0; border-bottom: 1px solid #dce9e3; }
.intro-inner { padding-block: 40px 53px; }
.intro-inner h1 { font-size: clamp(1.8rem, 3.4vw, 2.9rem); font-weight: 800; letter-spacing: -.025em; }
.intro-inner p { margin-block: 8px 19px; color: var(--muted); }
.search-form { display: flex; align-items: center; gap: 12px; width: min(100%, 640px); min-height: 56px; padding: 5px 7px; padding-inline-start: 15px; border: 1px solid #cbdad5; border-radius: 10px; background: var(--white); }
.search-form > svg { color: var(--green); width: 20px; }
.search-form input { flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; color: var(--ink); padding: 4px; }
.search-form input::placeholder { color: var(--muted); }
.search-form button { min-height: 43px; border: 0; border-radius: 7px; padding-inline: 22px; background: var(--green); color: var(--white); font-weight: 700; font-size: .9rem; }
.search-form button:hover { background: var(--green-dark); }
.category-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-block: -22px 30px; position: relative; }
.category-tile { display: flex; align-items: center; gap: 9px; padding: 11px 10px; min-height: 68px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; font-size: .83rem; font-weight: 700; line-height: 1.5; }
.category-tile:hover { border-color: var(--green); }
.tile-icon { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border-radius: 7px; color: var(--green); background: var(--mint); }
.tile-icon svg { width: 20px; height: 20px; }
.home-layout, .article-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 310px); gap: 28px; align-items: start; margin-block: 0 50px; }
.home-layout:has(> :only-child) { grid-template-columns: 1fr; }
.home-native { margin-block-end: 26px; }
.section-heading { display: flex; align-items: center; gap: 15px; margin-block-end: 15px; }
.section-heading h2 { font-size: 1.32rem; }
.section-heading::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.post-grid { display: grid; gap: 17px; }
.home-post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-card { min-width: 0; height: 100%; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 11px; overflow-wrap: anywhere; }
.post-card:focus-within, .post-card:hover { border-color: #9eb8af; }
.card-photo { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px 10px 0 0; background: var(--mint); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-body { flex: 1; display: flex; flex-direction: column; align-items: start; padding: 14px 15px 12px; gap: 6px; }
.category-label { display: inline-block; width: fit-content; background: var(--mint); color: var(--green-dark); padding: 2px 8px; border-radius: 4px; font-size: .73rem; font-weight: 650; line-height: 1.7; }
.card-title { font-size: 1rem; font-weight: 750; }
.card-body time { padding-block-start: 4px; margin-block-start: auto; color: var(--muted); font-size: .76rem; }
.sidebar-box { background: var(--white); border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-block-end: 14px; overflow-wrap: anywhere; }
.sidebar-box h2 { font-size: 1rem; padding-block-end: 10px; border-block-end: 1px solid var(--line); }
.home-sidebar { padding-block-start: 45px; }
.mini-list { padding: 0; list-style: none; }
.mini-list li + li { border-block-start: 1px solid var(--line); }
.mini-link { display: flex; align-items: center; gap: 10px; padding-block: 11px; font-size: .84rem; font-weight: 650; line-height: 1.65; }
.mini-photo { flex: 0 0 55px; height: 50px; border-radius: 5px; overflow: hidden; background: var(--mint); }
.mini-photo img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-more, .more-line a, .ad-box a { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: .85rem; font-weight: 750; }
.sidebar-more svg, .more-line svg, .ad-box svg { width: 17px; }
.more-line { margin-block-start: 18px; }
.ad-box { background: #eaf3f0; }
.ad-box h2 { border: 0; padding: 0; }
.ad-box p { margin-block: 6px 9px; font-size: .87rem; }
.archive-head { padding-block: 35px; background: #eaf3f0; border-bottom: 1px solid var(--line); }
.archive-head h1 { font-size: clamp(1.55rem, 4vw, 2.4rem); overflow-wrap: anywhere; }
.archive-head p, .archive-head .search-form { margin-block-start: 12px; }
.archive-description { max-width: 70ch; margin-block-start: 12px; }
.archive-body { margin-block: 24px 55px; }
.trail { display: flex; flex-wrap: wrap; gap: 8px; margin-block-end: 10px; font-size: .84rem; color: var(--muted); }
.trail a { color: var(--green-dark); }
.article-trail { margin-block: 21px 13px; }
.article-layout:has(> :only-child) { grid-template-columns: minmax(0, 880px); justify-content: center; }
.article, .comments { padding: clamp(16px, 3vw, 30px); background: var(--white); border: 1px solid var(--line); border-radius: 11px; overflow-wrap: anywhere; }
.article-header h1 { margin-block: 8px 10px; font-size: clamp(1.5rem, 3.3vw, 2.25rem); font-weight: 800; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 17px; font-size: .85rem; color: var(--muted); }
.article-image { margin-block: 18px 24px; }
.article-image img { width: 100%; border-radius: 8px; }
.article-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 15px; }
.article-actions a, .copy-link, .post-tags a { display: inline-flex; align-items: center; gap: 7px; color: var(--green-dark); background: var(--mint); border: 1px solid var(--line); border-radius: 6px; padding: 5px 11px; font-size: .85rem; font-weight: 650; }
.article-actions a:hover, .copy-link:hover { border-color: var(--green); }
.article-actions svg { width: 17px; height: 17px; }
.prose { margin-block-start: 12px; line-height: 1.95; }
.prose > * + * { margin-block-start: 1em; }
.prose :is(h2, h3, h4) { margin-block-start: 1.4em; }
.prose :is(a, .content-pages a) { color: var(--green-dark); text-decoration: underline; text-underline-offset: .2em; }
.prose :is(iframe, video, embed, .wp-caption) { max-width: 100%; }
.prose blockquote { margin-inline: 0; padding: 5px 14px; border-inline-start: 3px solid var(--green); background: var(--surface); }
.prose img { height: auto; }
.prose :is(pre, .table-scroll, .wp-block-table) { max-width: 100%; overflow: auto; }
.prose pre { direction: ltr; text-align: left; padding: 12px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; }
.prose :is(td, th) { border: 1px solid var(--line); padding: 7px 9px; }
.prose th { background: var(--mint); }
.article-end { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-block-start: 24px; }
.article-end:has(> button[hidden]:only-child) { display: none; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.comments { margin-block-start: 16px; }
.comments h2 { margin-block-end: 8px; font-size: 1.18rem; }
.comment-list { padding-inline-start: 20px; }
.comment-list li { margin-block: 10px; }
.comment-respond { margin-block-start: 12px; }
.comment-form p { margin-block: 8px; }
.comment-form label { display: block; }
.comment-form input:not([type=checkbox]), .comment-form textarea { max-width: 100%; border: 1px solid #cbdad5; border-radius: 6px; padding: 5px 9px; }
.comment-form .form-submit input { background: var(--green); color: var(--white); font-weight: 700; cursor: pointer; }
.pagination { margin-block-start: 18px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { border: 1px solid var(--line); background: var(--white); border-radius: 5px; padding: 4px 10px; }
.page-numbers.current { background: var(--green); color: var(--white); }
.site-footer { background: var(--white); border-block-start: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; padding-block: 30px; }
.footer-grid h2 { font-size: 1rem; margin-block-end: 6px; }
.footer-grid ul { padding: 0; list-style: none; }
.footer-grid p, .footer-grid li { color: var(--muted); font-size: .87rem; }
.footer-grid p { margin-block-start: 9px; max-width: 38ch; }
.footer-bottom { padding-block: 9px; border-block-start: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
@media (max-width: 1020px) {
  .wrap { width: calc(100% - 40px); }
  .header-inner { gap: 14px; flex-wrap: wrap; min-height: 68px; padding-block: 9px; }
  .menu-toggle { display: inline-flex; margin-inline-start: auto; }
  .primary-nav { flex: 0 0 100%; order: 1; }
  .has-menu-toggle .primary-nav:not(.is-open) { display: none; }
  .primary-nav ul { gap: 4px 14px; }
  .primary-nav .sub-menu { position: static; display: block; border: 0; padding-block: 0; }
  .category-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 725px) {
  .home-layout, .article-layout { grid-template-columns: 1fr; gap: 18px; }
  .home-sidebar { padding-block-start: 0; }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-inner { padding-block: 26px 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 450px) {
  .wrap { width: calc(100% - 28px); }
  .brand img { width: 124px; }
  .header-search span { display: none; }
  .header-inner { gap: 8px; }
  .search-form { gap: 6px; padding-inline-start: 8px; }
  .search-form button { padding-inline: 10px; }
  .search-form input { font-size: .88rem; }
  .category-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-tile { min-height: 52px; }
  .post-grid { grid-template-columns: 1fr; }
  .article { overflow: hidden; }
}
.article-layout > *, .home-layout > * { min-inline-size: 0; }
.header-ads { color: var(--muted); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.header-ads:hover { color: var(--green); }
@media (max-width: 1020px) { .header-ads { display: none; } }
.footer-backlinks { padding-block: 12px; border-block-start: 1px solid var(--line); }
.footer-backlinks h2 { margin-block-end: 6px; font-size: .9rem; }
.footer-backlinks ul { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; list-style: none; }
.footer-backlinks a { color: var(--green-dark); font-size: .84rem; text-decoration: underline; text-underline-offset: .18em; overflow-wrap: anywhere; }
