/* =============================================================
   MASHINOM v2 — Laravel integration overrides
   فقط چیزهایی که پروتوتایپ نداشت و فرم‌های واقعی لازم دارند.
   ============================================================= */

/* انتخابگر بومی داخل فیلدهای جست‌وجو */
.field__select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.6;
  cursor: pointer;
}
.field__select:focus { outline: none; }
.field__select option {
  background: var(--surface-1);
  color: var(--text);
}
[data-theme="light"] .field__select option {
  background: #fff;
  color: var(--ink-950);
}

/* مگامنوی واقعی ۴ ستون است، بدون کارت ویژه */
.mega__inner { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* فیلدهای بومی داخل نوار جست‌وجوی قهرمان — همان فاصلهٔ داخلی دکمه‌های پروتوتایپ */
.searchbar .field {
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  padding-inline: 1rem;
}

/* ورودی متنی داخل فیلدهای جست‌وجو */
.field__input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}
.field__input::placeholder { color: var(--text-4); font-weight: 500; }
.field__input:focus { outline: none; }

/* برچسب فیلد در فرم‌های واقعی */
.field__label {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

/* دکمهٔ فیلتر موبایل — ستون فیلتر در عرض‌های کوچک پنهان می‌شود */
.filters-open { display: none; }
@media (max-width: 1024px) {
  .filters-open { display: inline-flex; }
}

/* خلاصهٔ کارت مقاله */
.post-card__excerpt {
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1.9;
  margin-block-start: 0.45rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* متن مقاله — خروجی sanitized در bodyForDisplay */
.article-body {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 2;
  max-width: 78ch;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.article-body p { margin-block: 1em; }
.article-body h2 {
  color: var(--text);
  font-size: var(--fs-h3);
  line-height: 1.5;
  margin-block: 1.8em 0.6em;
}
.article-body h3 {
  color: var(--text);
  font-size: var(--fs-h4);
  line-height: 1.6;
  margin-block: 1.6em 0.5em;
}
.article-body ul,
.article-body ol {
  padding-inline-start: 1.5rem;
  margin-block: 1em;
}
.article-body li { margin-block: 0.4em; }
.article-body a { color: var(--gold-300); text-decoration: underline; }
.article-body strong { color: var(--text); }
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  margin-block: 1.2rem;
}
.article-body blockquote {
  margin-block: 1.4rem;
  padding-inline-start: 1rem;
  border-inline-start: 2px solid var(--brand-500);
  color: var(--text-3);
}
[data-theme="light"] .article-body a { color: var(--brand-600); }

/* کارت خدمات */
.service-card {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface-1);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.service-card__title {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--text);
  line-height: 1.6;
}
.service-card__text {
  color: var(--text-3);
  font-size: 0.86rem;
  line-height: 1.95;
}
.service-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-block-start: auto;
  padding-block-start: 0.5rem;
}

/* داشبورد */
.dash-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}
.dash-card {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface-1);
  padding: 1rem;
}
.dash-link {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.86rem;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
}
.dash-link:hover {
  background: var(--glass);
  color: var(--text);
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-block: 1rem;
}
.dash-stat {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  padding: 0.75rem;
  text-align: center;
}
.dash-stat__num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-300);
  line-height: 1.4;
}
.dash-stat__label {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-block-start: 0.2rem;
}
.dash-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.9rem;
  border-block-end: 1px solid var(--line);
}
.dash-row:last-child { border-block-end: 0; }
.dash-row__title {
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}
.dash-row__title:hover { color: var(--gold-300); }
.dash-card .badge { align-self: flex-start; }
.dash-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-3);
  flex: none;
}
a.dash-row {
  color: inherit;
  text-decoration: none;
  border-radius: var(--r-lg);
}
a.dash-row:hover { background: var(--glass); }
.dash-thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex: none;
  background: var(--surface-3);
}
@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* کارت ورود */
.auth-card {
  max-width: 480px;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  background: var(--surface-1);
}
.form-error {
  display: flex;
  gap: 0.35rem;
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.7;
  margin-block-start: 0.4rem;
}

/* فرم‌ها */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}
.form-card {
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  background: var(--surface-1);
}
.radio-card {
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.radio-card:hover { border-color: var(--line-brand); background: var(--glass); }
.radio-card input { accent-color: var(--brand-600); }

/* گفت‌وگو */
.chat-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface-1);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 280px;
}
.chat-msg {
  max-width: 78%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.chat-msg--mine {
  align-self: flex-end;
  background: var(--brand-700);
  border-color: transparent;
  color: #fff;
}
.chat-msg__meta {
  font-size: 0.68rem;
  opacity: 0.7;
  margin-block-end: 0.3rem;
}
.chat-msg__body {
  white-space: pre-line;
  line-height: 1.9;
}
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-block-start: 1rem;
}

/* جلوگیری از اسکرول افقی ناشی از عناصر off-canvas (منوی موبایل) */
html { overflow-x: clip; }

/* ردیف چیپ‌ها (شهرها) */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* دکمهٔ فرم‌ها در حالت disabled (مثل «نمایش بیشتر») */
.btn[disabled],
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
