/**
 * FMD Advanced Plots - front end styles.
 *
 * All colours and spacing are exposed as custom properties so a theme can
 * override them without touching this file, e.g.
 *
 *   .fmd-ap { --fmd-ap-primary: #123456; }
 */

.fmd-ap {
	--fmd-ap-primary: #124c56;
	--fmd-ap-primary-hover: #0d3a42;
	--fmd-ap-segment-hover: #e8eff0;
	--fmd-ap-accent: #00a3c8;
	--fmd-ap-text: #3d4a5c;
	--fmd-ap-muted: #8a94a3;
	--fmd-ap-border: #d5dbe4;
	--fmd-ap-panel-bg: #ffffff;
	--fmd-ap-stage-bg: #ffffff;
	--fmd-ap-section-bg: transparent;
	--fmd-ap-radius: 4px;
	--fmd-ap-gap: 48px;
	--fmd-ap-columns: minmax(0, 1fr) minmax(0, 1fr);
	--fmd-ap-stage-padding: 16px;
	--fmd-ap-image-scale: 90%;

	box-sizing: border-box;
	background: var(--fmd-ap-section-bg);
	color: var(--fmd-ap-text);
}

.fmd-ap *,
.fmd-ap *::before,
.fmd-ap *::after {
	box-sizing: border-box;
}

.fmd-ap,
.fmd-ap__inner,
.fmd-ap__panel,
.fmd-ap__viewer {
	max-width: 100%;
}

.fmd-ap__title {
	margin: 0 0 32px;
	text-align: center;
	color: var(--fmd-ap-primary);
}

.fmd-ap__inner {
	display: grid;
	/* Equal 50 / 50 columns on desktop. */
	grid-template-columns: var(--fmd-ap-columns);
	gap: var(--fmd-ap-gap);
	align-items: start;
}

/* -------------------------------------------------- Panel */

.fmd-ap__panel {
	min-width: 0;
}

.fmd-ap__control {
	margin: 0 0 24px;
}

.fmd-ap__control-label {
	display: block;
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--fmd-ap-primary);
}

/* -------------------------------------------------- Segmented controls */

.fmd-ap__segments {
	display: flex;
	flex-wrap: wrap;
	overflow: hidden;
	/* Top and left only: each button supplies its own right and bottom edge, so
	   the control stays perfectly joined however many floors wrap onto new rows. */
	border: 1px solid var(--fmd-ap-border);
	border-right-width: 0;
	border-bottom-width: 0;
	border-radius: var(--fmd-ap-radius);
	background: var(--fmd-ap-panel-bg);
}

.fmd-ap__segment {
	flex: 1 1 50%;
	min-width: 96px;
	margin: 0;
	padding: 14px 12px;
	border: 0 solid var(--fmd-ap-border);
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-radius: 0;
	background: var(--fmd-ap-panel-bg);
	color: var(--fmd-ap-primary);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.fmd-ap__segment:hover:not(:disabled):not(.is-active) {
	background: var(--fmd-ap-segment-hover);
}

.fmd-ap__segment:focus-visible {
	outline: 2px solid var(--fmd-ap-accent);
	outline-offset: -3px;
}

.fmd-ap__segment.is-active {
	background: var(--fmd-ap-primary);
	border-color: var(--fmd-ap-primary);
	color: #ffffff;
}

.fmd-ap__segment.is-active:hover:not(:disabled) {
	background: var(--fmd-ap-primary-hover);
	border-color: var(--fmd-ap-primary-hover);
}

.fmd-ap__segment:disabled {
	color: var(--fmd-ap-muted);
	cursor: not-allowed;
	opacity: 0.6;
}

.fmd-ap__segments--floors .fmd-ap__segment {
	flex: 1 1 50%;
}

/* -------------------------------------------------- Dimensions */

.fmd-ap__dimensions {
	padding: 24px 28px 28px;
	background: var(--fmd-ap-panel-bg);
	border-radius: var(--fmd-ap-radius);
}

.fmd-ap__dimensions-head {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 20px;
}

.fmd-ap__dimensions-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: #1b1b1b;
}

.fmd-ap__segments--units {
	flex: 0 0 auto;
	width: auto;
	border-color: var(--fmd-ap-primary);
}

.fmd-ap__segments--units .fmd-ap__segment {
	flex: 0 0 auto;
	min-width: 52px;
	padding: 8px 14px;
	font-size: 14px;
	border-color: var(--fmd-ap-primary);
}

.fmd-ap__floor-details[hidden] {
	display: none;
}

.fmd-ap__floor-description {
	margin: 0 0 18px;
	font-size: 15px;
	line-height: 1.5;
}

.fmd-ap__floor-description > :first-child {
	margin-top: 0;
}

.fmd-ap__floor-description > :last-child {
	margin-bottom: 0;
}

.fmd-ap__rooms {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.fmd-ap__room {
	margin: 0;
	min-width: 0;
}

.fmd-ap__room-name {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--fmd-ap-primary);
}

.fmd-ap__room-size {
	display: block;
	margin-top: 4px;
	font-size: 15px;
	line-height: 1.3;
	color: var(--fmd-ap-text);
}

.fmd-ap__disclaimer {
	margin: 20px 0 0;
	font-size: 11px;
	line-height: 1.45;
	color: var(--fmd-ap-muted);
}

/* -------------------------------------------------- Viewer */

.fmd-ap__viewer {
	min-width: 0;
}

/*
 * The stage has no fixed height: the figure sits in normal flow, so the stage
 * (and therefore the row) grows to whatever height the active plan needs at
 * full column width.
 */
.fmd-ap__stage {
	position: relative;
	overflow: hidden;
	width: 100%;
	max-width: 100%;
	padding: var(--fmd-ap-stage-padding);
	background: var(--fmd-ap-stage-bg);
	border-radius: var(--fmd-ap-radius);
}

.fmd-ap__figure {
	display: block;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.fmd-ap__figure[hidden] {
	display: none;
}

/*
 * The plan fills the width of its column and the height follows its natural
 * aspect ratio. Specificity is kept high enough to win against theme img rules.
 */
.fmd-ap .fmd-ap__figure img {
	display: block;
	width: var(--fmd-ap-image-scale);
	max-width: 100%;
	height: auto;
	max-height: none;
	margin: 0 auto;
}

/* -------------------------------------------------- Responsive */

@media (max-width: 1024px) {
	.fmd-ap {
		--fmd-ap-gap: 32px;
	}
}

@media (max-width: 860px) {
	.fmd-ap {
		--fmd-ap-columns: minmax(0, 1fr);
	}

	.fmd-ap__viewer {
		order: -1;
	}

	.fmd-ap__stage {
		--fmd-ap-stage-padding: 8px;
	}

	.fmd-ap__dimensions {
		padding: 20px;
	}
}

@media (max-width: 480px) {
	.fmd-ap__rooms {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fmd-ap__segment {
		transition: none;
	}
}

section.advanced_floor_plans { padding-top: 80px; padding-bottom: 80px; }
.advanced_floor_plans button::before { display: none !important; }