/* =========================================================
   ایران ILO — افزوده‌های وردپرس به طرح ۲۰۲۷
   خروجی بلوک‌های ویرایشگر، دیدگاه‌ها، نوار مدیریت و چند کامپوننت
   که در طرح استاتیک نبودند. بعد از استایل صفحه بارگذاری می‌شود.
   ========================================================= */

/* ---------- دسترس‌پذیری ---------- */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; top: .75rem; right: .75rem; z-index: 100;
  padding: .6rem 1rem; border-radius: var(--r); background: var(--ink); color: #fff; font-weight: 700;
  transform: translateY(-200%); transition: transform var(--t);
}
.skip-link:focus { transform: none; outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: 0; }

/* ---------- نوار مدیریت وردپرس ---------- */
.admin-bar { --sticky-top: calc(var(--header-h) + var(--wp-admin--admin-bar--height, 32px)); }
.admin-bar .header { top: var(--wp-admin--admin-bar--height, 32px); }
.is-header-hidden .admin-bar { --sticky-top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) {
  .admin-bar { --sticky-top: var(--header-h); }
  .admin-bar .header { top: 0; }
}

/* ---------- محتوای ویرایشگر (prose مقاله و article توضیحات دوره) ---------- */
.prose > *:first-child, .article > *:first-child { margin-top: 0; }
.prose img, .article img { height: auto; border-radius: var(--r-lg); }
.prose .wp-block-image, .article .wp-block-image,
.prose .wp-caption, .article .wp-caption { margin-block: 2rem; }
.prose .wp-block-image img, .article .wp-block-image img { width: 100%; background: var(--soft); }
.prose figcaption, .article figcaption, .prose .wp-caption-text, .article .wp-caption-text,
.prose .wp-element-caption, .article .wp-element-caption { margin-top: .6rem; font-size: .82rem; color: var(--muted); line-height: 1.8; text-align: center; }
.prose ol:not([class]), .prose ol.wp-block-list:not(.steps-list), .article ol:not([class]) { display: grid; gap: .55rem; padding-right: 1.4rem; list-style: persian; }
.prose ul ul, .prose ol ol { margin-top: .5rem; }
.prose > ul.steps-list, .prose > ul.chips, .prose > ul.checklist { list-style: none; padding-right: 0; }
.prose hr, .article hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }
.prose code, .article code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; padding: .1rem .4rem; border-radius: 6px; background: var(--soft); direction: ltr; unicode-bidi: embed; }
.prose pre, .article pre { overflow-x: auto; padding: 1rem 1.25rem; border-radius: var(--r); background: var(--ink); color: #e6e8ee; direction: ltr; text-align: left; font-size: .88rem; line-height: 1.8; }
.prose pre code { padding: 0; background: none; color: inherit; }
.prose blockquote:not(.pull):not(.teacher__quote), .article blockquote { padding: 1rem 1.25rem; border-right: 4px solid var(--accent); background: var(--soft); border-radius: var(--r); color: var(--ink); }
.prose blockquote cite { display: block; margin-top: .5rem; font-style: normal; font-size: .85rem; color: var(--muted); }
.prose iframe, .article iframe { max-width: 100%; border: 0; border-radius: var(--r); }
.wp-block-embed__wrapper { position: relative; }
.wp-has-aspect-ratio .wp-block-embed__wrapper iframe { width: 100%; height: 100%; }
.prose .wp-block-table, .article .wp-block-table { margin-block: 1.5rem; }
.prose .wp-block-table table, .article .wp-block-table table { border-collapse: collapse; }
.prose .wp-block-table td, .prose .wp-block-table th { border: 0; border-bottom: 1px solid var(--line); }
.prose .wp-block-buttons, .article .wp-block-buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.prose .wp-block-button__link { display: inline-flex; padding: .7rem 1.4rem; border-radius: var(--r); background: var(--accent); color: #fff !important; text-decoration: none !important; font-weight: 700; }
.prose .wp-block-group.has-background, .article .wp-block-group.has-background { padding: 1.25rem 1.5rem; border-radius: var(--r-lg); }
.prose .callout > :is(p, ul, ol) { margin-top: .2rem; }
.prose .tldr > :first-child { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.prose .chips li, .article .chips li { font-size: .85rem; padding: .3rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); line-height: 1.7; }

/* تراز تصاویر (راست‌چین) */
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; max-width: 50%; }
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; max-width: 50%; }
.aligncenter { margin-inline: auto; display: block; text-align: center; }
.prose::after, .article::after { content: ""; display: table; clear: both; }

/* گالری کلاسیک */
.gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: .75rem; }
.gallery-columns-2 { --cols: 2; } .gallery-columns-4 { --cols: 4; }
.gallery-item img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); }

/* ---------- بلوک‌های قالب قبلی (acf/accordion، listgrid، relatedcourse) ---------- */
.iblock { margin-block: 2.5rem; }
.iblock__title { font-size: 1.4rem; font-weight: 800; margin-bottom: 1rem; }
.iacc { display: grid; gap: .6rem; }
.iacc details { border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.iacc details[open] { border-color: #cfd5de; }
.iacc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; font-weight: 700; color: var(--ink); }
.iacc summary::-webkit-details-marker { display: none; }
.iacc summary .ic { width: 18px; height: 18px; color: var(--muted); transition: transform var(--t); }
.iacc details[open] summary .ic { transform: rotate(180deg); }
.iacc__body { padding: 0 1.1rem 1rem; font-size: .97rem; line-height: 2; }
.iacc__body > * + * { margin-top: .6rem; }
.igrid { list-style: none !important; padding: 0 !important; display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 1rem; }
.igrid li { display: flex; align-items: center; gap: .9rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--ink); font-weight: 500; line-height: 1.8; }
.igrid img { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; object-fit: cover; margin: 0 !important; }
.iblock .course-grid { margin-top: 0; }
@media (max-width: 640px) { .igrid { grid-template-columns: repeat(var(--cols-m, 1), minmax(0, 1fr)); } }

/* ---------- دیدگاه‌ها ---------- */
.comments { list-style: none; }
.comments .children { list-style: none; display: grid; gap: 0; }
.comment__head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.comment__time { margin-inline-start: auto; font-size: .78rem; color: var(--muted); }
.comment__text > * + * { margin-top: .5rem; }
.comment__pending { font-size: .82rem; color: var(--warn, #b45309); }
.comment__reply { display: inline-block; }
.comment-respond { margin-top: 2rem; }
.comment-respond .cform { margin-top: 0; }
.comment-reply-title { font-size: .9rem; color: var(--ink); }
.comment-reply-title small a { color: var(--accent); font-weight: 500; }
.comments .comment-respond { margin-top: 1rem; }
.comments__closed { margin-top: 1rem; font-size: .9rem; color: var(--muted); }
.comments-pagination { margin-top: 1.5rem; }
.comments-pagination .nav-links { display: contents; }
.form-submit, .cform p.form-submit { margin: 0; }

/* ---------- جستجو: تب‌ها به‌صورت لینک (فیلتر سمت سرور) ---------- */
.stabs a { position: relative; padding: .7rem 1rem; font-size: .92rem; color: var(--muted); white-space: nowrap; }
.stabs a small { margin-right: .3rem; padding: 0 .45rem; border-radius: 999px; background: var(--soft); font-size: .72rem; }
.stabs a::after { content: ""; position: absolute; inset: auto 1rem -1px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform var(--t); }
.stabs a[aria-current="page"] { color: var(--accent); font-weight: 500; }
.stabs a[aria-current="page"]::after { transform: scaleX(1); }
.result { position: relative; }

/* ---------- صفحه دوره ---------- */
.chero__lead > * + * { margin-top: .6rem; }
.cvideo--embed { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--ink); }
.cvideo--embed iframe, .cvideo--embed video { display: block; width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; border: 0; }
.cvideo--image img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-lg); }
.sessions-empty { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 1.5rem; border: 1px dashed #cfd5de; border-radius: var(--r-lg); background: #fff; }
.sessions-empty > div { flex: 1 1 260px; }
.sessions-empty strong { display: block; color: var(--ink); }
.sessions-empty p { margin-top: .25rem; font-size: .9rem; color: var(--muted); }
.sessions-empty__icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: 0 0 48px; }
.session__ask { font-size: .9rem; }
.sessions-legacy { margin-bottom: 1.5rem; }
.ic--img { width: 32px; height: 32px; object-fit: contain; flex: 0 0 auto; }

/* ---------- صفحه اصلی ---------- */
.offer--reverse .offer__media { order: 2; }
.offer .btn + .btn { margin-inline-start: .5rem; }
.why__list h3 a:hover { color: var(--accent); }
.footer__about-text { margin-top: 1rem; }
.footer__about-text p { color: inherit; }
.footer__legal a + a { margin-inline-start: .75rem; }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.badges img { height: 56px; width: auto; }
.badges a { display: inline-flex; align-items: center; gap: .75rem; }

/* ---------- برگه‌ها ---------- */
.ahero--page { padding-bottom: 1rem; }
.page-layout { max-width: calc(var(--measure, 760px) + 2.5rem); padding-block: 2rem 5rem; }
.page-layout__main .acomments { margin-top: 3rem; }
.contact-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; align-items: start; padding-block: 2rem 5rem; }
.contact-page__map iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: var(--r-lg); background: var(--soft); }
.contact-page__list { margin-top: 1.5rem; display: grid; gap: .9rem; color: var(--text); }
.contact-page__list li { display: flex; gap: .6rem; align-items: flex-start; }
.contact-page__list .ic { color: var(--accent); margin-top: .35rem; }
.contact-page__phones { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.contact-page__social { margin-top: 1.25rem; }
.contact-page__social a { color: var(--ink); }
.contact-page__form { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
@media (max-width: 860px) { .contact-page { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- ویدیو ---------- */
.acover--video video, .acover--video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--r-lg); background: var(--ink); }

/* ---------- فرم‌های افزونه (Gravity Forms / Contact Form 7) ---------- */
.prose .gform_wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.prose .gform_wrapper select, .prose .gform_wrapper textarea,
.prose .wpcf7 input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.prose .wpcf7 select, .prose .wpcf7 textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font: inherit; font-size: .95rem; color: var(--ink);
}
.prose .gform_wrapper input:focus, .prose .gform_wrapper textarea:focus, .prose .gform_wrapper select:focus,
.prose .wpcf7 input:focus, .prose .wpcf7 textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.prose .gform_wrapper .gform_button, .prose .wpcf7 .wpcf7-submit {
  display: inline-flex; padding: .75rem 1.6rem; border: 0; border-radius: var(--r); background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.prose .gform_wrapper .gform_button:hover, .prose .wpcf7 .wpcf7-submit:hover { background: var(--accent-ink); }
.prose .gform_wrapper .gfield_label { font-size: .88rem; color: var(--ink); font-weight: 500; }
.prose .gform_wrapper .gfield_radio label, .prose .gform_wrapper .gfield_checkbox label { display: inline; }
.prose .gform_wrapper ul, .prose .gform_wrapper ol { list-style: none; padding: 0; }

/* ---------- چاپ ---------- */
@media print {
  .header, .footer, .contact, .to-top, .rdock, .readbar, .alayout__side, .byline__tools, .feedback, .acomments, .arelated, .pager, .mbar, .ctabs, .chipbar { display: none !important; }
  .alayout { display: block; padding: 0; }
  .prose a { color: inherit; text-decoration: none; }
}
