/*
 * Blokeliai tvoroms (W2-U4): the tabs section 495:1080 of page 356 /blokeliai-tvoroms/ (and the same
 * section with only its works tab on /vidaus-ir-lauko-tureklai/, I2 Q14). The three frames 495:984 /
 * 495:1114 / 495:1303 are ONE page in three tab states: the stamp 495:1080 holds the bar and all three
 * panels; 495:1114.s05 (specs) and 495:1303.s05 (colours) are its other states, not other sections.
 *
 * Every value is read from the nodes (.dc/design/design.json), y values from frame 495:984 at 1440:
 *
 *   tab bar    495:1081  x 249, y 1009, 942 x 57 (centred in the 1176 column, 117 each side). Three
 *              tabs of 314 x 57 white (#FFFFFF), the selected one #C69A37; radius 11 on the bar's two
 *              outer ends only. Label Geist 500 18/30 #424242, white when selected, preceded by a
 *              line icon (24 x 21 / 20.5 x 25.1 / 25.4 x 23.2) in the label's colour, 16 / 17.5 /
 *              17.6 px before the label, the pair centred in the tab.
 *   panel      starts 63 under the bar (y 1129)
 *     works    495:1104  3 x 386 x 272 photos, radius 12, 9 px gaps (the Galerija wall's tile)
 *     specs    495:1236..  4 cards in 2 columns of 508 (160 apart), 76 between the card rows: a 272
 *              square photo, then the 192 wide table 44 right of it and 29 below its top (the table
 *              is 4 rows of 56 white r5, 10 apart: label Geist 500 16/28, value 500 18/28 right-aligned,
 *              19 / 20 px inside)
 *     colours  495:1377  3 x 386 tiles: photo 386 x 272 r12, 18, the name Geist 500 22/30 centred;
 *              9 px between the columns, 20 between the rows
 *   to the consult block: works 216 (y 1966 -> 2182), specs 158 (1771 -> 1929), colours 259
 *              (2129 -> 2388): the three frames draw three gaps, each is built under its own panel.
 *   from the contact strip (its own 80 px) the bar is 54 further down: 875 -> 1009 = 134.
 *
 * Mobile has no frame (intake reference pass): 20 px gutter; the tab row swipes when its three tabs no
 * longer fit (the selected tab is centred by tabs.js); the photo grids go to 2 columns below 782; a spec
 * card stacks its table under the photo where the two no longer fit side by side; the gaps halve.
 * The generic tab rules (hide the panels that are not open) are at the top of kontaktai.css.
 */

.mn-bk {
	box-sizing: border-box;
	width: min(var(--mn-content, 1176px), 100% - 2 * var(--mn-gutter, 20px));
	margin-inline: auto;
	padding-top: 54px;
	color: var(--wp--preset--color--c-02);
	font-family: var(--wp--preset--font-family--geist);
}

.mn-bk .wp-block-image {
	margin: 0;
}

/* ---- the tab bar: one white strip of equal tabs, ends rounded 11 ---- */

.mn-bk .mn-bk__tabs {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	box-sizing: border-box;
	width: min(942px, 100%);
	margin: 0 auto 63px;
	padding: 0;
}

.mn-bk .mn-bk-tab {
	flex: 1 1 0;
	min-width: 0;
	box-sizing: border-box;
	height: 57px;
	margin: 0;
	background: var(--wp--preset--color--c-01);
}

.mn-bk .mn-bk-tab:first-child {
	border-radius: 11px 0 0 11px;
}

.mn-bk .mn-bk-tab:last-child {
	border-radius: 0 11px 11px 0;
}

.mn-bk .mn-bk-tab:only-child {
	border-radius: 11px;
}

.mn-bk .mn-bk-tab.is-active {
	background: var(--wp--preset--color--c-07);
}

/* the <button> is the whole tab: icon + label centred, the click area the full 314 x 57 */
.mn-bk .mn-bk-tab .wp-block-button__link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--mn-bk-icon-gap, 16px);
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0 12px;
	border: 0;
	border-radius: inherit;
	background: none;
	color: var(--wp--preset--color--c-02);
	font-family: var(--wp--preset--font-family--geist);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--s-04);
	line-height: 30px;
	letter-spacing: 0;
	white-space: nowrap;
	cursor: pointer;
}

.mn-bk .mn-bk-tab.is-active .wp-block-button__link {
	color: var(--wp--preset--color--c-01);
}

/* the line icons (frame nodes 495:1103 / 1095 / 1087) are masks, so one file takes both colours */
.mn-bk .mn-bk-tab .wp-block-button__link::before {
	content: "";
	flex: none;
	width: var(--mn-bk-icon-w);
	height: var(--mn-bk-icon-h);
	background: currentColor;
	-webkit-mask: var(--mn-bk-icon) center / 100% 100% no-repeat;
	mask: var(--mn-bk-icon) center / 100% 100% no-repeat;
}

.mn-bk .mn-bk-tab--works {
	--mn-bk-icon: url("../../img/blokeliai/darbai.svg");
	--mn-bk-icon-w: 24px;
	--mn-bk-icon-h: 21px;
	--mn-bk-icon-gap: 16px;
}

/* drawn 1.5 px above the label's middle */
.mn-bk .mn-bk-tab--works .wp-block-button__link::before {
	margin-bottom: 3px;
}

.mn-bk .mn-bk-tab--specs {
	--mn-bk-icon: url("../../img/blokeliai/specifikacijos.svg");
	--mn-bk-icon-w: 20.5px;
	--mn-bk-icon-h: 25.1px;
	--mn-bk-icon-gap: 17.5px;
}

/* the drawn icon + label pair of this tab sits 2.5 px right of the tab's middle (601..844 in a tab
 * drawn 563..877), the other two are centred: 5 px more room on the left shifts the centred pair by 2.5 */
.mn-bk .mn-bk-tab--specs .wp-block-button__link {
	padding-left: 17px;
}

.mn-bk .mn-bk-tab--colours {
	--mn-bk-icon: url("../../img/blokeliai/spalvos.svg");
	--mn-bk-icon-w: 25.4px;
	--mn-bk-icon-h: 23.2px;
	--mn-bk-icon-gap: 17.6px;
}

/* ---- panels: the space under each is the drawn gap to the consult block ---- */

/* tabs.js makes the open panel a tab stop (tabindex 0). Arriving by an address with its anchor
 * (/#spalvos) moves focus onto it, which would draw a ring round the whole grid, so the ring is off
 * while the panel is the address's target. Known cost: the panel stays the target while the address
 * keeps its anchor, so tabbing back onto the bare panel shows no ring there; the tabs and the photos
 * inside it still ring. */
.mn-bk .mn-bk__panel:target:focus {
	outline: none;
}

.mn-bk .mn-bk__panel {
	--mn-bk-after: 216px;
	padding-bottom: var(--mn-bk-after);
}

.mn-bk .mn-bk__panel--specs {
	--mn-bk-after: 158px;
}

.mn-bk .mn-bk__panel--colours {
	--mn-bk-after: 259px;
}

/* ---- photo grids (works, colours): the Galerija wall's 386 x 272 tile, radius 12 ---- */

.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 9px;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 0;
}

.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery figure.wp-block-image:not(#individual-image) {
	display: block;
	position: relative;
	width: auto;
	max-width: none;
	margin: 0;
	aspect-ratio: 386 / 272;
	border-radius: 12px;
	overflow: hidden;
}

.mn-bk .wp-block-gallery.has-nested-images.is-cropped.mn-bk__gallery figure.wp-block-image:not(#individual-image) img {
	display: block;
	width: 100%;
	height: 100% !important; /* the editor writes inline height:auto on images (R8 item 3) */
	max-width: none;
	border-radius: inherit;
	object-fit: cover;
	object-position: 50% 50%;
}

/* colours: the photo, 18 px, the name; the core gallery lays a caption over the photo, this puts it under */
.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery--colours {
	row-gap: 20px;
}

.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery--colours figure.wp-block-image:not(#individual-image) {
	display: flex;
	flex-direction: column;
	gap: 18px;
	aspect-ratio: auto;
	border-radius: 0;
	overflow: visible;
}

.mn-bk .wp-block-gallery.has-nested-images.is-cropped.mn-bk__gallery--colours figure.wp-block-image:not(#individual-image) img {
	flex: none;
	/* !important beats the works rule above (R10: its height:100% !important made the colour photos 320 tall, not the drawn 272) */
	height: auto !important;
	aspect-ratio: 386 / 272;
	border-radius: 12px;
	/* the drawn colour renders (495:1380 ...) are MULTIPLY layers as well */
	mix-blend-mode: multiply;
}

.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery--colours figure.wp-block-image:not(#individual-image)::before {
	display: none;
}

.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery--colours figure.wp-block-image:not(#individual-image) figcaption {
	position: static;
	flex: none;
	box-sizing: border-box;
	width: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow: visible;
	background: none;
	color: var(--wp--preset--color--c-02);
	font-family: var(--wp--preset--font-family--geist);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--s-07);
	line-height: 30px;
	letter-spacing: 0;
	text-align: center;
	text-shadow: none;
}

/* ---- specs: four cards, two by two ---- */

/* two columns of 508 at the ends of the 1176 column (160 between them at 1440, never less than 44 here) */
.mn-bk .mn-bk__panel--specs {
	display: grid;
	grid-template-columns: repeat(2, 508px);
	justify-content: space-between;
	column-gap: 0;
	row-gap: 76px;
	align-content: start;
}

.mn-bk .mn-bk-spec {
	display: flex;
	align-items: flex-start;
	gap: 44px;
	min-width: 0;
}

.mn-bk .mn-bk-spec > .mn-bk-spec__photo {
	flex: 0 0 272px;
	width: 272px;
}

.mn-bk .mn-bk-spec__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	/* the drawn block photos (495:1237 ...) are MULTIPLY layers: their white ground is the page's grey */
	mix-blend-mode: multiply;
}

.mn-bk .mn-bk-spec > .mn-bk-spec__table {
	flex: 0 0 192px;
	width: 192px;
	margin: 29px 0 0;
}

/* rows are separate white cards of 56 px, 10 apart: border-spacing between them, taken back at both ends */
.mn-bk .mn-bk-spec__table table {
	table-layout: auto;
	width: 100%;
	margin: -10px 0;
	border-collapse: separate;
	border-spacing: 0 10px;
	border: 0;
}

.mn-bk .mn-bk-spec__table td {
	box-sizing: border-box;
	height: 56px;
	padding: 0 0 0 19px;
	border: 0;
	background: var(--wp--preset--color--c-01);
	color: var(--wp--preset--color--c-02);
	font-family: var(--wp--preset--font-family--geist);
	font-weight: 500;
	font-size: var(--wp--preset--font-size--s-03);
	line-height: 28px;
	letter-spacing: 0;
	vertical-align: middle;
}

.mn-bk .mn-bk-spec__table td:first-child {
	border-radius: 5px 0 0 5px;
	white-space: nowrap;
}

.mn-bk .mn-bk-spec__table td:last-child {
	padding: 0 20px 0 0;
	border-radius: 0 5px 5px 0;
	font-size: var(--wp--preset--font-size--s-04);
	text-align: right;
	white-space: nowrap;
}

/* ---- narrower than the drawn column ---- */

/* the two side-by-side cards need 1016 + a gap: below that the cards stack (photo, then table) and stay in two columns */
@media (max-width: 1099.98px) {
	.mn-bk .mn-bk__panel--specs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 40px;
		row-gap: 56px;
	}

	.mn-bk .mn-bk-spec {
		flex-direction: column;
		gap: 20px;
	}

	.mn-bk .mn-bk-spec > .mn-bk-spec__photo {
		flex: none;
		width: min(272px, 100%);
	}

	.mn-bk .mn-bk-spec > .mn-bk-spec__table {
		flex: none;
		width: min(192px, 100%);
		margin: 0;
	}
}

/* the three tabs side by side need about 650: below 900 they size to their label and the row swipes */
@media (max-width: 899.98px) {
	.mn-bk .mn-bk__tabs {
		margin: -4px -4px 59px;
		padding: 4px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		scroll-padding-inline: 4px;
		scrollbar-width: none;
		width: calc(100% + 8px);
	}

	.mn-bk .mn-bk__tabs::-webkit-scrollbar {
		display: none;
	}

	.mn-bk .mn-bk-tab {
		flex: 1 0 auto;
		scroll-snap-align: center;
	}

	.mn-bk .mn-bk-tab .wp-block-button__link {
		padding: 0 24px;
	}
}

/* below 782 (WordPress's own stacking width): photo grids in 2 columns, gaps halved */
@media (max-width: 781.98px) {
	.mn-bk {
		padding-top: 27px;
	}

	.mn-bk .mn-bk__panel {
		--mn-bk-after: 108px;
	}

	.mn-bk .mn-bk__panel--specs {
		--mn-bk-after: 79px;
		row-gap: 40px;
	}

	.mn-bk .mn-bk__panel--colours {
		--mn-bk-after: 130px;
	}

	.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery--colours {
		row-gap: 14px;
	}

	.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery--colours figure.wp-block-image:not(#individual-image) {
		gap: 10px;
	}

	.mn-bk .wp-block-gallery.has-nested-images.mn-bk__gallery--colours figure.wp-block-image:not(#individual-image) figcaption {
		font-size: var(--wp--preset--font-size--s-05);
		line-height: 26px;
	}
}

/* one column of cards below 700; a card goes side by side again while its 508 fits (to 560), then the table is as wide as the card */
@media (max-width: 699.98px) {
	.mn-bk .mn-bk__panel--specs {
		grid-template-columns: minmax(0, 508px);
		justify-content: start;
	}

	.mn-bk .mn-bk-spec {
		flex-direction: row;
		gap: 44px;
	}

	.mn-bk .mn-bk-spec > .mn-bk-spec__photo {
		flex: 0 0 272px;
		width: 272px;
	}

	.mn-bk .mn-bk-spec > .mn-bk-spec__table {
		flex: 0 0 192px;
		width: 192px;
		margin: 29px 0 0;
	}
}

@media (max-width: 559.98px) {
	.mn-bk .mn-bk-spec {
		flex-direction: column;
		gap: 20px;
	}

	.mn-bk .mn-bk-spec > .mn-bk-spec__photo {
		flex: none;
		width: min(272px, 100%);
	}

	.mn-bk .mn-bk-spec > .mn-bk-spec__table {
		flex: none;
		width: 100%;
		margin: 0;
	}
}

@media (forced-colors: active) {
	.mn-bk .mn-bk-tab {
		border: 1px solid ButtonText;
	}

	.mn-bk .mn-bk-tab.is-active {
		border-color: Highlight;
	}
}
