/* Housing single + statistics dashboard (Page 6.1) */

.geocity-housing-single-page {
	background: var(--geocity-color-surface, #fff);
}

.geocity-housing-single__hero {
	margin: 0;
}

.geocity-housing-single__hero img {
	display: block;
	width: 100%;
	height: auto;
	max-height: clamp(240px, 40vh, 460px);
	object-fit: cover;
}

.geocity-housing-single__gallery {
	margin: 0;
}

.geocity-housing-single__content-wrap {
	padding-block: 2rem 3rem;
}

.geocity-housing-single__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.geocity-housing-single__back {
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--geocity-color-accent, #e30613);
}

.geocity-housing-single__back:hover {
	text-decoration: underline;
}

.geocity-housing-single__year {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--geocity-color-text-muted, #6b6b6b);
}

.geocity-housing-single__title {
	margin: 0 0 1.25rem;
	font-family: var(--wp--preset--font-family--playfair, Georgia, serif);
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 700;
	line-height: 1.15;
}

.geocity-housing-single__content {
	max-width: 72ch;
	font-size: 1.05rem;
	line-height: 1.75;
}

/* Dashboard */

.geocity-housing-dashboard {
	padding-block: 3rem 4rem;
	background: var(--geocity-color-surface-alt, #f3f5f4);
	color: var(--geocity-color-text, #1a1a1a);
	border-block: 1px solid var(--geocity-color-border, #d9d9d9);
}

.geocity-housing-dashboard__title {
	margin: 0 0 2rem;
	font-family: var(--wp--preset--font-family--playfair, Georgia, serif);
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	font-weight: 700;
	color: var(--geocity-color-text, #1a1a1a);
}

.geocity-housing-dashboard__section-title {
	margin: 0 0 1.25rem;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--geocity-color-text-muted, #6b6b6b);
}

.geocity-housing-dashboard__population {
	margin-bottom: 2.5rem;
}

.geocity-housing-dashboard__population-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
	gap: 2rem;
	align-items: start;
}

.geocity-housing-dashboard__population-total {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.geocity-housing-dashboard__population-number {
	font-size: clamp(2.5rem, 6vw, 4rem);
	font-weight: 800;
	line-height: 1;
	color: var(--geocity-color-text, #1a1a1a);
}

.geocity-housing-dashboard__population-label {
	font-size: 0.95rem;
	color: var(--geocity-color-text-muted, #6b6b6b);
}

.geocity-housing-dashboard__population-icons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin-top: 0.75rem;
}

.geocity-housing-dashboard__person {
	display: block;
	width: 14px;
	height: 22px;
	border-radius: 3px 3px 2px 2px;
	background: #4a90d9;
}

.geocity-housing-dashboard__person:nth-child(4n + 2) {
	background: #e85d8a;
}

.geocity-housing-dashboard__person:nth-child(4n + 3) {
	background: #f5a623;
}

.geocity-housing-dashboard__person:nth-child(4n) {
	background: #50c878;
}

.geocity-housing-dashboard__demographics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 1rem;
}

.geocity-housing-dashboard__donut {
	--percent: 0;
	--color: #4a90d9;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	max-width: 140px;
	border-radius: 50%;
	background: conic-gradient(
		var(--color) calc(var(--percent) * 1%),
		var(--geocity-color-border, #d9d9d9) 0
	);
}

.geocity-housing-dashboard__donut::before {
	content: "";
	position: absolute;
	inset: 12%;
	border-radius: 50%;
	background: var(--geocity-color-surface-alt, #f3f5f4);
}

.geocity-housing-dashboard__donut-value,
.geocity-housing-dashboard__donut-label {
	position: relative;
	z-index: 1;
}

.geocity-housing-dashboard__donut-value {
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--geocity-color-text, #1a1a1a);
}

.geocity-housing-dashboard__donut-label {
	margin-top: 0.15rem;
	font-size: 0.8rem;
	color: var(--geocity-color-text-muted, #6b6b6b);
}

.geocity-housing-dashboard__vital,
.geocity-housing-dashboard__average-age {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	text-align: center;
	background: var(--geocity-color-surface, #fff);
	border: 1px solid var(--geocity-color-border, #d9d9d9);
	border-radius: 8px;
}

.geocity-housing-dashboard__vital-icon {
	font-size: 1.5rem;
	line-height: 1;
}

.geocity-housing-dashboard__vital-value,
.geocity-housing-dashboard__average-value {
	font-size: 1.75rem;
	font-weight: 800;
	line-height: 1.1;
	color: var(--geocity-color-text, #1a1a1a);
}

.geocity-housing-dashboard__vital-label,
.geocity-housing-dashboard__average-label {
	margin-top: 0.25rem;
	font-size: 0.8rem;
	color: var(--geocity-color-text-muted, #6b6b6b);
}

.geocity-housing-dashboard__average-value small {
	font-size: 0.55em;
	font-weight: 600;
}

/* Business cards */

.geocity-housing-dashboard__business {
	margin-bottom: 2.5rem;
}

.geocity-housing-dashboard__business-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
}

.geocity-housing-dashboard__business-card {
	padding: 1.25rem 1rem;
	background: var(--geocity-color-surface, #fff);
	border: 1px solid var(--geocity-color-border, #d9d9d9);
	border-radius: 8px;
}

.geocity-housing-dashboard__business-number {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 2rem;
	font-weight: 800;
	line-height: 1;
	color: var(--geocity-color-primary, #e30613);
}

.geocity-housing-dashboard__business-title {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--geocity-color-text, #1a1a1a);
}

.geocity-housing-dashboard__business-text {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--geocity-color-text-muted, #6b6b6b);
}

/* Charts */

.geocity-housing-dashboard__chart-zone {
	padding: 1.25rem;
	background: var(--geocity-color-surface, #fff);
	border: 1px solid var(--geocity-color-border, #d9d9d9);
	border-radius: 8px;
}

.geocity-housing-dashboard__chart-svg {
	display: block;
	width: 100%;
	height: auto;
}

.geocity-housing-dashboard__chart-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	margin: 1rem 0 0;
	padding: 0;
	list-style: none;
}

.geocity-housing-dashboard__chart-legend li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: var(--geocity-color-text, #1a1a1a);
}

.geocity-housing-dashboard__chart-swatch {
	display: block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
}

/* Related housing */

.geocity-housing-single__related {
	padding-block: 2.5rem 4rem;
	background: var(--geocity-color-surface, #fff);
	border-top: 1px solid var(--geocity-color-border, #d9d9d9);
}

.geocity-housing-single__related-title {
	margin: 0 0 1.5rem;
	font-family: var(--wp--preset--font-family--playfair, Georgia, serif);
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 700;
	line-height: 1.2;
}

.geocity-housing-single__related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
}

.geocity-housing-related-card {
	margin: 0;
}

.geocity-housing-related-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.geocity-housing-related-card__media {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	background: var(--geocity-color-surface-alt, #f3f5f4);
}

.geocity-housing-related-card__image {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.geocity-housing-related-card__image--placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #c5d4c8, #e8efe9);
}

.geocity-housing-related-card__tag {
	position: absolute;
	left: 0.5rem;
	bottom: 0.5rem;
	padding: 0.25rem 0.5rem;
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	background: var(--geocity-color-primary, #e30613);
	border-radius: 3px;
}

.geocity-housing-related-card__title {
	margin: 0.75rem 0 0.35rem;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.35;
}

.geocity-housing-related-card__link:hover .geocity-housing-related-card__title {
	color: var(--geocity-color-primary, #e30613);
}

.geocity-housing-related-card__excerpt {
	margin: 0;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--geocity-color-text-muted, #6b6b6b);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media (max-width: 768px) {
	.geocity-housing-dashboard__population-grid {
		grid-template-columns: 1fr;
	}

	.geocity-housing-single__related-grid {
		grid-template-columns: 1fr;
	}
}
