/*
 * north-fork-homes — main stylesheet
 *
 * Palette is taken off the place itself: harbour navy, weathered teal and
 * oyster-shell white, with wine and farm-stand amber as the two accents. No
 * webfonts — the site loads over patchy mobile coverage east of Riverhead, and
 * a font request is the wrong thing to spend that budget on.
 */

/* ---------------------------------------------------------------- tokens */

:root {
	--ink:        #0f2430;
	--ink-soft:   #22333f;
	--sea:        #1d5c66;
	--sea-dark:   #16474f;
	--surf:       #6fa8a3;
	--sand:       #e6dccb;
	--shell:      #fbf9f5;
	--paper:      #ffffff;
	--vine:       #7a3f4d;
	--amber:      #c2762c;

	--text:       #22303a;
	--muted:      #5d6f79;
	--line:       #e2ded5;

	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
	--sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--wrap: 1200px;
	--gap:  clamp(1rem, 3vw, 2rem);

	--r:    10px;
	--r-lg: 16px;

	--shadow:    0 1px 2px rgba(15, 36, 48, .06), 0 4px 16px rgba(15, 36, 48, .06);
	--shadow-lg: 0 2px 6px rgba(15, 36, 48, .08), 0 18px 44px rgba(15, 36, 48, .12);
}

/* ------------------------------------------------------------------ base */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--shell);
	color: var(--text);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--vine); }

h1, h2, h3 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.15;
	color: var(--ink);
	margin: 0 0 .5em;
	letter-spacing: -.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }

.wrap {
	width: min(100% - 2.5rem, var(--wrap));
	margin-inline: auto;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap;
}

.skip {
	position: absolute; left: -9999px;
	background: var(--ink); color: #fff;
	padding: .7rem 1.1rem; z-index: 200;
}
.skip:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* --------------------------------------------------------------- buttons */

.btn {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .75rem 1.35rem;
	border: 1px solid var(--sea);
	border-radius: 999px;
	background: transparent;
	color: var(--sea);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--sea); color: #fff; border-color: var(--sea); }

.btn--primary { background: var(--sea); color: #fff; }
.btn--primary:hover { background: var(--sea-dark); border-color: var(--sea-dark); color: #fff; }
.btn--block { width: 100%; justify-content: center; }

/* -------------------------------------------------------------- masthead */

.masthead {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 100;
}

.masthead__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .8rem 0;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: .65rem;
	color: var(--ink);
	text-decoration: none;
}
.brand__mark { color: var(--sea); display: grid; place-items: center; }
.brand__text { display: grid; line-height: 1.1; }
.brand__text strong {
	font-family: var(--serif);
	font-size: 1.3rem;
	font-weight: 600;
	letter-spacing: -.015em;
}
.brand__text em {
	font-style: normal;
	font-size: .68rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted);
}

.masthead__actions { display: flex; align-items: center; gap: .5rem; }

.tel {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-weight: 600;
	font-size: .95rem;
	color: var(--ink);
	text-decoration: none;
	padding: .5rem .9rem;
	border: 1px solid var(--line);
	border-radius: 999px;
}
.tel:hover { border-color: var(--sea); color: var(--sea); }

.navtoggle {
	display: grid;
	place-items: center;
	width: 42px; height: 42px;
	background: none;
	border: 1px solid var(--line);
	border-radius: var(--r);
	cursor: pointer;
}
.navtoggle__bars { display: grid; gap: 4px; }
.navtoggle__bars i {
	display: block; width: 18px; height: 2px;
	background: var(--ink); border-radius: 2px;
}

/* ------------------------------------------------------------------- nav */

.sitenav { background: var(--ink); }
.sitenav__inner { position: relative; }

.sitenav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sitenav__list > li > a,
.sub-toggle {
	display: block;
	padding: .8rem .95rem;
	color: #dfe8ea;
	font-size: .84rem;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	background: none;
	border: 0;
	font-family: inherit;
	cursor: pointer;
}
.sitenav__list > li > a:hover,
.sub-toggle:hover,
.sub-toggle[aria-expanded="true"] { background: rgba(255,255,255,.09); color: #fff; }

.has-sub { position: relative; }
.sub-toggle::after { content: " ▾"; opacity: .7; }

.subnav {
	display: none;
	position: absolute;
	top: 100%; left: 0;
	min-width: 230px;
	margin: 0; padding: .4rem 0;
	list-style: none;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 0 0 var(--r) var(--r);
	box-shadow: var(--shadow-lg);
	z-index: 60;
}
.subnav.is-open { display: block; }
.subnav a {
	display: block;
	padding: .5rem 1.1rem;
	color: var(--text);
	font-size: .95rem;
	text-decoration: none;
}
.subnav a:hover { background: var(--shell); color: var(--sea); }

@media (max-width: 860px) {
	.sitenav { display: none; }
	.sitenav.is-open { display: block; }
	.sitenav__list { flex-direction: column; }
	.subnav {
		position: static;
		display: block;
		border: 0;
		box-shadow: none;
		background: rgba(255,255,255,.05);
		border-radius: 0;
	}
	.subnav a { color: #cfdadd; padding-left: 2rem; }
	.sub-toggle { width: 100%; text-align: left; }
}

@media (min-width: 861px) {
	.navtoggle { display: none; }
}

/* ------------------------------------------------------------------ hero */

/*
 * Height is deliberately modest. This is a listings site: the job of the top of
 * the page is to get someone into a town or a search, so the hero is sized as a
 * band that the town picker and the first row of content sit close under —
 * not as a full-height splash. It was originally 52vh and pushed everything
 * below the fold.
 *
 * min-height is a floor, not the driver: the content sets the real height, and
 * the floor only stops the band collapsing when the viewport is short.
 */
.hero {
	position: relative;
	min-height: clamp(220px, 30vh, 320px);
	display: grid;
	align-items: end;
	overflow: hidden;
	background: var(--ink);
}
.hero__img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover;
	/* Keeps the waterline in frame as the band gets shorter. */
	object-position: center 58%;
}
.hero__scrim {
	position: absolute; inset: 0;
	background: linear-gradient(to top, rgba(10,26,35,.88) 0%, rgba(10,26,35,.5) 48%, rgba(10,26,35,.15) 100%);
}
.hero__inner { position: relative; padding: 1.5rem 0 1.7rem; color: #fff; }
.hero__title {
	color: #fff;
	font-size: clamp(1.7rem, 3.6vw, 2.4rem);
	margin-bottom: .25em;
	text-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.hero__lede {
	font-size: clamp(1rem, 1.6vw, 1.13rem);
	color: #e8eef0;
	max-width: 44ch;
	margin-bottom: 1rem;
}

/*
 * Capped rather than fluid. `flex: 1 1 260px` made the select grow to the full
 * width of the hero on a wide screen — a 900px-wide dropdown holding eleven
 * short town names, which reads as a layout fault rather than a control.
 * It now sizes to its content up to a sane ceiling, and only goes full-width
 * on narrow screens where that is genuinely wanted.
 */
.hero__search {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	max-width: 480px;
}
.hero__search select {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	max-width: 300px;
	padding: .8rem 2.2rem .8rem 1rem;
	font: inherit;
	color: var(--text);
	background: #fff;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

@media (max-width: 480px) {
	.hero__search select { max-width: none; }
	.hero__search .btn { flex: 1 1 auto; justify-content: center; }
}
.hero__search .btn { background: var(--amber); border-color: var(--amber); color: #fff; }
.hero__search .btn:hover { background: #a9631f; border-color: #a9631f; }

/* ----------------------------------------------------------- page header */

.pagehero {
	background: var(--ink);
	color: #fff;
	padding: 2.4rem 0 2.2rem;
}
.pagehero h1 { color: #fff; }
.pagehero__lede { color: #cfdde1; font-size: 1.12rem; max-width: 56ch; margin: 0; }
.pagehero--town { background: linear-gradient(120deg, var(--ink) 0%, var(--sea-dark) 100%); }

.crumbs {
	font-size: .82rem;
	color: #9fb6bd;
	margin-bottom: .9rem;
	display: flex;
	flex-wrap: wrap;
	gap: .45rem;
}
.crumbs a { color: #cfe2e6; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: #fff; }

/* ----------------------------------------------------------------- stats */

.stats { background: var(--sand); border-bottom: 1px solid rgba(0,0,0,.06); }
.stats__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 1rem 1.5rem;
	margin: 0;
	padding: 1.2rem 0;
}
.stats__item dt {
	font-size: .74rem;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #6b5f4c;
	margin-bottom: .2rem;
	display: flex;
	align-items: center;
	gap: .35rem;
}
.stats__item dd {
	margin: 0;
	font-family: var(--serif);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.1;
}
.stats__range { font-size: 1rem !important; }
.stats__schools {
	margin: 0;
	padding: 0 0 1.1rem;
	font-size: .88rem;
	color: #6b5f4c;
}

.hint {
	width: 16px; height: 16px;
	border-radius: 50%;
	border: 1px solid currentColor;
	background: none;
	color: inherit;
	font-size: .62rem;
	line-height: 1;
	cursor: help;
	padding: 0;
}

/* ----------------------------------------------------------------- intro */

.intro { padding: 2.6rem 0 1.4rem; }
.intro__inner { max-width: 68ch; }
.intro p { font-size: 1.06rem; color: var(--ink-soft); }
.intro__extra { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }

.section-head { margin-bottom: 1.5rem; }
.section-head p { color: var(--muted); margin: 0; }

/* ----------------------------------------------------------------- towns */

.towns { padding: 2rem 0 1rem; }
.towns__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: .9rem;
	list-style: none;
	margin: 0; padding: 0;
}
.towncard a {
	display: grid;
	gap: .2rem;
	height: 100%;
	padding: 1.1rem 1.2rem;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	text-decoration: none;
	color: var(--text);
	transition: transform .15s, box-shadow .15s, border-color .15s;
}
.towncard a:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
	border-color: var(--surf);
}
.towncard__name {
	font-family: var(--serif);
	font-size: 1.22rem;
	font-weight: 600;
	color: var(--ink);
}
.towncard__meta {
	font-size: .76rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--sea);
	font-weight: 600;
}
.towncard__lede { font-size: .9rem; color: var(--muted); line-height: 1.45; margin-top: .3rem; }

/* ------------------------------------------------------------------- map */

.mapsec { padding: 2rem 0; }

/*
 * Narrower than the content column on purpose. Full-bleed it read as a banner
 * rather than a tool, and a map running the whole width of the window leaves a
 * visitor no clear margin to scroll past it.
 */
.mapsec__frame {
	max-width: 860px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	overflow: hidden;
	box-shadow: var(--shadow);
	background: var(--sand);
}

.mapsec__canvas {
	height: clamp(300px, 38vh, 420px);
	width: 100%;
}

/* Leaflet sets its own font; keep it in the site's. */
.leaflet-container { font-family: var(--sans); font-size: 14px; }
.leaflet-container a { color: var(--sea); }

.mapsec__fallback {
	margin: 1rem 0 0;
	padding-left: 1.1rem;
	columns: 2;
	font-size: .95rem;
}

/* --- town pins (home page) --- */

.nfh-pin--town {
	display: grid;
	justify-items: center;
	gap: 2px;
	width: 110px;
	text-decoration: none;
	line-height: 1;
}
.nfh-pin__bubble {
	display: grid;
	place-items: center;
	width: 38px; height: 38px;
	border-radius: 50%;
	background: var(--sea);
	color: #fff;
	font-weight: 700;
	border: 2px solid #fff;
	box-shadow: 0 2px 8px rgba(15,36,48,.35);
	transition: background .15s, transform .15s;
}
.nfh-pin--town:hover .nfh-pin__bubble { background: var(--vine); transform: scale(1.08); }
.nfh-pin__name {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--ink);
	background: rgba(255,255,255,.9);
	padding: 1px 6px;
	border-radius: 999px;
	white-space: nowrap;
}

/* --- listing pins (town / category pages) --- */

.nfh-pin--dot {
	display: block;
	width: 16px; height: 16px;
	border-radius: 50%;
	background: var(--vine);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(15,36,48,.45);
	transition: transform .12s;
}
.nfh-pin--dot:hover { transform: scale(1.3); }

/* --- popup --- */

.leaflet-popup-content-wrapper { border-radius: var(--r); padding: 0; overflow: hidden; }
.leaflet-popup-content { margin: 0; width: auto !important; }

.nfh-pop {
	display: grid;
	text-decoration: none;
	color: var(--text);
	width: 200px;
}
.nfh-pop img { width: 100%; height: 130px; object-fit: cover; display: block; }
.nfh-pop__price {
	font-family: var(--serif);
	font-size: 1.15rem;
	color: var(--ink);
	padding: .5rem .7rem 0;
}
.nfh-pop__addr { padding: 0 .7rem; font-weight: 600; font-size: .9rem; }
.nfh-pop__town { padding: 0 .7rem .6rem; color: var(--muted); font-size: .84rem; }
.nfh-pop:hover .nfh-pop__price { color: var(--vine); }

@media (max-width: 600px) {
	.mapsec__fallback { columns: 1; }
	.nfh-pin__name { font-size: 10px; }
}

/* ------------------------------------------------------------ categories */

.categories { padding: 2rem 0; }
.cats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: .9rem;
	list-style: none; margin: 0; padding: 0;
}
.cats a {
	display: grid;
	gap: .25rem;
	height: 100%;
	padding: 1.1rem 1.2rem;
	border-radius: var(--r-lg);
	border: 1px solid transparent;
	background: linear-gradient(180deg, rgba(29,92,102,.07), rgba(29,92,102,.03));
	text-decoration: none;
	color: var(--text);
	transition: border-color .15s, background .15s;
}
.cats a:hover { border-color: var(--surf); background: rgba(29,92,102,.1); }
.cats strong { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); }
.cats span { font-size: .9rem; color: var(--muted); line-height: 1.45; }

/* ------------------------------------------------------------ listing grid */

.grid-section { padding: 2.4rem 0; }
.grid-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: .5rem 1rem;
	margin-bottom: 1.4rem;
}
.grid-section__head h2 { margin: 0; }
.grid-section__count { margin: 0; color: var(--muted); font-size: .92rem; }

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.4rem;
}

.card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	overflow: hidden;
	transition: transform .16s, box-shadow .16s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card__link { display: block; text-decoration: none; color: inherit; height: 100%; }

.card__media {
	position: relative;
	aspect-ratio: 3 / 2;
	background: var(--sand);
	overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__nophoto {
	display: grid;
	place-content: center;
	justify-items: center;
	gap: .4rem;
	height: 100%;
	color: #a2937c;
	font-size: .82rem;
}

.badge {
	position: absolute;
	top: .7rem; left: .7rem;
	padding: .25rem .6rem;
	border-radius: 999px;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #fff;
	background: var(--ink);
}
.badge--pending { background: var(--amber); }
.badge--rental  { background: var(--vine); left: auto; right: .7rem; }

.card__count {
	position: absolute;
	bottom: .7rem; right: .7rem;
	padding: .2rem .55rem;
	border-radius: 999px;
	background: rgba(10,26,35,.72);
	color: #fff;
	font-size: .72rem;
}

.card__body { padding: 1rem 1.1rem 1.15rem; }
.card__price {
	font-family: var(--serif);
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 .15rem;
}
.card__addr { font-size: 1rem; font-family: var(--sans); font-weight: 600; margin: 0 0 .1rem; }
.card__town { font-size: .88rem; color: var(--muted); margin: 0 0 .7rem; }

.card__specs {
	display: flex;
	flex-wrap: wrap;
	gap: .3rem .9rem;
	list-style: none;
	margin: 0; padding: .7rem 0 0;
	border-top: 1px solid var(--line);
	font-size: .87rem;
	color: var(--muted);
}
.card__specs strong { color: var(--ink); }

/* ----------------------------------------------------------------- pager */

.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-top: 2rem;
	flex-wrap: wrap;
}
.pager__btn {
	padding: .6rem 1.1rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
	text-decoration: none;
	font-weight: 600;
	font-size: .92rem;
}
.pager__btn:hover { border-color: var(--sea); }
.pager__pos { color: var(--muted); font-size: .9rem; }

/* --------------------------------------------------------------- notices */

.notice {
	padding: 1.1rem 1.3rem;
	border-radius: var(--r);
	border-left: 4px solid;
	margin-bottom: 1.4rem;
	font-size: .96rem;
}
.notice p:last-child { margin-bottom: 0; }
.notice--stale { background: #fdf6e7; border-color: var(--amber); color: #6a4a17; }
.notice--down  { background: #fbeeee; border-color: #b0413e; color: #6d2a28; }
.notice--empty {
	background: var(--paper);
	border: 1px solid var(--line);
	border-left: 4px solid var(--surf);
	color: var(--ink-soft);
}
.notice--down h3 { margin-top: 0; color: #6d2a28; }

/* ---------------------------------------------------------------- nearby */

.nearby { padding: 1rem 0 2.6rem; }
.nearby__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: .9rem;
	list-style: none; margin: 0; padding: 0;
}
.nearby__list a {
	display: grid;
	gap: .2rem;
	height: 100%;
	padding: 1rem 1.1rem;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r);
	text-decoration: none;
	color: var(--text);
}
.nearby__list a:hover { border-color: var(--surf); }
.nearby__list strong { font-family: var(--serif); font-size: 1.06rem; color: var(--ink); }
.nearby__list span { font-size: .87rem; color: var(--muted); line-height: 1.4; }

/* ----------------------------------------------------------------- place */

.place { background: var(--paper); border-block: 1px solid var(--line); padding: 2.8rem 0; }
.place__inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 2.4rem;
}
.place__list { margin: 0; padding-left: 1.1rem; }
.place__list li { margin-bottom: .7rem; color: var(--ink-soft); }
.place__list strong { color: var(--ink); }

/* ------------------------------------------------------------------ lead */

.lead { background: var(--ink); color: #dfe8ea; padding: 3rem 0; }
.lead__inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 2.4rem;
	align-items: start;
}
.lead h2 { color: #fff; }
.lead__copy p { color: #bccdd3; }
.lead__phone a { color: var(--surf); font-weight: 600; }

.lead__form { display: grid; gap: .9rem; }
.field { display: grid; gap: .3rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; }
.field label { font-size: .82rem; font-weight: 600; letter-spacing: .03em; color: #cfdde1; }
.field .opt { font-weight: 400; color: #8fa5ac; }
.field input, .field textarea {
	width: 100%;
	padding: .7rem .85rem;
	font: inherit;
	color: var(--text);
	background: #fff;
	border: 1px solid transparent;
	border-radius: var(--r);
}
.field input:invalid:not(:placeholder-shown) { border-color: #c98b8b; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.lead__status { margin: 0; font-size: .92rem; min-height: 1.4em; }
.lead__status.is-ok  { color: var(--surf); }
.lead__status.is-err { color: #f0b3b3; }

/* -------------------------------------------------------- listing detail */

.listing { padding-bottom: 3rem; }
.listing .crumbs { color: var(--muted); padding-top: 1rem; }
.listing .crumbs a { color: var(--sea); }

/*
 * Two columns: the main photo, and the remaining frames stacked beside it.
 *
 * The gallery previously ran full-bleed while the rest of the page sat inside
 * .wrap, so the photo hit both edges of the window. Constraining it alone was
 * not enough — the main image cannot fill a 1200px column without becoming
 * absurdly tall, so it left a ~490px dead gap on its right. The thumbnails now
 * occupy that space, which is also the arrangement people expect on a listing.
 */
.gallery { margin: 1rem 0 1.8rem; }

.gallery--split {
	display: grid;
	grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr);
	gap: .55rem;
	align-items: start;
}

.gallery__main {
	height: clamp(260px, 52vh, 520px);
	background: var(--sand);
	overflow: hidden;
	border-radius: var(--r-lg);
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }

.gallery__thumbs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .55rem;
	height: clamp(260px, 52vh, 520px);
	overflow-y: auto;
	scrollbar-width: thin;
}
.gallery__thumbs button {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 2px solid transparent;
	border-radius: var(--r);
	overflow: hidden;
	background: none;
	cursor: pointer;
	line-height: 0;
}
.gallery__thumbs button[aria-current="true"] { border-color: var(--sea); }
.gallery__thumbs img { width: 100%; height: 84px; object-fit: cover; }

/* "+6" overlay on the last visible thumbnail when there are more photos. */
.gallery__more {
	position: absolute; inset: 0;
	display: grid; place-items: center;
	background: rgba(10,26,35,.6);
	color: #fff;
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1;
}

@media (max-width: 720px) {
	/* Beside becomes below, and the thumbs go back to a single scrolling row. */
	.gallery--split { grid-template-columns: minmax(0, 1fr); }
	.gallery__thumbs {
		display: flex;
		height: auto;
		overflow-x: auto;
		overflow-y: visible;
	}
	.gallery__thumbs li { flex: 0 0 auto; }
	.gallery__thumbs img { width: 118px; height: 80px; }
}

/* --- top bar: breadcrumb + back link --- */

.listing__topbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .5rem 1rem;
	padding-top: 1rem;
}
.listing__topbar .crumbs { margin-bottom: 0; }

.backlink {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .45rem 1rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
	color: var(--sea);
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.backlink:hover { border-color: var(--sea); background: var(--sea); color: #fff; }

/* --- comparables row --- */

.listing__similar { background: var(--paper); border-top: 1px solid var(--line); margin-top: 2.5rem; }
.cards--three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.listing__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
}
@media (min-width: 900px) {
	.listing__grid { grid-template-columns: minmax(0, 1fr) 340px; }
	.listing__aside { position: sticky; top: 110px; }
}

.listing__price {
	font-family: var(--serif);
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 .1em;
	display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
}
.listing__price .badge { position: static; }
.listing__addr { font-size: clamp(1.3rem, 3vw, 1.8rem); margin: 0 0 .1em; }
.listing__town { color: var(--muted); margin: 0 0 1.4rem; }

.listing__unitnote {
	font-size: .88rem;
	color: #6a4a17;
	background: #fdf6e7;
	border-left: 4px solid var(--amber);
	border-radius: var(--r);
	padding: .8rem 1rem;
	margin: 0 0 1.4rem;
	max-width: 62ch;
}

.listing__specs {
	display: flex;
	flex-wrap: wrap;
	gap: 1.6rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 1.1rem 0;
	border-block: 1px solid var(--line);
}
.listing__specs li { display: grid; }
.listing__specs strong {
	font-family: var(--serif);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.1;
}
.listing__specs span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.listing__desc { margin-bottom: 2rem; max-width: 68ch; }
.listing__desc p { color: var(--ink-soft); }

.listing__facts { margin-bottom: 2rem; }
.listing__facts dl {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: .1rem 1.5rem;
	margin: 0;
}
.listing__facts dl > div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .55rem 0;
	border-bottom: 1px solid var(--line);
}
.listing__facts dt { color: var(--muted); font-size: .92rem; }
.listing__facts dd { margin: 0; font-weight: 600; text-align: right; }

.listing__attrib {
	font-size: .84rem;
	color: var(--muted);
	padding: 1rem 1.1rem;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r);
}

.askbox {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	padding: 1.4rem;
	box-shadow: var(--shadow);
}
.askbox h2 { font-size: 1.25rem; margin-bottom: .3em; }
.askbox > p { font-size: .92rem; color: var(--muted); }
.askbox .field label { color: var(--ink-soft); }
.askbox .field input, .askbox .field textarea { border-color: var(--line); background: var(--shell); }
.askbox .lead__status.is-ok { color: var(--sea); }
.askbox .lead__status.is-err { color: #a5403d; }
.askbox__tel { margin: .9rem 0 0; text-align: center; font-size: .92rem; color: var(--muted); }

.listing__maplink { margin-top: 1rem; text-align: center; font-size: .93rem; }
.listing__back { margin-top: 2.5rem; }

/* ---------------------------------------------------------------- footer */

.siteftr { background: var(--ink); color: #b9cbd1; margin-top: 0; }
.siteftr__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 2rem;
	padding: 3rem 0 2.4rem;
}
.siteftr__col--brand { grid-column: span 1; }
.siteftr__brand {
	font-family: var(--serif);
	font-size: 1.35rem;
	color: #fff;
	margin: 0 0 .4rem;
}
.siteftr__blurb { font-size: .92rem; max-width: 34ch; }
.siteftr__contact a { color: var(--surf); text-decoration: none; font-weight: 600; }
.siteftr__contact a:hover { text-decoration: underline; }

.siteftr__col h2 {
	font-family: var(--sans);
	font-size: .76rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #7f979f;
	margin-bottom: .8rem;
}
.siteftr__col ul { list-style: none; margin: 0; padding: 0; }
.siteftr__col li { margin-bottom: .35rem; }
.siteftr__col a { color: #cfdde1; text-decoration: none; font-size: .93rem; }
.siteftr__col a:hover { color: #fff; text-decoration: underline; }

.siteftr__note { font-size: .86rem; color: #93a9b0; }
.siteftr__note--warn { color: #e8c07d; }

.siteftr__legal {
	border-top: 1px solid rgba(255,255,255,.1);
	padding: 1.2rem 0 2rem;
	font-size: .8rem;
	color: #7f979f;
}
.siteftr__legal a { color: #a9c0c6; }
.siteftr__disclaimer { max-width: 90ch; margin: .6rem 0 0; line-height: 1.5; }

/* ----------------------------------------------------------------- plain */

.plain { padding: 2.5rem 0 3rem; max-width: 70ch; }
.plainlist { padding-left: 1.1rem; }

/* --------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}

/* ----------------------------------------------------------------- print */

@media print {
	.masthead, .sitenav, .lead, .siteftr__grid, .askbox, .pager, .navtoggle { display: none !important; }
	body { background: #fff; font-size: 12pt; }
	.card { break-inside: avoid; }
}
