/*
 * Section 6 — "Prime Commercial Opportunities", eight listing cards.
 *
 * Measured from the published design at 1440, 1200, 810 and 390. Everything inside a card is the
 * same size at every width: 18px for the address and the price, 16px for the type and the area, 14px
 * for the badge. Only the heading above the band changes, and it changes on the same 48/46/36 scale
 * as the other section headings.
 */

.as-places {
	display: flex;
	flex-direction: column;
	gap: 40px;
	align-items: center;
	padding: 124px 32px;
	background: var(--as-cream);
}

.as-places__intro {
	width: 100%;
	max-width: var(--as-container);
}

.as-places__title {
	font-size: 48px;
	font-weight: 500;
	line-height: var(--as-lh-display);
	letter-spacing: -0.05em;
	color: var(--as-ink);
}

/*
 * Full width, not the content column: at 1440 this runs to the page padding at 1376 while the list
 * inside it stops at 1280. The clip is the design's and has nothing to clip yet.
 */
.as-places__viewport {
	width: 100%;
	overflow: clip;
}

.as-places__list {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: flex-start;
	width: 100%;
	max-width: var(--as-container);
	margin-inline: auto;
	list-style: none;
}

/*
 * Four to a line at every width above the phone, so the basis is the line minus its three gaps. The
 * tablet lands on 169px cards this way, which is narrow enough that the design's own type starts
 * wrapping awkwardly — see the note at the bottom of this file.
 */
.as-place {
	flex: 0 0 calc((100% - 72px) / 4);
	min-width: 0;
}

.as-place__inner {
	display: flex;
	flex-direction: column;
	gap: 16px;
	color: inherit;
	text-decoration: none;
}

/*
 * A fixed 184 tall at every width, so the photograph's own shape never decides where the row below
 * it sits. At 1440 that is a 302x184 window on a landscape photo and at 810 it is 169x184, closer to
 * a portrait one, which is why the image has to cover rather than contain.
 */
.as-place__figure {
	position: relative;
	height: 184px;
	overflow: hidden;
}

.as-place__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.as-place__status {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 4px 8px;
	background: var(--as-black-30);
}

.as-place__status-text {
	font-size: 14px;
	font-weight: 500;
	line-height: var(--as-lh-snug);
	letter-spacing: -0.04em;
	color: var(--as-white);
}

/*
 * The rule under the address is an inset shadow rather than a border. A border would add its pixel to
 * the card and push every row below it down by one; the design draws the line without paying for it.
 */
.as-place__meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-bottom: 16px;
	box-shadow: inset 0 -1px 0 var(--as-black-10);
}

/*
 * Two lines' worth of height whether the address needs one or two. Four cards in a row have four
 * different address lengths, and this is what keeps their prices on one line instead of three.
 */
.as-place__address {
	height: 44px;
}

.as-place__address-text {
	font-size: 18px;
	font-weight: 500;
	line-height: var(--as-lh-snug);
	letter-spacing: -0.04em;
	color: var(--as-ink);
}

.as-place__type {
	font-size: 16px;
	font-weight: 500;
	line-height: var(--as-lh-snug);
	letter-spacing: -0.04em;
	color: var(--as-ink-50);
}

/*
 * Two parts to one, at every width: 191 and 95 inside a 302 card, 102 and 51 inside a 169 one. So the
 * split is a ratio rather than a measurement, and the area is free to wrap to two lines when the card
 * gets narrow — which is exactly what the tablet does.
 */
.as-place__terms {
	display: flex;
	flex-direction: row;
	gap: 16px;
	align-items: center;
}

.as-place__price {
	flex: 2 1 0;
	font-size: 18px;
	font-weight: 500;
	line-height: var(--as-lh-snug);
	letter-spacing: -0.04em;
	color: var(--as-ink);
}

/*
 * Right-aligned, and nothing in a box measurement says so: the area sits in a full-width box whose
 * edges match either way, and only the glyphs inside it move. It was found by measuring the ink in a
 * screenshot — 30px out at 1440 — which is the second time on this page that a text diff has passed
 * over an alignment.
 */
.as-place__area {
	flex: 1 1 0;
	font-size: 16px;
	text-align: right;
	font-weight: 500;
	line-height: var(--as-lh-snug);
	letter-spacing: -0.04em;
	color: var(--as-ink-50);
}

/*
 * The underline is a pseudo-element at a measured 28.5px from the top, not a border and not
 * text-decoration. Both of those would sit on the text's own baseline box; the design's sits 6.5px
 * below it.
 */
.as-places__more {
	position: relative;
	padding-bottom: 8px;
	text-decoration: none;
}

.as-places__more-text {
	display: block;
	font-size: 18px;
	font-weight: 500;
	line-height: var(--as-lh-snug);
	letter-spacing: -0.04em;
	color: var(--as-ink);
}

.as-places__more::after {
	position: absolute;
	top: 28.5px;
	right: 0;
	left: 0;
	height: 1px;
	content: '';
	background: var(--as-ink);
}

@media (max-width: 1199px) {
	.as-places__title {
		font-size: 46px;
	}
}

/*
 * Reproduced as measured, and on the list for the designer. At 810 the cards are 169 wide and the
 * type inside them does not shrink, so "Contact Agent" takes two lines in three cards of the second
 * row and "200 sqm" takes two in the first. The rows then come out 340 and 344 tall for no reason a
 * reader can see. Four cards is one too many at this width; three would give 237px each and the
 * wrapping would stop.
 */

@media (max-width: 809px) {
	.as-places {
		padding: 80px 20px;
	}

	.as-places__title {
		font-size: 36px;
	}

	.as-place {
		flex-basis: 100%;
	}
}
