/* Site-wide container width (10-10: 1750px, BIFF 기준). Change here only. */
:root {
	--hl-container: 1750px;
	--hl-gutter: 20px;
}

/* HolyLink church directory (/churches/) + shared map styles.
   Layout follows the Zillow split view: filter bar on top, sticky map on the
   left, list on the right. Below 1024px the list shows alone and a floating
   button switches to the map. */

/* ---------- Directory shell ---------- */

.hl-dir {
	--hl-ink: #111827;
	--hl-text: #374151;
	--hl-muted: #6b7280;
	--hl-line: #e5e7eb;
	--hl-soft: #f3f4f6;
	--hl-accent: #b4232b;
	--hl-top: 0px;          /* fixed chrome above the page (admin bar) */
	--hl-toolbar: 72px;     /* height of the sticky filter bar */
	padding: 0 20px 48px;
	color: var(--hl-text);
}

.admin-bar .hl-dir { --hl-top: 32px; }

@media (max-width: 782px) {
	.admin-bar .hl-dir { --hl-top: 46px; }
}

@media (max-width: 600px) {
	/* WP stops fixing the admin bar here. */
	.admin-bar .hl-dir { --hl-top: 0px; }
}

/* ---------- Filter bar ---------- */

/* CrocoBuilder blocks get max-width:100%, which caps the bar at the parent's
   content width and cancels the negative side margins on the right. */
.hl-dir .hl-dir__toolbar {
	width: auto;
	max-width: none;
}

.hl-dir__toolbar {
	position: sticky;
	top: var(--hl-top);
	z-index: 30;
	margin: 0 -20px;
	padding: 14px 20px;
	background: #fff;
	border-bottom: 1px solid var(--hl-line);
}

.hl-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.hl-filters__search {
	position: relative;
	flex: 1 1 320px;
	max-width: 440px;
}

.hl-filters__icon {
	position: absolute;
	left: 14px;
	top: 50%;
	width: 18px;
	height: 18px;
	transform: translateY(-50%);
	fill: none;
	stroke: var(--hl-muted);
	stroke-width: 2;
	stroke-linecap: round;
	pointer-events: none;
}

.hl-filters__input,
.hl-filters__select select {
	height: 44px;
	margin: 0;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	background-color: #fff;
	font-size: 15px;
	color: var(--hl-ink);
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

/* Doubled class: Hello Elementor's input[type="search"] rule (0,1,1) would
   otherwise reset the padding and the icon would sit on the text. */
.hl-filters .hl-filters__input {
	width: 100%;
	padding: 0 14px 0 42px;
}

.hl-filters__input::placeholder { color: #9ca3af; }

.hl-filters__select { margin: 0; }

.hl-filters__select select {
	min-width: 150px;
	padding: 0 38px 0 14px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	cursor: pointer;
}

.hl-filters__input:focus,
.hl-filters__select select:focus {
	outline: none;
	border-color: var(--hl-ink);
	box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}

.hl-filters__submit {
	height: 44px;
	padding: 0 20px;
	border: 0;
	border-radius: 10px;
	background: var(--hl-ink);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.hl-filters__submit:hover { background: #1f2937; }

.hl-filters__reset {
	padding: 0 6px;
	font-size: 14px;
	color: var(--hl-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hl-filters__reset:hover { color: var(--hl-ink); }

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

/* ---------- Split ---------- */

.hl-dir__split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(560px, 46%);
	gap: 24px;
	align-items: start;
	margin-top: 20px;
}

.hl-dir__map {
	position: sticky;
	top: calc(var(--hl-top) + var(--hl-toolbar) + 20px);
	height: calc(100vh - var(--hl-top) - var(--hl-toolbar) - 40px);
	min-height: 420px;
	border: 1px solid var(--hl-line);
	border-radius: 14px;
	overflow: hidden;
	background: #eceff3;
}

.hl-dir__map .hl-map {
	height: 100% !important;
	min-height: 0;
	border-radius: 0;
}

.hl-dir__list { min-width: 0; }

/* Title on top; count left and sort right on the row below (Zillow). */
.hl-dir__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 12px;
	margin-bottom: 14px;
}

.hl-dir__head > :first-child { grid-column: 1 / -1; }

/* ---------- Sort ---------- */

.hl-sort {
	position: relative;
	margin: 0;
}

.hl-sort__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 14px;
	color: var(--hl-muted);
	white-space: nowrap;
}

.hl-sort select {
	height: 34px;
	margin: 0;
	padding: 0 30px 0 10px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 14px;
	appearance: none;
	-webkit-appearance: none;
	font-size: 14px;
	font-weight: 600;
	color: var(--hl-ink);
	cursor: pointer;
}

.hl-sort select:focus {
	outline: none;
	border-color: var(--hl-ink);
	box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}

.hl-sort select:disabled { opacity: .6; cursor: progress; }

/* Message under the control, without pushing the list down. */
.hl-sort__msg {
	position: absolute;
	right: 0;
	top: calc(100% + 6px);
	z-index: 5;
	width: max-content;
	max-width: 260px;
	margin: 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: var(--hl-ink);
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	box-shadow: 0 6px 18px rgba(17, 24, 39, .2);
}

.hl-sort__msg[hidden] { display: none; }

/* Distance on a card, only while sorting by "near". */
.hl-dir .hl-card__dist {
	margin: 4px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--hl-accent);
}

.hl-dir__head h1 {
	margin: 0 0 2px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.25;
	color: var(--hl-ink);
}

/* ---------- Result count / empty state ---------- */

.hl-count__line {
	margin: 0;
	font-size: 14px;
	color: var(--hl-muted);
}

.hl-count__line strong { color: var(--hl-ink); }

.hl-count__empty {
	margin-top: 16px;
	padding: 32px 20px;
	border: 1px dashed #d1d5db;
	border-radius: 14px;
	text-align: center;
}

.hl-count__empty p {
	margin: 0 0 10px;
	font-size: 15px;
	color: var(--hl-text);
}

.hl-count__empty a {
	font-size: 14px;
	font-weight: 600;
	color: var(--hl-ink);
}

/* ---------- Map controls ----------
   One row across the top of the map, same pill style for both:
   left "내 위치", right "지도 이동 시 검색". "이 지역에서 검색" (auto off) sits
   centred under the row. Google's own controls stay bottom right. */

.hl-area {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	margin: 0;
}

.hl-area__auto,
.hl-locate {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 38px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: var(--hl-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 2px 10px rgba(17, 24, 39, .18);
	cursor: pointer;
}

.hl-area__auto input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--hl-ink);
	cursor: pointer;
}

.hl-locate {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 5;
	padding-left: 11px;
}

.hl-locate:hover,
.hl-area__auto:hover { background: #f9fafb; }

.hl-locate svg {
	width: 18px;
	height: 18px;
	fill: #1a73e8;
	stroke: #1a73e8;
	stroke-width: 2;
	stroke-linecap: round;
	flex: none;
}

.hl-locate.is-busy svg { animation: hl-locate-pulse 1s ease-in-out infinite; }

@keyframes hl-locate-pulse {
	50% { opacity: .3; }
}

.hl-area__btn {
	position: absolute;
	top: 62px;
	left: 50%;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	height: 38px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	transform: translateX(-50%);
	background: var(--hl-ink);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 2px 10px rgba(17, 24, 39, .25);
	cursor: pointer;
}

.hl-area__btn[hidden] { display: none; }

.hl-locate__msg {
	position: absolute;
	top: 58px;
	left: 12px;
	z-index: 6;
	max-width: 240px;
	margin: 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: var(--hl-ink);
	color: #fff;
	font-size: 13px;
	line-height: 1.4;
	box-shadow: 0 6px 18px rgba(17, 24, 39, .2);
}

.hl-locate__msg[hidden] { display: none; }

/* Narrow maps: tighter pills so both fit on one row. */
@media (max-width: 420px) {
	.hl-area { right: 8px; top: 10px; }
	.hl-locate { left: 8px; top: 10px; }
	.hl-area__auto,
	.hl-locate { height: 36px; padding: 0 11px; font-size: 13px; gap: 6px; }
}

.hl-dir__list { transition: opacity .15s ease; }

.hl-dir.is-loading .hl-dir__list {
	opacity: .45;
	pointer-events: none;
}

/* ---------- Narrow screens: list first, map on demand ---------- */

.hl-dir__toggle { display: none; }

@media (max-width: 1023px) {
	.hl-dir__split {
		grid-template-columns: minmax(0, 1fr);
		margin-top: 16px;
	}

	.hl-dir__map { display: none; }

	.hl-dir--map .hl-dir__map {
		display: block;
		position: relative;
		top: auto;
		height: calc(100vh - var(--hl-top) - var(--hl-toolbar) - 120px);
		min-height: 360px;
	}

	.hl-dir--map .hl-dir__list { display: none; }

	.hl-dir__toggle {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		position: fixed;
		left: 50%;
		bottom: 20px;
		z-index: 40;
		transform: translateX(-50%);
		height: 44px;
		padding: 0 20px;
		border: 0;
		border-radius: 999px;
		background: var(--hl-ink);
		color: #fff;
		font-size: 15px;
		font-weight: 600;
		box-shadow: 0 8px 24px rgba(17, 24, 39, .25);
		cursor: pointer;
	}
}

@media (max-width: 600px) {
	.hl-dir { padding: 0 14px 88px; }

	.hl-dir__toolbar {
		position: static;
		margin: 0 -14px;
		padding: 12px 14px;
	}

	.hl-filters__search {
		flex: 1 1 100%;
		max-width: none;
	}

	.hl-filters__select { flex: 1 1 calc(50% - 4px); }
	.hl-filters__select select { width: 100%; min-width: 0; }

	/* The search field submits with the keyboard's search key; the
	   selects submit on change. */
	.hl-filters__submit { display: none; }

	.hl-dir__head h1 { font-size: 22px; }

	.hl-dir--map .hl-dir__map {
		height: calc(100vh - 220px);
	}
}

/* ---------- Map (shared with the single church page) ---------- */

.hl-map { position: relative; width: 100%; min-height: 240px; border-radius: 14px; overflow: hidden; background: #eceff3; }
.hl-map__canvas { position: absolute; inset: 0; }
.hl-map__notice { margin: 0; padding: 24px; font-size: 14px; color: #6b7280; }
.hl-map--empty { display: flex; align-items: center; justify-content: center; font-size: 14px; color: #6b7280; }
.hl-map__info { display: flex; flex-direction: column; gap: 2px; width: 220px; padding: 2px 4px 4px; font-size: 13px; line-height: 1.45; }
.hl-map__info-img { display: block; width: 100%; height: 120px; margin-bottom: 6px; object-fit: cover; border-radius: 8px; background: #f3f4f6; }
.hl-map__info strong { font-size: 14px; color: #111827; }
.hl-map__info span { color: #6b7280; }
.hl-map__info a { margin-top: 6px; font-weight: 600; color: #111827; }

/* ---------- Pager (CrocoBuilder native pagination ships with no CSS) ---------- */

.cb-el-pagination { flex-wrap: wrap; align-items: center; gap: 6px; }
.cb-el-pagination__items { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cb-el-pagination__item {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
	font-size: 14px; line-height: 1; color: #374151; text-decoration: none;
	transition: background-color .15s ease, border-color .15s ease;
}
a.cb-el-pagination__item[href]:hover { border-color: #9ca3af; background: #f9fafb; }
.cb-el-pagination__item--active { background: #111827; border-color: #111827; color: #fff; font-weight: 600; }
.cb-el-pagination__item[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.cb-el-pagination__item--delimiter { border-color: transparent; background: none; min-width: 24px; padding: 0; color: #9ca3af; }
@media (max-width: 480px) {
	.cb-el-pagination__item { min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px; }
}
