/* Mahanameh Manager — scoped to its own elements so it works with existing themes. */
.mhm-root {
  --mhm-green: #187d47;
  --mhm-green-dark: #0c6035;
  --mhm-green-muted: #eaf5ed;
  --mhm-ink: #20392c;
  --mhm-muted: #76867b;
  --mhm-border: #e4ebe5;
  --mhm-gap: 22px;
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  padding: 34px 0;
  direction: rtl;
  color: var(--mhm-ink);
  font-family: inherit;
  text-align: right;
  isolation: isolate;
}
.mhm-root *, .mhm-root *::before, .mhm-root *::after { box-sizing: border-box; }
.mhm-root a { text-decoration: none; box-shadow: none; }
.mhm-root button, .mhm-root input { font: inherit; }
.mhm-root button { cursor: pointer; }
.mhm-root svg { width: 18px; height: 18px; flex-shrink: 0; }
.mhm-root :focus-visible { outline: 3px solid #8ccda5 !important; outline-offset: 3px; }
.mhm-section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.mhm-heading-wrap { min-width: 0; }
.mhm-eyebrow { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--mhm-green); margin-bottom: 12px; }
.mhm-eyebrow i { display: inline-block; width: 24px; height: 3px; border-radius: 5px; background: linear-gradient(90deg, #a6e3bc, #187d47); }
.mhm-root .mhm-heading { color: var(--mhm-ink); font-size: clamp(23px, 2.5vw, 32px); font-weight: 850; line-height: 1.45; margin: 0; padding: 0; border: 0; }
.mhm-root .mhm-subheading { font-size: 13px; margin: 7px 0 0; color: var(--mhm-muted); line-height: 1.9; }
.mhm-all-link { display: inline-flex; justify-content: center; align-items: center; gap: 9px; white-space: nowrap; border: 1px solid #cce6d3; background: #f5faf6; color: var(--mhm-green-dark) !important; padding: 11px 16px; border-radius: 14px; font-size: 13px; font-weight: 800; transition: background .2s ease, transform .2s ease, border-color .2s ease; }
.mhm-all-link:hover { background: #e7f6eb; transform: translateY(-2px); border-color: #98cda8; }
.mhm-all-link svg { width: 15px; height: 15px; transform: rotate(180deg); }
.mhm-carousel-viewport { display: flex; align-items: stretch; gap: var(--mhm-gap); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; padding: 5px 3px 15px; scroll-padding-inline: 3px; overscroll-behavior-x: contain; }
.mhm-carousel-viewport::-webkit-scrollbar { display: none; }
.mhm-carousel-viewport > .mhm-card { flex: 0 0 calc((100% - 3 * var(--mhm-gap) - 6px) / 4); scroll-snap-align: start; }
.mhm-card { display: flex; flex-direction: column; position: relative; min-width: 0; overflow: hidden; border-radius: 20px; border: 1px solid var(--mhm-border); background: #fff; box-shadow: 0 6px 20px rgba(22, 63, 36, .045); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.mhm-card:hover { transform: translateY(-5px); box-shadow: 0 15px 37px rgba(19, 82, 42, .12); border-color: #bbdac4; }
.mhm-card-cover { display: block; position: relative; overflow: hidden; aspect-ratio: 4 / 4.75; background: linear-gradient(145deg,#edf6ee,#d7ebdd); border-radius: 14px; margin: 11px 11px 0; outline-offset: 4px; }
.mhm-cover-image { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 35%; transition: transform .5s cubic-bezier(.2,.7,.15,1); }
.mhm-card:hover .mhm-cover-image { transform: scale(1.065); }
.mhm-card-cover::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(to top, rgba(14,58,28,.18), transparent); pointer-events: none; }
.mhm-cover-tag { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 6px 10px; border-radius: 9px; background: rgba(251,255,251,.94); backdrop-filter: blur(8px); color: #1a6f40; font-size: 11px; font-weight: 800; box-shadow: 0 3px 13px rgba(0,0,0,.09); }
.mhm-cover-action { position: absolute; bottom: 14px; left: 14px; z-index: 1; display: grid; place-items: center; border-radius: 11px; width: 36px; height: 36px; color: #fff; background: var(--mhm-green); box-shadow: 0 5px 17px rgba(20,96,53,.3); transition: transform .25s ease, background .25s ease; }
.mhm-card:hover .mhm-cover-action { transform: scale(1.1); background: var(--mhm-green-dark); }
.mhm-cover-placeholder { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 100%; height: 100%; color: #2a7950; background: radial-gradient(circle at 25% 20%, #e8fbe8, transparent 50%), linear-gradient(155deg, #d6ebdb, #f1f8eb 56%, #c8e4d1); }
.mhm-cover-placeholder svg { width: 38%; height: 38%; }
.mhm-cover-placeholder span { font-weight: 900; font-size: 18px; }
.mhm-card-body { display: flex; flex: 1; flex-direction: column; padding: 16px 15px 16px; }
.mhm-card-date { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #708677; }
.mhm-card-date svg { width: 15px; height: 15px; color: #6d9c7b; }
.mhm-root .mhm-card-title { color: var(--mhm-ink); font-size: 15px; font-weight: 850; line-height: 1.8; min-height: 54px; margin: 6px 0 15px; padding: 0; border: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mhm-card-title a { color: inherit !important; }
.mhm-card-title a:hover { color: var(--mhm-green) !important; }
.mhm-card-actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mhm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 41px; padding: 8px 7px; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 800; white-space: nowrap; transition: background .2s ease, transform .2s ease, box-shadow .2s ease; }
.mhm-btn svg { width: 15px; height: 15px; }
.mhm-btn-primary { background: linear-gradient(115deg,#17894b,#116e3d); color: white !important; box-shadow: 0 4px 12px rgba(12,111,56,.13); }
.mhm-btn-primary:hover { color: #fff !important; background: linear-gradient(115deg,#106e3c,#0b5e31); box-shadow: 0 7px 17px rgba(12,111,56,.2); transform: translateY(-2px); }
.mhm-btn-secondary { color: var(--mhm-green-dark) !important; border-color: #d6eade; background: #f4faf6; }
.mhm-btn-secondary:hover { background: #e3f2e8; color: var(--mhm-green-dark) !important; transform: translateY(-2px); }
.mhm-no-pdf { grid-column: 1/-1; font-size: 11px; text-align: center; padding: 11px; border-radius: 11px; background: #fff7ed; color: #967044; }
.mhm-carousel-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; }
.mhm-carousel-status { display: flex; align-items: center; gap: 7px; color: #397d53; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mhm-status-separator { color: #c0cfc3; }
.mhm-carousel-buttons { display: flex; align-items: center; gap: 9px; }
.mhm-nav-btn { width: 41px; height: 41px; border-radius: 12px; border: 1px solid #d4e8da; background: #f3faf5; color: var(--mhm-green); display: inline-flex; justify-content: center; align-items: center; transition: background .2s ease, transform .2s ease; }
.mhm-nav-btn:hover:not(:disabled) { background: var(--mhm-green); color: #fff; transform: translateY(-2px); }
.mhm-nav-btn:disabled { opacity: .33; cursor: not-allowed; }
.mhm-nav-btn[data-mhm-step="1"] svg { transform: rotate(180deg); }
.mhm-empty { background: #f8fbf8; border: 1px dashed #bdd7c4; padding: 40px 22px; border-radius: 18px; text-align: center; color: #6b8272; font-size: 14px; }
.mhm-empty a { color: var(--mhm-green); font-weight: 800; }
/* Archive */
.mhm-archive-section { padding: 25px 0 40px; }
.mhm-archive-hero { padding: 35px clamp(22px,4vw,52px); background: radial-gradient(circle at 4% 0%,rgba(220,255,227,.17),transparent 40%), linear-gradient(110deg,#0e6035 0%,#1a834b 55%,#429965 100%); border-radius: 24px; color: #fff; position: relative; overflow: hidden; }
.mhm-archive-hero::after { content: ''; position: absolute; width: 230px; height: 230px; left: -75px; bottom: -130px; border: 35px solid rgba(255,255,255,.07); border-radius: 50%; pointer-events: none; }
.mhm-archive-hero .mhm-eyebrow { color: #c8ffdb; }
.mhm-archive-hero .mhm-eyebrow i { background: #c8ffdb; }
.mhm-root .mhm-archive-hero h1 { font-size: clamp(25px,3.1vw,36px); color: #fff; }
.mhm-archive-hero p { margin: 7px 0 20px; font-size: 14px; color: #e7f6eb; }
.mhm-archive-count { display: inline-flex; align-items: center; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.12); padding: 7px 13px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.mhm-search { margin: 30px 0 22px; }
.mhm-search > label { display: block; margin-bottom: 11px; color: var(--mhm-ink); font-size: 14px; font-weight: 850; }
.mhm-search-row { display: flex; align-items: center; min-height: 56px; border: 1px solid #dce9de; border-radius: 15px; padding: 5px 6px 5px 12px; background: #fff; box-shadow: 0 5px 19px rgba(24,87,45,.035); transition: border-color .2s ease; }
.mhm-search-row:focus-within { border-color: #6cbd88; }
.mhm-search-icon { padding: 0 12px 0 8px; color: #86a28d; display: flex; align-items: center; }
.mhm-search-row input[type="search"] { flex: 1; width: 100%; min-width: 0; background: transparent; color: var(--mhm-ink); border: 0 !important; box-shadow: none !important; outline: none !important; min-height: 41px; padding: 6px 2px; margin: 0; border-radius: 0; font-size: 13px; }
.mhm-search-row input::placeholder { color: #99aba0; }
.mhm-search-row button { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 43px; border: 0; padding: 10px 24px; border-radius: 11px; color: #fff; background: var(--mhm-green); font-size: 13px; font-weight: 800; transition: background .2s ease; }
.mhm-search-row button:hover { background: var(--mhm-green-dark); }
.mhm-search-row button svg { width: 15px; height: 15px; transform: rotate(180deg); }
.mhm-archive-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; font-size: 12px; color: #7d8f82; }
.mhm-archive-meta span:first-child { color: #42674d; font-weight: 800; }
.mhm-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--mhm-gap); }
.mhm-pagination { margin: 36px auto 0; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; }
.mhm-pagination > a, .mhm-pagination > span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 9px; border: 1px solid #dceade; border-radius: 10px; color: var(--mhm-green-dark); background: #fff; font-size: 13px; font-weight: 800; }
.mhm-pagination > a:hover { border-color: #80be93; background: #eaf6ed; }
.mhm-pagination > a.is-active { color: #fff; background: var(--mhm-green); border-color: var(--mhm-green); pointer-events: none; }
.mhm-pagination > .mhm-page-edge { padding: 0 16px; }
.mhm-pagination > .mhm-page-ellipsis { border: 0; background: transparent; color: #95a498; }
@media (max-width: 1023px) {
 .mhm-carousel-viewport > .mhm-card { flex-basis: calc((100% - 2 * var(--mhm-gap) - 6px) / 3); }
 .mhm-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 767px) {
 .mhm-root { --mhm-gap: 12px; padding-top: 20px; padding-bottom: 25px; }
 .mhm-section-header { align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
 .mhm-all-link { padding: 8px 11px; font-size: 11px; border-radius: 10px; }
 .mhm-root .mhm-heading { font-size: 22px; }
 .mhm-root .mhm-subheading { font-size: 11px; }
 .mhm-carousel-viewport > .mhm-card { flex-basis: calc((100% - var(--mhm-gap) - 6px) / 2); }
 .mhm-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .mhm-card { border-radius: 14px; }
 .mhm-card-cover { margin: 7px 7px 0; border-radius: 10px; aspect-ratio: 4 / 5; }
 .mhm-cover-tag { font-size: 9px; border-radius: 7px; top: 7px; right: 7px; padding: 4px 7px; }
 .mhm-cover-action { bottom: 9px; left: 9px; width: 30px; height: 30px; border-radius: 9px; }
 .mhm-cover-action svg { width: 16px; height: 16px; }
 .mhm-card-body { padding: 12px 9px 10px; }
 .mhm-card-date { gap: 4px; font-size: 10px; }
 .mhm-card-date svg { width: 12px; height: 12px; }
 .mhm-root .mhm-card-title { font-size: 12px; min-height: 43px; margin: 6px 0 11px; }
 .mhm-card-actions { gap: 5px; }
 .mhm-btn { min-height: 35px; font-size: 10px; gap: 4px; padding: 6px 3px; border-radius: 8px; }
 .mhm-btn svg { width: 13px; height: 13px; }
 .mhm-archive-hero { padding: 28px 22px; border-radius: 18px; }
 .mhm-archive-hero p { font-size: 12px; }
 .mhm-search { margin: 24px 0 19px; }
 .mhm-archive-meta { font-size: 10px; }
 .mhm-search-row button { padding: 9px 13px; min-height: 39px; }
 .mhm-search-icon { padding: 0 9px 0 5px; }
 .mhm-search-row input[type="search"] { font-size: 11px; }
}
@media (max-width: 355px) { .mhm-root { --mhm-gap: 8px; } .mhm-btn svg { display: none; } .mhm-card-date { font-size: 9px; } .mhm-search-row button svg { display: none; } }
@media (prefers-reduced-motion: reduce) { .mhm-root *, .mhm-root *::before, .mhm-root *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
