/*
 * Legal Agent — public site sections. "Navy & bone" direction.
 *
 * Scoped entirely to .legal-agent-rtl (the wrapper on every pattern section),
 * so this restyles the plugin's own pages without touching the rest of the
 * site. The patterns keep using core's palette classes
 * (has-primary-background-color, …), which resolve through the
 * --wp--preset--color--* custom properties redefined below — so the sections
 * stay fully editable in the block editor and still render correctly if the
 * theme is switched.
 *
 * Colour roles are split by contrast, not by vibe. --la-gold measures 3.00:1
 * against bone, which fails WCAG AA for text, so it is used only for rules,
 * borders and large decorative marks; --la-gold-text (5.17:1) is the variant
 * used wherever gold has to carry words. See the ratios in the plugin's test
 * suite, which asserts them.
 */

.legal-agent-rtl {
	--la-navy: #16233d;
	--la-navy-deep: #0f1829;
	--la-bone: #f4f1e9;
	--la-bone-soft: #eae5d9;
	--la-ink-soft: #5a6478;
	--la-gold: #a8873f;
	--la-gold-text: #7a6220;
	--la-gold-soft: #e8c97a;
	--la-line: #d8d2c2;

	--wp--preset--color--background: var(--la-bone);
	--wp--preset--color--surface: var(--la-bone-soft);
	--wp--preset--color--foreground: var(--la-navy);
	--wp--preset--color--primary: var(--la-navy);
	--wp--preset--color--secondary: var(--la-gold);
	--wp--preset--color--accent: var(--la-gold);
	--wp--preset--color--muted: var(--la-ink-soft);
	--wp--preset--color--border: var(--la-line);

	direction: rtl;
	text-align: right;
	background-color: var(--la-bone);
	color: var(--la-navy);
	font-family: var(--la-font-sans, system-ui, sans-serif);
	line-height: 1.9;
}

.legal-agent-rtl.has-surface-background-color {
	background-color: var(--la-bone-soft);
}

/* Headings carry Amiri — the same face as the PDF export, so what the customer
   previews matches what they download. */
.legal-agent-rtl h1,
.legal-agent-rtl h2,
.legal-agent-rtl h3 {
	font-family: var(--la-font-serif, Georgia, serif);
	font-weight: 400;
	color: var(--la-navy);
	line-height: 1.45;
	letter-spacing: 0;
}

.legal-agent-rtl h1 {
	font-size: clamp(1.7rem, 4.2vw, 2.5rem);
}

.legal-agent-rtl h2 {
	font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.legal-agent-rtl h3 {
	font-size: 1.15rem;
}

/* The brand rule under a section heading: a short gold hairline, the one
   decorative move this direction allows itself. */
.legal-agent-rtl h2::after {
	content: "";
	display: block;
	width: 46px;
	height: 2px;
	background: var(--la-gold);
	margin: 12px 0 0;
}

.legal-agent-rtl .has-text-align-center h2::after,
.legal-agent-rtl h2.has-text-align-center::after {
	margin-inline: auto;
}

.legal-agent-rtl p {
	color: var(--la-navy);
}

/* The masthead line. Letter-spacing is applied only to the Latin brand token
   via the wrapper — Arabic is cursive and tracking breaks letter joining, so
   the value stays small enough not to disconnect the Arabic that follows. */
.legal-agent-rtl .legal-agent-brandmark {
	color: var(--la-ink-soft) !important;
	letter-spacing: 0.04em;
	margin-bottom: 18px;
}

.legal-agent-rtl .legal-agent-brandmark::after {
	content: "";
	display: block;
	width: 64px;
	height: 2px;
	background: var(--la-gold);
	margin: 10px auto 0;
}

/* h1 has no rule under it — the brandmark above already carries one, and two
   gold hairlines stacked reads as decoration rather than structure. */
.legal-agent-rtl h1::after {
	content: none;
}

.legal-agent-rtl .has-muted-color {
	color: var(--la-ink-soft) !important;
}

.legal-agent-rtl .has-primary-color {
	color: var(--la-navy) !important;
}

/* Buttons: one solid navy, one gold-outlined. Sharp 2px corners — formal, not
   brutalist, never pills. 44px min target for the mobile-heavy audience. */
.legal-agent-rtl .wp-block-button__link {
	border-radius: 2px;
	padding: 13px 26px;
	min-height: 44px;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 180ms ease-out, color 180ms ease-out;
}

.legal-agent-rtl .wp-block-button__link.has-primary-background-color {
	background-color: var(--la-navy);
	color: var(--la-bone);
	border: 1px solid var(--la-navy);
}

.legal-agent-rtl .wp-block-button__link.has-primary-background-color:hover,
.legal-agent-rtl .wp-block-button__link.has-primary-background-color:focus {
	background-color: var(--la-navy-deep);
	border-color: var(--la-navy-deep);
}

.legal-agent-rtl .is-style-outline .wp-block-button__link {
	background-color: transparent;
	color: var(--la-navy);
	border: 1px solid var(--la-gold);
}

.legal-agent-rtl .is-style-outline .wp-block-button__link:hover,
.legal-agent-rtl .is-style-outline .wp-block-button__link:focus {
	background-color: var(--la-bone-soft);
	border-color: var(--la-gold-text);
}

.legal-agent-rtl .wp-block-button__link:focus-visible {
	outline: 2px solid var(--la-gold-text);
	outline-offset: 2px;
}

.legal-agent-rtl .wp-block-buttons {
	gap: 12px;
	justify-content: center;
	margin-top: 22px;
}

.legal-agent-rtl .wp-block-list {
	padding-right: 1.25em;
	padding-left: 0;
}

.legal-agent-rtl .wp-block-list li {
	margin-bottom: 8px;
}

/* Numbered step markers in "how it works". */
.legal-agent-rtl .wp-block-column > p:first-child.has-large-font-size {
	color: var(--la-gold-text);
	font-family: var(--la-font-serif, Georgia, serif);
	margin-bottom: 4px;
}

.legal-agent-rtl .wp-block-columns {
	gap: 30px;
	margin-top: 34px;
}

.legal-agent-rtl .wp-block-column {
	border-top: 1px solid var(--la-line);
	padding-top: 16px;
}

/* FAQ. A hairline-separated list, not a stack of cards — DESIGN.md rules out
   card-in-card layouts, and accordions are the usual offender. */
.legal-agent-rtl .wp-block-details {
	border-top: 1px solid var(--la-line);
	padding: 14px 0;
	margin: 0;
}

.legal-agent-rtl .wp-block-details summary {
	cursor: pointer;
	font-weight: 500;
	color: var(--la-navy);
	list-style: none;
	padding-left: 24px;
	position: relative;
}

.legal-agent-rtl .wp-block-details summary::-webkit-details-marker {
	display: none;
}

.legal-agent-rtl .wp-block-details summary::after {
	content: "+";
	position: absolute;
	left: 0;
	color: var(--la-gold-text);
	font-size: 1.15rem;
	line-height: 1.4;
}

.legal-agent-rtl .wp-block-details[open] summary::after {
	content: "\2212";
}

.legal-agent-rtl .wp-block-details summary:focus-visible {
	outline: 2px solid var(--la-gold-text);
	outline-offset: 3px;
}

.legal-agent-rtl .wp-block-details p {
	color: var(--la-ink-soft);
	margin: 10px 0 0;
}

/* The price. The one place gold is allowed to be loud — and it is a display
   number, well past the 24px where AA drops to 3:1, but it uses the AA-safe
   text gold anyway rather than relying on that exemption. */
.legal-agent-rtl .has-xx-large-font-size.has-primary-color {
	color: var(--la-gold-text) !important;
	font-family: var(--la-font-serif, Georgia, serif);
}

@media (max-width: 781px) {
	.legal-agent-rtl .wp-block-columns {
		gap: 0;
	}

	.legal-agent-rtl .wp-block-column {
		margin-bottom: 22px;
	}
}

@media print {
	.legal-agent-rtl {
		background: #fff;
		color: #000;
	}

	.legal-agent-rtl .wp-block-buttons {
		display: none;
	}
}
