/* Restaurant gallery (ManO2 Figma 1:1600/1:1604, Kaptol 1:2346/1:2350): white section 4097–5474 at 1440,
   two rows of photos 92px apart, 106px from the top and 105 from the bottom.
   Three tall (403 × 537), then one wide (825 × 537) left with one small (191 × 240) top right.
   Row types: --three, --c, and --a (one large 615 × 769 + two small; not on the pages now).
   Each photo is an Image block cropped to its slot. */

.mano-photos.mano-photos {
	margin-block: 0;
	padding: 106px var(--wp--preset--spacing--gutter) 105px;
	background: var(--wp--preset--color--bijela);
}

.mano-photos__row.mano-photos__row {
	display: grid;
	align-items: start;
	max-width: 1249px;
	margin: 0 auto;
}

.mano-photos__row + .mano-photos__row { margin-top: 92px; }

.mano-photos__row > .wp-block-image {
	margin: 0;
}

.mano-photos__row img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* A: 615 · 231 · 192 · 20 · 191 */
.mano-photos__row--a { grid-template-columns: 615fr 231fr 192fr 20fr 191fr; }
.mano-photos__row--a > :nth-child(1) { grid-column: 1; }
.mano-photos__row--a > :nth-child(2) { grid-column: 3; }
.mano-photos__row--a > :nth-child(3) { grid-column: 5; }
.mano-photos__row--a > :nth-child(1) img { aspect-ratio: 615 / 769; }
.mano-photos__row--a > :nth-child(n+2) img { aspect-ratio: 192 / 240; }

/* B, D: three tall, 20px apart */
.mano-photos__row--three { grid-template-columns: repeat(3, 1fr); column-gap: 20px; }
.mano-photos__row--three img { aspect-ratio: 403 / 537; }

/* C: 825 · 233 · 191 */
.mano-photos__row--c { grid-template-columns: 825fr 233fr 191fr; }
.mano-photos__row--c > :nth-child(2) { grid-column: 3; }
.mano-photos__row--c > :nth-child(1) img { aspect-ratio: 825 / 537; }
.mano-photos__row--c > :nth-child(2) img { aspect-ratio: 191 / 240; }

@media (max-width: 1023px) {
	.mano-photos.mano-photos {
		padding-block: 80px;
	}

	.mano-photos__row + .mano-photos__row {
		margin-top: 20px;
	}

	/* Rows A and C: large photo full width, the small ones side by side under it. */
	.mano-photos__row--a,
	.mano-photos__row--c {
		grid-template-columns: 1fr 1fr;
		gap: 20px;
	}

	.mano-photos__row--a > :nth-child(1),
	.mano-photos__row--c > :nth-child(1) {
		grid-column: 1 / -1;
	}

	.mano-photos__row--a > :nth-child(2) { grid-column: 1; }
	.mano-photos__row--a > :nth-child(3) { grid-column: 2; }
	.mano-photos__row--c > :nth-child(2) { grid-column: 1; }
}

@media (max-width: 599px) {
	.mano-photos__row--three {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	.mano-photos__row--three > :nth-child(3) {
		grid-column: 1 / -1;
	}

	.mano-photos__row--three > :nth-child(3) img {
		aspect-ratio: 806 / 537;
	}

	.mano-photos__row--a,
	.mano-photos__row--c {
		gap: 12px;
	}

	.mano-photos__row + .mano-photos__row {
		margin-top: 12px;
	}
}

/* Phones, restaurant pages (Figma 353:392 Frame 134, 370:1537 Frame 123): 370 wide, photos 24px
   apart: two 173 × 231 side by side, one 370 × 493, one 370 × 241. The fifth photo (the small one
   of the second row) is not in the frames. ManO2 on the page colour, 50px above; ManO white, 80px
   above; 80 below both. */
@media (max-width: 781px) {
	body:has(.mano-rhero__wordmark) .mano-photos.mano-photos {
		padding: 50px 16px 80px;
		background: var(--mano-page, var(--wp--preset--color--topla-bijela));
	}

	body.page-template-page-restoran-kaptol:has(.mano-rhero__wordmark) .mano-photos.mano-photos {
		padding-top: 80px;
		background: var(--wp--preset--color--bijela);
	}

	body:has(.mano-rhero__wordmark) .mano-photos__row.mano-photos__row {
		grid-template-columns: 1fr 1fr;
		gap: 24px;
	}

	body:has(.mano-rhero__wordmark) .mano-photos__row + .mano-photos__row {
		margin-top: 24px;
	}

	body:has(.mano-rhero__wordmark) .mano-photos__row--three > :nth-child(-n+2) img {
		aspect-ratio: 173 / 231;
	}

	body:has(.mano-rhero__wordmark) .mano-photos__row--three > :nth-child(3) img {
		aspect-ratio: 370 / 493;
	}

	body:has(.mano-rhero__wordmark) .mano-photos__row--c > :nth-child(1) img {
		aspect-ratio: 370 / 241;
	}

	body:has(.mano-rhero__wordmark) .mano-photos__row--c > :nth-child(2) {
		display: none;
	}
}
