/**
 * IDX listing detail styles -- scoped entirely under .idx-listing-single.
 *
 * Nothing here touches the site header/footer or any other template; every
 * selector is prefixed with the wrapper class so rules cannot leak.
 *
 * Brand palette (PLACEHOLDER -- fine-tune against the Homes & Gardens logo):
 *   --idx-teal : #1a7a7a   approximate H&G teal, headings/accents/buttons
 *   --idx-navy : #1c2b39   dark navy body text
 * Adjust the two custom properties below once the exact brand hexes are pulled
 * from the logo; everything else inherits from them.
 *
 * Uploaded to: wp-content/themes/edmonton-city-homes/inc/idx-listing.css
 * Version-controlled copy: idx/theme/inc/idx-listing.css
 */

.idx-listing-single {
	--idx-teal: #1a7a7a;
	--idx-navy: #1c2b39;
	--idx-muted: #5a6b78;
	--idx-border: #dfe5e9;
	--idx-card-bg: #ffffff;

	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 20px 48px;
	color: var(--idx-navy);
	box-sizing: border-box;
}

.idx-listing-single *,
.idx-listing-single *::before,
.idx-listing-single *::after {
	box-sizing: inherit;
}

/* ------------------------------------------------------------------ *
 * Two-column top: gallery left (~62%), summary card right (~38%)
 * ------------------------------------------------------------------ */
.idx-listing-single .idx-top {
	display: flex;
	gap: 28px;
	align-items: flex-start;
}

.idx-listing-single .idx-gallery {
	flex: 0 1 62%;
	min-width: 0; /* lets the flex child shrink; images never overflow */
}

.idx-listing-single .idx-summary {
	flex: 0 1 38%;
	min-width: 0;
	background: var(--idx-card-bg);
	border: 1px solid var(--idx-border);
	border-radius: 8px;
	padding: 20px 22px;
	box-shadow: 0 1px 3px rgba(28, 43, 57, 0.06);
}

@media (max-width: 900px) {
	.idx-listing-single .idx-top {
		flex-direction: column;
	}
	.idx-listing-single .idx-gallery,
	.idx-listing-single .idx-summary {
		flex: 1 1 100%;
		width: 100%;
	}
}

/* ------------------------------------------------------------------ *
 * Gallery: hero image + horizontal thumbnail strip + view-all button
 * ------------------------------------------------------------------ */
.idx-listing-single .idx-hero {
	margin: 0;
	position: relative;
}

.idx-listing-single .idx-hero img {
	display: block;
	width: 100%;
	max-width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 8px;
	cursor: pointer;
}

.idx-listing-single .idx-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	overflow-x: auto;
	padding-bottom: 4px; /* room for the scrollbar */
	scrollbar-width: thin;
}

.idx-listing-single .idx-thumb {
	flex: 0 0 auto;
	width: calc(20% - 7px); /* ~5 thumbnails visible */
	min-width: 96px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: none;
	cursor: pointer;
	overflow: hidden;
}

.idx-listing-single .idx-thumb:focus-visible,
.idx-listing-single .idx-thumb.is-active {
	border-color: var(--idx-teal);
	outline: none;
}

.idx-listing-single .idx-thumb img {
	display: block;
	width: 100%;
	height: 72px;
	object-fit: cover; /* uniform tile shape regardless of source ratio */
	border-radius: 4px;
}

/* Thumbs past the 10th stay in the DOM (the lightbox JS reads its full photo
   list from .idx-thumb data-full attributes) but are not shown in the strip. */
.idx-listing-single .idx-thumb-hidden {
	display: none;
}

.idx-listing-single .idx-view-all {
	display: inline-block;
	margin-top: 10px;
	padding: 9px 18px;
	background: var(--idx-teal);
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}

.idx-listing-single .idx-view-all:hover,
.idx-listing-single .idx-view-all:focus-visible {
	background: #14615f; /* teal, darkened */
	color: #ffffff;
}

/* ------------------------------------------------------------------ *
 * Summary card: attribution ABOVE price, address, stat grid
 * ------------------------------------------------------------------ */
.idx-listing-single .idx-attribution {
	margin-bottom: 10px;
}

.idx-listing-single .idx-attribution p {
	margin: 0 0 2px;
	font-size: 0.8rem;
	color: var(--idx-muted);
	line-height: 1.4;
}

.idx-listing-single .idx-price {
	margin: 0 0 6px;
	font-size: 2rem;
	font-weight: 700;
	color: var(--idx-navy);
	line-height: 1.2;
}

.idx-listing-single .idx-address {
	margin: 0 0 16px;
	font-size: 1rem;
	color: var(--idx-navy);
}

.idx-listing-single .idx-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px 16px;
	margin: 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--idx-border);
	list-style: none;
}

.idx-listing-single .idx-stat {
	margin: 0;
}

.idx-listing-single .idx-stat-label {
	display: block;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--idx-muted);
}

.idx-listing-single .idx-stat-value {
	display: block;
	font-size: 0.98rem;
	font-weight: 600;
	color: var(--idx-navy);
}

/* ------------------------------------------------------------------ *
 * Full-width description
 * ------------------------------------------------------------------ */
.idx-listing-single .idx-description {
	margin-top: 32px;
	font-size: 1rem;
	line-height: 1.7;
}

.idx-listing-single .idx-description h2 {
	color: var(--idx-teal);
	font-size: 1.25rem;
	margin: 0 0 12px;
}

/* ------------------------------------------------------------------ *
 * Accordions: header button with +/- indicator, panel below.
 * Panels are OPEN in the raw HTML (no-JS users see everything);
 * idx-gallery.js collapses them on load and drives the toggling.
 * ------------------------------------------------------------------ */
.idx-listing-single .idx-accordion {
	margin-top: 18px;
	border: 1px solid var(--idx-border);
	border-radius: 8px;
	overflow: hidden;
}

.idx-listing-single .idx-accordion-heading {
	margin: 0;
	font-size: inherit;
}

.idx-listing-single .idx-accordion-header {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	background: #f4f7f8;
	border: none;
	font-size: 1.02rem;
	font-weight: 600;
	color: var(--idx-teal);
	text-align: left;
	cursor: pointer;
}

.idx-listing-single .idx-accordion-header:hover,
.idx-listing-single .idx-accordion-header:focus-visible {
	background: #e9f0f1;
}

.idx-listing-single .idx-acc-icon::before {
	content: "\2212"; /* minus while expanded */
	font-size: 1.2rem;
	line-height: 1;
	color: var(--idx-teal);
}

.idx-listing-single .idx-accordion-header[aria-expanded="false"] .idx-acc-icon::before {
	content: "+";
}

.idx-listing-single .idx-accordion-panel {
	padding: 14px 18px 18px;
	border-top: 1px solid var(--idx-border);
}

.idx-listing-single .idx-accordion-panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.idx-listing-single .idx-accordion-panel li {
	margin: 0 0 8px;
	font-size: 0.95rem;
	line-height: 1.55;
}

.idx-listing-single .idx-accordion-panel li:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Lightbox (DOM injected by idx-gallery.js)
 * ------------------------------------------------------------------ */
.idx-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(12, 20, 28, 0.92);
}

.idx-lightbox img {
	max-width: 88vw;
	max-height: 86vh;
	object-fit: contain;
	border-radius: 4px;
}

.idx-lightbox .idx-lb-btn {
	position: absolute;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	border: none;
	border-radius: 50%;
	width: 48px;
	height: 48px;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.idx-lightbox .idx-lb-btn:hover,
.idx-lightbox .idx-lb-btn:focus-visible {
	background: rgba(255, 255, 255, 0.28);
}

.idx-lightbox .idx-lb-close {
	top: 20px;
	right: 20px;
}

.idx-lightbox .idx-lb-prev {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.idx-lightbox .idx-lb-next {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.idx-lightbox .idx-lb-count {
	position: absolute;
	bottom: 18px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.85rem;
}

/* ------------------------------------------------------------------ *
 * Compliance footer: small print, muted, clearly separated, readable
 * ------------------------------------------------------------------ */
.idx-listing-single .idx-compliance {
	margin-top: 40px;
	padding-top: 18px;
	border-top: 1px solid var(--idx-border);
	font-size: 0.78rem;
	color: var(--idx-muted);
	line-height: 1.6;
}

.idx-listing-single .idx-compliance p {
	margin: 0 0 8px;
}
