/* SI Estates — single new-development detail page.
 * Tokens come from assets/site.css (--si-navy, --si-gold, --si-gold-deep, etc).
 * This file only adds the layout/components that page needs; it does not
 * redefine or override anything in site.css.
 */

/* Column: same resolved geometry as the theme's 1240px content column
 * (see site.css's own `calc(1240px + 2 * var(--si-gutter))` pattern for the
 * Kadence page title and the NLS Property Hub wrapper), so this page's edges
 * line up with every other page on the site. */
.si-devd-wrap {
	box-sizing: border-box;
	max-width: calc(1240px + 2 * var(--si-gutter));
	margin-inline: auto;
	padding-inline: var(--si-gutter);
	padding-block: clamp(1.5rem, 3vw, 2.5rem) var(--si-section);
}

/* ---------- Breadcrumb ---------- */
.si-devd-crumb {
	margin: 0 0 1.25rem;
	font-size: .95rem;
}
.si-devd-crumb a {
	color: var(--si-gold-deep);
	font-weight: 600;
	text-decoration: none;
}
.si-devd-crumb a:hover {
	color: var(--si-navy);
	text-decoration: underline;
	text-underline-offset: .25em;
}

/* ---------- Gallery ---------- */
.si-devd-gallery {
	margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
}
/* Full-bleed hero: the wrap is a centred 1240px column, so break out of it with
 * a viewport-width margin trick. `width: 100vw` alone would overflow when a
 * scrollbar is present, hence the calc against 100%. Square corners because the
 * image now runs to both edges. */
.si-devd-gallery__lead {
	position: relative;
	aspect-ratio: 16 / 9;
	max-block-size: 72vh;
	overflow: hidden;
	background: var(--si-mist);
	inline-size: 100vw;
	max-inline-size: 100vw;
	margin-inline: calc(50% - 50vw);
	border-radius: 0;
}
.si-devd-gallery__lead img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.si-devd-gallery__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(160deg, #e6ecf2, #dbe3ea);
}
.si-devd-gallery__badge {
	position: absolute;
	top: .75rem;
	left: .75rem;
	background: rgba(15, 31, 51, .86);
	color: #fff;
	font-size: .75rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: .4em .8em;
	border-radius: 2px;
}

/* Single-row scroller: count-independent, unlike a wrapping grid which goes
 * ragged whenever the image count isn't a multiple of the row length. */
.si-devd-gallery__strip {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-behavior: smooth;
	gap: .6rem;
	margin-top: .6rem;
	padding-bottom: .35rem;
}
.si-devd-gallery__thumb {
	flex: 0 0 auto;
	scroll-snap-align: start;
	display: block;
	width: 92px;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: 3px;
	border: 2px solid transparent;
	opacity: .8;
	transition: opacity .2s ease, border-color .2s ease;
}
.si-devd-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
}
/* Source photos arrive at mixed ratios (960x540 and 1200x800 both occur), so
   every slot fixes its own box and lets object-fit do the normalising —
   otherwise the thumbnails sit at different heights. */
.si-devd-gallery__thumb { block-size: auto; }
.si-devd-gallery__thumb:hover {
	opacity: 1;
}
.si-devd-gallery__thumb.is-active {
	opacity: 1;
	border-color: var(--si-gold);
}

/* ---------- Body layout ---------- */
.si-devd-body {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
	gap: clamp(2rem, 5vw, 4rem);
	align-items: start;
}
.si-devd-main > * + * {
	margin-top: clamp(2rem, 4vw, 2.75rem);
}

/* ---------- Head ---------- */
.si-devd-head { margin: 0; }
.si-devd-title {
	font-size: clamp(2rem, 3.8vw, 3.1rem);
	color: var(--si-navy);
	margin: 0 0 .3em;
}
.si-devd-ref {
	margin: 0;
	color: var(--si-ink);
	font-size: .9rem;
	opacity: .8;
}

/* ---------- Facts ---------- */
.si-devd-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1.25rem 1.5rem;
	margin: 0;
}
.si-devd-facts__item {
	padding-inline-start: .9rem;
	border-inline-start: 2px solid var(--si-gold);
}
.si-devd-facts dt {
	font-size: .78rem;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--si-ink);
	margin: 0 0 .2rem;
}
.si-devd-facts dd {
	margin: 0;
	font-family: var(--si-display);
	font-size: 1.2rem;
	color: var(--si-navy);
	line-height: 1.25;
}

/* ---------- Description ----------
 * About a third of these run under 200 characters with nothing richer upstream,
 * so the treatment has to carry a single short sentence as deliberately as a
 * full description — no padding, no invented copy, just weight: a gold top
 * rule (the same accent device the facts list uses) and body type set larger
 * than the rest of the page, rather than a box that reads empty when short.
 */
.si-devd-description h2,
.si-devd-amenities-wrap h2,
.si-devd-location h2 {
	font-size: clamp(1.4rem, 2.2vw, 1.8rem);
	color: var(--si-navy);
	margin: 0 0 .85em;
}
.si-devd-description {
	padding-top: clamp(1.5rem, 3vw, 2rem);
	border-top: 2px solid var(--si-gold);
}
.si-devd-description__body :is(p, li) {
	max-width: var(--si-measure);
	color: var(--si-ink);
	font-size: clamp(1.1rem, 1.4vw, 1.25rem);
	line-height: 1.8;
}
.si-devd-description__body > :first-child { margin-top: 0; }
.si-devd-description__body > :last-child { margin-bottom: 0; }

/* ---------- Amenities ---------- */
.si-devd-amenities {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	margin: 0;
	padding: 0;
}
.si-devd-amenities li {
	margin: 0;
	max-width: none;
	background: #fff;
	border: 1px solid var(--si-rule);
	border-radius: 100px;
	padding: .5em 1.1em;
	font-size: .92rem;
	color: var(--si-navy);
}

/* ---------- Location ---------- */
.si-devd-location p {
	color: var(--si-ink);
	font-size: 1.05rem;
	margin: 0 0 1rem;
}
/* Live map, drawn by the theme's self-hosted MapLibre provider. The script
 * removes the element when there are no coordinates or no WebGL, so this never
 * renders as an empty grey panel. */
.si-devd-map {
	aspect-ratio: 16 / 7;
	min-block-size: 260px;
	inline-size: 100%;
	border-radius: 4px;
	overflow: hidden;
	background: var(--si-mist);
}
.si-devd-map:focus-visible { outline: 2px solid var(--si-gold-deep); outline-offset: 3px; }
/* Match the pin treatment used on the developments index map. */
.si-devd-map .nlsph-pin {
	inline-size: 14px;
	block-size: 14px;
	padding: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--si-gold-deep);
	box-shadow: 0 2px 8px rgba(15, 31, 51, .45);
	cursor: default;
}

/* ---------- CTA / enquiry sidebar ---------- */
.si-devd-side { min-width: 0; }
.si-devd-cta-panel {
	position: sticky;
	top: clamp(1rem, 4vw, 2rem);
	padding: clamp(1.5rem, 3vw, 1.85rem);
	background: #fff;
	border: 1px solid var(--si-rule);
	border-radius: 4px;
	/* A form this tall can exceed a short viewport; let the panel itself
	   scroll rather than pin content off-screen with no way to reach it. */
	max-height: calc(100vh - clamp(2rem, 8vw, 4rem));
	overflow-y: auto;
}
.si-devd-cta-price {
	font-family: var(--si-display);
	font-size: 1.5rem;
	color: var(--si-navy);
	margin: 0 0 1rem;
}

.si-devd-enquiry h2 {
	font-size: clamp(1.2rem, 1.8vw, 1.45rem);
	color: var(--si-navy);
	margin: 0 0 .5em;
}
.si-devd-enquiry__intro {
	color: var(--si-ink);
	font-size: .95rem;
	line-height: 1.6;
	margin: 0 0 1.25rem;
}

.si-devd-form { margin: 0; }
.si-devd-field {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	margin: 0 0 1rem;
}
.si-devd-field label {
	font-size: .8rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--si-ink);
}
.si-devd-field input,
.si-devd-field textarea {
	font-family: var(--si-text);
	font-size: 1rem;
	color: var(--si-navy);
	background: #fff;
	border: 1px solid var(--si-rule);
	border-radius: 3px;
	padding: .65em .8em;
	box-sizing: border-box;
	width: 100%;
	resize: vertical;
}

/* Honeypot: kept a real, focusable text input (not type="hidden") but moved
 * off-screen, so a scraper that skips hidden inputs still finds and fills it.
 * A sighted visitor never sees it; aria-hidden + tabindex="-1" keep assistive
 * tech and keyboard navigation from ever landing on it either. */
.si-devd-hp {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	left: -9999px;
	margin: 0;
}

.si-devd-consent {
	display: flex;
	margin: 0 0 1.1rem;
}
.si-devd-consent label {
	display: flex;
	align-items: flex-start;
	gap: .55rem;
	font-size: .88rem;
	line-height: 1.5;
	color: var(--si-ink);
}
.si-devd-consent input[type="checkbox"] {
	flex: 0 0 auto;
	margin-top: .2em;
	width: 1.05em;
	height: 1.05em;
}

.si-devd-form__submit-wrap { margin: 0; }
.si-devd-form__submit-wrap .wp-block-button__link {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	border: 0;
	cursor: pointer;
}
.si-devd-form__submit-wrap .wp-block-button__link[disabled] {
	opacity: .6;
	cursor: not-allowed;
}

.si-devd-form__status {
	margin: .85rem 0 0;
	min-height: 1.2em;
	font-size: .88rem;
	color: var(--si-ink);
}
.si-devd-form__status.is-error { color: #a3392b; }
.si-devd-form__success {
	font-size: 1.02rem;
	line-height: 1.6;
	color: var(--si-navy);
	margin: 0;
}
.si-devd-form__noscript { margin: 0; }
.si-devd-form__noscript .wp-block-button__link {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	background: var(--si-navy);
	color: #fff;
}
.si-devd-form__noscript .wp-block-button__link:hover { background: var(--si-night); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.si-devd-body { grid-template-columns: 1fr; }
	.si-devd-cta-panel { position: static; max-height: none; overflow-y: visible; }
}
@media (max-width: 560px) {
	.si-devd-gallery__lead { aspect-ratio: 4 / 3; max-block-size: none; }
	.si-devd-gallery__thumb { width: 76px; }
	.si-devd-facts { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	.si-devd-gallery__strip { scroll-behavior: auto; }
	.si-devd-gallery__thumb { transition: none; }
}
