/* [ohi_open_houses]. Inherits the theme's fonts and colors. */
.ohi-open-houses {
	margin: 1.5em 0;
	/* Card columns follow the embed's own width (themes differ, sidebars eat space), not the viewport. */
	container-type: inline-size;
}

.ohi-oh-empty {
	font-style: italic;
}

/* Day tiles: a grid of days; one day open at a time, its panel directly under its row. */
.ohi-oh-days {
	display: grid;
	gap: 0.75em;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@container (min-width: 400px) {
	.ohi-oh-days {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container (min-width: 640px) {
	.ohi-oh-days {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.ohi-oh-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.15em;
	width: 100%;
	margin: 0;
	padding: 0.9em 1em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: clamp(12px, 2.1cqi, 15px);
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ohi-oh-tile:hover {
	border-color: rgba(0, 0, 0, 0.35);
}

/* Themes style bare button:hover/:focus/:active with a filled background (Themify: solid blue),
   which sticks on phones after a tap. Tiles and pager buttons stay unfilled in every state. */
.ohi-oh-tile:hover,
.ohi-oh-tile:focus,
.ohi-oh-tile:active,
.ohi-oh-pager button:hover,
.ohi-oh-pager button:focus,
.ohi-oh-pager button:active {
	background: transparent;
	color: inherit;
}

.ohi-oh-tile:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ohi-oh-tile[aria-expanded="true"] {
	border-color: currentColor;
	box-shadow: inset 0 0 0 1px currentColor;
}

/* Small pointer from the open tile down to its panel. */
.ohi-oh-tile[aria-expanded="true"]::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -0.45em;
	width: 0.7em;
	height: 0.7em;
	margin-left: -0.35em;
	background: #fff;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

.ohi-oh-tile-weekday {
	font-size: 0.72em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.6;
}

.ohi-oh-tile-date {
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1.15;
}

.ohi-oh-tile-count {
	font-size: 0.85em;
	opacity: 0.7;
	white-space: nowrap;
}

/* Panel: spans the full grid width wherever the script places it. */
.ohi-oh-panel {
	grid-column: 1 / -1;
	margin: 0.25em 0 0.5em;
	padding: 0.75em;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.03);
}

/* Listing cards on the tinted panel stay white. */
.ohi-oh-panel .ohi-oh-item {
	background: #fff;
}

.ohi-oh-panel .ohi-oh-pager {
	margin-bottom: 0;
}

.ohi-oh-panel[hidden] {
	display: none !important;
}

.ohi-oh-panel-title {
	margin: 0 0 0.75em;
	font-size: 1.1em;
}

.ohi-oh-panel-count {
	font-weight: 400;
	font-size: 0.85em;
	opacity: 0.7;
	margin-left: 0.3em;
}

/* With the script running the tile already names the day, so the heading is for screen readers only. */
.ohi-oh-days--js .ohi-oh-panel-title {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Cards: 4 per page. 4 across when the embed is >= 640px wide, 2x2 when narrower, 1 column on phones. */
.ohi-oh-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75em;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@container (min-width: 640px) {
	.ohi-oh-list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@container (max-width: 399px) {
	.ohi-oh-list {
		grid-template-columns: minmax(0, 1fr);
	}
}

.ohi-oh-item {
	/* Square by default; grows taller only if its content needs the room. */
	aspect-ratio: 1 / 1;
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0.8em 0.85em;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	/* Sized from the embed width so four cards stay square whatever the theme's base font. */
	font-size: clamp(12px, 1.9cqi, 14px);
	overflow-wrap: break-word;
}

/* Single-column phones: full-width squares would be needlessly tall. */
@container (max-width: 399px) {
	.ohi-oh-item {
		aspect-ratio: auto;
		font-size: 14px;
	}
}

/* Theme styles must not un-hide cards the pager has hidden. */
.ohi-oh-item[hidden] {
	display: none !important;
}

.ohi-oh-item p {
	margin: 0 0 0.25em;
	line-height: 1.3;
}

.ohi-oh-when {
	font-weight: 700;
}

.ohi-oh-price {
	font-size: 1.3em;
	font-weight: 700;
	line-height: 1.2 !important;
}

.ohi-oh-facts {
	font-size: 0.9em;
	opacity: 0.8;
}

/* Address: at most two lines. */
.ohi-oh-address {
	font-weight: 600;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

/* Brokerage: one line. */
.ohi-oh-agent {
	font-size: 0.85em;
	opacity: 0.7;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Pin the details link to the bottom of the square. */
.ohi-oh-link {
	margin-top: auto !important;
	margin-bottom: 0 !important;
	padding-top: 0.5em;
}

/* Pager inside each open day. */
.ohi-oh-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1em;
	margin: 1em 0 0.5em;
}

.ohi-oh-pager button {
	font: inherit;
	cursor: pointer;
	padding: 0.4em 0.9em;
	border: 1px solid rgba(0, 0, 0, 0.25);
	border-radius: 999px;
	background: transparent;
	color: inherit;
}

.ohi-oh-pager button:disabled {
	opacity: 0.35;
	cursor: default;
}

.ohi-oh-pager-status {
	font-size: 0.9em;
	opacity: 0.75;
	min-width: 7em;
	text-align: center;
}

/* Price filter: two range inputs stacked on one track; only their thumbs take pointer input. */
.ohi-oh-filter {
	margin: 0 0 1.25em;
}

.ohi-oh-filter[hidden],
.ohi-oh-filter-empty[hidden],
.ohi-oh-tile[hidden] {
	display: none;
}

.ohi-oh-filter-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 0.35em;
}

.ohi-oh-filter-label {
	font-weight: 600;
}

.ohi-oh-filter-value {
	font-variant-numeric: tabular-nums;
}

.ohi-oh-range {
	--ohi-lo: 0%;
	--ohi-hi: 100%;
	--ohi-thumb: 22px;
	position: relative;
	height: var(--ohi-thumb);
	margin: 0 calc(var(--ohi-thumb) / 2);
}

/* Track, with the selected span filled between the handles. */
.ohi-oh-range::before,
.ohi-oh-range::after {
	content: "";
	position: absolute;
	top: 50%;
	height: 4px;
	margin-top: -2px;
	border-radius: 2px;
}

.ohi-oh-range::before {
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.15);
}

.ohi-oh-range::after {
	left: var(--ohi-lo);
	right: calc(100% - var(--ohi-hi));
	background: currentColor;
}

.ohi-oh-range input[type="range"] {
	position: absolute;
	z-index: 1;
	top: 0;
	left: calc(var(--ohi-thumb) / -2);
	width: calc(100% + var(--ohi-thumb));
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.ohi-oh-range input[type="range"]::-webkit-slider-runnable-track {
	height: 100%;
	background: none;
	border: 0;
}

.ohi-oh-range input[type="range"]::-moz-range-track {
	height: 100%;
	background: none;
	border: 0;
}

.ohi-oh-range input[type="range"]::-webkit-slider-thumb {
	width: var(--ohi-thumb);
	height: var(--ohi-thumb);
	margin-top: 0;
	border: 2px solid currentColor;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: grab;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
}

.ohi-oh-range input[type="range"]::-moz-range-thumb {
	width: var(--ohi-thumb);
	height: var(--ohi-thumb);
	box-sizing: border-box;
	border: 2px solid currentColor;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	cursor: grab;
	pointer-events: auto;
}

.ohi-oh-range input[type="range"]:focus {
	outline: none;
}

.ohi-oh-range input[type="range"]:focus-visible::-webkit-slider-thumb {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ohi-oh-range input[type="range"]:focus-visible::-moz-range-thumb {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ohi-oh-filter-empty {
	margin: 0.75em 0 0;
	font-style: italic;
}

/* From the Blog: posts tagged with this city, below the listings. */
.ohi-city-posts {
	margin: 2.5em 0 0;
}

.ohi-city-posts-title {
	margin: 0 0 0.75em;
}

.ohi-city-posts-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.25em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ohi-city-post {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	margin: 0;
}

.ohi-city-post-thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 21 / 9;
	object-fit: cover;
	border-radius: 8px;
}

.ohi-city-post-link {
	font-weight: 600;
	line-height: 1.3;
}

.ohi-city-post-date {
	font-size: 0.85em;
	opacity: 0.75;
}
