/* =========================================================
   SHIFT.camp — Patterns v2 (۳ آبان ۱۴۰۵)
   الگوهای صفحه برای گوتنبرگ: برگرفته از روح صفحه‌ی اصلی سایت.
   هیرو (تصویرسازی + تیتر کادردار)، خط اتصال، پنل، بخش. فقط var(--sc-…).
   ========================================================= */

/* ظرف صفحه و بخش */
.sc-page { max-width: var(--sc-container); margin-inline: auto; padding-inline: var(--sc-gutter); padding-bottom: var(--sc-section-y); }
.sc-page > * { margin-block: 0; }
.sc-section { padding-block: var(--sc-section-y); }
.sc-center { text-align: center; }
.sc-measure { max-width: var(--sc-measure); margin-inline: auto; }
.sc-page p:not(.sc-mark) { font-size: var(--sc-body-m-size); line-height: var(--sc-body-m-lh); color: var(--sc-text); text-align: start; }
.sc-page .sc-center > p, .sc-page p.sc-center { text-align: center; }

/* کادر عنوان وسط‌چین و هر خط یک کادر (داخل بلوک) */
.sc-mark.is-centered, .sc-center > .sc-mark:not(.is-inline) { margin-inline: auto; }
.sc-mark.is-inline {
  display: inline;
  width: auto;
  background-color: var(--sc-mark-bg);
  color: var(--sc-on-mark);
  padding: var(--sc-mark-pad-y) var(--sc-mark-pad-x);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  border-radius: var(--sc-mark-radius);
  line-height: 1.75;
}

/* ---------- هیرو ---------- */
.sc-hero { padding-block: var(--sc-section-y) var(--sc-space-6); }
.sc-hero.wp-block-columns { align-items: center; gap: 0; margin-bottom: 0; }
.sc-hero .sc-hero-art img { display: block; width: 100%; max-width: var(--sc-hero-art-w); height: auto; margin-inline: auto 0; }
.sc-hero .sc-hero-text { position: relative; z-index: 1; margin-inline-start: calc(-1 * var(--sc-hero-overlap)); }
.sc-hero h1.sc-mark { font-size: var(--sc-hero-title-size); line-height: 1.4; font-weight: var(--sc-weight-bold); margin: 0; }
.sc-hero .sc-hero-sub {
  width: fit-content; margin: var(--sc-space-2) 0 0;
  font-size: var(--sc-body-m-size); font-weight: var(--sc-weight-bold); line-height: 1.6; text-align: start;
}

/* ---------- خط اتصال (میان بخش‌ها) ---------- */
.sc-connector {
  position: relative;
  z-index: 2;
  width: var(--sc-connector-w) !important;
  height: calc(var(--sc-connector-h) + var(--sc-connector-overlap)) !important;
  margin: 0 auto calc(-1 * var(--sc-connector-overlap)) !important;
  background-color: var(--sc-accent);
}
.sc-connector.is-ink { background-color: var(--sc-ink); }

/* ---------- پنل (ظرف خاکستری) ---------- */
.sc-panel {
  background-color: var(--sc-surface);
  border-radius: var(--sc-radius-md);
  padding: var(--sc-space-6) var(--sc-space-4);
}
.sc-panel > * { max-width: var(--sc-measure); margin-inline: auto; }
.sc-panel > :first-child { margin-top: 0; }
.sc-panel > :last-child { margin-bottom: 0; }
.sc-panel h2, .sc-panel h3 { text-align: center; color: var(--sc-ink); }
.sc-panel h2:not(.sc-mark) { font-size: var(--sc-title-l-size); line-height: var(--sc-title-l-lh); margin-bottom: var(--sc-space-3); }
.sc-panel h3.sc-mark { font-size: var(--sc-title-m-size); }
.sc-panel .wp-block-image { margin-inline: auto; margin-bottom: var(--sc-space-4); }
.sc-panel .wp-block-image img { max-width: 240px; height: auto; }
.sc-panel .wp-block-buttons, .sc-center .wp-block-buttons { justify-content: center; gap: var(--sc-space-2); margin-top: var(--sc-space-4); }

/* عنوان بخش */
.sc-section-title { text-align: center; margin-bottom: var(--sc-space-5); }
.sc-section-title h2.sc-mark { font-size: var(--sc-title-l-size); margin-inline: auto; }

/* ---------- موبایل ---------- */
@media (max-width: 781px) {
  .sc-hero .sc-hero-text { text-align: center; margin-top: var(--sc-space-4); }
  .sc-hero .sc-hero-sub { margin-inline: auto; }
  .sc-hero .sc-hero-art img { margin-inline: auto; }
}
@media (max-width: 549px) {
  .sc-panel { padding: var(--sc-space-6) var(--sc-space-3); }
}

/* دکمه‌های گوتنبرگ داخل الگوها = Label L */
.sc-page .wp-block-button .wp-block-button__link { font-size: var(--sc-label-l-size); }

/* پنل پهن: محتوا تمام‌عرض، تیترها راست‌چین */
.sc-panel.is-wide > * { max-width: none; }
.sc-panel.is-wide :is(h2, h3) { text-align: start; }

/* ظاهر شدن نرم از پایین — فقط تصویر هیرو، هنگام بارگذاری (نه اسکرولی) */
@keyframes sc-rise { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
.sc-rise { animation: sc-rise 900ms var(--sc-ease) both; }
@media (prefers-reduced-motion: reduce) { .sc-rise { animation: none; } }
.editor-styles-wrapper .sc-rise { animation: none; }

/* پنل و وسط‌چین: بر قانون‌های عمومی ماژول‌ها (مثل .sh-home p) غلبه کند */
/* style.css چایلد و shift-home.css با !important راست‌چین/justify می‌کنند؛ تا پاک‌سازی مرحله‌ی ۹ ناچار !important */
.sc-page .sc-panel:not(.is-wide) > * { margin-inline: auto !important; }
.sc-page .sc-center > :is(p, h1, h2, h3, h4):not(.sc-mark) { text-align: center !important; }

/* متن پاراگراف‌های پنل: justify، سطر آخر وسط (۳ آبان، به خواست مالک)؛ تیترها وسط‌چین می‌مانند */
.sc-page .sc-center > p:not(.sc-mark) { text-align: justify !important; text-align-last: start; }
/* سطر کوتاه پیش از معادله وسط بماند */
.sc-page .sc-center > p:has(+ .sh-eq) { text-align: center !important; }
