@font-face {
	font-family: "MIF Alegreya";
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url("fonts/alegreya-latin-800-normal.woff2") format("woff2");
}

/* The frame measures the available width. The slide height is worked out from that
   width only, never from the text, so every slide has exactly the same size. */
.mif-frame {
	width: 100%;
	margin: 0 0 28px;
	container-type: inline-size;
}

.mif-slider {
	--mif-bg: #1b3f7a;
	--mif-ink: #fbf3e4;
	--mif-mark: #e9b949;
	--mif-mark-ink: #12264a;
	--mif-c1: #122b56;
	--mif-c2: #c9d6ea;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	width: 100%;
	height: 420px;
	height: clamp(320px, 56.25cqw, 520px);
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	overflow: hidden;
	border-radius: 3px;
	background: var(--mif-bg);
	color: var(--mif-ink);
	outline: none;
	container-type: inline-size;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

.mif-slider:focus-visible {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px #1c6fc4;
}

.mif-slider.mif-light {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.mif-slider.mif-light:focus-visible {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px #1c6fc4;
}

/* Text area. The bottom padding keeps the text clear of the bottom bar. */
.mif-inner {
	position: relative;
	display: flex;
	flex: none;
	flex-direction: column;
	align-items: flex-start;
	box-sizing: border-box;
	width: 100%;
	padding: 24px 60px 76px;
	padding: 3cqw 9cqw 76px 8cqw;
}

/* ---- Layouts, named after heraldic field divisions. Decoration stays clear of the
   bottom right corner, where the arrows always sit. ---- */

/* Pale: a narrow vertical bar down the left edge. */
.mif-slider.mif-l-pale {
	background: linear-gradient(90deg, var(--mif-c1) 0 3.2%, var(--mif-c2) 3.2% 3.9%, var(--mif-bg) 3.9%);
}

/* Chief: a band across the top. */
.mif-slider.mif-l-chief {
	background: linear-gradient(180deg, var(--mif-c1) 0 11%, var(--mif-c2) 11% 12.4%, var(--mif-bg) 12.4%);
}

.mif-l-chief .mif-inner {
	padding-top: 9cqw;
}

/* Bend: diagonal bars across the top right corner. */
.mif-slider.mif-l-bend {
	background:
		linear-gradient(225deg, var(--mif-c1) 0 8%, var(--mif-c2) 8% 9.5%, var(--mif-c1) 9.5% 13%, var(--mif-c2) 13% 14.5%, transparent 14.5%),
		var(--mif-bg);
}

.mif-l-bend .mif-inner {
	padding-right: 16cqw;
}

/* Chequy: a chequered strip down the left edge. */
.mif-slider.mif-l-chequy {
	background:
		conic-gradient(var(--mif-c1) 25%, var(--mif-c2) 0 50%, var(--mif-c1) 0 75%, var(--mif-c2) 0) left top / 44px 44px repeat-y,
		var(--mif-bg);
}

.mif-l-chequy .mif-inner,
.mif-l-chequy .mif-bar {
	padding-left: calc(44px + 5cqw);
}

/* Bordure: a double line frame. */
.mif-slider.mif-l-bordure::before,
.mif-slider.mif-l-bordure::after {
	content: "";
	position: absolute;
	inset: 7px;
	border: 2px solid var(--mif-c2);
	pointer-events: none;
}

.mif-slider.mif-l-bordure::after {
	inset: 12px;
	border-width: 1px;
}

.mif-slider.mif-has-image.mif-l-bordure::before,
.mif-slider.mif-has-image.mif-l-bordure::after {
	display: none;
}

/* Canton: a square in the top right corner. */
.mif-slider.mif-l-canton {
	background:
		linear-gradient(var(--mif-c1), var(--mif-c1)) right top / 12cqw 12cqw no-repeat,
		linear-gradient(var(--mif-c2), var(--mif-c2)) right top / 13.2cqw 13.2cqw no-repeat,
		var(--mif-bg);
}

.mif-l-canton .mif-inner {
	padding-right: 17cqw;
}

/* Bars: three thin horizontal bars across the top. */
.mif-slider.mif-l-bars {
	background:
		linear-gradient(180deg, var(--mif-c1) 0 2.6%, transparent 2.6% 4.4%, var(--mif-c2) 4.4% 5.6%, transparent 5.6% 7.4%, var(--mif-c1) 7.4% 10%, transparent 10%),
		var(--mif-bg);
}

.mif-l-bars .mif-inner {
	padding-top: 8cqw;
}

/* Paly: narrow vertical stripes down the left edge. */
.mif-slider.mif-l-paly {
	background:
		repeating-linear-gradient(90deg, var(--mif-c1) 0 16.67%, var(--mif-c2) 16.67% 33.33%) left top / 42px 100% no-repeat,
		var(--mif-bg);
}

.mif-l-paly .mif-inner,
.mif-l-paly .mif-bar {
	padding-left: calc(42px + 5cqw);
}

/* ---- Optional photo background ---- */

.mif-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.mif-slider.mif-has-image {
	--mif-ink: #fff;
	--mif-mark: #e9b949;
	--mif-mark-ink: #1b1a1d;
}

.mif-slider.mif-has-image .mif-bg {
	opacity: 1;
}

.mif-slider.mif-has-image .mif-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
}

/* ---- Text ---- */

.mif-kicker {
	display: inline-block;
	margin: 0 0 1.1em;
	padding: 0 0 0.45em;
	border-bottom: 2px solid var(--mif-mark);
	color: var(--mif-ink);
	font-family: Georgia, "Times New Roman", serif;
	font-size: 13px;
	font-size: clamp(12px, 1.5cqw, 17px);
	font-style: italic;
	line-height: 1;
	letter-spacing: 0.06em;
}

.mif-slider .mif-text {
	position: relative;
	margin: 0;
	padding: 0;
	max-width: 100%;
	font-family: "MIF Alegreya", Georgia, "Times New Roman", serif;
	font-size: 26px;
	font-size: clamp(21px, 4.5cqw, 46px);
	line-height: 1.3;
	font-weight: 800;
	text-align: left;
	color: var(--mif-ink);
	transition: opacity 0.18s ease;
}

.mif-slider.mif-long .mif-text {
	font-size: 21px;
	font-size: clamp(18px, 3.5cqw, 38px);
}

/* Highlighted words sit on a marker block, like a rubricated label. */
.mif-slider .mif-text strong {
	padding: 0 0.22em 0.04em;
	background: var(--mif-mark);
	color: var(--mif-mark-ink);
	font-weight: 800;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

.mif-slider.mif-fading .mif-text,
.mif-slider.mif-fading .mif-source {
	opacity: 0;
}

/* ---- Bottom bar. Same place and same size on every slide. ---- */

.mif-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	box-sizing: border-box;
	height: 62px;
	padding: 0 24px 22px 60px;
	padding: 0 24px 22px 8cqw;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	line-height: 1.2;
}

.mif-slider .mif-source {
	min-width: 0;
	overflow: hidden;
	color: var(--mif-ink);
	font-weight: 400;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	text-overflow: ellipsis;
	white-space: nowrap;
	box-shadow: none;
	transition: opacity 0.18s ease;
}

.mif-slider .mif-source:hover,
.mif-slider .mif-source:focus {
	color: var(--mif-ink);
	text-decoration-thickness: 2px;
}

.mif-slider .mif-source[hidden] {
	display: none;
}

.mif-controls {
	display: flex;
	flex: none;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.mif-controls[hidden] {
	display: none;
}

.mif-counter {
	flex: none;
	width: 64px;
	color: var(--mif-ink);
	font-weight: 700;
	text-align: center;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.mif-slider .mif-nav {
	flex: none;
	width: 40px;
	min-width: 40px;
	height: 40px;
	min-height: 40px;
	margin: 0;
	padding: 0 0 2px;
	border: 0;
	border-radius: 2px;
	background: var(--mif-ink);
	box-shadow: none;
	color: var(--mif-bg);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.mif-slider.mif-has-image .mif-nav {
	color: #1b1a1d;
}

.mif-slider .mif-nav:focus {
	outline: none;
}

.mif-slider .mif-nav:focus-visible {
	background: var(--mif-mark);
	color: var(--mif-mark-ink);
}

@media (hover: hover) {
	.mif-slider .mif-nav:hover {
		background: var(--mif-mark);
		color: var(--mif-mark-ink);
	}
}

/* ---- Slider placed automatically on a category page ---- */

.mif-auto {
	width: 100%;
	margin: 0 0 30px;
}

/* ---- List under the slider ---- */

.mif-list {
	margin: 0 0 28px;
	padding-left: 1.6em;
}

.mif-item {
	margin: 0 0 22px;
	padding-left: 6px;
}

.mif-item p {
	margin: 0 0 6px;
}

.mif-item-fact {
	font-size: 1.1em;
	font-weight: 600;
}

.mif-item-fact strong {
	color: #8f1d21;
}

.mif-item-source {
	font-size: 0.85em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* ---- Narrow places: phones, sidebars, narrow columns ---- */

@container (max-width: 600px) {
	.mif-slider {
		height: clamp(400px, 120cqw, 520px);
	}

	.mif-inner {
		padding: 8cqw 8cqw 68px 9cqw;
	}

	.mif-slider .mif-text {
		font-size: clamp(20px, 7cqw, 32px);
	}

	.mif-slider.mif-long .mif-text {
		font-size: clamp(18px, 5.6cqw, 26px);
	}

	.mif-kicker {
		font-size: 12px;
	}

	.mif-bar {
		height: 54px;
		padding: 0 18px 18px 9cqw;
		font-size: 12px;
	}

	.mif-slider .mif-nav {
		width: 36px;
		min-width: 36px;
		height: 36px;
		min-height: 36px;
		font-size: 18px;
	}

	.mif-controls {
		gap: 6px;
	}

	.mif-counter {
		width: 54px;
	}

	.mif-slider.mif-l-pale {
		background: linear-gradient(90deg, var(--mif-c1) 0 4%, var(--mif-c2) 4% 5%, var(--mif-bg) 5%);
	}

	.mif-slider.mif-l-chief {
		background: linear-gradient(180deg, var(--mif-c1) 0 8%, var(--mif-c2) 8% 9%, var(--mif-bg) 9%);
	}

	.mif-l-chief .mif-inner,
	.mif-l-bars .mif-inner {
		padding-top: 16cqw;
	}

	.mif-l-bend .mif-inner,
	.mif-l-canton .mif-inner {
		padding-top: 20cqw;
		padding-right: 8cqw;
	}

	.mif-slider.mif-l-chequy {
		background:
			conic-gradient(var(--mif-c1) 25%, var(--mif-c2) 0 50%, var(--mif-c1) 0 75%, var(--mif-c2) 0) left top / 28px 28px repeat-y,
			var(--mif-bg);
	}

	.mif-l-chequy .mif-inner,
	.mif-l-chequy .mif-bar {
		padding-left: calc(28px + 6cqw);
	}

	.mif-slider.mif-l-paly {
		background:
			repeating-linear-gradient(90deg, var(--mif-c1) 0 16.67%, var(--mif-c2) 16.67% 33.33%) left top / 30px 100% no-repeat,
			var(--mif-bg);
	}

	.mif-l-paly .mif-inner,
	.mif-l-paly .mif-bar {
		padding-left: calc(30px + 6cqw);
	}

	.mif-slider.mif-l-canton {
		background:
			linear-gradient(var(--mif-c1), var(--mif-c1)) right top / 17cqw 17cqw no-repeat,
			linear-gradient(var(--mif-c2), var(--mif-c2)) right top / 19cqw 19cqw no-repeat,
			var(--mif-bg);
	}

	.mif-slider.mif-l-bordure::before {
		inset: 5px;
	}

	.mif-slider.mif-l-bordure::after {
		inset: 9px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mif-bg,
	.mif-slider .mif-text,
	.mif-slider .mif-source,
	.mif-slider .mif-nav {
		transition: none;
	}
}
