/**
 * Ram Content Generator — bidirectional content rendering.
 *
 * Loaded on single/archive views of rcg_short_answer and rcg_full_answer.
 * Deliberately narrow: everything is scoped under .rcg-content so the theme
 * keeps control of everything else on the page.
 */

.rcg-content {
	unicode-bidi: isolate;
}

/*
 * `plaintext` makes each block choose its own base direction from its first
 * strong character. That is what stops an English-opening paragraph inside a
 * Persian article from dragging its punctuation to the wrong end — and vice
 * versa in an English article quoting Persian.
 */
.rcg-content p,
.rcg-content li,
.rcg-content dt,
.rcg-content dd,
.rcg-content h1,
.rcg-content h2,
.rcg-content h3,
.rcg-content h4,
.rcg-content h5,
.rcg-content h6,
.rcg-content blockquote,
.rcg-content figcaption,
.rcg-content th,
.rcg-content td,
.rcg-content caption {
	unicode-bidi: plaintext;
}

/* Latin runs isolated by RCG_Bidi::isolate_html(). */
.rcg-content bdi {
	unicode-bidi: isolate;
}

/* ---------------------------------------------------------------- RTL sets */

.rcg-content.rcg-rtl {
	direction: rtl;
	text-align: right;
	font-family: var(--rcg-rtl-font, inherit);
	line-height: 1.9; /* Persian needs more leading than Latin at equal size */
}

.rcg-content.rcg-rtl ul,
.rcg-content.rcg-rtl ol {
	padding-right: 1.6em;
	padding-left: 0;
	margin-right: 0;
}

.rcg-content.rcg-rtl blockquote {
	border-right: 3px solid currentColor;
	border-left: 0;
	padding-right: 1em;
	padding-left: 0;
	margin-right: 0;
}

.rcg-content.rcg-rtl th,
.rcg-content.rcg-rtl td {
	text-align: right;
}

.rcg-content.rcg-rtl table {
	direction: rtl;
}

/* Media and companion links follow the reading direction. */
.rcg-content.rcg-rtl .rcg-companion-link {
	text-align: right;
}

.rcg-content .rcg-audio,
.rcg-content .rcg-video {
	margin: 1.2em 0;
}

.rcg-content .rcg-audio audio,
.rcg-content .rcg-video video {
	width: 100%;
	max-width: 100%;
	direction: ltr; /* player chrome is always LTR */
}

/*
 * Keep numerals and Latin terms upright and unstyled inside RTL prose — some
 * themes apply italic or letter-spacing that reads badly mid-Persian.
 */
.rcg-content.rcg-rtl bdi {
	font-style: normal;
	letter-spacing: normal;
}

/* ---- 1.3.0 (§24.3): article footer — reviewed-by note, profile card, disclaimer.
   Deliberately quiet: inherits the theme's typography and colors so the card
   reads as part of the site, not a widget. Logical properties keep it correct
   in both LTR and RTL without direction-specific rules. */
.rcg-reviewed-note {
	margin-block: 2em 0.75em;
	font-size: 0.95em;
	opacity: 0.85;
}
.rcg-profile-card {
	display: flex;
	gap: 1.1em;
	align-items: flex-start;
	margin-block: 1em 1.25em;
	padding: 1.1em 1.25em;
	border: 1px solid currentColor;
	border-radius: 6px;
	background: transparent;
}
.rcg-profile-card { border-color: color-mix(in srgb, currentColor 25%, transparent); }
.rcg-profile-media { flex: 0 0 auto; }
.rcg-profile-media img.rcg-profile-photo {
	width: 84px; height: 84px;
	object-fit: cover;
	border-radius: 50%;
	max-width: 100%;
}
.rcg-profile-body { flex: 1 1 auto; min-width: 0; }
.rcg-profile-body p { margin-block: 0 0.45em; }
.rcg-profile-name { font-weight: 700; font-size: 1.05em; }
.rcg-profile-title { font-size: 0.92em; opacity: 0.85; }
.rcg-profile-bio { font-size: 0.95em; }
.rcg-profile-areas { font-size: 0.92em; }
.rcg-profile-links { font-size: 0.92em; }
.rcg-profile-links a { text-decoration: underline; text-underline-offset: 2px; }
.rcg-profile-sep { opacity: 0.5; }
.rcg-disclaimer {
	margin-block: 0.5em 0;
	font-size: 0.85em;
	opacity: 0.7;
}
@media (max-width: 480px) {
	.rcg-profile-card { flex-direction: column; }
}
