:where(.legacy-article) :not(x-legacy) {
	margin: revert-layer;
	padding: revert-layer;
}

:where(.legacy-article) :is(h1, h2, h3, h4, h5, h6) {
	padding: 0;
}

.legacy-article {
	.tac { text-align: center; }
	.tal { text-align: left; }
	.tar { text-align: right; }
	.taj { text-align: justify; }
	.fw700 { font-weight: 700; }

	/* Legacy markup places images inline inside text-align containers (.tac) */
	:where(img) { display: inline-block; max-width: 100%; height: auto; }

	.dfl { display: flex; }
	.bgc--background-light { background-color: var(--fd-semantic-surface-sunken); }

	.m0 { margin: 0; }
	.ml0 { margin-left: 0; }
	.mt05 { margin-top: var(--fd-spacing-2); }
	.mt2 { margin-top: var(--fd-spacing-5); }
	.mt3 { margin-top: var(--fd-spacing-8); }
	.mt4 { margin-top: var(--fd-spacing-9); }
	.mb0 { margin-bottom: 0; }
	.mb2 { margin-bottom: var(--fd-spacing-5); }
	.mb3 { margin-bottom: var(--fd-spacing-8); }
	.mb4 { margin-bottom: var(--fd-spacing-9); }
	.mb5 { margin-bottom: var(--fd-spacing-10); }

	.p1 { padding: var(--fd-spacing-3); }
	.pt3 { padding-top: var(--fd-spacing-8); }

	/* minmax(0, 1fr): a wide child (a 1500px image, a nested row) must not stretch the tracks past the content width */
	.row {
		display: grid;
		grid-template-columns: repeat(12, minmax(0, 1fr));
		gap: var(--fd-spacing-8);
	}

	/* A row child without a col-* class takes the whole line, as on the old flexbox grid (flex-wrap): mostly the next rows
	   nested by an unclosed </div> in the description HTML (ADO 29837, 40051414), which would each get one 1/12 track */
	.row > :not([class*="col-"]) { grid-column: 1 / -1; }

	.row-center-vertical > * { align-self: center; }

	/* Old-site flex helpers (.reverse = row-reverse, .middle-* = vertical centering) mapped onto the grid */
	@media (min-width: 760px) {
		.row.reverse > :first-child { order: 2; }
		.row.middle-sm { align-items: center; }
	}
	@media (min-width: 1025px) {
		.row.middle-md { align-items: center; }
	}
	@media (min-width: 1200px) {
		.row.middle-lg { align-items: center; }
	}

	.col-xs-1 { grid-column: span 1; }
	.col-xs-2 { grid-column: span 2; }
	.col-xs-3 { grid-column: span 3; }
	.col-xs-4 { grid-column: span 4; }
	.col-xs-5 { grid-column: span 5; }
	.col-xs-6 { grid-column: span 6; }
	.col-xs-7 { grid-column: span 7; }
	.col-xs-8 { grid-column: span 8; }
	.col-xs-9 { grid-column: span 9; }
	.col-xs-10 { grid-column: span 10; }
	.col-xs-11 { grid-column: span 11; }
	.col-xs-12 { grid-column: span 12; }

	@media (min-width: 760px) {
		.col-sm-1 { grid-column: span 1; }
		.col-sm-2 { grid-column: span 2; }
		.col-sm-3 { grid-column: span 3; }
		.col-sm-4 { grid-column: span 4; }
		.col-sm-5 { grid-column: span 5; }
		.col-sm-6 { grid-column: span 6; }
		.col-sm-7 { grid-column: span 7; }
		.col-sm-8 { grid-column: span 8; }
		.col-sm-9 { grid-column: span 9; }
		.col-sm-10 { grid-column: span 10; }
		.col-sm-11 { grid-column: span 11; }
		.col-sm-12 { grid-column: span 12; }
	}

	@media (min-width: 1240px) {
		.col-md-1 { grid-column: span 1; }
		.col-md-2 { grid-column: span 2; }
		.col-md-3 { grid-column: span 3; }
		.col-md-4 { grid-column: span 4; }
		.col-md-5 { grid-column: span 5; }
		.col-md-6 { grid-column: span 6; }
		.col-md-7 { grid-column: span 7; }
		.col-md-8 { grid-column: span 8; }
		.col-md-9 { grid-column: span 9; }
		.col-md-10 { grid-column: span 10; }
		.col-md-11 { grid-column: span 11; }
		.col-md-12 { grid-column: span 12; }
	}

	@media (min-width: 1650px) {
		.col-lg-1 { grid-column: span 1; }
		.col-lg-2 { grid-column: span 2; }
		.col-lg-3 { grid-column: span 3; }
		.col-lg-4 { grid-column: span 4; }
		.col-lg-5 { grid-column: span 5; }
		.col-lg-6 { grid-column: span 6; }
		.col-lg-7 { grid-column: span 7; }
		.col-lg-8 { grid-column: span 8; }
		.col-lg-9 { grid-column: span 9; }
		.col-lg-10 { grid-column: span 10; }
		.col-lg-11 { grid-column: span 11; }
		.col-lg-12 { grid-column: span 12; }
	}

	/* Old-site variables and buttons used by imported article bodies (their inline styles reference var(--color-primary) and c-btn--*). */
	--color-primary: var(--fd-semantic-content-primary);
	--color-error: var(--fd-semantic-feedback-danger-default);
	--color-background-light: var(--fd-semantic-surface-sunken);

	/* Headings of the old site: the DS resets bare h1-h3, the article bodies rely on their size and weight. */
	h1 { font-size: var(--font-size-fluid-h1); }
	h2 { font-size: var(--font-size-fluid-h2); }
	h3 { font-size: var(--font-size-fluid-h3); }
	h4 { font-size: var(--font-size-fluid-h4); }

	h1,
	h2,
	h3,
	h4 {
		font-weight: var(--fd-font-weight-black);
		line-height: var(--fd-text-heading-line-height);
	}

	:where(h1, h2, h3, h4) {
		margin: 0 0 var(--fd-size-16);
		color: var(--fd-semantic-content-primary);
	}

	.c-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: var(--fd-spacing-3);
		min-height: var(--fd-size-48);
		padding: 0 var(--fd-spacing-5);
		border: var(--fd-border-width-xs) solid transparent;
		border-radius: var(--fd-border-radius-sm);
		font-weight: var(--fd-font-weight-bold);
		text-decoration: none;
		cursor: pointer;
		transition: background-color var(--fd-animation-speed-1), border-color var(--fd-animation-speed-1);
	}

	.c-btn--primary {
		background-color: var(--fd-interactive-primary-default);
		border-color: var(--fd-interactive-primary-default);
		color: var(--fd-semantic-content-on-primary);
	}

	.c-btn--primary:hover {
		background-color: var(--fd-interactive-primary-hovered);
		border-color: var(--fd-interactive-primary-hovered);
	}

	.c-btn--light {
		background-color: var(--fd-interactive-neutral-light-default);
		border-color: var(--fd-semantic-border-default);
		color: var(--fd-semantic-content-primary);
	}

	.c-btn--light:hover {
		background-color: var(--fd-interactive-neutral-light-hovered);
	}

	/* Old-site accordion (c-accordion, toggled by the script in formatovac-obsahu) used by imported articles.
	   :where() keeps these defaults at the lowest specificity so the article's own inline styles (.acc ...) always win. */
	:where([hidden]) { display: none; }

	:where(.c-accordion) { width: 100%; }

	:where(.c-accordion__button) {
		position: relative;
		width: 100%;
		padding: 0;
		border: 0;
		background: transparent;
		font: inherit;
		font-weight: var(--fd-font-weight-bold);
		text-align: left;
		color: var(--fd-semantic-content-primary);
		cursor: pointer;
	}

	:where(.c-accordion__button)::after {
		content: " ";
		position: absolute;
		top: 0;
		right: 0;
		width: var(--fd-size-32);
		height: 100%;
		background-repeat: no-repeat;
		background-size: var(--fd-size-24) auto;
		background-position: center;
		background-image: url("data:image/svg+xml,%3Csvg width='13' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m11.52,1.46l-5,5l-5,-5' fill='none' stroke='%230D4F9E' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'/%3E%3C/svg%3E");
	}

	:where(.c-accordion__button[aria-expanded="true"])::after { transform: rotate(180deg); }

	:where(.c-accordion--outlined .c-accordion__button) {
		min-height: var(--fd-size-48);
		display: flex;
		align-items: center;
		gap: var(--fd-spacing-3);
	}

	:where(.c-accordion--outlined .c-accordion__button)::after {
		position: static;
		display: block;
		width: var(--fd-size-16);
		height: var(--fd-size-16);
		background-size: var(--fd-size-16) auto;
	}

	/* Old-site helpers used by imported landings (style-jz.css) */
	.clr-white {
		color: #fff;
	}


	:where(a) {
		color: var(--fd-semantic-content-primary);
		text-underline-offset: var(--fd-size-2);
	}

	:where(p) {
		margin: 0 0 var(--fd-size-16);
		line-height: 1.6;
	}

	:where(ol) {
		list-style: decimal;
		padding-left: var(--fd-size-24);
	}

	:where(ul) {
		list-style: disc;
		padding-left: var(--fd-size-24);
		line-height: 150%;
	}

	.c-product--panel img {
		width: auto;
		margin-top: 0;
	}
}

:where(.ec) .legacy-article {
	.row {
		display: flex;
		flex-wrap: wrap;
		gap: 0;
		margin-bottom: var(--fd-size-20);
	}

	/* the grid's .reverse above (first child order: 2) would undo row-reverse */
	.row.reverse > :first-child { order: 0; }

	.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6,
	.col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
		flex: 0 0 auto;
		padding-inline: var(--fd-size-16);
	}

	.col-xs-1 { flex-basis: 8.333%; max-width: 8.333%; }
	.col-xs-2 { flex-basis: 16.667%; max-width: 16.667%; }
	.col-xs-3 { flex-basis: 25%; max-width: 25%; }
	.col-xs-4 { flex-basis: 33.333%; max-width: 33.333%; }
	.col-xs-5 { flex-basis: 41.667%; max-width: 41.667%; }
	.col-xs-6 { flex-basis: 50%; max-width: 50%; }
	.col-xs-7 { flex-basis: 58.333%; max-width: 58.333%; }
	.col-xs-8 { flex-basis: 66.667%; max-width: 66.667%; }
	.col-xs-9 { flex-basis: 75%; max-width: 75%; }
	.col-xs-10 { flex-basis: 83.333%; max-width: 83.333%; }
	.col-xs-11 { flex-basis: 91.667%; max-width: 91.667%; }
	.col-xs-12 { flex-basis: 100%; max-width: 100%; }

	@media (min-width: 671px) {
		.row.reverse { flex-direction: row-reverse; }
		.row.middle-sm { align-items: center; }

		.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
		.col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
			flex: 0 0 auto;
			padding-inline: var(--fd-size-16);
		}

		.col-sm-1 { flex-basis: 8.333%; max-width: 8.333%; }
		.col-sm-2 { flex-basis: 16.667%; max-width: 16.667%; }
		.col-sm-3 { flex-basis: 25%; max-width: 25%; }
		.col-sm-4 { flex-basis: 33.333%; max-width: 33.333%; }
		.col-sm-5 { flex-basis: 41.667%; max-width: 41.667%; }
		.col-sm-6 { flex-basis: 50%; max-width: 50%; }
		.col-sm-7 { flex-basis: 58.333%; max-width: 58.333%; }
		.col-sm-8 { flex-basis: 66.667%; max-width: 66.667%; }
		.col-sm-9 { flex-basis: 75%; max-width: 75%; }
		.col-sm-10 { flex-basis: 83.333%; max-width: 83.333%; }
		.col-sm-11 { flex-basis: 91.667%; max-width: 91.667%; }
		.col-sm-12 { flex-basis: 100%; max-width: 100%; }
	}

	@media (min-width: 1025px) {
		.row.middle-md { align-items: center; }

		.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
		.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
			flex: 0 0 auto;
			padding-inline: var(--fd-size-16);
		}

		.col-md-1 { flex-basis: 8.333%; max-width: 8.333%; }
		.col-md-2 { flex-basis: 16.667%; max-width: 16.667%; }
		.col-md-3 { flex-basis: 25%; max-width: 25%; }
		.col-md-4 { flex-basis: 33.333%; max-width: 33.333%; }
		.col-md-5 { flex-basis: 41.667%; max-width: 41.667%; }
		.col-md-6 { flex-basis: 50%; max-width: 50%; }
		.col-md-7 { flex-basis: 58.333%; max-width: 58.333%; }
		.col-md-8 { flex-basis: 66.667%; max-width: 66.667%; }
		.col-md-9 { flex-basis: 75%; max-width: 75%; }
		.col-md-10 { flex-basis: 83.333%; max-width: 83.333%; }
		.col-md-11 { flex-basis: 91.667%; max-width: 91.667%; }
		.col-md-12 { flex-basis: 100%; max-width: 100%; }
	}

	@media (min-width: 1200px) {
		.row.middle-lg { align-items: center; }

		.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6,
		.col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
			flex: 0 0 auto;
			padding-inline: var(--fd-size-16);
		}

		.col-lg-1 { flex-basis: 8.333%; max-width: 8.333%; }
		.col-lg-2 { flex-basis: 16.667%; max-width: 16.667%; }
		.col-lg-3 { flex-basis: 25%; max-width: 25%; }
		.col-lg-4 { flex-basis: 33.333%; max-width: 33.333%; }
		.col-lg-5 { flex-basis: 41.667%; max-width: 41.667%; }
		.col-lg-6 { flex-basis: 50%; max-width: 50%; }
		.col-lg-7 { flex-basis: 58.333%; max-width: 58.333%; }
		.col-lg-8 { flex-basis: 66.667%; max-width: 66.667%; }
		.col-lg-9 { flex-basis: 75%; max-width: 75%; }
		.col-lg-10 { flex-basis: 83.333%; max-width: 83.333%; }
		.col-lg-11 { flex-basis: 91.667%; max-width: 91.667%; }
		.col-lg-12 { flex-basis: 100%; max-width: 100%; }
	}

	/* Responsive video wrapper of the EasyContent editor; most descriptions also bring it in their own <style> */
	.embed-container {
		position: relative;
		max-width: 100%;
		height: 0;
		padding-bottom: 56.25%;
		overflow: hidden;
	}

	.embed-container :is(iframe, object, embed) {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
	}

	/* Stacked image and text columns have no gutter between them on mobile */
	@media (max-width: 670px) {
		img { margin-bottom: var(--fd-size-20); }
	}
}
