/* RGB Live Visual Evidence (rgb-shots) - Liquid Glass Dark v3.0 + MWG 1.0
 * Compliance:
 *  - Uniform 1px borders ONLY (zero single-edge colored stripes / railroad bars)
 *  - Zero eyebrow micro-badges above headings
 *  - Zero px font-sizes (rem / clamp only), zero RTL letter-spacing
 *  - Apple concentric radii (--r-lg: 26px -> --r-md: 18px -> --r-sm: 12px -> --r-xs: 8px)
 *  - Native <dialog closedby="any"> with overscroll-behavior: contain & backdrop scroll lock
 *  - Safe vh fallback before dvh; prefers-reduced-motion & forced-colors support
 */

.rgbs-sec {
	padding: var(--sp-10, 40px) 0;
}

.rgbs-sec-inline {
	margin: var(--sp-8, 32px) 0;
	padding: 0;
}

.rgbs-shell {
	background: var(--surface, rgba(255, 255, 255, 0.045));
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: var(--r-lg, 26px);
	padding: var(--sp-6, 24px) var(--sp-8, 32px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 24px 60px -18px rgba(0, 0, 0, 0.55);
}

.rgbs-sec-inline .rgbs-shell {
	padding: var(--sp-6, 24px);
	border-radius: var(--r-md, 18px);
}

/* Zone 1: Compact Hero Visual Spotlight (rgb_after_hero priority 20) */
.rgbs-spot-sec {
	padding: var(--sp-4, 16px) 0 var(--sp-5, 20px);
}

.rgbs-spot-shell {
	background: var(--surface, rgba(255, 255, 255, 0.045));
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: var(--r-lg, 26px);
	padding: var(--sp-4, 16px) var(--sp-5, 20px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 18px 46px -18px rgba(0, 0, 0, 0.55);
}

.rgbs-spot-bar,
.rgbs-mid-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3, 12px);
	margin-bottom: var(--sp-3, 12px);
}

.rgbs-spot-label,
.rgbs-mid-label {
	margin: 0;
	font-size: 0.96rem;
	line-height: 1.5;
	font-weight: 800;
	color: var(--text, #eef1f8);
}

.rgbs-fig-compact {
	padding: var(--sp-2, 10px);
	gap: var(--sp-2, 10px);
	border-radius: var(--r-md, 16px);
}

.rgbs-fig-compact .rgbs-cap-text {
	font-size: 0.84rem;
	line-height: 1.6;
}

/* Zone 2: Contextual Mid-Article Proof inside Blog .prose (zero heading tags -> pure TOC) */
.rgbs-mid {
	margin: var(--sp-7, 28px) 0;
	padding: var(--sp-4, 16px) var(--sp-5, 20px);
	background: var(--surface, rgba(255, 255, 255, 0.045));
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: var(--r-md, 18px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 40px -16px rgba(0, 0, 0, 0.5);
}

.prose .rgbs-mid p.rgbs-mid-label {
	margin: 0;
	padding: 0;
	font-size: 0.94rem;
	line-height: 1.5;
	font-weight: 800;
	color: var(--text, #eef1f8);
}

.prose .rgbs-mid figure.rgbs-fig {
	margin: 0;
}

.prose .rgbs-mid img.rgbs-img {
	margin: 0;
	border: 0;
	border-radius: 0;
}

.rgbs-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--sp-4, 16px);
	margin-bottom: var(--sp-5, 20px);
}

.rgbs-head-copy {
	max-width: 70ch;
}

.rgbs-title {
	margin: 0 0 var(--sp-2, 8px);
	font-size: clamp(1.3rem, 2.4vw, 1.78rem);
	line-height: 1.45;
	font-weight: 800;
	color: var(--text, #eef1f8);
	text-wrap: balance;
}

.rgbs-sec-inline .rgbs-title,
.prose .rgbs-sec-inline h2.rgbs-title {
	margin: 0 0 var(--sp-2, 8px);
	padding: 0;
	font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.prose .rgbs-sec-inline h2.rgbs-title::before,
.prose .rgbs-sec-inline h2.rgbs-title::after,
.prose .rgbs-sec-inline h3.rgbs-lb-title::before,
.prose .rgbs-sec-inline h3.rgbs-lb-title::after {
	content: none;
}

.prose .rgbs-sec-inline h3.rgbs-lb-title {
	margin: 0;
	padding: 0;
}

.prose .rgbs-sec-inline figure.rgbs-fig,
.prose .rgbs-sec-inline figure.rgbs-lb-stage {
	margin: 0;
}

.prose .rgbs-sec-inline img.rgbs-img {
	margin: 0;
	border: 0;
	border-radius: 0;
}

.rgbs-lead {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.85;
	color: var(--text-2, #a9b1c3);
}

.rgbs-meta-count {
	font-size: 0.8rem;
	line-height: 1.5;
	font-weight: 700;
	color: var(--text-3, #8690a6);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	padding: 0.34rem 0.78rem;
	border-radius: var(--r-pill, 999px);
	background: var(--surface-2, rgba(255, 255, 255, 0.075));
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
}

/* Gallery Grid */
.rgbs-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--sp-5, 20px);
	align-items: start;
}

.rgbs-grid-single {
	grid-template-columns: minmax(0, 1fr);
	max-width: 880px;
}

/* Concentric Card & Figure (outer 18px - 10px pad = 8px inner radius) */
.rgbs-fig {
	margin: 0;
	background: var(--bg-2, #0b0f1a);
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: var(--r-md, 18px);
	padding: var(--sp-3, 12px);
	display: flex;
	flex-direction: column;
	gap: var(--sp-3, 12px);
	min-width: 0;
}

.rgbs-trigger {
	appearance: none;
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: var(--r-xs, 8px);
	background: var(--bg, #07090f);
	overflow: hidden;
	cursor: zoom-in;
	text-align: start;
}

.rgbs-trigger:hover {
	border-color: var(--border-2, rgba(255, 255, 255, 0.18));
}

.rgbs-trigger:focus-visible,
.rgbs-lb-btn:focus-visible,
.rgbs-lb-close:focus-visible {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.35);
}

.rgbs-media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background: var(--bg, #07090f);
}

.rgbs-media.is-mobile {
	padding: var(--sp-3, 12px) 0;
	background: radial-gradient(circle at 50% 25%, rgba(77, 159, 255, 0.12), rgba(7, 9, 15, 0.96) 72%);
}

.rgbs-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.rgbs-media.is-mobile .rgbs-img {
	width: auto;
	max-width: 240px;
	max-height: 460px;
	aspect-ratio: 1 / 2;
	object-fit: contain;
}

.rgbs-cap {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2, 8px);
	padding: 0 var(--sp-1, 4px) var(--sp-1, 4px);
}

.rgbs-cap-text {
	font-size: 0.88rem;
	line-height: 1.7;
	font-weight: 600;
	color: var(--text, #eef1f8);
}

.rgbs-cap-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-2, 8px);
	font-size: 0.78rem;
	line-height: 1.5;
	color: var(--text-3, #8690a6);
	font-variant-numeric: tabular-nums;
}

.rgbs-cap-dom {
	font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
	font-size: 0.76rem;
	color: var(--blue, #4d9fff);
}

.rgbs-cap-tag {
	display: inline-flex;
	align-items: center;
	padding: 0.14rem 0.56rem;
	border-radius: var(--r-pill, 999px);
	background: var(--surface-2, rgba(255, 255, 255, 0.075));
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	color: var(--text-2, #a9b1c3);
	font-size: 0.74rem;
	font-weight: 700;
}

.rgbs-cap-date {
	color: var(--text-3, #8690a6);
}

/* Native <dialog closedby="any"> Zoom Lightbox (MWG 1.0 compliant) */
dialog.rgbs-dialog {
	padding: 0;
	border: 1px solid var(--border-2, rgba(255, 255, 255, 0.18));
	border-radius: var(--r-lg, 26px);
	background: var(--bg-2, #0b0f1a);
	color: var(--text, #eef1f8);
	width: min(1160px, calc(100vw - 24px));
	max-width: 1160px;
	max-height: 92vh;
	max-height: 92dvh;
	overflow: auto;
	margin: auto;
	box-shadow: 0 32px 90px -16px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

dialog.rgbs-dialog[open] {
	display: flex;
	flex-direction: column;
}

/* MANDATORY MWG 1.0 scroll-chaining prevention rules */
dialog.rgbs-dialog:modal {
	overscroll-behavior: contain;
}

dialog.rgbs-dialog::backdrop {
	overflow: hidden;
	overscroll-behavior: contain;
	background: rgba(4, 6, 12, 0.84);
	backdrop-filter: blur(10px);
}

.rgbs-lb-inner {
	display: flex;
	flex-direction: column;
	gap: var(--sp-4, 16px);
	padding: var(--sp-5, 20px);
}

.rgbs-lb-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3, 12px);
	padding-bottom: var(--sp-3, 12px);
	border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.09));
}

.rgbs-lb-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.5;
	font-weight: 800;
	color: var(--text, #eef1f8);
}

.rgbs-lb-actions {
	display: flex;
	align-items: center;
	gap: var(--sp-2, 8px);
}

.rgbs-lb-form {
	margin: 0;
}

.rgbs-lb-btn,
.rgbs-lb-close {
	appearance: none;
	font-family: inherit;
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.4;
	min-height: 40px;
	padding: 0.42rem 0.95rem;
	border-radius: var(--r-pill, 999px);
	cursor: pointer;
	border: 1px solid var(--border-2, rgba(255, 255, 255, 0.18));
	background: var(--surface-2, rgba(255, 255, 255, 0.075));
	color: var(--text, #eef1f8);
}

.rgbs-lb-close {
	background: var(--blue-fill, #2563eb);
	border-color: rgba(77, 159, 255, 0.55);
	color: #ffffff;
}

.rgbs-lb-stage {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--sp-3, 12px);
}

.rgbs-lb-img {
	display: block;
	max-width: 100%;
	width: auto;
	height: auto;
	max-height: 70vh;
	max-height: 70dvh;
	border-radius: var(--r-sm, 12px);
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	background: var(--bg, #07090f);
}

.rgbs-lb-cap {
	width: 100%;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-2, 8px) var(--sp-4, 16px);
	font-size: 0.88rem;
	line-height: 1.7;
	color: var(--text-2, #a9b1c3);
}

.rgbs-lb-cap-main,
.rgbs-lb-cap-side {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-2, 8px);
}

.rgbs-lb-badge,
.rgbs-zoom-pill {
	display: inline-flex;
	align-items: center;
	padding: 0.14rem 0.58rem;
	border-radius: var(--r-pill, 999px);
	background: rgba(77, 159, 255, 0.13);
	border: 1px solid rgba(77, 159, 255, 0.36);
	color: var(--blue, #4d9fff);
	font-size: 0.74rem;
	font-weight: 700;
	line-height: 1.45;
	white-space: nowrap;
}

.rgbs-lb-ext {
	display: inline-flex;
	align-items: center;
	padding: 0.22rem 0.72rem;
	border-radius: var(--r-pill, 999px);
	background: var(--surface-2, rgba(255, 255, 255, 0.075));
	border: 1px solid var(--border-2, rgba(255, 255, 255, 0.18));
	color: var(--text, #eef1f8);
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.rgbs-lb-ext:hover {
	border-color: rgba(77, 159, 255, 0.55);
	color: var(--blue, #4d9fff);
}

.rgbs-lb-cap-meta {
	font-size: 0.8rem;
	color: var(--text-3, #8690a6);
	font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   v2.0.0 INLINE EVIDENCE ATTACHMENTS (Tools, Sources, Blog Cites, Real Data)
   Strictly uniform 1px borders, Apple concentric radii, zero accent stripes!
   ========================================================================== */

/* 1. Learn "ابزارهایی که واقعا کمک می کنند" (.rgbl-tool-tile) */
.rgbl-tool-tile.has-rgbs-shot {
	display: flex;
	flex-direction: column;
}

.rgbs-tool-shot {
	margin: auto 0 0;
	padding-top: var(--sp-3, 12px);
	display: flex;
	flex-direction: column;
	gap: var(--sp-2, 8px);
}

.rgbs-tool-trigger {
	border-radius: var(--r-xs, 8px);
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	background: var(--bg, #07090f);
	overflow: hidden;
}

.rgbs-tool-shot-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-2, 8px);
	font-size: 0.76rem;
	line-height: 1.5;
	color: var(--text-3, #8690a6);
}

.rgbs-tool-shot-lbl {
	font-weight: 700;
	color: var(--text-2, #a9b1c3);
}

/* 2. Learn & Blog "منبع ها:" Visual Source Evidence Strip */
.rgbl-ai-sources a[data-rgbs-has-shot="1"] {
	border-color: rgba(77, 159, 255, 0.34);
}

.rgbs-src-strip {
	margin-top: var(--sp-5, 20px);
	padding: var(--sp-5, 20px);
	background: var(--surface, rgba(255, 255, 255, 0.045));
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: var(--r-md, 18px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 46px -18px rgba(0, 0, 0, 0.52);
}

.rgbs-src-strip-prose {
	margin: var(--sp-6, 24px) 0;
}

.rgbs-src-strip-head {
	margin-bottom: var(--sp-4, 16px);
}

.rgbs-src-strip-title,
.prose .rgbs-src-strip p.rgbs-src-strip-title {
	margin: 0 0 var(--sp-1, 4px);
	padding: 0;
	font-size: 1rem;
	line-height: 1.5;
	font-weight: 800;
	color: var(--text, #eef1f8);
}

.rgbs-src-strip-lead,
.prose .rgbs-src-strip p.rgbs-src-strip-lead {
	margin: 0;
	padding: 0;
	font-size: 0.86rem;
	line-height: 1.75;
	color: var(--text-2, #a9b1c3);
}

.rgbs-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prose .rgbs-src-strip figure.rgbs-fig {
	margin: 0;
}

.prose .rgbs-src-strip img.rgbs-img {
	margin: 0;
	border: 0;
	border-radius: 0;
}

/* 3. AI "منابع" Row Thumbnail (section.rgba-sources li.rgba-source) */
li.rgba-source.has-rgbs-row-shot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3, 12px) var(--sp-4, 16px);
}

.rgbs-src-row-btn {
	position: relative;
	flex: 0 0 auto;
	width: 144px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: var(--r-xs, 8px);
	background: var(--bg, #07090f);
	overflow: hidden;
	cursor: zoom-in;
}

.rgbs-src-row-btn:hover {
	border-color: rgba(77, 159, 255, 0.55);
}

.rgbs-src-row-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.rgbs-src-row-tag {
	position: absolute;
	inset-block-end: 4px;
	inset-inline-start: 4px;
	padding: 0.08rem 0.42rem;
	border-radius: var(--r-pill, 999px);
	background: rgba(7, 9, 15, 0.82);
	border: 1px solid rgba(77, 159, 255, 0.45);
	color: var(--blue, #4d9fff);
	font-size: 0.66rem;
	font-weight: 700;
	line-height: 1.35;
}

/* 4. Blog Inline Citation Proof Pill (.prose a + .rgbs-inline-cite-btn) */
.rgbs-inline-cite-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 0.28rem;
	margin-inline-start: 0.35rem;
	padding: 0.1rem 0.52rem;
	border-radius: var(--r-pill, 999px);
	background: rgba(77, 159, 255, 0.11);
	border: 1px solid rgba(77, 159, 255, 0.34);
	color: var(--blue, #4d9fff);
	font-family: inherit;
	font-size: 0.74rem;
	font-weight: 700;
	line-height: 1.5;
	cursor: zoom-in;
	vertical-align: baseline;
	white-space: nowrap;
}

.rgbs-inline-cite-btn:hover {
	background: rgba(77, 159, 255, 0.2);
	border-color: rgba(77, 159, 255, 0.58);
}

/* 5. Real Data ("داده های واقعی" / rgb-intel .rgbi-table .rgbi-dom-cell) */
.rgbs-dom-thumb {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 64px;
	height: 40px;
	padding: 0;
	margin-inline-start: auto;
	border: 1px solid var(--border, rgba(255, 255, 255, 0.09));
	border-radius: 6px;
	background: var(--bg, #07090f);
	overflow: hidden;
	cursor: zoom-in;
	vertical-align: middle;
}

.rgbs-dom-thumb:hover {
	border-color: rgba(77, 159, 255, 0.6);
}

.rgbs-dom-thumb-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rgbs-src-row-btn:focus-visible,
.rgbs-inline-cite-btn:focus-visible,
.rgbs-dom-thumb:focus-visible,
.rgbs-lb-ext:focus-visible {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: 0 0 0 3px rgba(77, 159, 255, 0.38);
}

/* Reduced Motion Gate (MWG 1.0 & Brand Constitution Section 6) */
@media (prefers-reduced-motion: no-preference) {
	.rgbs-trigger,
	.rgbs-lb-btn,
	.rgbs-lb-close,
	.rgbs-fig {
		transition: border-color 160ms cubic-bezier(0.4, 0, 0.2, 1),
			background-color 160ms cubic-bezier(0.4, 0, 0.2, 1),
			transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
	}
	.rgbs-trigger:hover .rgbs-img {
		transform: scale(1.012);
	}
	.rgbs-img {
		transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
	}
}

/* High-Contrast Forced Colors Accessibility */
@media (forced-colors: active) {
	.rgbs-shell,
	.rgbs-spot-shell,
	.rgbs-mid,
	.rgbs-fig,
	.rgbs-trigger,
	.rgbs-cap-tag,
	.rgbs-meta-count,
	.rgbs-lb-btn,
	.rgbs-lb-close,
	dialog.rgbs-dialog {
		border: 1px solid CanvasText;
	}
}

@media (max-width: 980px) {
	.rgbs-grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Responsive Breakpoints */
@media (max-width: 780px) {
	.rgbs-shell,
	.rgbs-spot-shell,
	.rgbs-mid,
	.rgbs-src-strip {
		padding: var(--sp-4, 16px);
		border-radius: var(--r-md, 18px);
	}
	.rgbs-grid,
	.rgbs-grid-3 {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--sp-4, 16px);
	}
	.rgbs-dom-thumb {
		width: 50px;
		height: 32px;
	}
	.rgbs-src-row-btn {
		width: 120px;
	}
	dialog.rgbs-dialog {
		border-radius: var(--r-md, 18px);
	}
	.rgbs-lb-inner {
		padding: var(--sp-4, 16px);
	}
}
