/*
 * Terms & Conditions and Privacy Policy: standalone reading layout (.lrc-policy) and the two shared
 * pieces that also appear inside the Contact dialogs (.lrc-policy-meta, .lrc-policy-table).
 * Scoped to those classes only; no existing page, Contact or footer rule is changed. Uses the site's
 * own tokens (--serif, --sans, --lotus-*) and logical properties, so Persian (RTL) mirrors by itself.
 */

/* Page frame */
.lotus-page-editable > .lrc-policy {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--lotus-max, 1240px);
	margin-inline: auto;
	padding: 3.5rem max(24px, 2vw) 6rem;
	color: var(--lotus-copy, #383E48);
	background: var(--lotus-cream, #fbfaf7);
}
.lrc-policy__header { margin-block-end: 2.25rem; padding-block-end: 1.5rem; border-block-end: 1px solid var(--lotus-border, rgba(84, 56, 132, .16)); }
body .lrc-policy h1.lrc-policy__title {
	margin: 0;
	text-align: center;
	font-family: var(--serif);
	font-size: clamp(2rem, 3vw, 3rem) !important;
	font-weight: 700;
	letter-spacing: 0 !important;
	text-transform: none;
	color: var(--lotus-purple, #363061);
	overflow-wrap: anywhere;
}

/* Contents list beside the text on desktop; a plain list above it on small screens (never sticky on phones) */
.lrc-policy__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.lrc-policy__toc {
	box-sizing: border-box;
	padding: 1.1rem 1.25rem;
	background: #fff;
	border: 1px solid var(--lotus-border, rgba(84, 56, 132, .16));
	border-radius: 14px;
	font-size: 15px;
	line-height: 1.5;
	text-transform: none; /* the site capitalises every <nav>; these repeat the headings as written */
}
.lrc-policy__toc-title { margin: 0 0 .6rem; font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #CE9F67; }
/* The headings already carry their own numbers ("1. Scope and agreement"), so the list adds none. */
.lrc-policy__toc ol { margin: 0; padding: 0; list-style: none; columns: 1; }
.lrc-policy__toc li { margin: 0 0 .3rem; break-inside: avoid; }
.lrc-policy__toc a { color: #543884; text-underline-offset: 2px; overflow-wrap: anywhere; }
@media (min-width: 600px) and (max-width: 959px) { .lrc-policy__toc ol { columns: 2; column-gap: 2rem; } }
@media (min-width: 960px) {
	.lrc-policy__layout { grid-template-columns: 17rem minmax(0, 46rem); gap: 3.5rem; justify-content: start; }
	.lrc-policy__toc { position: sticky; top: 6.5rem; align-self: start; max-height: calc(100vh - 8rem); overflow: auto; }
	/* A policy with no section headings has no contents list: one centred reading column, never the narrow contents slot. */
	.lrc-policy__layout--single { grid-template-columns: minmax(0, 46rem); justify-content: center; }
}

/* Reading text. About 46rem at 17px is roughly 70 characters per line. */
.lrc-policy__body { min-width: 0; font-size: 17px; line-height: 1.75; }
.lrc-policy__body > :first-child { margin-block-start: 0; }
/* The box holds the effective date only; one blank line (one line of body text) separates it from what follows. */
.lrc-policy-meta { margin-block: 0 1.75rem; padding: 1.1rem 1.25rem; background: transparent; border: 1px solid var(--lotus-border, rgba(84, 56, 132, .16)); border-inline-start: 4px solid var(--lotus-gold, #CE9F67); border-radius: 10px; font-size: 16px; line-height: 1.6; }
.lrc-policy-meta > p { margin: 0 0 .5rem; overflow-wrap: anywhere; }
.lrc-policy-meta > p:last-child,
.lrc-policy__body .lrc-policy-meta p:last-child,
.lotus-policy-dialog__body .lrc-policy-meta p:last-child { margin-block-end: 0; }
body .lrc-policy__body .lrc-policy-meta + h2.wp-block-heading,
.lotus-policy-dialog__body .lrc-policy-meta + h2 { margin-block-start: 0; }
body .lrc-policy__body h2.wp-block-heading {
	margin: 2.75rem 0 .9rem;
	scroll-margin-block-start: 6rem;
	font-family: var(--serif);
	font-size: clamp(1.4rem, 2vw, 1.75rem) !important;
	font-weight: 700;
	letter-spacing: 0 !important;
	text-transform: none;
	color: var(--lotus-purple, #363061);
}
.lrc-policy__body p { margin: 0 0 1.1rem; }
.lrc-policy__body :is(p, li, td, th) { overflow-wrap: anywhere; }
.lrc-policy__body ul { margin: 0 0 1.25rem; padding-inline-start: 1.4rem; }
.lrc-policy__body li { margin: 0 0 .5rem; }
.lrc-policy__body a, .lrc-policy-meta a, .lrc-policy-table a { color: #543884; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.lrc-policy__body a:hover { text-decoration-thickness: 2px; }
html:lang(fa) .lrc-policy__body { line-height: 2; }

/* Focus: same 2px purple ring the Contact dialogs use */
.lrc-policy :is(a, .lrc-policy-table):focus-visible,
.lotus-policy-dialog__body a:focus-visible,
.lotus-policy-dialog .lrc-policy-table:focus-visible { outline: 2px solid #543884; outline-offset: 2px; border-radius: 4px; }

/* Tables: a real table that scrolls inside its own keyboard-focusable box on narrow screens, with edge shadows
   that show there is more to see. The page itself never scrolls sideways. */
.wp-block-table.lrc-policy-table {
	max-width: 100%;
	margin: 1.25rem 0 1.75rem;
	overflow-x: auto;
	background:
		linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center / 2rem 100% no-repeat local,
		linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center / 2rem 100% no-repeat local,
		radial-gradient(farthest-side at 0 50%, rgba(54, 48, 97, .22), rgba(54, 48, 97, 0)) left center / .75rem 100% no-repeat scroll,
		radial-gradient(farthest-side at 100% 50%, rgba(54, 48, 97, .22), rgba(54, 48, 97, 0)) right center / .75rem 100% no-repeat scroll;
	border: 1px solid var(--lotus-border, rgba(84, 56, 132, .16));
	border-radius: 10px;
}
.wp-block-table.lrc-policy-table table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 15px; line-height: 1.55; table-layout: auto; }
/* Words wrap between words, not inside them: a narrow column grows and the table scrolls in its box instead. */
.wp-block-table.lrc-policy-table :is(th, td) { padding: .7rem .85rem; text-align: start; vertical-align: top; word-break: normal; overflow-wrap: break-word; border: 0; border-block-end: 1px solid var(--lotus-border, rgba(84, 56, 132, .16)); }
.wp-block-table.lrc-policy-table thead th { background: var(--lotus-lavender, #eeeaff); color: var(--lotus-purple-dark, #27224e); font-weight: 700; }
.wp-block-table.lrc-policy-table tbody tr:last-child td { border-block-end: 0; }
@media (max-width: 600px) { .wp-block-table.lrc-policy-table table { min-width: 30rem; } }

@media (prefers-reduced-motion: reduce) { .lrc-policy * { scroll-behavior: auto !important; transition: none !important; } }
html:has(.lrc-policy) { scroll-padding-top: 6rem; }

/* Inside the Contact dialogs: only the body is shown (no H1, no contents list); keep the same text and table look. */
.lotus-policy-dialog__body .lrc-policy-meta { margin-block: 0 1.75rem; font-size: 15px; }
.lotus-policy-dialog__body .wp-block-table.lrc-policy-table table { font-size: 14px; }
.lotus-policy-dialog__body ul { padding-inline-start: 1.25rem; }

/* Site Map page ([lrc_site_map]): one readable column, the site's heading and link styles, RTL-aware. */
body .lrc-site-map { box-sizing: border-box; max-width: 760px; margin-inline: auto; padding: 80px 24px; }
body .lrc-site-map h1.lrc-site-map__title { margin: 0 0 32px; font-family: var(--serif); font-weight: 500; font-size: 40px !important; line-height: 1.2; color: #383e48; text-align: center; }
body .lrc-site-map h2.lrc-site-map__heading { margin: 40px 0 12px; font-family: var(--serif); font-weight: 500; font-size: 26px !important; letter-spacing: normal; line-height: 1.3; color: #383e48; }
.lrc-site-map .lrc-site-map__list,
.lrc-site-map .lrc-site-map__list ul { margin: 0; padding-inline-start: 1.25rem; list-style: disc; }
.lrc-site-map .lrc-site-map__list li { margin-block: 6px; line-height: 1.6; }
.lrc-site-map .lrc-site-map__list a { color: #543884; text-decoration: underline; text-underline-offset: .2em; overflow-wrap: anywhere; }
.lrc-site-map .lrc-site-map__list a:hover { color: #383e48; }
.lrc-site-map .lrc-site-map__list a:focus-visible { outline: 2px solid #543884; outline-offset: 2px; border-radius: 2px; }
html:lang(fa) body .lrc-site-map h1.lrc-site-map__title,
html:lang(fa) body .lrc-site-map h2.lrc-site-map__heading { font-family: var(--font-display-fa, 'Estedad'), serif; line-height: 1.6; }
html:lang(fa) .lrc-site-map .lrc-site-map__list { font-family: var(--font-body-fa, 'Vazirmatn'), sans-serif; }
@media (max-width: 781px) {
	body .lrc-site-map { padding: 48px 16px; }
	body main .lrc-site-map h1.lrc-site-map__title { font-size: 30px !important; }
	html:lang(fa) body main .lrc-site-map h1.lrc-site-map__title { font-size: 27px !important; }
	body main .lrc-site-map h2.lrc-site-map__heading { font-size: 24px !important; }
	html:lang(fa) body main .lrc-site-map h2.lrc-site-map__heading { font-size: 22px !important; }
}
