/**
 * FictionX Pages - Frontend Styles
 *
 * The page shell below - tokens, hero, scrim, search pill, band, empty state - and
 * the card rules beneath it are COPIED from updates.css and monq.css, as every module
 * in this pass is. A page here is a title, a date and a short opening, which is the
 * same card a tender is. If one of the shared values is changed, change the others.
 */

:root {
	--fxpg-teal: #26667c;        /* the site's own --bs-primary */
	--fxpg-teal-deep: #0E3D4C;
	--fxpg-ink: #0B2B33;
	--fxpg-muted: #5B7076;
	--fxpg-mist: #EFF3F4;
	--fxpg-rule: #DCE4E6;

	/* The theme's --bs-primary-rgb is 40,84,109, which is NOT --bs-primary (#26667c):
	   every rgba(var(--bs-primary-rgb), …) tint comes out a different blue. */
	--fxpg-primary-rgb: 38, 102, 124;
}

[data-bs-theme="dark"] {
	/* The teal is ink and border in almost every rule below, and on the dark surface
	   #26667c measured 2.85:1 - under the 4.5:1 a 12.5px label needs. Lightened for
	   dark only, which repairs every teal word at once rather than per component.
	   Its one BACKGROUND use (.fxpg-search-btn:hover, white text) is pinned back to the
	   deep teal further down, or that button would invert into pale-on-white. */
	--fxpg-teal: #4FA3BA;
	--fxpg-ink: #E8F0F2;
	--fxpg-muted: #9FB3B9;
	--fxpg-mist: #0F1B1F;
	--fxpg-rule: rgba(255, 255, 255, .10);
}

/* ==============================================================================
   The hero, on the band header.dwt paints behind every module page
   ============================================================================== */
.fxpg-hero {
	position: relative;
	z-index: 3;
	padding: 18px 0 0;
}
/* A one-way ramp: nothing at the top, where the band's video is left alone behind the
   nav, coming on through the lower half and ending opaque under the search pill.

   It was a near-opaque slab from edge to edge, which is the same mistake the library
   made: it read as a dark rectangle dropped on the page and drew a hard line where it
   met the bright band above it. Measured here at every width from 390 to 1920 — the
   scrim started at .87 immediately, so the cut was at the hero's top edge, around y=103
   on a desktop.

   The stops are deliberately uneven. A straight two-stop ramp spends most of its length
   pale, and that is the height at which the band's video changes tone, so the darkening
   is held back and then brought on quickly. These values are the library's, exactly —
   the two pages are meant to be indistinguishable here. */
.fxpg-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg,
		rgba(5, 27, 34, 0) 0%,
		rgba(5, 27, 34, .10) 30%,
		rgba(5, 27, 34, .34) 52%,
		rgba(5, 27, 34, .70) 74%,
		rgba(5, 27, 34, .92) 89%,
		rgba(5, 27, 34, 1) 100%);
	pointer-events: none;
}
/* text-align: start resolves to right in Arabic and left in English on its own -
   header.dwt sets dir on <html>. No <RTL>/<LTR> tags and no dir= attribute needed. */
.fxpg-hero-inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: start;
	padding-bottom: 26px;
}
.fxpg-hero-crumbs .breadcrumb {
	justify-content: flex-start;
	margin-bottom: 6px;
	opacity: .85;
}
.fxpg-hero-crumbs .breadcrumb-item,
.fxpg-hero-crumbs .breadcrumb-item a {
	color: rgba(255, 255, 255, .85);
	font-size: 13px;
	font-weight: 500;
}
/* The crumbs carry Metronic's .text-hover-primary, whose rule is
   `color: var(--bs-text-primary) !important` — #26667c, the hero's own colour, so a
   hovered crumb vanished. Colour is not winnable here (.text-white is !important too),
   so the feedback rides on opacity. */
.fxpg-hero-crumbs .breadcrumb-item.opacity-75 {
	opacity: .72 !important;
	transition: opacity .2s ease;
}
.fxpg-hero-crumbs .breadcrumb-item.opacity-75:hover {
	opacity: 1 !important;
}
.fxpg-hero-crumbs .breadcrumb-item a:hover {
	color: #fff !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
}
.fxpg-hero-title {
	margin: 0;
	color: #fff;
	/* The shared hero scale. These three were clamp(32px, 18px + 3.2vw, 56px) while
	   the other 22 module sheets used this one, so a heading changed size when you
	   moved between, say, the news list and the library. */
	font-size: clamp(32px, 18px + 3.2vw, 56px);
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: -.01em;
	text-shadow: 0 2px 18px rgba(0, 0, 0, .28);
}

/* ------------------------------------------------------------ the toolbar ---- */
/* The search used to be a 620px pill centred in the hero, straddling the seam on a
   -46px margin, which is why the band below reserved 86px at its top. It sits in a
   toolbar above the cards now - search on the start side, the count on the end - the
   same object library, updates and topics carry. */
.fxpg-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 20px;
	margin: 0 0 28px;
}
.fxpg-toolbar-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}
.fxpg-search {
	display: flex;
	align-items: center;
	gap: 8px;
	width: min(460px, 100%);
	margin: 0;
	padding: 0;
	background: transparent;
	border-radius: 0;
}
.fxpg-search-field {
	display: flex;
	align-items: center;
	gap: 9px;
	flex: 1 1 auto;
	min-width: 0;
	height: 42px;
	padding-inline: 14px;
	margin: 0;
	background: var(--bs-body-bg);
	border: 1px solid var(--fxpg-rule);
	border-radius: 10px;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.fxpg-search-icon {
	flex: 0 0 auto;
	color: var(--fxpg-muted);
	font-size: 15px;
}
.fxpg-search-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--fxpg-ink);
	font-size: 13.5px;
	font-family: inherit;
	font-weight: 500;
	padding: 0;
}
.fxpg-search-input::placeholder {
	color: var(--fxpg-muted);
	font-weight: 400;
	opacity: 1;
}
.fxpg-search-input:focus {
	outline: 0;
}
/* The ring is on the FIELD, not the form: the form also holds the button, and a ring
   around both reads as one giant control. */
.fxpg-search-field:focus-within {
	border-color: var(--fxpg-teal);
	box-shadow: 0 0 0 3px rgba(var(--fxpg-primary-rgb), .18);
}
.fxpg-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.fxpg-search-btn {
	flex: 0 0 auto;
	height: 42px;
	border: 0;
	border-radius: 10px;
	background: var(--fxpg-teal-deep);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	padding: 0 22px;
	transition: background .2s ease;
}
.fxpg-search-btn:hover,
.fxpg-search-btn:focus-visible {
	background: var(--fxpg-teal);
}
[data-bs-theme="dark"] .fxpg-search-btn:hover,
[data-bs-theme="dark"] .fxpg-search-btn:focus-visible {
	background: #2E7E96;
}
/* On the field, not the form: the form is transparent now. */
[data-bs-theme="dark"] .fxpg-search-field {
	background: #16262B;
}
[data-bs-theme="dark"] .fxpg-search-btn {
	background: #2E7F96;
}
[data-bs-theme="dark"] .fxpg-search-btn:hover {
	background: #3C9AB4;
}

@media (max-width: 767.98px) {
	.fxpg-hero {
		padding-top: 6px;
	}
	.fxpg-hero-inner {
		padding-bottom: 20px;
	}
	.fxpg-search {
		width: 100%;
	}
}

/* 40px, not the 86px this reserved for the pill that used to overlap the seam. */
.fxpg-band {
	position: relative;
	z-index: 2;
	background: var(--fxpg-mist);
	padding: 40px 0 56px;
}

.fxpg-resultline-text {
	margin: 0;
	color: var(--fxpg-muted);
	font-size: 15px;
	font-weight: 500;
}
.fxpg-resultline-text strong {
	color: var(--fxpg-ink);
	font-weight: 700;
}
.fxpg-clear {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--fxpg-teal);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.fxpg-clear,
.fxpg-clear:hover {
	transition: color .2s ease;
}
.fxpg-clear:hover {
	color: var(--fxpg-teal-deep);
}
[data-bs-theme="dark"] .fxpg-clear:hover {
	color: var(--fxpg-ink);
}

.fxpg-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 64px 20px;
	background: var(--bs-body-bg);
	border: 1px solid var(--fxpg-rule);
	border-radius: 14px;
}
.fxpg-empty-icon {
	color: var(--fxpg-muted);
	font-size: 36px;
	opacity: .5;
	margin-bottom: 16px;
}
.fxpg-empty-title {
	margin: 0;
	color: var(--fxpg-ink);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.7;
}
.fxpg-empty-text {
	margin: 10px 0 0;
	color: var(--fxpg-muted);
	font-size: 15px;
}
.fxpg-empty-text:empty {
	display: none;
}
.fxpg-empty-btn {
	display: inline-flex;
	align-items: center;
	margin-top: 20px;
	padding: 11px 26px;
	border-radius: 999px;
	background: var(--fxpg-teal);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s ease;
}
.fxpg-empty-btn:hover {
	background: var(--fxpg-teal-deep);
	color: #fff;
}

/* ==============================================================================
   Sections
   ============================================================================== */
.fxpg-sections {
	margin-bottom: 40px;
}
.fxpg-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	color: var(--fxpg-ink);
	font-size: 17px;
	font-weight: 700;
}
.fxpg-head i {
	color: var(--fxpg-teal);
	font-size: 15px;
}
.fxpg-sec-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	/* Equal rows: as plain flex items the cards take their height from their own text
	   and one two-line name makes its whole row taller. */
	grid-auto-rows: 1fr;
	gap: 14px;
}
.fxpg-sec {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	border: 1px solid var(--fxpg-rule);
	border-radius: 14px;
	background: var(--bs-body-bg);
	text-decoration: none;
	/* Declared on :hover too. These are <a> elements and the theme's
	   a:hover { transition: color .2s ease } at (0,1,1) REPLACES the list below, so a
	   transition set only here is dropped the moment the pointer arrives. */
	transition: border-color .2s ease, transform .2s ease;
}
.fxpg-sec:hover {
	border-color: var(--fxpg-teal);
	transform: translateY(-2px);
	transition: border-color .2s ease, transform .2s ease;
}
.fxpg-sec-icon {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: rgba(var(--fxpg-primary-rgb), .10);
	color: var(--fxpg-teal);
}
.fxpg-sec-icon i {
	font-size: 17px;
	color: inherit;
}
.fxpg-sec-body {
	min-width: 0;
}
.fxpg-sec-name {
	display: block;
	color: var(--fxpg-ink);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.5;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.fxpg-sec-meta {
	display: block;
	margin-top: 2px;
	color: var(--fxpg-muted);
	font-size: 12.5px;
}

/* ==============================================================================
   Tender cards
   ==============================================================================
   Only ONE of the 718 published tenders names a picture that is on disk, so a photo
   tile would be a placeholder 717 times. The date leads instead - a tender is a thing
   with a date - and the title sits beside it, printed once.
   ============================================================================== */
.fxpg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	grid-auto-rows: 1fr;
	gap: 16px;
}
.fxpg-card {
	display: flex;
	gap: 16px;
	padding: 16px;
	border: 1px solid var(--fxpg-rule);
	border-radius: 14px;
	background: var(--bs-body-bg);
	text-decoration: none;
	transition: border-color .2s ease, transform .2s ease;
}
.fxpg-card:hover {
	border-color: var(--fxpg-teal);
	transform: translateY(-2px);
	transition: border-color .2s ease, transform .2s ease;
}
.fxpg-date {
	flex: 0 0 auto;
	width: 64px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 10px 0;
	border-radius: 12px;
	background: linear-gradient(160deg,
		rgba(var(--fxpg-primary-rgb), .13) 0%,
		rgba(var(--fxpg-primary-rgb), .05) 100%);
	color: var(--fxpg-teal);
	line-height: 1.15;
}
.fxpg-date-day {
	font-size: 22px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.fxpg-date-month {
	font-size: 12px;
	font-weight: 600;
}
.fxpg-date-year {
	margin-top: 2px;
	font-size: 11px;
	opacity: .75;
	font-variant-numeric: tabular-nums;
}
.fxpg-card-body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.fxpg-card-title {
	margin: 0;
	color: var(--fxpg-ink);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.65;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}
.fxpg-card-excerpt {
	margin: 0;
	color: var(--fxpg-muted);
	font-size: 12.5px;
	line-height: 1.75;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.fxpg-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 4px;
	color: var(--fxpg-muted);
	font-size: 12.5px;
}
/* A chip per fact the row actually carries. nomonq is filled on 193 of 718 rows and
   lastdate on 150, so an always-printed labelled row would be empty most of the time. */
.fxpg-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	/* One fixed height for every chip, so a row of them sits on one line however many
	   there are and whatever each says. Padding alone gives a chip with an icon a
	   different height from one without. */
	height: 24px;
	padding: 0 10px;
	border-radius: 999px;
	border: 1px solid transparent;
	background: rgba(var(--fxpg-primary-rgb), .09);
	color: var(--fxpg-teal);
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.fxpg-chip i {
	/* fs-5 escapes the theme's i[class] { font-size: 1.5rem } in markup; here the
	   sheet sets it, but the COLOUR half of that rule is (0,1,1) and still outranks a
	   single class - hence .fxpg-chip i rather than a bare .fxpg-chip-icon. */
	font-size: 11px;
	color: inherit;
	line-height: 1;
}
/* A status chip states a fact about the tender, so it carries a quiet outline of its
   own tone - enough to read as a badge rather than a tinted label. */
.fxpg-chip-danger,
.fxpg-chip-open {
	border-color: currentColor;
	/* The tint is already light; at 28% the border reads without boxing the chip in. */
	border-color: color-mix(in srgb, currentColor 28%, transparent);
}
/* The CLOSING DATE is a deadline, so it carries its own red rather than the teal the
   other facts use - the one chip on the card that is about running out of time.
   An explicit red, not --bs-danger: that token is a background colour here and lands
   near 3:1 as ink on its own tint. Both values below were measured on the tint they
   actually sit on, in both themes. */
.fxpg-chip-danger {
	background: rgba(214, 57, 57, .10);
	color: #B32020;
}
[data-bs-theme="dark"] .fxpg-chip-danger {
	background: rgba(255, 110, 110, .16);
	color: #FF9B9B;
}
/* Still open. An EXPLICIT green: --bs-success is #00a39a in this theme, identical to
   --bs-primary, so a chip built on it would be indistinguishable from the teal ones
   beside it - which is the whole point of the state. */
.fxpg-chip-open {
	background: rgba(23, 139, 86, .10);
	color: #15794C;
}
[data-bs-theme="dark"] .fxpg-chip-open {
	background: rgba(80, 205, 137, .16);
	color: #6FD9A0;
}
/* The view count is not a status - it is the quietest thing on the card, so it keeps
   no chrome at all and sits at the end of the row. */
.fxpg-chip-plain {
	height: auto;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--fxpg-muted);
	font-weight: 500;
	margin-inline-start: auto;
}

[data-bs-theme="dark"] .fxpg-date {
	background: linear-gradient(160deg,
		rgba(var(--fxpg-primary-rgb), .26) 0%,
		rgba(var(--fxpg-primary-rgb), .10) 100%);
}

@media (max-width: 575.98px) {
	.fxpg-card {
		gap: 12px;
		padding: 14px;
	}
	.fxpg-date {
		width: 56px;
	}
}

@media (max-width: 991.98px) {
	/* The off-canvas drawer sits outside the viewport; without this the page can be
	   scrolled sideways to reach it. */
	.wrapper {
		overflow-x: clip;
	}
}

@media (prefers-reduced-motion: reduce) {
	/* Reduced motion means no MOVEMENT, not a dead page: the travel goes, the colour
	   change stays. */
	.fxpg-card:hover,
	.fxpg-sec:hover {
		transform: none;
	}
}

/* The pager. Centred like every other list's. */
.fxpg-pager-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

/* A page may carry a cover image. It sits where the date tile does, at the same size,
   so a mixed grid still lines up. */
.fxpg-cover {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	border-radius: 12px;
	overflow: hidden;
	background: var(--bs-body-bg);
}
.fxpg-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* =============================================================================
   THE DETAIL SHELL
   =============================================================================
   Copied from assets/css/modules/topics/topics.css (the .fxt-article* block, the
   origin) and shared verbatim with monq, mazaya, album, media, zawity, manaheg,
   govdalil and participate. Change one, change all nine.

   DELIBERATE DIVERGENCE between the copies - do not "fix" these back:
     album, media          -article-media is .is-figure: the picture IS the subject,
                           so it is contained, not cropped to 16/9
     media                 additionally .is-video, which holds an embed
     zawity, manaheg       -article-media is .is-cover: a portrait book cover
     govdalil, participate no -article-media rules at all - those rows carry no image

   -facts, -section, -filebar, -pager and -related are new vocabulary this shell
   introduces; they do not exist in topics.css.
   ============================================================================= */
.fxpg-article {
	max-width: 900px;
	margin: 0 auto;
	border-radius: 18px;
	overflow: hidden;
	background: var(--bs-body-bg);
	border: 1px solid var(--fxpg-rule);
}
.fxpg-article-media {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--fxpg-mist);
}
.fxpg-article-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* No picture on disk: the placeholder is centred small and dimmed rather than
   stretched, so an absent image reads as absent instead of as a bad photograph. */
.fxpg-article-media.is-empty img {
	width: 32%;
	height: auto;
	margin: auto;
	position: absolute;
	inset: 0;
	opacity: .5;
	object-fit: contain;
}
[data-bs-theme="dark"] .fxpg-article-media.is-empty img {
	/* The shared SVG paints its own light gradient because the listings use it too. */
	filter: invert(.92) hue-rotate(180deg);
	opacity: .35;
}
.fxpg-article-inner {
	padding: 28px 38px 26px;
}
.fxpg-article-head {
	padding-bottom: 20px;
	margin-bottom: 26px;
	border-bottom: 1px solid var(--fxpg-rule);
}
.fxpg-article-cat {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(var(--fxpg-primary-rgb), .10);
	color: var(--fxpg-teal);
	font-size: 12.5px;
	font-weight: 700;
}
.fxpg-article-cat i {
	font-size: 11px;
	color: inherit;
}
/* The category arrives as a finished <a>, and the theme's --bs-link-color is ORANGE
   in a teal panel. (0,2,1) beats the link rule without reaching for !important. */
.fxpg-article-cat a {
	color: inherit;
	text-decoration: none;
}
.fxpg-article-title {
	margin: 0 0 14px;
	color: var(--fxpg-ink);
	font-size: 27px;
	font-weight: 800;
	line-height: 1.45;
	/* A stored title can be one unbroken token; without this it overflows the card. */
	overflow-wrap: anywhere;
}
.fxpg-article-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 22px;
	color: var(--fxpg-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}
.fxpg-article-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.fxpg-article-meta-item i {
	font-size: 12px;
	color: inherit;
}

/* The body is the one place the stored HTML runs the show, so these rules CONTAIN it
   rather than style it: the measure, images that overflow, lists, and tables. */
.fxpg-article-body {
	max-width: 68ch;
	margin: 0 auto;
	color: var(--fxpg-ink);
	font-size: 15.5px;
	line-height: 2;
	overflow-wrap: anywhere;
}
.fxpg-article-body > *:first-child { margin-top: 0; }
.fxpg-article-body > *:last-child  { margin-bottom: 0; }
.fxpg-article-body img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}
.fxpg-article-body a {
	color: var(--fxpg-teal);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.fxpg-article-body h1,
.fxpg-article-body h2,
.fxpg-article-body h3,
.fxpg-article-body h4 {
	color: var(--fxpg-ink);
	font-weight: 700;
	line-height: 1.6;
}
/* Lists: the reference leaves these to the browser, which in RTL puts the marker on
   the wrong side and indents from the wrong edge. padding-inline-start is the fix in
   both directions. */
.fxpg-article-body ul,
.fxpg-article-body ol {
	padding-inline-start: 1.6em;
	margin-block: 0 16px;
}
.fxpg-article-body li {
	margin-bottom: 6px;
}
.fxpg-article-body blockquote {
	margin: 0 0 16px;
	padding-inline-start: 16px;
	border-inline-start: 3px solid rgba(var(--fxpg-primary-rgb), .35);
	color: var(--fxpg-muted);
}
.fxpg-article-body table {
	max-width: 100%;
	border-collapse: collapse;
}
.fxpg-article-body th,
.fxpg-article-body td {
	padding: 8px 12px;
	border: 1px solid var(--fxpg-rule);
	text-align: start;
}
/* A wide table scrolls inside the column instead of widening the page. The wrapper is
   added by assets/js/fx-detail.js from the body's data-fx-tables attribute. */
.fxpg-table-scroll {
	overflow-x: auto;
	margin: 0 0 18px;
	-webkit-overflow-scrolling: touch;
}
/* Editor HTML carries inline colours chosen against a white page; in dark mode they
   become unreadable. These neutralise the colour without touching the structure, and
   are the only !important rules in this sheet. */
[data-bs-theme="dark"] .fxpg-article-body [style*="color"]      { color: inherit !important; }
[data-bs-theme="dark"] .fxpg-article-body [style*="background"] { background: transparent !important; }
[data-bs-theme="dark"] .fxpg-article-body font[color]           { color: inherit !important; }
[data-bs-theme="dark"] .fxpg-article-body a[style*="color"],
[data-bs-theme="dark"] .fxpg-article-body a[style*="color"]:hover { color: var(--fxpg-teal) !important; }

/* ---- facts: label/value pairs for the fields a row actually carries ---------- */
.fxpg-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px 24px;
	margin: 26px 0 0;
	padding: 20px 22px;
	border: 1px solid var(--fxpg-rule);
	border-radius: 14px;
	background: var(--fxpg-mist);
}
.fxpg-fact {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.fxpg-fact-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--fxpg-muted);
	font-size: 12px;
	font-weight: 600;
}
.fxpg-fact-label i {
	font-size: 11px;
	color: inherit;
}
.fxpg-fact-value {
	color: var(--fxpg-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

/* ---- section: a titled block of stored HTML, repeated ----------------------- */
.fxpg-section {
	margin-top: 28px;
}
.fxpg-section-title {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 14px;
	color: var(--fxpg-ink);
	font-size: 17px;
	font-weight: 700;
}
.fxpg-section-title i {
	color: var(--fxpg-teal);
	font-size: 14px;
}

/* ---- filebar: download / watch / open an external link ---------------------- */
.fxpg-filebar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 26px;
	padding: 16px 18px;
	border: 1px solid var(--fxpg-rule);
	border-radius: 14px;
	background: var(--fxpg-mist);
}
.fxpg-filebar-icon {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: rgba(var(--fxpg-primary-rgb), .10);
	color: var(--fxpg-teal);
}
.fxpg-filebar-icon i {
	font-size: 17px;
	color: inherit;
}
.fxpg-filebar-info {
	flex: 1 1 180px;
	min-width: 0;
}
.fxpg-filebar-title {
	display: block;
	color: var(--fxpg-ink);
	font-size: 14px;
	font-weight: 700;
	overflow-wrap: anywhere;
}
.fxpg-filebar-hint {
	display: block;
	margin-top: 2px;
	color: var(--fxpg-muted);
	font-size: 12.5px;
}
.fxpg-filebar-btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: var(--fxpg-teal-deep);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	/* Declared on :hover too - these are <a> elements and the theme's
	   a:hover { transition: color .2s ease } at (0,1,1) REPLACES the list. */
	transition: background-color .2s ease, color .2s ease;
}
.fxpg-filebar-btn:hover {
	background: var(--fxpg-teal);
	color: #fff;
	transition: background-color .2s ease, color .2s ease;
}
/* btn-outline-* paints no border in this theme, so the quiet button gets its own. */
.fxpg-filebar-btn-quiet {
	background: transparent;
	border-color: var(--fxpg-rule);
	color: var(--fxpg-teal);
}
.fxpg-filebar-btn-quiet:hover {
	background: transparent;
	border-color: var(--fxpg-teal);
	color: var(--fxpg-teal);
}

/* ---- pager: previous / next within the same section ------------------------- */
.fxpg-pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 26px;
	padding-top: 20px;
	border-top: 1px solid var(--fxpg-rule);
}
.fxpg-pager-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--fxpg-teal);
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	transition: color .2s ease;
}
.fxpg-pager-link:hover {
	color: var(--fxpg-teal-deep);
	transition: color .2s ease;
}
/* RTL: the arrows point with the flow, not against it. */
[dir="rtl"] .fxpg-pager-link i {
	transform: scaleX(-1);
}

/* ---- the share footer ------------------------------------------------------- */
.fxpg-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-top: 28px;
	padding-top: 20px;
	border-top: 1px solid var(--fxpg-rule);
}
.fxpg-actions-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--fxpg-muted);
	font-size: 13px;
	font-weight: 600;
}
.fxpg-actions-label i {
	font-size: 12px;
	color: inherit;
}
.fxpg-share {
	display: flex;
	align-items: center;
	gap: 8px;
}
.fxpg-share > * {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--fxpg-mist);
	color: var(--fxpg-muted);
	cursor: pointer;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}
.fxpg-share > *:hover {
	background: rgba(var(--fxpg-primary-rgb), .12);
	color: var(--fxpg-teal);
	transition: background-color .2s ease, color .2s ease;
}
.fxpg-share i {
	font-size: 14px;
	color: inherit;
}
/* The copy button after a successful copy, set by assets/js/fx-detail.js. */
.fxpg-share > .is-done {
	background: rgba(23, 139, 86, .12);
	color: #15794C;
}
[data-bs-theme="dark"] .fxpg-share > .is-done {
	background: rgba(80, 205, 137, .18);
	color: #6FD9A0;
}

/* ---- back to the section ---------------------------------------------------- */
.fxpg-backlink {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	margin-top: 22px;
	color: var(--fxpg-muted);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: color .2s ease;
}
.fxpg-backlink:hover {
	color: var(--fxpg-teal);
	transition: color .2s ease;
}
[dir="rtl"] .fxpg-backlink i {
	transform: scaleX(-1);
}

/* ---- related: the block that used to be a sidebar --------------------------- */
.fxpg-related {
	max-width: 900px;
	margin: 36px auto 0;
}
.fxpg-related-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	color: var(--fxpg-ink);
	font-size: 17px;
	font-weight: 700;
}
.fxpg-related-head i {
	color: var(--fxpg-teal);
	font-size: 15px;
}

@media (max-width: 767.98px) {
	.fxpg-article-inner {
		padding: 22px 18px 20px;
	}
	.fxpg-article-title {
		font-size: 21px;
	}
	.fxpg-actions {
		justify-content: center;
	}
	.fxpg-facts {
		padding: 16px 18px;
	}
}

@media print {
	.fxpg-actions,
	.fxpg-backlink,
	.fxpg-pager,
	.fxpg-related,
	.fxpg-hero {
		display: none;
	}
	.fxpg-article {
		border: 0;
		max-width: none;
	}
}

/* The shared pager's active page.
   class.pager.php emits its own CSS as an inline <style> inside {PageNumber}, i.e.
   AFTER this sheet, so overriding it takes specificity rather than source order.
   Without this the current page stays the theme's blue while everything around it is
   teal - it was set on only 2 of the 14 sheets that render a pager. */
#kt_content .fx-pager .fx-pg-btn.active {
	background: var(--fxpg-teal);
	border-color: var(--fxpg-teal);
}
