/*
 * Theme customisations that live in the codebase (not Customizer).
 * ------------------------------------------------------------------
 * Availability styling is driven by a status class on each row
 * (`status-solgt` / `status-reservert`), emitted from the ACF
 * `availability` field. This replaces the old hand-maintained
 * `#table-etasje .table-columns:nth-of-type(N)` list, so marking a
 * unit sold in wp-admin styles it automatically — no CSS edits.
 */

/* --- Price table (front page "Priser og tilgjengelighet") --- */

#table-etasje .table-columns.status-solgt,
#table-etasje .table-columns.status-reservert {
	color: #aaa; /* grey out a taken row */
}

#table-etasje .table-columns.status-solgt .price-cell,
#table-etasje .table-columns.status-reservert .price-cell {
	color: red;
	text-transform: uppercase;
	font-weight: bold;
}

/* --- Single apartment: big headline price --- */

.yellow-big-prices.status-solgt,
.yellow-big-prices.status-reservert {
	color: red;
	text-transform: uppercase;
}

/*
 * Rules moved in from the old Customizer → Additional CSS so they ship
 * with the theme. Dropped on purpose: the "SOLGT" nth-of-type list
 * (replaced by the status classes above) and the `.squares-container`
 * picker rules (image-map-pro is no longer used — see css/picker.css).
 */

/* --- Front page: centred logo over the hero --- */

body.home .brand {
	display: block;
	position: absolute;
	top: 50%;
	right: 0;
	bottom: auto;
	left: 0;
	width: 192px;
	height: 218px;
	margin-top: 64px;
	margin-right: auto;
	margin-left: auto;
}

@media only screen and (max-width: 768px) {
	body.home .brand {
		top: -100% !important;
		left: -40% !important;
	}
}

/* --- Price table layout --- */

.column {
	padding-right: 0;
}

.w-col-tiny-2:first-of-type {
	width: 60px;
}

/* Mobile. `#boligvleger` (sic) matches the container id in frontpage.php. */
@media only screen and (max-width: 768px) {
	#boligvelger {
		overflow: hidden;
	}

	#table-etasje {
		margin-left: -5vw;
		margin-right: 0;
		width: 100vw;
	}

	#boligvleger #table-etasje .table-columns,
	#boligvleger #table-etasje .table-header {
		padding: 0 20px 15px 5% !important;
	}

	#boligvleger #table-etasje .w-col-tiny-1 {
		width: 50px !important;
	}

	#boligvleger .link {
		max-width: 50px;
		max-height: 0;
		overflow: hidden;
	}
}

/* --- Floor "Kjellerplan" (etasjer #326): basement, no apartment table --- */

body.postid-326 #table-etasje {
	display: none;
}

body.postid-326 #Grey-section {
	margin-bottom: 80px;
}

/* --- "Under oppdatering" maintenance page (page #439) --- */

body.page-id-439 {
	background: #405244;
	max-height: 100vh !important;
	overflow: hidden;
}

body.page-id-439 h1,
body.page-id-439 article,
body.page-id-439 a {
	color: #fff;
}

body.page-id-439 article p,
body.page-id-439 article a {
	line-height: 160%;
	font-size: 1.4rem;
}

body.page-id-439 article {
	width: 90%;
	max-width: 600px;
	margin: 20vh auto 0;
}

body.page-id-439 .navbar,
body.page-id-439 aside,
body.page-id-439 footer {
	display: none;
}

/* --- News: block images keep their aspect ratio --- */

body.single-nyheter .wp-block-image img {
	height: auto !important;
}
