/**
 * FictionX Media - Frontend Styles
 *
 * The page shell and the card rules are COPIED from updates.css and album.css, as
 * every module in this pass is - a media section and a photo album are the same
 * screen. If one of the shared values is changed, change the others.
 */

:root {
	--fxmd-teal: #26667c;        /* the site's own --bs-primary */
	--fxmd-teal-deep: #0E3D4C;
	--fxmd-ink: #0B2B33;
	--fxmd-muted: #5B7076;
	--fxmd-mist: #EFF3F4;
	--fxmd-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. */
	--fxmd-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 (.fxmd-search-btn:hover, white text) is pinned back to the
	   deep teal further down, or that button would invert into pale-on-white. */
	--fxmd-teal: #4FA3BA;
	--fxmd-ink: #E8F0F2;
	--fxmd-muted: #9FB3B9;
	--fxmd-mist: #0F1B1F;
	--fxmd-rule: rgba(255, 255, 255, .10);
}

/* ==============================================================================
   The hero, on the band header.dwt paints behind every module page
   ============================================================================== */
.fxmd-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. */
.fxmd-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;
}
/* Start-aligned, not centred: a centred column reads as a campaign banner over the
   site's video band, and `text-align: start` resolves to right in Arabic and left in
   English on its own. The 46px below was clearance for the pill that hung off the
   hero's lower edge; nothing straddles the seam now, so it is 26px. */
.fxmd-hero-inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	text-align: start;
	padding-bottom: 26px;
}
.fxmd-hero-crumbs .breadcrumb {
	justify-content: flex-start;
	margin-bottom: 6px;
	opacity: .85;
}
.fxmd-hero-crumbs .breadcrumb-item,
.fxmd-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. */
.fxmd-hero-crumbs .breadcrumb-item.opacity-75 {
	opacity: .72 !important;
	transition: opacity .2s ease;
}
.fxmd-hero-crumbs .breadcrumb-item.opacity-75:hover {
	opacity: 1 !important;
}
.fxmd-hero-crumbs .breadcrumb-item a:hover {
	color: #fff !important;
	text-decoration: underline !important;
	text-underline-offset: 3px;
}
.fxmd-hero-title {
	margin: 0;
	color: #fff;
	font-size: clamp(32px, 18px + 3.2vw, 56px);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -.01em;
	text-shadow: 0 2px 18px rgba(0, 0, 0, .28);
}
.fxmd-hero-sub {
	/* Not `auto`: that re-centres the paragraph inside the start-aligned column. */
	margin: 14px 0 0;
	max-width: 54ch;
	color: rgba(255, 255, 255, .86);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.9;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .3);
}

/* ------------------------------------------------------------- the toolbar ----
   The search and the count, on one row above the cards: search at the reading-start
   edge, count at the other. `space-between` with the form first does that in both
   directions, so Arabic gets search-right/count-left and English the mirror without
   a single direction-specific rule.
   ------------------------------------------------------------------------------ */
.fxmd-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 20px;
	margin: 0 0 28px;
}
.fxmd-toolbar-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

/* --------------------------------------------------------------- the search ---
   It was a white elevated pill straddling the hero/band seam. On the band it is an
   ordinary field, the shape every other module's toolbar uses: 42px, one hairline,
   10px radius. */
.fxmd-search {
	display: flex;
	align-items: center;
	gap: 8px;
	width: min(460px, 100%);
	margin: 0;
	padding: 0;
	background: transparent;
	border-radius: 0;
}
.fxmd-search-field {
	display: flex;
	align-items: center;
	gap: 9px;
	flex: 1 1 auto;
	min-width: 0;            /* or a long placeholder refuses to shrink */
	height: 42px;
	padding-inline: 14px;
	margin: 0;
	background: var(--bs-body-bg);
	border: 1px solid var(--fxmd-rule);
	border-radius: 10px;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.fxmd-search-icon {
	flex: 0 0 auto;
	color: var(--fxmd-muted);
	font-size: 15px;
}
.fxmd-search-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--fxmd-ink);
	font-size: 13.5px;
	font-weight: 500;
	padding: 0;
}
.fxmd-search-input::placeholder {
	color: var(--fxmd-muted);
	font-weight: 400;
	opacity: 1;
}
.fxmd-search-input:focus {
	outline: 0;
}
/* The ring is the focus affordance, so it stays - on the FIELD now, which is the box
   that has an edge. On .fxmd-search it would have drawn around the button too. */
.fxmd-search-field:focus-within {
	border-color: var(--fxmd-teal);
	box-shadow: 0 0 0 3px rgba(var(--fxmd-primary-rgb), .18);
}
.fxmd-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.fxmd-search-btn {
	flex: 0 0 auto;
	height: 42px;
	border: 0;
	border-radius: 10px;
	background: var(--fxmd-teal-deep);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	padding: 0 22px;
	transition: background .2s ease;
}
.fxmd-search-btn:hover,
.fxmd-search-btn:focus-visible {
	background: var(--fxmd-teal);
}
[data-bs-theme="dark"] .fxmd-search-btn:hover,
[data-bs-theme="dark"] .fxmd-search-btn:focus-visible {
	background: #2E7E96;
}
[data-bs-theme="dark"] .fxmd-search-field {
	background: #16262B;
}
[data-bs-theme="dark"] .fxmd-search-btn {
	background: #2E7F96;
}
[data-bs-theme="dark"] .fxmd-search-btn:hover {
	background: #3C9AB4;
}

.fxmd-band {
	position: relative;
	z-index: 2;
	background: var(--fxmd-mist);
	/* 86px used to clear the pill hanging off the hero. Nothing straddles the seam
	   now, so this is the ordinary band padding the other listings use. 46px / -46px
	   / 86px were one system and moved together - none of the three is left here. */
	padding: 40px 0 56px;
}

/* .fxmd-resultline is gone from the markup: the count is no longer a row of its own
   with a rule under it, it is the toolbar's end-edge member. The two rules below are
   reused unchanged by both states - the idle count and the "N results for" line. */
.fxmd-resultline-text {
	margin: 0;
	color: var(--fxmd-muted);
	font-size: 15px;
	font-weight: 500;
}
.fxmd-resultline-text strong {
	color: var(--fxmd-ink);
	font-weight: 700;
}
.fxmd-clear {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--fxmd-teal);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}
.fxmd-clear,
.fxmd-clear:hover {
	transition: color .2s ease;
}
.fxmd-clear:hover {
	color: var(--fxmd-teal-deep);
}
[data-bs-theme="dark"] .fxmd-clear:hover {
	color: var(--fxmd-ink);
}

.fxmd-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 64px 20px;
	background: var(--bs-body-bg);
	border: 1px solid var(--fxmd-rule);
	border-radius: 14px;
}
.fxmd-empty-icon {
	color: var(--fxmd-muted);
	font-size: 36px;
	opacity: .5;
	margin-bottom: 16px;
}
.fxmd-empty-title {
	margin: 0;
	color: var(--fxmd-ink);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.7;
}
.fxmd-empty-text {
	margin: 10px 0 0;
	color: var(--fxmd-muted);
	font-size: 15px;
}
.fxmd-empty-text:empty {
	display: none;
}
.fxmd-empty-btn {
	display: inline-flex;
	align-items: center;
	margin-top: 20px;
	padding: 11px 26px;
	border-radius: 999px;
	background: var(--fxmd-teal);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s ease;
}
.fxmd-empty-btn:hover {
	background: var(--fxmd-teal-deep);
	color: #fff;
}

/* ==============================================================================
   Headings shared by both grids
   ============================================================================== */
.fxmd-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	color: var(--fxmd-ink);
	font-size: 17px;
	font-weight: 700;
}
.fxmd-head i {
	color: var(--fxmd-teal);
	font-size: 15px;
}
.fxmd-head-n {
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(var(--fxmd-primary-rgb), .10);
	color: var(--fxmd-teal);
	font-size: 12.5px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ==============================================================================
   Albums
   ============================================================================== */
.fxmd-albums {
	margin-bottom: 44px;
}
.fxmd-album-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 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: 16px;
}
.fxmd-album {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--fxmd-rule);
	border-radius: 14px;
	background: var(--bs-body-bg);
	overflow: hidden;
	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. */
	transition: border-color .2s ease, transform .2s ease;
}
.fxmd-album:hover {
	border-color: var(--fxmd-teal);
	transform: translateY(-2px);
	transition: border-color .2s ease, transform .2s ease;
}
.fxmd-album-cover {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	/* Opaque: the name tile's tint is translucent, and without a base of its own it
	   would composite over whatever the card sits on. */
	background: var(--bs-body-bg);
}
.fxmd-album-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* No cover on disk, so the NAME fills the tile - and comes out of the body below, so
   it is printed once. Same tint the events date tiles and the library covers use. */
.fxmd-tile-name {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px 18px;
	background-image: linear-gradient(160deg,
		rgba(var(--fxmd-primary-rgb), .13) 0%,
		rgba(var(--fxmd-primary-rgb), .05) 100%);
	color: var(--fxmd-teal);
	text-align: center;
}
.fxmd-tile-name span {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}
[data-bs-theme="dark"] .fxmd-tile-name {
	background-image: linear-gradient(160deg,
		rgba(var(--fxmd-primary-rgb), .26) 0%,
		rgba(var(--fxmd-primary-rgb), .10) 100%);
	color: #7FC3D6;
}
.fxmd-album-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px 16px;
}
.fxmd-album-name {
	margin: 0;
	color: var(--fxmd-ink);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}
.fxmd-album-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 6px;
	color: var(--fxmd-muted);
	font-size: 12.5px;
}
.fxmd-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 24px;
	padding: 0 10px;
	border-radius: 999px;
	background: rgba(var(--fxmd-primary-rgb), .09);
	color: var(--fxmd-teal);
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.fxmd-chip i {
	font-size: 11px;
	color: inherit;
	line-height: 1;
}

/* ==============================================================================
   Pictures
   ============================================================================== */
.fxmd-photo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	grid-auto-rows: 1fr;
	gap: 14px;
}
.fxmd-photo {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	overflow: hidden;
	background: var(--bs-body-bg);
	border: 1px solid var(--fxmd-rule);
	text-decoration: none;
	transition: border-color .2s ease, transform .2s ease;
}
.fxmd-photo:hover {
	border-color: var(--fxmd-teal);
	transform: translateY(-2px);
	transition: border-color .2s ease, transform .2s ease;
}
.fxmd-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
/* The caption sits over the picture, so it needs its own scrim rather than relying on
   whatever the photograph happens to be. */
.fxmd-photo-cap {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	padding: 24px 12px 10px;
	background: linear-gradient(to top,
		rgba(5, 27, 34, .88) 0%,
		rgba(5, 27, 34, .55) 55%,
		rgba(5, 27, 34, 0) 100%);
	color: #fff;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}
/* A picture whose file is not on disk still has a name, and a name is more use than a
   broken image. */
.fxmd-photo-missing {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	background-image: linear-gradient(160deg,
		rgba(var(--fxmd-primary-rgb), .13) 0%,
		rgba(var(--fxmd-primary-rgb), .05) 100%);
	color: var(--fxmd-teal);
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.6;
	overflow: hidden;
}
[data-bs-theme="dark"] .fxmd-photo-missing {
	background-image: linear-gradient(160deg,
		rgba(var(--fxmd-primary-rgb), .26) 0%,
		rgba(var(--fxmd-primary-rgb), .10) 100%);
	color: #7FC3D6;
}
/* Neither a file nor a name: the icon says "a picture" without claiming to know
   which. Sized here because a bare <i> inherits display:inline, which ignores width
   and height - the fault that left an invisible map pin on the events screen. */
.fxmd-photo-anon i {
	display: block;
	font-size: 30px;
	color: inherit;
	opacity: .55;
}
.fxmd-pager-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

@media (max-width: 575.98px) {
	.fxmd-photo-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

@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;
	}
}

@keyframes fxmd-rise {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}
/* The search is no longer part of the hero, so it is no longer part of the hero's
   entrance - it would have risen on its own, out of sequence, down in the band. */
.fxmd-hero-title,
.fxmd-hero-sub {
	animation: fxmd-rise .55s cubic-bezier(.22, .7, .3, 1) both;
}
.fxmd-hero-sub { animation-delay: .08s; }

@media (prefers-reduced-motion: reduce) {
	.fxmd-hero-title,
	.fxmd-hero-sub {
		animation: none;
	}
	/* Reduced motion means no MOVEMENT, not a dead page: the travel goes, the colour
	   change stays. */
	.fxmd-album:hover,
	.fxmd-photo:hover {
		transform: none;
	}
}

/* =============================================================================
   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.
   ============================================================================= */
/* The listing's band reserves 86px at the top for the search pill that overlaps the
   seam. A detail page has no pill, so it closes that gap. */
.fxmd-band-nopill {
	padding-top: 40px;
}

.fxmd-article {
	max-width: 900px;
	margin: 0 auto;
	border-radius: 18px;
	overflow: hidden;
	background: var(--bs-body-bg);
	border: 1px solid var(--fxmd-rule);
}
.fxmd-article-media {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--fxmd-mist);
}
.fxmd-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. */
.fxmd-article-media.is-empty img {
	width: 32%;
	height: auto;
	margin: auto;
	position: absolute;
	inset: 0;
	opacity: .5;
	object-fit: contain;
}
[data-bs-theme="dark"] .fxmd-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;
}
.fxmd-article-inner {
	padding: 28px 38px 26px;
}
.fxmd-article-head {
	padding-bottom: 20px;
	margin-bottom: 26px;
	border-bottom: 1px solid var(--fxmd-rule);
}
.fxmd-article-cat {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(var(--fxmd-primary-rgb), .10);
	color: var(--fxmd-teal);
	font-size: 12.5px;
	font-weight: 700;
}
.fxmd-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. */
.fxmd-article-cat a {
	color: inherit;
	text-decoration: none;
}
.fxmd-article-title {
	margin: 0 0 14px;
	color: var(--fxmd-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;
}
.fxmd-article-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 22px;
	color: var(--fxmd-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}
.fxmd-article-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
.fxmd-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. */
.fxmd-article-body {
	max-width: 68ch;
	margin: 0 auto;
	color: var(--fxmd-ink);
	font-size: 15.5px;
	line-height: 2;
	overflow-wrap: anywhere;
}
.fxmd-article-body > *:first-child { margin-top: 0; }
.fxmd-article-body > *:last-child  { margin-bottom: 0; }
.fxmd-article-body img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}
.fxmd-article-body a {
	color: var(--fxmd-teal);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.fxmd-article-body h1,
.fxmd-article-body h2,
.fxmd-article-body h3,
.fxmd-article-body h4 {
	color: var(--fxmd-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. */
.fxmd-article-body ul,
.fxmd-article-body ol {
	padding-inline-start: 1.6em;
	margin-block: 0 16px;
}
.fxmd-article-body li {
	margin-bottom: 6px;
}
.fxmd-article-body blockquote {
	margin: 0 0 16px;
	padding-inline-start: 16px;
	border-inline-start: 3px solid rgba(var(--fxmd-primary-rgb), .35);
	color: var(--fxmd-muted);
}
.fxmd-article-body table {
	max-width: 100%;
	border-collapse: collapse;
}
.fxmd-article-body th,
.fxmd-article-body td {
	padding: 8px 12px;
	border: 1px solid var(--fxmd-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. */
.fxmd-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"] .fxmd-article-body [style*="color"]      { color: inherit !important; }
[data-bs-theme="dark"] .fxmd-article-body [style*="background"] { background: transparent !important; }
[data-bs-theme="dark"] .fxmd-article-body font[color]           { color: inherit !important; }
[data-bs-theme="dark"] .fxmd-article-body a[style*="color"],
[data-bs-theme="dark"] .fxmd-article-body a[style*="color"]:hover { color: var(--fxmd-teal) !important; }

/* ---- facts: label/value pairs for the fields a row actually carries ---------- */
.fxmd-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(--fxmd-rule);
	border-radius: 14px;
	background: var(--fxmd-mist);
}
.fxmd-fact {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.fxmd-fact-label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--fxmd-muted);
	font-size: 12px;
	font-weight: 600;
}
.fxmd-fact-label i {
	font-size: 11px;
	color: inherit;
}
.fxmd-fact-value {
	color: var(--fxmd-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

/* ---- section: a titled block of stored HTML, repeated ----------------------- */
.fxmd-section {
	margin-top: 28px;
}
.fxmd-section-title {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 14px;
	color: var(--fxmd-ink);
	font-size: 17px;
	font-weight: 700;
}
.fxmd-section-title i {
	color: var(--fxmd-teal);
	font-size: 14px;
}

/* ---- filebar: download / watch / open an external link ---------------------- */
.fxmd-filebar {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-top: 26px;
	padding: 16px 18px;
	border: 1px solid var(--fxmd-rule);
	border-radius: 14px;
	background: var(--fxmd-mist);
}
.fxmd-filebar-icon {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: rgba(var(--fxmd-primary-rgb), .10);
	color: var(--fxmd-teal);
}
.fxmd-filebar-icon i {
	font-size: 17px;
	color: inherit;
}
.fxmd-filebar-info {
	flex: 1 1 180px;
	min-width: 0;
}
.fxmd-filebar-title {
	display: block;
	color: var(--fxmd-ink);
	font-size: 14px;
	font-weight: 700;
	overflow-wrap: anywhere;
}
.fxmd-filebar-hint {
	display: block;
	margin-top: 2px;
	color: var(--fxmd-muted);
	font-size: 12.5px;
}
.fxmd-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(--fxmd-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;
}
.fxmd-filebar-btn:hover {
	background: var(--fxmd-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. */
.fxmd-filebar-btn-quiet {
	background: transparent;
	border-color: var(--fxmd-rule);
	color: var(--fxmd-teal);
}
.fxmd-filebar-btn-quiet:hover {
	background: transparent;
	border-color: var(--fxmd-teal);
	color: var(--fxmd-teal);
}

/* ---- pager: previous / next within the same section ------------------------- */
.fxmd-pager {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 26px;
	padding-top: 20px;
	border-top: 1px solid var(--fxmd-rule);
}
.fxmd-pager-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--fxmd-teal);
	font-size: 13.5px;
	font-weight: 700;
	text-decoration: none;
	transition: color .2s ease;
}
.fxmd-pager-link:hover {
	color: var(--fxmd-teal-deep);
	transition: color .2s ease;
}
/* RTL: the arrows point with the flow, not against it. */
[dir="rtl"] .fxmd-pager-link i {
	transform: scaleX(-1);
}

/* ---- the share footer ------------------------------------------------------- */
.fxmd-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(--fxmd-rule);
}
.fxmd-actions-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--fxmd-muted);
	font-size: 13px;
	font-weight: 600;
}
.fxmd-actions-label i {
	font-size: 12px;
	color: inherit;
}
.fxmd-share {
	display: flex;
	align-items: center;
	gap: 8px;
}
.fxmd-share > * {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--fxmd-mist);
	color: var(--fxmd-muted);
	cursor: pointer;
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}
.fxmd-share > *:hover {
	background: rgba(var(--fxmd-primary-rgb), .12);
	color: var(--fxmd-teal);
	transition: background-color .2s ease, color .2s ease;
}
.fxmd-share i {
	font-size: 14px;
	color: inherit;
}
/* The copy button after a successful copy, set by assets/js/fx-detail.js. */
.fxmd-share > .is-done {
	background: rgba(23, 139, 86, .12);
	color: #15794C;
}
[data-bs-theme="dark"] .fxmd-share > .is-done {
	background: rgba(80, 205, 137, .18);
	color: #6FD9A0;
}

/* ---- back to the section ---------------------------------------------------- */
.fxmd-backlink {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	margin-top: 22px;
	color: var(--fxmd-muted);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: color .2s ease;
}
.fxmd-backlink:hover {
	color: var(--fxmd-teal);
	transition: color .2s ease;
}
[dir="rtl"] .fxmd-backlink i {
	transform: scaleX(-1);
}

/* ---- related: the block that used to be a sidebar --------------------------- */
.fxmd-related {
	max-width: 900px;
	margin: 36px auto 0;
}
.fxmd-related-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	color: var(--fxmd-ink);
	font-size: 17px;
	font-weight: 700;
}
.fxmd-related-head i {
	color: var(--fxmd-teal);
	font-size: 15px;
}

@media (max-width: 767.98px) {
	.fxmd-hero {
		padding-top: 6px;
	}
	.fxmd-hero-inner {
		padding-bottom: 20px;
	}
	/* The field takes the row and the count drops under it, rather than the two
	   squeezing side by side. */
	.fxmd-search {
		width: 100%;
	}
	.fxmd-band {
		padding-top: 28px;
	}
	.fxmd-article-inner {
		padding: 22px 18px 20px;
	}
	.fxmd-article-title {
		font-size: 21px;
	}
	.fxmd-actions {
		justify-content: center;
	}
	.fxmd-facts {
		padding: 16px 18px;
	}
}

@media print {
	.fxmd-actions,
	.fxmd-backlink,
	.fxmd-pager,
	.fxmd-related,
	.fxmd-hero {
		display: none;
	}
	.fxmd-article {
		border: 0;
		max-width: none;
	}
}

/* ---- the gallery divergence ------------------------------------------------
   On this module the ITEM is the subject, not an illustration of one, so a picture is
   CONTAINED rather than cropped to 16/9: a portrait photograph keeps its top and
   bottom. .is-figure replaces the aspect-ratio, it does not add to it.
   -------------------------------------------------------------------------- */
.fxmd-article-media.is-figure {
	aspect-ratio: auto;
	max-height: 72vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--fxmd-mist);
}
.fxmd-article-media.is-figure img {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 72vh;
	object-fit: contain;
}
.fxmd-article-media.is-figure a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
/* A video row: the embed fills the slot and keeps 16/9, which is what a player wants.
   No row in this table is a video today (all 14 published rows are MKind=1, an image)
   but the path exists in showimage.php, so the rule exists with it. */
.fxmd-article-media.is-video {
	aspect-ratio: 16 / 9;
	max-height: none;
	background: #000;
}
.fxmd-article-media.is-video iframe,
.fxmd-article-media.is-video .ratio {
	width: 100%;
	height: 100%;
	border: 0;
}
.fxmd-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}
.fxmd-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 26px;
	padding: 0 11px;
	border-radius: 999px;
	background: rgba(var(--fxmd-primary-rgb), .09);
	color: var(--fxmd-teal);
	font-size: 12px;
	font-weight: 600;
}
.fxmd-tag i {
	font-size: 10px;
	color: inherit;
}

/* 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(--fxmd-teal);
	border-color: var(--fxmd-teal);
}
