/**
 * Block styles shared by the home page and the subpages (template "NOJA:
 * pełna szerokość", e.g. Montaż): steps (core/columns "noja-steps") and the
 * material / facade media-text (core/media-text "noja-material",
 * "noja-material--facade") with its parameters. Moved from home.css in
 * 0.8.0 unchanged, scoped to both page types; loaded before home.css and
 * page.css (inc/assets.php), which keep the page-specific parts (tabs of
 * "Trzy materiały", the facade gallery, 5 steps in a row on Montaż).
 */

/* ------------------------------------------------------------------------
 * Steps: core/columns "noja-steps". Numbers 01, 02, ... and the short gold
 * rule come from a CSS counter, so steps can be added or removed.
 * --------------------------------------------------------------------- */
:is(.noja-home, .noja-subpage) .wp-block-columns.is-style-noja-steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
	gap: 2.5rem;
	margin: 0;
	counter-reset: noja-step;
}

:is(.noja-home, .noja-subpage) .is-style-noja-steps > .wp-block-column {
	display: flex;
	flex-direction: column;
	gap: var(--noja-space-3);
	min-width: 0;
	margin: 0;
	counter-increment: noja-step;
}

:is(.noja-home, .noja-subpage) .is-style-noja-steps > .wp-block-column > * {
	margin: 0;
}

:is(.noja-home, .noja-subpage) .is-style-noja-steps > .wp-block-column::before {
	content: counter(noja-step, decimal-leading-zero);
	order: -2;
	color: var(--noja-accent);
	font-size: 3rem;
	font-weight: var(--noja-weight-thin);
	line-height: 1;
}

:is(.noja-home, .noja-subpage) .is-style-noja-steps > .wp-block-column::after {
	content: "";
	order: -1;
	width: 3rem;
	height: 1px;
	background: var(--noja-gold);
}

/* ------------------------------------------------------------------------
 * Material: core/media-text "noja-material" (photo 5:4 on the left; text:
 * line, H3, gold rule, places, description, parameters, buttons). Below 60em
 * one column, the photo on top. The text pieces also style the text column of
 * core/columns "noja-facade" (home page, "Elewacje" with the slider, 0.12.0).
 * --------------------------------------------------------------------- */
:is(.noja-home, .noja-subpage) .wp-block-media-text.is-style-noja-material {
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: clamp(2rem, 4vw, 4.5rem);
	align-items: center;
	margin: 0;
}

:is(.noja-home, .noja-subpage) .wp-block-media-text.is-style-noja-material[hidden] {
	display: none;
}

:is(.noja-home, .noja-subpage) .is-style-noja-material > .wp-block-media-text__media {
	align-self: center;
	margin: 0;
	overflow: hidden;
	border-radius: var(--noja-radius);
}

:is(.noja-home, .noja-subpage) .is-style-noja-material > .wp-block-media-text__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 4;
	object-fit: cover;
}

:is(.noja-home, .noja-subpage) .is-style-noja-material > .wp-block-media-text__content {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	min-width: 0;
	padding: 0;
}

:is(.noja-home, .noja-subpage) .is-style-noja-material > .wp-block-media-text__content > * {
	margin: 0;
}

@media (max-width: 59.99em) {
	:is(.noja-home, .noja-subpage) .wp-block-media-text.is-style-noja-material {
		grid-template-columns: 100%;
	}

	:is(.noja-home, .noja-subpage) .is-style-noja-material > .wp-block-media-text__media {
		grid-row: 1;
		grid-column: 1;
	}

	:is(.noja-home, .noja-subpage) .is-style-noja-material > .wp-block-media-text__content {
		grid-row: 2;
		grid-column: 1;
	}
}

:is(.noja-home, .noja-subpage) .is-style-noja-material .noja-material__line {
	color: var(--noja-grey);
	font-size: var(--noja-fs-xs);
	line-height: 1.5;
	letter-spacing: var(--noja-tracking-wider);
	text-transform: uppercase;
}

:is(.noja-home, .noja-subpage) .is-style-noja-material h3 {
	--theme-font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
	color: var(--noja-gold-light);
	font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
	font-weight: var(--noja-weight-thin);
	line-height: var(--noja-leading-tight);
	letter-spacing: var(--noja-tracking-wide);
	overflow-wrap: anywhere;
}

:is(.noja-home, .noja-subpage) :is(.is-style-noja-material, .is-style-noja-facade) hr.wp-block-separator.is-style-noja-rule {
	width: 4rem;
	background: var(--noja-gradient);
}

:is(.noja-home, .noja-subpage) :is(.is-style-noja-material, .is-style-noja-facade) .noja-material__places {
	color: var(--noja-white);
	font-size: 0.8125rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

:is(.noja-home, .noja-subpage) :is(.is-style-noja-material, .is-style-noja-facade) p:not([class]) {
	color: var(--noja-white);
}

/* Parameters: value (in <strong>) above its label, three in a row. */
:is(.noja-home, .noja-subpage) :is(.is-style-noja-material, .is-style-noja-facade) ul.noja-material__specs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0;
	padding: 1.125rem 0 0;
	border-top: 1px solid var(--noja-gold-dark);
	list-style: none;
}

:is(.noja-home, .noja-subpage) .noja-material__specs > li {
	display: flex;
	flex-direction: column-reverse;
	gap: var(--noja-space-1);
	justify-content: flex-end;
	min-width: 0;
	margin: 0;
	padding: 0 var(--noja-space-3);
	color: var(--noja-grey);
	font-size: 0.6875rem;
	line-height: 1.4;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

:is(.noja-home, .noja-subpage) .noja-material__specs > li:first-child {
	padding-left: 0;
}

:is(.noja-home, .noja-subpage) .noja-material__specs > li:last-child {
	padding-right: 0;
}

:is(.noja-home, .noja-subpage) .noja-material__specs strong {
	color: var(--noja-gold-light);
	font-size: clamp(1.0625rem, 0.75rem + 1.4vw, 1.625rem);
	font-weight: var(--noja-weight-thin);
	line-height: 1.2;
	letter-spacing: var(--noja-tracking);
	text-transform: none;
	white-space: nowrap;
}

:is(.noja-home, .noja-subpage) :is(.is-style-noja-material, .is-style-noja-facade) .wp-block-buttons {
	padding-top: var(--noja-space-1);
}

/* ------------------------------------------------------------------------
 * Facade: "noja-material" + "noja-material--facade": photo on the right, 4:5,
 * text : photo = 1 : 1.1; below 60em the photo (5:4) above the text.
 * --------------------------------------------------------------------- */
:is(.noja-home, .noja-subpage) .wp-block-media-text.is-style-noja-material.noja-material--facade {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

:is(.noja-home, .noja-subpage) .is-style-noja-material.noja-material--facade > .wp-block-media-text__content {
	grid-row: 1;
	grid-column: 1;
}

:is(.noja-home, .noja-subpage) .is-style-noja-material.noja-material--facade > .wp-block-media-text__media {
	grid-row: 1;
	grid-column: 2;
}

:is(.noja-home, .noja-subpage) .is-style-noja-material.noja-material--facade > .wp-block-media-text__media img {
	aspect-ratio: 4 / 5;
}

@media (max-width: 59.99em) {
	:is(.noja-home, .noja-subpage) .wp-block-media-text.is-style-noja-material.noja-material--facade {
		grid-template-columns: 100%;
	}

	:is(.noja-home, .noja-subpage) .is-style-noja-material.noja-material--facade > .wp-block-media-text__media {
		grid-row: 1;
		grid-column: 1;
	}

	:is(.noja-home, .noja-subpage) .is-style-noja-material.noja-material--facade > .wp-block-media-text__content {
		grid-row: 2;
		grid-column: 1;
	}

	:is(.noja-home, .noja-subpage) .is-style-noja-material.noja-material--facade > .wp-block-media-text__media img {
		aspect-ratio: 5 / 4;
	}
}
