/* Unified readable layout for ArabicStock CMS pages. */
.cms-readable-page {
	--cms-navy: #05283b;
	--cms-teal: #1f6b69;
	--cms-gold: #d5ad48;
	--cms-ink: #1f2933;
	--cms-muted: #5d6b78;
	--cms-line: #dbe5ec;
	--cms-soft: #f3f8fb;
	padding: 34px 0 58px;
}

.cms-readable-page > .container {
	max-width: 1080px;
}

.cms-readable-page .section-content,
.cms-readable-page .page-content {
	min-width: 0;
}

.cms-readable-page .cms-page-shell {
	margin: 0;
	padding: 0;
	border: 1px solid rgba(5, 40, 59, .08);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 18px 48px rgba(5, 40, 59, .09);
	overflow: hidden;
}

.cms-readable-page .cms-page-shell > .row,
.cms-readable-page .cms-page-shell > .row > [class*="col-"] {
	margin: 0;
	padding: 0;
}

.cms-page-hero {
	position: relative;
	padding: 52px 64px 48px;
	overflow: hidden;
	background:
		radial-gradient(circle at 12% 20%, rgba(213, 173, 72, .24), transparent 31%),
		linear-gradient(135deg, #05283b 0%, #0b4357 58%, #1f6b69 100%);
	color: #fff;
	text-align: right;
}

.cms-page-hero::after {
	position: absolute;
	top: -85px;
	left: -70px;
	width: 240px;
	height: 240px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 50%;
	content: "";
}

.cms-page-hero__eyebrow {
	display: block;
	width: max-content;
	margin-bottom: 16px;
	padding: 6px 13px;
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 999px;
	background: rgba(255, 255, 255, .1);
	color: #fff4c5;
	font-family: Tahoma, Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}

.cms-page-hero h1 {
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 0;
	border: 0;
	color: #fff;
	font-family: Tahoma, Arial, sans-serif;
	font-size: clamp(30px, 4vw, 44px);
	font-weight: 700;
	line-height: 1.55;
	text-align: right;
	letter-spacing: -.02em;
}

.cms-page-hero p {
	position: relative;
	z-index: 1;
	max-width: 760px;
	margin: 15px 0 0;
	color: rgba(255, 255, 255, .82);
	font-family: Tahoma, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.8;
}

.cms-readable-content {
	padding: 48px 66px 62px;
	color: var(--cms-ink);
	font-family: Tahoma, Arial, sans-serif;
	font-size: 17px;
	font-weight: 400;
	line-height: 2;
	text-align: right !important;
}

.cms-readable-content p {
	margin: 0 0 21px;
}

.cms-readable-content > p:first-child,
.cms-readable-content > article > p:first-child {
	color: #263746;
	font-size: 18px;
	font-weight: 500;
	line-height: 2.05;
}

.cms-readable-content h2,
.cms-readable-content h3 {
	font-family: Tahoma, Arial, sans-serif;
	scroll-margin-top: 96px;
}

.cms-readable-content h2 {
	margin: 50px 0 22px;
	padding: 15px 20px;
	border-right: 5px solid var(--cms-gold);
	border-radius: 10px;
	background: linear-gradient(90deg, #fff 0%, var(--cms-soft) 100%);
	color: var(--cms-navy);
	font-size: clamp(23px, 2.7vw, 29px);
	font-weight: 700;
	line-height: 1.65;
}

.cms-readable-content h3 {
	position: relative;
	margin: 38px 0 17px;
	padding: 0 18px 10px 0;
	border-bottom: 1px solid var(--cms-line);
	color: var(--cms-teal);
	font-size: clamp(20px, 2.2vw, 24px);
	font-weight: 700;
	line-height: 1.7;
}

.cms-readable-content h3::before {
	position: absolute;
	top: .55em;
	right: 0;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--cms-gold);
	content: "";
}

.cms-readable-content h3 br:first-child {
	display: none;
}

.cms-readable-content ul,
.cms-readable-content ol {
	margin: 4px 0 27px;
	padding-right: 28px;
}

.cms-readable-content li {
	margin-bottom: 10px;
	padding-right: 5px;
}

.cms-readable-content li::marker {
	color: var(--cms-teal);
	font-weight: 700;
}

.cms-readable-content a {
	color: #08647c;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-color: rgba(8, 100, 124, .3);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	transition: color .2s ease, text-decoration-color .2s ease;
}

.cms-readable-content a:hover,
.cms-readable-content a:focus {
	color: #b05a16;
	text-decoration-color: currentColor;
}

.cms-readable-content hr {
	width: 90px;
	height: 3px;
	margin: 34px 0;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--cms-gold), var(--cms-teal));
	opacity: .75;
}

.cms-readable-content blockquote {
	margin: 38px 0;
	padding: 21px 24px;
	border: 1px solid #e8d9a7;
	border-right: 5px solid var(--cms-gold);
	border-radius: 12px;
	background: #fffcf2;
	color: #4f4a3d;
	font-size: 15px;
	line-height: 1.9;
}

.cms-readable-content img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.cms-readable-content table {
	width: 100%;
	margin: 28px 0;
	font-size: 15px;
	line-height: 1.7;
}

.cms-readable-content th,
.cms-readable-content td {
	padding: 12px 14px;
	vertical-align: middle;
}

.cms-readable-content math[display="block"] {
	display: block;
	max-width: 100%;
	margin: 26px 0;
	padding: 18px;
	overflow-x: auto;
	border: 1px solid var(--cms-line);
	border-radius: 10px;
	background: #f8fbfd;
	direction: ltr;
	text-align: center;
}

.cms-page-toc {
	margin: 4px 0 44px;
	padding: 24px 26px;
	border: 1px solid var(--cms-line);
	border-radius: 14px;
	background: #f8fbfd;
}

.cms-page-toc__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 17px !important;
	color: var(--cms-navy) !important;
	font-size: 20px !important;
	font-weight: 700 !important;
	line-height: 1.5 !important;
}

.cms-page-toc__title::before {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--cms-gold);
	content: "";
}

.cms-page-toc__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px 26px;
	margin: 0 !important;
	padding: 0 !important;
	padding-inline-start: 0 !important;
	list-style: none !important;
	list-style-type: none !important;
	counter-reset: cms-section;
}

.cms-page-toc__list li {
	margin: 0;
	padding: 0;
	counter-increment: cms-section;
}

.cms-page-toc .cms-page-toc__list > li::marker {
	content: "";
}

.cms-page-toc__list a {
	display: grid;
	grid-template-columns: 25px minmax(0, 1fr);
	gap: 8px;
	padding: 7px 0;
	color: #344858;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.65;
	text-decoration: none;
}

.cms-page-toc__list a::before {
	color: var(--cms-teal);
	content: counter(cms-section, decimal-leading-zero);
	font-size: 12px;
	font-weight: 700;
}

.cms-page-toc__list a:hover,
.cms-page-toc__list a:focus,
.cms-page-toc__list a.is-active {
	color: #b05a16;
}

.cms-reading-progress {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 1100;
	width: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--cms-gold), #f0cf72);
	box-shadow: 0 0 8px rgba(213, 173, 72, .45);
	pointer-events: none;
}

.cms-back-to-top {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 1050;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: var(--cms-navy);
	box-shadow: 0 8px 22px rgba(5, 40, 59, .25);
	color: #fff;
	font-size: 20px;
	cursor: pointer;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .2s ease, transform .2s ease, background .2s ease;
	pointer-events: none;
}

.cms-back-to-top.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.cms-back-to-top:hover,
.cms-back-to-top:focus {
	background: var(--cms-teal);
}

@media (max-width: 767.98px) {
	.cms-readable-page {
		padding: 16px 0 38px;
	}

	.cms-readable-page > .container {
		padding-right: 12px;
		padding-left: 12px;
	}

	.cms-readable-page .cms-page-shell {
		border-radius: 13px;
	}

	.cms-page-hero {
		padding: 38px 22px 34px;
	}

	.cms-page-hero h1 {
		font-size: 29px;
		line-height: 1.6;
	}

	.cms-readable-content {
		padding: 34px 20px 42px;
		font-size: 16px;
		line-height: 1.95;
	}

	.cms-readable-content > p:first-child,
	.cms-readable-content > article > p:first-child {
		font-size: 17px;
	}

	.cms-readable-content h2 {
		margin-top: 42px;
		padding: 13px 15px;
		font-size: 22px;
	}

	.cms-readable-content h3 {
		margin-top: 32px;
		font-size: 19px;
	}

	.cms-page-toc {
		margin-bottom: 36px;
		padding: 21px 18px;
	}

	.cms-page-toc__list {
		grid-template-columns: 1fr;
		gap: 3px;
	}

	.cms-back-to-top {
		right: 14px;
		bottom: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cms-readable-content *,
	.cms-back-to-top,
	.cms-reading-progress {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
