/* =========================================================
   Listing extras: home listing pages only.
     - .ich-neighborhood        "The Neighborhood" (1.22.0): area map,
                                Schools, Nearby (tabs), Neighborhoods & Clubs
                                PHP: inc/neighborhood.php, JS: js/ich-area-map.js
     - .ich-community-listings  "Other Homes in {Community}" (1.20.0, above
                                "More Homes"; layout from listing-browse.css)
                                PHP: inc/listing-extras.php
   Map layer colours: --ich-l-* below (chips, pins, legend).
   ========================================================= */

.ich-neighborhood{
	--ich-l-home: var(--ich-accent);
	--ich-l-schools: var(--ich-brass);
	--ich-l-everyday: #4F7A86;
	--ich-l-lifestyle: #6E8A5C;
	--ich-l-clubs: #9A5B45;
}

/* ---- Area map ---- */
.ich-area-map-block{ margin: 0 0 20px; }
.ich-area-layers{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
}
.ich-area-layers[hidden]{ display: none; }
.ich-area-chip{
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	border: 1px solid var(--ich-line);
	background: var(--ich-card);
	color: var(--ich-ink);
	font: inherit;
	font-size: 0.85rem;
	line-height: 1.2;
	border-radius: 999px;
}
button.ich-area-chip{ cursor: pointer; }
button.ich-area-chip:hover{ border-color: var(--ich-accent-soft); }
button.ich-area-chip:focus-visible{ outline: 2px solid var(--ich-accent); outline-offset: 2px; }
button.ich-area-chip[aria-pressed="false"]{
	color: var(--ich-ink-soft);
	background: transparent;
	text-decoration: line-through;
	text-decoration-color: var(--ich-line);
}
button.ich-area-chip[aria-pressed="false"] .ich-area-swatch{ opacity: 0.35; }
.ich-area-swatch{
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--ich-l-home);
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--ich-line);
}
.ich-area-chip--schools .ich-area-swatch{ background: var(--ich-l-schools); }
.ich-area-chip--everyday .ich-area-swatch{ background: var(--ich-l-everyday); }
.ich-area-chip--lifestyle .ich-area-swatch{ background: var(--ich-l-lifestyle); }
.ich-area-chip--clubs .ich-area-swatch{ background: var(--ich-l-clubs); }

.ich-area-map{
	height: 420px;
	border: 1px solid var(--ich-line);
	background: var(--ich-band);
	position: relative;
	z-index: 0; /* keeps Leaflet's panes under the sticky header */
}
.ich-area-map .leaflet-tile-pane{ filter: grayscale(0.7) sepia(0.12) brightness(1.03) contrast(0.95); }
.ich-area-map .leaflet-control-attribution{ font-size: 11px; background: rgba(246, 244, 239, 0.88); }
.ich-area-map .leaflet-container,
.ich-area-map.leaflet-container{ font: inherit; }

.ich-area-pin span{
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
	background: var(--ich-l-everyday);
}
.ich-area-pin--schools span{ background: var(--ich-l-schools); }
.ich-area-pin--lifestyle span{ background: var(--ich-l-lifestyle); }
.ich-area-pin--clubs span{ background: var(--ich-l-clubs); }
.ich-area-pin--home span{
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ich-l-home);
	border-width: 3px;
}
.ich-area-pop strong{ display: block; font-size: 0.95rem; color: var(--ich-ink); }
.ich-area-pop strong a{ color: var(--ich-accent); }
.ich-area-pop span{ display: block; margin-top: 2px; font-size: 0.82rem; color: var(--ich-ink-soft); }

.ich-area-map-foot{
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 10px 24px;
	margin-top: 10px;
}
.ich-area-map-foot .ich-map-address{ margin-top: 0; }
.ich-area-map-links{
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	font-size: 0.9rem;
}
.ich-area-map-links a{
	color: var(--ich-accent);
	text-decoration: none;
	border-bottom: 1px solid var(--ich-accent-soft);
}
.ich-area-map-links a:hover{ color: var(--ich-ink); border-color: var(--ich-ink); }

@media (max-width: 760px){
	.ich-area-map{ height: 340px; }
}

/* ---- Cards ---- */
.ich-neighborhood-grid{
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* cards stacked, each full width */
	gap: 20px;
}
.ich-hood-block{
	background: var(--ich-card);
	border: 1px solid var(--ich-line);
	padding: 22px 24px;
}
.ich-listing .ich-hood-title{
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ich-ink-soft);
	margin: 0 0 16px;
}
.ich-hood-title .ich-area-icon{ color: var(--ich-accent); flex: 0 0 auto; }
.ich-hood-block a:focus-visible{ outline: 2px solid var(--ich-accent); outline-offset: 3px; }

/* Schools */
.ich-agent-schools-label{
	margin: 0 0 8px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ich-ink);
}
.ich-agent-schools{
	list-style: none;
	margin: 0 0 14px;
	padding: 0 0 14px;
	border-bottom: 1px solid var(--ich-line);
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 6px 32px;
	font-size: 0.95rem;
	line-height: 1.45;
}
.ich-agent-school-level{ font-weight: 600; color: var(--ich-ink); } /* 1.22.1: bold level labels */
.ich-ext{ white-space: nowrap; }
.ich-hood-fine{
	margin: 14px 0 0;
	font-size: 0.78rem;
	line-height: 1.5;
	color: var(--ich-ink-soft);
}
.ich-hood-fine a{ color: inherit; }
/* Schools: GreatSchools + district on one line (1.22.1) */
.ich-hood-more{
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.6;
}
.ich-hood-more-label{ color: var(--ich-ink-soft); }
.ich-hood-more a{
	color: var(--ich-accent);
	text-decoration: none;
	border-bottom: 1px solid var(--ich-accent-soft);
	font-weight: 500;
}
.ich-hood-more a:hover{ color: var(--ich-ink); border-color: var(--ich-ink); }
.ich-hood-sep{ color: var(--ich-ink-soft); }
.ich-hood-schools .ich-hood-fine{ margin-top: 6px; }

/* Nearby: tabs + rows */
.ich-tabs{
	display: flex;
	gap: 4px 24px;
	flex-wrap: wrap;
	border-bottom: 1px solid var(--ich-line);
	margin: -4px 0 6px;
}
.ich-tabs[hidden]{ display: none; }
.ich-tab{
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	padding: 8px 0 10px;
	font: inherit;
	font-size: 0.95rem;
	color: var(--ich-ink-soft);
	cursor: pointer;
}
.ich-tab:hover{ color: var(--ich-ink); }
.ich-tab[aria-selected="true"]{
	color: var(--ich-ink);
	font-weight: 600;
	border-bottom-color: var(--ich-accent);
}
.ich-tab:focus-visible{ outline: 2px solid var(--ich-accent); outline-offset: 2px; }
.ich-listing .ich-tab-panel-title{
	margin: 18px 0 4px;
	font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ich-ink-soft);
}
.has-tabs .ich-tab-panel-title{ display: none; }
.ich-tab-panel[hidden]{ display: none; }
.ich-nearby-list{
	list-style: none;
	margin: 0;
	padding: 0;
}
.ich-nearby-row{
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 14px 0;
	border-bottom: 1px solid var(--ich-line);
}
.ich-nearby-row:last-child{ border-bottom: 0; }
.ich-nearby-row .ich-area-icon{
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	padding: 7px;
	border-radius: 50%;
	background: var(--ich-bg);
	color: var(--ich-accent);
}
.ich-nearby-body{ min-width: 0; }
.ich-nearby-cat{
	display: block;
	font-weight: 600;
	font-size: 0.98rem;
	color: var(--ich-ink);
}
.ich-nearby-places{
	display: block;
	margin-top: 2px;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--ich-ink-soft);
}
.ich-nearby-places a{
	color: var(--ich-ink-soft);
	text-decoration: underline;
	text-decoration-color: var(--ich-line);
	text-underline-offset: 3px;
}
.ich-nearby-places a:hover{ color: var(--ich-accent); text-decoration-color: currentColor; }
.ich-nearby-dist{ white-space: nowrap; }

/* Neighborhoods & Clubs */
.ich-places-groups{
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 22px 36px;
}
.ich-listing .ich-places-type{
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-family: 'Fraunces', Georgia, serif;
	font-style: italic;
	font-weight: 500;
	font-size: 1.05rem;
	color: var(--ich-accent);
}
.ich-places-type .ich-area-icon{ width: 20px; height: 20px; color: var(--ich-l-clubs); }
.ich-places-list{
	list-style: none;
	margin: 0;
	padding: 0;
}
.ich-places-item{
	padding: 8px 0;
	border-top: 1px solid var(--ich-line);
}
.ich-places-line{
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 10px;
}
.ich-places-name{
	color: var(--ich-ink);
	font-weight: 500;
	text-decoration: none;
	border-bottom: 1px solid var(--ich-line);
}
.ich-places-name:hover{ color: var(--ich-accent); border-color: var(--ich-accent); }
.ich-places-dist{
	font-size: 0.85rem;
	color: var(--ich-ink-soft);
	white-space: nowrap;
}
.ich-places-badge{
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ich-brass);
	white-space: nowrap;
}
.ich-places-note{
	margin: 3px 0 0;
	font-size: 0.86rem;
	line-height: 1.45;
	color: var(--ich-ink-soft);
}

.ich-neighborhood .screen-reader-text{
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

@media (max-width: 520px){
	.ich-hood-block{ padding: 20px 18px; }
	.ich-nearby-row{ gap: 12px; }
}

/* ---- Other Homes in {Community} ----
   Same block as "More Homes" (listing-browse.css). When both show, the
   gaps either side of the full-width line between them are tightened. */
.ich-community-listings .ich-featured{
	padding-bottom: clamp(40px, 5vw, 64px);
}
.ich-community-listings + .ich-more-listings .ich-featured{
	padding-top: clamp(40px, 5vw, 64px);
}

/* ---- Print ----
   The lists print (useful on a spec sheet); the map, tabs, links and the
   community row don't. Every Nearby list prints, each under its title. */
@media print{
	.ich-community-listings,
	.ich-area-layers,
	.ich-area-map,
	.ich-area-map-links,
	.ich-tabs,
	.ich-hood-more,
	.ich-hood-fine{ display: none !important; }
	.ich-tab-panel[hidden]{ display: block !important; }
	.has-tabs .ich-tab-panel-title{ display: block; }
	.ich-hood-block{
		border: 0;
		padding: 0;
		margin-top: 14px;
	}
	.ich-agent-schools{ border: 0; padding: 0; margin: 0; }
	.ich-nearby-places,
	.ich-places-dist,
	.ich-places-note{ color: #000; }
	.ich-nearby-row{ padding: 6px 0; break-inside: avoid; }
	.ich-nearby-row .ich-area-icon{ width: 24px; height: 24px; padding: 0; background: none; }
	.ich-places-group{ break-inside: avoid; }
}
