/* سامانه استعلام اتحادیه – همه کلاس‌ها با ejr- شروع می‌شوند تا با قالب تداخل نداشته باشند.
   فونت از قالب سایت به ارث می‌رسد. */
.ejr {
	--ejr-line: #e2e4e8;
	--ejr-soft: #f5f6f8;
	--ejr-muted: #5b6470;
	--ejr-brass: #8a6d1d;
	--ejr-red: #a8231b;
	--ejr-red-soft: #fbeeed;
	--ejr-green: #1d6a44;
	--ejr-green-soft: #ebf5ef;
	--ejr-radius: 6px;
	line-height: 1.9;
}
.ejr *, .ejr *::before, .ejr *::after { box-sizing: border-box; }
.ejr .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

/* سربرگ */
.ejr-crumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; list-style: none; margin: 0 0 1rem; padding: 0; font-size: .85rem; color: var(--ejr-muted); }
.ejr-crumbs li + li::before { content: "/"; margin-inline-end: .5rem; color: var(--ejr-line); }
.ejr-crumbs a { color: inherit; }
.ejr-head { margin-bottom: 1.25rem; }
.ejr-head__title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.5; margin: .25rem 0 .5rem; }
.ejr-intro { max-width: 70ch; color: var(--ejr-muted); }
.ejr-intro p { margin: 0 0 .5rem; }

/* فرم جستجو */
.ejr-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1rem 0; }
.ejr-filter input[type="search"], .ejr-filter select,
.ejr-inquiry__row input {
	flex: 1 1 16rem; min-height: 46px; padding: .5rem .85rem; font: inherit;
	border: 1px solid #c9ced6; border-radius: var(--ejr-radius); background: #fff; color: inherit;
}
.ejr-filter select { flex: 0 1 12rem; }
.ejr-filter button, .ejr-inquiry__row button {
	min-height: 46px; padding: .5rem 1.4rem; font: inherit; font-weight: 700; cursor: pointer;
	border: 0; border-radius: var(--ejr-radius); background: var(--ejr-brass); color: #fff;
}
.ejr-filter button:hover, .ejr-inquiry__row button:hover { background: #745a14; }
.ejr :focus-visible { outline: 3px solid #2f6fb3; outline-offset: 2px; }
.ejr-filter__reset { font-size: .9rem; }
.ejr-count { font-size: .9rem; color: var(--ejr-muted); margin: .5rem 0 1rem; }

/* وضعیت */
.ejr-badge { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.ejr-badge--missing { background: var(--ejr-red-soft); color: var(--ejr-red); }
.ejr-badge--found { background: var(--ejr-green-soft); color: var(--ejr-green); }

/* فهرست نامه‌ها: هر ردیف مثل یک برگه نامه با شماره در کنار */
.ejr-letters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ejr-line); }
.ejr-letter { border-bottom: 1px solid var(--ejr-line); }
.ejr-letter__link { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1rem; align-items: center; padding: 1rem .25rem; color: inherit; text-decoration: none; }
.ejr-letter__link:hover { background: var(--ejr-soft); }
.ejr-letter__no { display: flex; flex-direction: column; align-items: center; padding: .35rem; border-inline-start: 3px solid var(--ejr-red); }
.ejr-letter--found .ejr-letter__no { border-color: var(--ejr-green); }
.ejr-letter__no small { font-size: .75rem; color: var(--ejr-muted); }
.ejr-letter__no b { font-size: 1.15rem; direction: ltr; font-variant-numeric: tabular-nums; }
.ejr-letter__body { display: flex; flex-direction: column; min-width: 0; }
.ejr-letter__title { font-weight: 700; }
.ejr-letter__items { color: var(--ejr-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ejr-letter__meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .82rem; color: var(--ejr-muted); }
.ejr-letters--compact .ejr-letter__link { grid-template-columns: 5rem 1fr auto; padding: .6rem .25rem; }

/* صفحه تکی */
.ejr-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1px; margin: 0 0 1.5rem; background: var(--ejr-line); border: 1px solid var(--ejr-line); border-radius: var(--ejr-radius); overflow: hidden; }
.ejr-facts > div { background: #fff; padding: .7rem .9rem; }
.ejr-facts dt { font-size: .8rem; color: var(--ejr-muted); }
.ejr-facts dd { margin: 0; font-weight: 700; }
.ejr-section { margin: 1.5rem 0; max-width: 75ch; }
.ejr-section h2, .ejr-callout h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.ejr-items { margin: 0; padding-inline-start: 1.25rem; }
.ejr-letter-img { margin: 1.5rem 0; max-width: 46rem; }
.ejr-letter-img img { width: 100%; height: auto; border: 1px solid var(--ejr-line); border-radius: var(--ejr-radius); }
.ejr-letter-img figcaption { font-size: .85rem; color: var(--ejr-muted); margin-top: .4rem; }
.ejr-callout { margin: 1.5rem 0; padding: 1rem 1.25rem; border-inline-start: 4px solid var(--ejr-red); background: var(--ejr-red-soft); border-radius: var(--ejr-radius); max-width: 75ch; }
.ejr-single--found .ejr-callout { border-color: var(--ejr-green); background: var(--ejr-green-soft); }
.ejr-callout p { margin: 0; }
.ejr-prevnext { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 1rem; font-size: .92rem; }

/* حکم استعلام: یک «مهر» رسمی؛ تنها عنصر پررنگ صفحه */
.ejr-verdict { display: flex; gap: 1.25rem; align-items: center; margin: 1rem 0; padding: 1.1rem 1.25rem; border: 1px solid var(--ejr-line); border-radius: var(--ejr-radius); background: #fff; }
.ejr-verdict p { margin: 0; }
.ejr-verdict__more { font-size: .9rem; color: var(--ejr-muted); }
.ejr-verdict__stamp {
	flex: none; padding: .45rem .9rem; font-weight: 800; font-size: 1.05rem; white-space: nowrap;
	border: 3px double currentColor; border-radius: 4px; transform: rotate(-3deg);
}
.ejr-verdict--bad { border-color: var(--ejr-red); background: var(--ejr-red-soft); }
.ejr-verdict--bad .ejr-verdict__stamp { color: var(--ejr-red); }
.ejr-verdict--clear .ejr-verdict__stamp { color: var(--ejr-green); }
@media (prefers-reduced-motion: no-preference) {
	.ejr-verdict__stamp { animation: ejr-stamp .28s ease-out; }
	@keyframes ejr-stamp { from { transform: rotate(-3deg) scale(1.35); opacity: 0; } to { transform: rotate(-3deg) scale(1); opacity: 1; } }
}

/* جدول کدها */
.ejr-table-wrap { overflow-x: auto; border: 1px solid var(--ejr-line); border-radius: var(--ejr-radius); }
.ejr-table { width: 100%; border-collapse: collapse; margin: 0; }
.ejr-table th, .ejr-table td { padding: .6rem .9rem; text-align: start; border-bottom: 1px solid var(--ejr-line); }
.ejr-table thead th { background: var(--ejr-soft); font-size: .85rem; color: var(--ejr-muted); }
.ejr-table tbody th { font-weight: 700; width: 7rem; }
.ejr-table tbody tr:last-child > * { border-bottom: 0; }
.ejr-table tr.is-hit { background: var(--ejr-red-soft); }
@media (max-width: 640px) {
	.ejr-table thead { display: none; }
	.ejr-table tr { display: block; padding: .5rem 0; border-bottom: 1px solid var(--ejr-line); }
	.ejr-table th, .ejr-table td { display: block; border: 0; padding: .1rem .9rem; width: auto; }
	.ejr-table td:empty { display: none; }
	.ejr-table td::before { content: attr(data-label) ": "; color: var(--ejr-muted); font-size: .82rem; }
	.ejr-letter__link { grid-template-columns: 5rem 1fr; }
	.ejr-letter__link .ejr-badge { grid-column: 2; justify-self: start; }
	.ejr-verdict { flex-direction: column; align-items: flex-start; }
}

/* صفحه‌بندی، خالی، پیوندها */
.ejr-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin: 1.5rem 0; }
.ejr-pagination .page-numbers { display: inline-block; min-width: 2.4rem; padding: .35rem .7rem; text-align: center; border: 1px solid var(--ejr-line); border-radius: var(--ejr-radius); text-decoration: none; }
.ejr-pagination .page-numbers.current { background: var(--ejr-brass); border-color: var(--ejr-brass); color: #fff; }
.ejr-empty { padding: 1.25rem; background: var(--ejr-soft); border-radius: var(--ejr-radius); }
.ejr-empty p { margin: 0 0 .25rem; }
.ejr-msg { color: var(--ejr-muted); }
.ejr-related { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; margin: 2.5rem 0 1rem; }
.ejr-related a { display: block; padding: .9rem 1rem; border: 1px solid var(--ejr-line); border-radius: var(--ejr-radius); color: inherit; text-decoration: none; }
.ejr-related a:hover { border-color: var(--ejr-brass); }
.ejr-related strong { display: block; color: var(--ejr-brass); }
.ejr-related span { font-size: .88rem; color: var(--ejr-muted); }

/* استعلام یکپارچه */
.ejr-inquiry__form { padding: 1.25rem; border: 1px solid var(--ejr-line); border-radius: var(--ejr-radius); background: var(--ejr-soft); }
.ejr-inquiry__label { display: block; font-weight: 700; margin-bottom: .5rem; }
.ejr-inquiry__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.ejr-hint { margin: .5rem 0 0; font-size: .85rem; color: var(--ejr-muted); }
.ejr-inquiry.is-loading .ejr-inquiry__results { opacity: .5; transition: opacity .15s; }
.ejr-result-group { margin-top: 1.5rem; }
.ejr-result-group h3 { font-size: 1rem; margin: 0 0 .5rem; }
.ejr-mini { list-style: none; margin: 0; padding: 0; }
.ejr-mini li { display: flex; gap: 1rem; padding: .4rem 0; border-bottom: 1px solid var(--ejr-line); }
.ejr-mini b { min-width: 5rem; }
.ejr-more { margin-top: 1rem; }
