/* ==========================================================================
   ImmoWP DPE GES - Pure CSS Energy Diagnostic Charts
   Faithful reproduction of the official 2021 DPE
   ========================================================================== */

.immowp-diagnostic-dpe-ges-wrapper {
	display: block;
	width: 100%;
	max-width: 900px;
	margin: 0 auto !important;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: #1a1a1a;
	--immowp-dpe-offset: 144px;
	--immowp-dpe-box-width: 138px;
	--immowp-dpe-active-height: 62px;
	--immowp-dpe-label-stack-height: 34px;
}

/* ---------- Side by side on desktop ---------- */

.immowp-diagnostic-dpe-ges-charts {
	display: flex;
	gap: 30px;
	flex-wrap: wrap;
	justify-content: center;
	align-items: flex-start;
}

/* ==========================================================================
   DPE Chart
   ========================================================================== */

.immowp-dpe-chart {
	flex: 1 1 460px;
	max-width: 540px;
	margin-bottom: 24px;
	--bar-pitch: 42px;
}

/* ---------- DPE Top legend (green, indented above A) ---------- */
.immowp-dpe-chart-legend-top {
	font-size: 13px;
	font-weight: 700;
	color: #009B4F;
	padding: 4px 0 6px;
	margin-left: var(--immowp-dpe-offset);
}

/* ---------- DPE Bottom legend (red, full width) ---------- */
.immowp-dpe-chart-legend-bottom {
	font-size: 13px;
	font-weight: 700;
	color: #E30613;
	padding: 6px 0 0;
	margin-left: var(--immowp-dpe-offset);
}

/* ---------- DPE Scale ---------- */

.immowp-dpe-scale {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-left: var(--immowp-dpe-offset);
}

/* ---------- DPE Bars ---------- */

.immowp-dpe-bar {
	--immowp-dpe-current-height: 38px;
	display: flex;
	align-items: center;
	gap: 10px;
	width: var(--bar-width);
	height: var(--immowp-dpe-current-height);
	background-color: var(--bar-color);
	color: var(--bar-text-color);
	border-radius: 4px 0 0 4px;
	position: relative;
	padding: 0 14px;
	box-sizing: border-box;
}

/* Arrow shape pointing right */
.immowp-dpe-bar::after {
	content: "";
	position: absolute;
	right: calc((var(--immowp-dpe-current-height) / 2) * -1);
	top: 0;
	width: 0;
	height: 0;
	border-top: calc(var(--immowp-dpe-current-height) / 2) solid transparent;
	border-bottom: calc(var(--immowp-dpe-current-height) / 2) solid transparent;
	border-left: calc(var(--immowp-dpe-current-height) / 2) solid var(--bar-color);
}

.immowp-dpe-bar-active {
	--immowp-dpe-current-height: var(--immowp-dpe-active-height);
	border-radius: 4px 0 0 4px;
}

.immowp-dpe-bar-letter {
	font-weight: 800;
	font-size: 22px;
	letter-spacing: 0;
	color: var(--bar-text-color);
}

/* Active DPE bar - bigger solid white letter */
.immowp-dpe-bar-active .immowp-dpe-bar-letter {
	font-size: 32px;
	color: var(--bar-text-color);
	font-weight: 900;
}

.immowp-dpe-bar-note {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.1;
	color: #ffffff;
	white-space: nowrap;
}

/* ---------- DPE Value Box (consommation + émissions) ---------- */

.immowp-dpe-value-box-group {
	position: absolute;
	left: 0;
	top: calc(var(--active-index) * var(--bar-pitch));
	width: var(--immowp-dpe-box-width);
	z-index: 2;
}

.immowp-dpe-value-box-labels {
	position: absolute;
	left: 0;
	bottom: 100%;
	width: 100%;
	display: grid;
	grid-template-columns: repeat(var(--immowp-dpe-value-box-columns, 2), minmax(0, 1fr));
	align-items: end;
	min-height: var(--immowp-dpe-label-stack-height);
	padding-bottom: 4px;
	box-sizing: border-box;
}

.immowp-dpe-value-box-label {
	font-size: 9px;
	font-weight: 500;
	color: #8a8a8a;
	line-height: 1.05;
	text-align: center;
}

.immowp-dpe-value-box-label span {
	color: #9a9a9a;
}

.immowp-dpe-value-box {
	width: 100%;
	height: var(--immowp-dpe-active-height);
	display: grid;
	grid-template-columns: repeat(var(--immowp-dpe-value-box-columns, 2), minmax(0, 1fr));
	border: 2px solid #1a1a1a;
	border-radius: 4px;
	background: #ffffff;
	box-sizing: border-box;
}

.immowp-dpe-value-box-cell {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 6px 4px;
	text-align: center;
	position: relative;
	min-width: 0;
	overflow: hidden;
}

.immowp-dpe-value-box-cell + .immowp-dpe-value-box-cell {
	border-left: 2px solid #1a1a1a;
}

.immowp-dpe-value-box-header {
	font-size: 9px;
	color: #1a1a1a;
	line-height: 1.1;
	font-weight: 600;
	margin-bottom: 1px;
}

.immowp-dpe-value-box-header span {
	color: #888;
	font-size: 8px;
	font-weight: 400;
}

.immowp-dpe-value-box-value {
	font-size: 18px;
	font-weight: 800;
	color: #1a1a1a;
	line-height: 1;
}

.immowp-dpe-value-box-value sup {
	font-size: 11px;
	vertical-align: super;
}

.immowp-dpe-value-box-unit {
	font-size: 8px;
	color: #1a1a1a;
	margin-top: 1px;
	line-height: 1.1;
}

/* ---------- "passoire énergétique" label (left of F/G bars) ---------- */

.immowp-dpe-passoire-label {
	position: absolute;
	left: 75px;
	top: calc(5 * var(--bar-pitch) + (var(--bar-pitch) - 4px));
	width: 60px;
	font-size: 10px;
	color: #888;
	text-align: right;
	line-height: 1.15;
	transform: translateY(-50%);
	pointer-events: none;
}

/* ==========================================================================
   GES Chart - inside a bordered card
   ========================================================================== */

.immowp-ges-chart-card {
	flex: 0 1 320px;
	max-width: 340px;
	height: max-content;
	border: 2px solid #BCD7EA;
	border-radius: 8px;
	padding: 14px 16px 16px;
	margin-bottom: 24px;
	background: #ffffff;
	box-sizing: border-box;
	overflow: hidden;
}

.immowp-ges-chart-asterisk {
	font-size: 13px;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.25;
	margin-bottom: 14px;
}

.immowp-ges-chart {
	--bar-pitch: 26px;
}

.immowp-ges-chart-legend-top {
	font-size: 11px;
	font-weight: 600;
	color: #6A9FC4;
	padding: 0 0 6px;
}

.immowp-ges-chart-legend-bottom {
	font-size: 11px;
	font-weight: 600;
	color: #1a1a1a;
	padding: 8px 0 0;
}

.immowp-ges-scale {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.immowp-ges-bar {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: var(--bar-width);
	height: 24px;
	background-color: var(--bar-color);
	color: var(--bar-text-color);
	border-radius: 4px 12px 12px 4px;
	position: relative;
	padding: 0 10px;
	box-sizing: border-box;
}

.immowp-ges-bar-letter {
	font-weight: 800;
	font-size: 14px;
	color: var(--bar-text-color);
}

/* Active GES bar - bigger solid white letter */
.immowp-ges-bar-active .immowp-ges-bar-letter {
	color: var(--bar-text-color);
	font-size: 17px;
	font-weight: 900;
}

.immowp-ges-bar-value-line {
	position: absolute;
	left: calc(100% + 2px);
	top: 50%;
	width: 14px;
	height: 2px;
	background: #1a1a1a;
	transform: translateY(-50%);
}

.immowp-ges-bar-value-text {
	position: absolute;
	left: calc(100% + 20px);
	top: 50%;
	transform: translateY(-50%);
	white-space: nowrap;
	font-size: 11px;
	font-weight: 700;
	color: #1a1a1a;
}

/* ==========================================================================
   Info block (cost graph + disclaimers)
   ========================================================================== */

.immowp-diagnostic-dpe-ges-info {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e0e0e0;
	font-size: 13px;
	color: #1a1a1a;
}

.immowp-diagnostic-dpe-ges-info p {
	margin: 0 0 8px;
	line-height: 1.5;
}

.immowp-diagnostic-dpe-ges-info p:last-child {
	margin-bottom: 0;
}

.immowp-diagnostic-dpe-ges-info a {
	color: #0073aa;
	text-decoration: underline;
}

.immowp-diagnostic-dpe-ges-info a:hover {
	color: #005177;
}

/* ---------- Cost graph title ---------- */

.immowp-diagnostic-dpe-ges-cost-title {
	font-size: 18px;
	font-weight: 700;
	color: #009B4F;
	margin: 8px 0 4px;
	padding-bottom: 4px;
	border-bottom: 2px solid #009B4F;
}

/* ---------- Cost graph (annual cost slider) ---------- */

.immowp-diagnostic-dpe-ges-cost-graph {
	margin: 14px auto 12px;
	max-width: 560px;
	text-align: center;
}

.immowp-cost-graph-label {
	font-size: 14px;
	color: #1a1a1a;
	margin-bottom: 12px;
	line-height: 1.4;
}

.immowp-cost-graph-label .immowp-cost-graph-amount {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 4px;
}

.immowp-cost-graph-label .immowp-cost-graph-word {
	font-size: 13px;
	color: #555;
}

.immowp-cost-graph-track {
	position: relative;
	height: 18px;
	background-image: radial-gradient(circle, #b8b8b8 1px, transparent 1.2px);
	background-size: 6px 2px;
	background-repeat: repeat-x;
	background-position: 0 50%;
}

.immowp-cost-graph-fill {
	position: absolute;
	top: 50%;
	left: 25%;
	right: 25%;
	height: 4px;
	transform: translateY(-50%);
	background: #e6007e;
	border-radius: 2px;
}

.immowp-cost-graph-dot {
	position: absolute;
	top: 50%;
	width: 16px;
	height: 16px;
	background: #ffffff;
	border: 3px solid #e6007e;
	border-radius: 50%;
	transform: translate(-50%, -50%);
	box-sizing: border-box;
}

.immowp-cost-graph-dot-min { left: 25%; }
.immowp-cost-graph-dot-max { left: 75%; }

/* ---------- Status message (non concerné / DPE en cours) ---------- */

.immowp-diagnostic-dpe-ges-status-message {
	padding: 14px 18px;
	background: #f7f7f7;
	border-left: 4px solid #1F5C90;
	color: #1a1a1a;
	font-style: italic;
	text-align: center;
	font-size: 14px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 880px) {
	.immowp-diagnostic-dpe-ges-charts {
		flex-direction: column;
		align-items: center;
		gap: 24px;
	}

	.immowp-dpe-chart {
		max-width: 540px;
		width: 100%;
	}

	.immowp-ges-chart-card {
		max-width: 320px;
		width: 100%;
	}
}

@media (max-width: 540px) {
	.immowp-dpe-chart {
		--bar-pitch: 38px;
	}

	.immowp-dpe-scale {
		padding-left: var(--immowp-dpe-offset);
	}

	.immowp-dpe-chart-legend-top,
	.immowp-dpe-chart-legend-bottom {
		margin-left: var(--immowp-dpe-offset);
	}

	.immowp-diagnostic-dpe-ges-wrapper {
		--immowp-dpe-offset: 128px;
		--immowp-dpe-box-width: 122px;
		--immowp-dpe-active-height: 56px;
		--immowp-dpe-label-stack-height: 30px;
	}

	.immowp-dpe-value-box-value {
		font-size: 18px;
	}

	.immowp-dpe-bar {
		--immowp-dpe-current-height: 34px;
	}

	.immowp-dpe-bar-letter {
		font-size: 18px;
	}

	.immowp-dpe-bar-active .immowp-dpe-bar-letter {
		font-size: 26px;
	}

	.immowp-dpe-bar-note {
		font-size: 11px;
	}

	.immowp-dpe-value-box-label {
		font-size: 8px;
	}

	.immowp-dpe-passoire-label {
		left: 60px;
		width: 60px;
		font-size: 9px;
	}
}
