/* CSS for articles */

/* Content that brings Tailwind v4 CSS (brand descriptions, e.g. Tefal) has its utilities in cascade layers, and the DS reset
   (* { margin: 0 }, html, body, div, … { margin: 0; padding: 0 }) is unlayered, so it beat every layered rule: all its margins
   and paddings were 0. revert-layer hands margin and padding back to the layered rules (the browser defaults without them, as
   on the old site, which had no such reset). Specificity 0,0,1 (:where + :not of a type that never matches): above the DS
   reset, below any class rule, so DS components inside (product cards in articles), the content's own CSS and the rules below
   still win. Headings keep the old site's padding reset. */
: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); }

	.row {
		display: grid;
		grid-template-columns: repeat(12, 1fr);
		gap: var(--fd-spacing-8);
	}

	.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;
	}


	/* Body text of the old site: link colour, list markers (the DS resets them), paragraph rhythm. :where() keeps it overridable by the article's own styles. */
	: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;
	}
}
