/* ==========================================================================
   Jewel blog kit — inherits the theme's font; colours come from settings.
   ========================================================================== */
:root {
	--mbk-main: #2B1533;
	--mbk-accent: #C8A04B;
	--mbk-soft: color-mix(in srgb, var(--mbk-accent) 12%, #fff);
	--mbk-line: color-mix(in srgb, var(--mbk-main) 12%, #fff);
	--mbk-muted: color-mix(in srgb, var(--mbk-main) 55%, #888);
	--mbk-r: 16px;
	--mbk-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8' preserveAspectRatio='none'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.6' d='M0 2C10 2 10 7 20 7S30 2 40 2'/%3E%3C/svg%3E");
}
.mbk-article, .mbk-article *, .mbk-progress, .mbk-lightbox { box-sizing: border-box; }
.mbk-ic { flex: none; vertical-align: middle; }

/* Reading meta */
.mbk-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 22px; font-size: .88em; color: var(--mbk-muted); }
.mbk-meta span { display: inline-flex; align-items: center; gap: 6px; }
.mbk-meta .mbk-ic { color: var(--mbk-accent); }

/* Progress bar */
.mbk-progress { position: fixed; z-index: 99999; inset: 0 0 auto 0; height: 3px; pointer-events: none; }
.mbk-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--mbk-accent), var(--mbk-main)); transform: scaleX(0); transform-origin: right; transition: transform .1s linear; }
.admin-bar .mbk-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .mbk-progress { top: 46px; } }

/* Table of contents */
.mbk-toc { margin: 26px 0 30px; border-radius: var(--mbk-r); background: var(--mbk-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mbk-accent) 30%, transparent); }
.mbk-toc summary { display: flex; align-items: center; gap: 8px; padding: 14px 18px; cursor: pointer; font-weight: 700; color: var(--mbk-main); list-style: none; }
.mbk-toc summary::-webkit-details-marker { display: none; }
.mbk-toc summary small { margin-inline-start: auto; font-weight: 400; color: var(--mbk-muted); }
.mbk-toc summary::after { content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(-45deg); margin-inline-start: 10px; transition: transform .2s; }
.mbk-toc details[open] summary::after { transform: rotate(135deg); }
.mbk-toc ol { margin: 0; padding: 0 18px 16px 18px; padding-inline-start: 36px; list-style: persian; }
.mbk-toc ol ol { padding: 2px 0 4px; padding-inline-start: 20px; font-size: .94em; list-style: circle; }
.mbk-toc li { margin: 4px 0; line-height: 1.8; }
.mbk-toc li::marker { color: var(--mbk-accent); font-weight: 700; }
.mbk-toc a { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; }
.mbk-toc a:hover { color: var(--mbk-main); border-bottom-color: var(--mbk-accent); }

/* Article typography (only with «زیباسازی متن» on) */
.mbk-article.is-styled .mbk-body { line-height: 2; }
.mbk-article.is-styled .mbk-body > p { margin: 0 0 1.15em; }
.mbk-article.is-styled .mbk-body h2 { position: relative; margin: 2em 0 .8em; padding-bottom: 14px; color: var(--mbk-main); line-height: 1.5; scroll-margin-top: 90px; }
.mbk-article.is-styled .mbk-body h2::after {
	content: ""; position: absolute; right: 0; bottom: 0; width: 64px; height: 7px; background: var(--mbk-accent);
	-webkit-mask: var(--mbk-wave) repeat-x 0 0 / 22px 7px; mask: var(--mbk-wave) repeat-x 0 0 / 22px 7px;
}
.mbk-article.is-styled .mbk-body h3 { margin: 1.6em 0 .6em; color: var(--mbk-main); line-height: 1.6; scroll-margin-top: 90px; }
.mbk-article.is-styled .mbk-body h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 10px; border-radius: 2px; background: var(--mbk-accent); transform: rotate(45deg) translateY(-3px); }
.mbk-article.is-styled .mbk-body a:not([class]) { color: var(--mbk-main); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--mbk-accent) 70%, transparent); text-underline-offset: 5px; }
.mbk-article.is-styled .mbk-body ul:not([class]) li::marker { color: var(--mbk-accent); }
.mbk-article.is-styled .mbk-body blockquote:not([class]) { margin: 1.6em 0; padding: 18px 22px; border: 0; border-inline-start: 4px solid var(--mbk-accent); border-radius: 0 var(--mbk-r) var(--mbk-r) 0; background: var(--mbk-soft); font-size: 1.05em; color: var(--mbk-main); }
.mbk-article.is-styled .mbk-body blockquote p:last-child { margin: 0; }
.mbk-article.is-styled .mbk-body img { border-radius: 14px; height: auto; }
.mbk-article.is-styled .mbk-body figcaption, .mbk-article.is-styled .mbk-body .wp-caption-text { font-size: .86em; color: var(--mbk-muted); text-align: center; margin-top: 8px; }
.mbk-article.is-styled .mbk-body table { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--mbk-line); margin: 1.4em 0; font-size: .94em; }
.mbk-article.is-styled .mbk-body th { background: var(--mbk-main); color: #fff; font-weight: 600; }
.mbk-article.is-styled .mbk-body th, .mbk-article.is-styled .mbk-body td { padding: 10px 14px; text-align: right; border: 0; border-bottom: 1px solid var(--mbk-line); }
.mbk-article.is-styled .mbk-body tr:nth-child(even) td { background: color-mix(in srgb, var(--mbk-soft) 60%, #fff); }
.mbk-zoomable { cursor: zoom-in; }

/* Boxes: shortcodes and block styles share the look */
.mbk-box, .is-style-mbk-tip, .is-style-mbk-warning, .is-style-mbk-note {
	margin: 1.6em 0; padding: 16px 20px; border-radius: var(--mbk-r); line-height: 1.95;
	background: var(--mbk-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mbk-accent) 35%, transparent);
}
.mbk-box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--mbk-main); }
.mbk-box-head .mbk-ic { color: var(--mbk-accent); }
.mbk-box-body > :last-child { margin-bottom: 0; }
.mbk-box-warning, .is-style-mbk-warning { background: #fff5f3; box-shadow: inset 0 0 0 1px #f0c6bd; }
.mbk-box-warning .mbk-box-head, .mbk-box-warning .mbk-box-head .mbk-ic { color: #a2321f; }
.mbk-box-note, .is-style-mbk-note { background: #f4f6fb; box-shadow: inset 0 0 0 1px #d8deee; }
.mbk-box-note .mbk-box-head .mbk-ic { color: #3d5aa8; }
.is-style-mbk-tip::before, .is-style-mbk-warning::before, .is-style-mbk-note::before { display: block; font-weight: 700; margin-bottom: 4px; color: var(--mbk-main); }
.is-style-mbk-tip::before { content: "✦ نکته"; }
.is-style-mbk-warning::before { content: "⚠ هشدار"; color: #a2321f; }
.is-style-mbk-note::before { content: "ⓘ بیشتر بدانید"; }
.is-style-mbk-tip > :last-child, .is-style-mbk-warning > :last-child, .is-style-mbk-note > :last-child { margin-bottom: 0; }
blockquote.is-style-mbk-gold { margin: 1.8em 0; padding: 26px 28px 22px; border: 0; border-radius: var(--mbk-r); background: var(--mbk-main); color: #fff; font-size: 1.12em; position: relative; }
blockquote.is-style-mbk-gold::before { content: "«"; position: absolute; top: -6px; right: 18px; font-size: 64px; line-height: 1; color: var(--mbk-accent); }
blockquote.is-style-mbk-gold cite { display: block; margin-top: 8px; font-size: .8em; color: color-mix(in srgb, var(--mbk-accent) 70%, #fff); font-style: normal; }
.is-style-mbk-soft img { border-radius: 18px; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .45); }

/* FAQ */
.mbk-body p:empty { display: none; }
.mbk-faq, details.is-style-mbk-faq { margin: 10px 0; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--mbk-line); overflow: hidden; }
.mbk-faq summary, details.is-style-mbk-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; cursor: pointer; font-weight: 600; color: var(--mbk-main); list-style: none; }
.mbk-faq summary::-webkit-details-marker, details.is-style-mbk-faq summary::-webkit-details-marker { display: none; }
.mbk-faq summary::after, details.is-style-mbk-faq summary::after { content: "+"; flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--mbk-soft); color: var(--mbk-main); font-weight: 400; transition: transform .2s; }
.mbk-faq[open] summary::after, details.is-style-mbk-faq[open] summary::after { transform: rotate(45deg); }
.mbk-faq-a { padding: 0 18px 14px; color: color-mix(in srgb, var(--mbk-main) 75%, #555); }
.mbk-faq-a > :last-child { margin-bottom: 0; }
details.is-style-mbk-faq > :not(summary) { padding: 0 18px 14px; margin: 0; }

/* Products inside and after the article */
.mbk-products-title { font-weight: 700; color: var(--mbk-main); margin: 1.6em 0 .6em; }
.mbk-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin: 1em 0 1.8em; }
.mbk-pcard { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 12px; border-radius: var(--mbk-r); background: #fff; box-shadow: 0 0 0 1px var(--mbk-line); text-decoration: none !important; color: inherit; transition: box-shadow .2s, transform .2s; }
.mbk-pcard:hover { box-shadow: 0 0 0 1px var(--mbk-accent), 0 18px 34px -24px rgba(0, 0, 0, .45); transform: translateY(-2px); }
.mbk-pcard-img { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--mbk-soft); margin-bottom: 6px; }
.mbk-pcard-img img { width: 100% !important; height: 100% !important; object-fit: contain; mix-blend-mode: multiply; margin: 0 !important; border-radius: 0 !important; }
.mbk-pcard-name { font-size: .9em; font-weight: 600; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.4em; }
.mbk-pcard-price { font-size: .9em; font-weight: 700; color: var(--mbk-main); }
.mbk-pcard-price del { font-weight: 400; opacity: .55; font-size: .9em; }
.mbk-pcard-price ins { text-decoration: none; }
.mbk-pcard-go { margin-top: auto; padding-top: 6px; font-size: .82em; color: var(--mbk-accent); font-weight: 700; }
.mbk-pline { display: flex; align-items: center; gap: 12px; margin: 1.2em 0; padding: 10px 12px; border-radius: var(--mbk-r); background: var(--mbk-soft); text-decoration: none !important; color: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mbk-accent) 30%, transparent); }
.mbk-pline img { width: 64px !important; height: 64px !important; object-fit: cover; border-radius: 10px !important; flex: none; margin: 0 !important; }
.mbk-pline span { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.7; }
.mbk-pline b { color: var(--mbk-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbk-pline small { color: var(--mbk-muted); }
.mbk-pline em { font-style: normal; padding: 6px 14px; border-radius: 999px; background: var(--mbk-main); color: #fff; font-size: .85em; flex: none; }

/* End of article */
.mbk-end { margin-top: 2.6em; display: grid; gap: 26px; }
.mbk-end-title { font-size: 1.25em; color: var(--mbk-main); margin: 0 0 12px; }
.mbk-end-products .mbk-products { margin: 0; }
.mbk-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; border-radius: 20px; background: var(--mbk-main); color: #fff; }
.mbk-cta b { display: block; font-size: 1.15em; margin-bottom: 2px; }
.mbk-cta p { margin: 0; opacity: .85; font-size: .94em; max-width: 52ch; }
.mbk-cta-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mbk-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 999px; background: var(--mbk-accent); color: var(--mbk-main) !important; font-weight: 700; font-size: .92em; text-decoration: none !important; }
.mbk-btn-line { background: transparent; color: #fff !important; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6); }
.mbk-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--mbk-line); font-size: .92em; color: var(--mbk-muted); }
.mbk-share a, .mbk-share button { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--mbk-soft); color: var(--mbk-main); cursor: pointer; text-decoration: none; padding: 0; }
.mbk-share button { width: auto; display: inline-flex; gap: 6px; padding: 0 14px; border-radius: 999px; font: inherit; }
.mbk-share a:hover, .mbk-share button:hover { background: var(--mbk-accent); }
.mbk-author { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px var(--mbk-line); }
.mbk-author img { border-radius: 50% !important; flex: none; }
.mbk-author small { color: var(--mbk-muted); display: block; }
.mbk-author b { color: var(--mbk-main); display: block; margin-bottom: 4px; }
.mbk-author p { margin: 0; font-size: .92em; line-height: 1.9; }
.mbk-rel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.mbk-rel-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none !important; color: inherit; }
.mbk-rel-img { display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: var(--mbk-soft); }
.mbk-rel-img img { width: 100% !important; height: 100% !important; object-fit: cover; margin: 0 !important; border-radius: 0 !important; transition: transform .5s; }
.mbk-rel-card:hover img { transform: scale(1.04); }
.mbk-rel-card b { line-height: 1.7; color: var(--mbk-main); }
.mbk-rel-card small { display: inline-flex; align-items: center; gap: 4px; color: var(--mbk-muted); font-size: .82em; }

/* Lightbox */
.mbk-lightbox { position: fixed; inset: 0; z-index: 100000; background: rgba(20, 10, 24, .88); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: mbk-fade .2s ease; }
.mbk-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
@keyframes mbk-fade { from { opacity: 0; } }

@media (max-width: 600px) {
	.mbk-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.mbk-cta { padding: 18px; }
	.mbk-author { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
	.mbk-pcard, .mbk-rel-img img, .mbk-progress span { transition: none; }
	.mbk-lightbox { animation: none; }
}
