/**
 * The starter templates of the Site Editor: the card, its overlays and the
 * parts that show on desktop only. Loaded with the gallery block, which
 * every starter layout contains.
 */

.immomakler-starter-card {
	overflow: hidden;
}

/*
 * In a Query Loop grid the cards of a row are as tall as the tallest: the
 * grid stretches the list items, the card has to fill its item. Flex so a
 * shorter card's text block still starts right below the image.
 */
.wp-block-post-template > li > .immomakler-starter-card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.immomakler-starter-card__media {
	position: relative;
}

.immomakler-starter-card__media > .wp-block-immomakler-gallery {
	margin: 0;
}

/*
 * Two classes: the theme's block gap (":root :where(.is-layout-flow) > *")
 * must not push the overlay down.
 */
.immomakler-starter-card__media > .immomakler-starter-overlay {
	position: absolute;
	z-index: 2;
	margin: 0;
	pointer-events: none;
}

.immomakler-starter-overlay > * {
	pointer-events: auto;
}

.immomakler-starter-overlay--top-row {
	inset-block-start: 12px;
	inset-inline-start: 12px;

	/* Room for the heart in the other corner, so the tags wrap before it. */
	inset-inline-end: calc(12px + 52px);
}

.immomakler-starter-overlay--top-end {
	inset-block-start: 12px;
	inset-inline-end: 12px;
}

.immomakler-starter-overlay--bottom-end {
	inset-block-end: 12px;
	inset-inline-end: 12px;
}

/* The notice as the other builders' alert box: outlined and worded in the accent colour. */
.immomakler-starter-notice {
	border: 1px solid var(--wp--preset--color--accent-1, currentcolor);
	border-radius: 4px;
	color: var(--wp--preset--color--accent-1, inherit);
}

/*
 * Data lists on phones, the spec's "inline" layout: label and value stay on
 * one line, the label as wide as its text (up to half the row, then it
 * wraps), the value at the end. The blocks' 40 % label column broke labels
 * mid-word at 390px. The contact list keeps its own stacking below 22rem.
 */
.immomakler-starter-list-mobile-inline {
	container-type: inline-size;
}

@container (max-width: 30rem) {

	/* Three classes, to outrank the blocks' own two-class column rules whatever the stylesheet order. */
	.immomakler-starter-list-mobile-inline:is(.wp-block-immomakler-single-data, .wp-block-immomakler-single-data-prices, .wp-block-immomakler-single-data-areas) :is(.immomakler-single-data__list, .immomakler-single-data-prices__list, .immomakler-single-data-areas__list),
	.immomakler-starter-list-mobile-inline.wp-block-immomakler-single-epass.immomakler-epass-list .immomakler-epass-list__row {
		grid-template-columns: fit-content(50%) minmax(0, 1fr);
	}

	.immomakler-starter-list-mobile-inline:is(.wp-block-immomakler-single-data, .wp-block-immomakler-single-data-prices, .wp-block-immomakler-single-data-areas) :is(.immomakler-single-data__list, .immomakler-single-data-prices__list, .immomakler-single-data-areas__list) dd,
	.immomakler-starter-list-mobile-inline.wp-block-immomakler-single-epass.immomakler-epass-list .immomakler-epass-list__value {
		text-align: end;
	}
}

/* "Name und Position" has no labels; the name is its first value. */
.immomakler-starter-name-bold .immomakler-single-contact-data__row--kontaktperson_fullname {
	font-weight: 700;
}

@media (max-width: 781px) {

	.immomakler-starter-desktop-only {
		display: none !important;
	}
}

/*
 * Key-figure boxes on phones: one box a line, the label at the start and the
 * value at the end (the box block's grid is one column there).
 */
@media (max-width: 640px) {

	.wp-block-immomakler-single-data-boxes.immomakler-starter-data-boxes-mobile-inline .immomakler-data-box {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: baseline;
		column-gap: 1em;
	}

	.wp-block-immomakler-single-data-boxes.immomakler-starter-data-boxes-mobile-inline .immomakler-data-value {
		text-align: end;
	}
}
