/* ABOUTME: Styles for the Congregations Finder. */
/* ABOUTME: Larger, darker, higher-contrast typography per design brief. */

.azcf-finder {
	/* --- Palette: darker ink by default, gray reserved for structural dividers --- */
	--azcf-accent:        #6b1a3b;
	--azcf-accent-ink:    #ffffff;
	--azcf-accent-soft:   rgba(107, 26, 59, 0.08);
	--azcf-accent-dark:   #4e1129;
	--azcf-ring:          rgba(107, 26, 59, 0.22);

	--azcf-ink:           #111827;   /* primary text — near-black */
	--azcf-ink-soft:      #1f2937;   /* body copy */
	--azcf-ink-muted:     #374151;   /* was #6b7280 — meaningfully darker */
	--azcf-ink-quiet:     #4b5563;   /* was #9ca3af — still readable */

	--azcf-surface:       #ffffff;
	--azcf-surface-soft:  #f6f5f1;
	--azcf-border:        #d4d4cc;
	--azcf-border-strong: #a8a89e;

	--azcf-radius:        12px;
	--azcf-radius-lg:     16px;
	--azcf-radius-pill:   999px;

	--azcf-font-base:     17px;

	max-width: 1200px;
	margin: 0 auto;
	color: var(--azcf-ink-soft);
	font-family: inherit;
	font-size: var(--azcf-font-base);
	line-height: 1.5;
}

.azcf-finder,
.azcf-finder * {
	box-sizing: border-box;
}

/* -------- Accessibility helpers -------- */

.azcf-sr-only {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap; border: 0;
}

/* -------- Controls panel -------- */

.azcf-finder__controls {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 22px 22px 18px;
	margin-bottom: 22px;
	background: var(--azcf-surface-soft);
	border: 1px solid var(--azcf-border);
	border-radius: var(--azcf-radius-lg);
}

.azcf-finder__row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 20px;
	align-items: flex-end;
	justify-content: space-between;
}

.azcf-finder__selects {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	flex: 1 1 auto;
	min-width: 260px;
}

.azcf-finder__toggles {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

/* -------- Search -------- */

.azcf-finder__search {
	position: relative;
	width: 100%;
}

.azcf-finder__search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--azcf-ink-muted);
	display: inline-flex;
	pointer-events: none;
}

.azcf-finder__search input[type="search"] {
	width: 100%;
	padding: 14px 16px 14px 48px;
	border: 1px solid var(--azcf-border-strong);
	border-radius: var(--azcf-radius);
	background: var(--azcf-surface);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.4;
	color: var(--azcf-ink);
	box-shadow: none;
	transition: border-color 120ms ease, box-shadow 120ms ease;
	appearance: none;
}

.azcf-finder__search input::placeholder {
	color: var(--azcf-ink-muted);
	opacity: 1;
}

.azcf-finder__search input:focus {
	outline: none;
	border-color: var(--azcf-accent);
	box-shadow: 0 0 0 3px var(--azcf-ring);
}

/* -------- Select fields (City / County) -------- */

.azcf-select {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 200px;
	min-width: 200px;
}

.azcf-select__label {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--azcf-ink);
	text-transform: none;
}

.azcf-select select {
	width: 100%;
	padding: 12px 40px 12px 16px;
	border: 1px solid var(--azcf-border-strong);
	border-radius: var(--azcf-radius);
	background: var(--azcf-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 8 10 13 15 8'/%3E%3C/svg%3E") no-repeat right 14px center;
	background-size: 14px 14px;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.3;
	color: var(--azcf-ink);
	cursor: pointer;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.azcf-select select:focus {
	outline: none;
	border-color: var(--azcf-accent);
	box-shadow: 0 0 0 3px var(--azcf-ring);
}

/* -------- Toggle chips (Bilingual / O&A) -------- */

.azcf-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: 1px solid var(--azcf-border-strong);
	border-radius: var(--azcf-radius-pill);
	background: var(--azcf-surface);
	font-size: 15px;
	font-weight: 600;
	color: var(--azcf-ink);
	cursor: pointer;
	user-select: none;
	transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.azcf-toggle:hover {
	border-color: var(--azcf-accent);
	background: var(--azcf-accent-soft);
}

.azcf-toggle input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border: 2px solid var(--azcf-border-strong);
	border-radius: 4px;
	background: var(--azcf-surface);
	margin: 0;
	display: inline-block;
	position: relative;
	cursor: pointer;
	transition: border-color 120ms ease, background-color 120ms ease;
}

.azcf-toggle input[type="checkbox"]:checked {
	background: var(--azcf-accent);
	border-color: var(--azcf-accent);
}

.azcf-toggle input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 2px;
	top: -1px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.azcf-toggle:has(input:checked) {
	background: var(--azcf-accent);
	border-color: var(--azcf-accent);
	color: var(--azcf-accent-ink);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.azcf-toggle:has(input:checked) input[type="checkbox"] {
	border-color: #fff;
	background: transparent;
}
.azcf-toggle:has(input:checked) input[type="checkbox"]::after {
	border-color: #fff;
}

.azcf-toggle input:focus-visible {
	outline: 2px solid var(--azcf-ring);
	outline-offset: 2px;
}

/* -------- Summary row: clear button + live count -------- */

.azcf-finder__summary {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 18px;
	align-items: center;
	justify-content: space-between;
	padding-top: 4px;
}

.azcf-finder__reset,
.azcf-finder__reset:hover,
.azcf-finder__reset:focus,
.azcf-finder__reset:active {
	background: var(--azcf-surface) !important;
	background-image: none !important;
	text-shadow: none !important;
}

.azcf-finder__reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border: 1px solid var(--azcf-border-strong);
	border-radius: var(--azcf-radius-pill);
	color: var(--azcf-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 120ms ease, color 120ms ease;
}

.azcf-finder__reset:hover {
	border-color: var(--azcf-accent);
	color: var(--azcf-accent) !important;
}

.azcf-finder__reset[hidden] {
	display: none;
}

.azcf-finder__count {
	font-size: 15px;
	color: var(--azcf-ink-soft);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.azcf-finder__count [data-azcf-count] {
	font-weight: 700;
	color: var(--azcf-ink);
	margin-right: 4px;
}

/* -------- Explainer panel (designation context) -------- */

.azcf-finder__explainer {
	padding: 20px 24px;
	margin-bottom: 18px;
	background: #faf5f7;
	border: 1px solid #ead8df;
	border-left: 4px solid var(--azcf-accent);
	border-radius: var(--azcf-radius);
	font-size: 15px;
	line-height: 1.55;
	color: var(--azcf-ink-soft);
}

.azcf-finder__explainer[hidden] { display: none; }

.azcf-explainer__item + .azcf-explainer__item {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--azcf-border);
}

.azcf-explainer__desc {
	margin: 0 0 6px;
}

.azcf-explainer__desc strong {
	color: var(--azcf-ink);
	font-weight: 700;
}

.azcf-explainer__link {
	display: inline-block;
	font-size: 14px;
	font-weight: 700;
	color: var(--azcf-accent);
	text-decoration: none;
}

.azcf-explainer__link:hover {
	color: var(--azcf-accent-dark);
	text-decoration: underline;
}

/* -------- Layout: results + map -------- */

.azcf-finder__layout {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: 24px;
	align-items: start;
}

@media (max-width: 900px) {
	.azcf-finder__layout {
		grid-template-columns: 1fr;
	}
	.azcf-finder__map {
		order: 2;
		position: static;
	}
}

.azcf-finder__map {
	position: sticky;
	top: 90px;
	border-radius: var(--azcf-radius-lg);
	overflow: hidden;
	border: 1px solid var(--azcf-border);
	background: var(--azcf-surface);
}

.azcf-finder__map-inner {
	width: 100%;
	height: 520px;
}

@media (max-width: 900px) {
	.azcf-finder__map-inner {
		height: 320px;
	}
}

/* -------- Results list -------- */

.azcf-finder__results {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Cards are rendered as <button> elements for a11y (native focus, Enter/Space).
   That also means theme button styles (Genesis et al.) *will* try to apply
   a color fill and/or zero-out our border on hover/focus. We lock every
   visual attribute that a theme typically touches — background, border
   width/style/color, text shadow — with !important at every state. The
   border shorthand sets all three border sub-properties in one sweep so a
   theme rule like `button:hover { border: none }` cannot erase it. */
.azcf-result,
.azcf-result:hover,
.azcf-result:focus,
.azcf-result:active {
	background: var(--azcf-surface) !important;
	background-color: var(--azcf-surface) !important;
	background-image: none !important;
	color: var(--azcf-ink) !important;
	text-shadow: none !important;
	border-width: 1px !important;
	border-style: solid !important;
}

.azcf-result                 { border-color: var(--azcf-border) !important; }
.azcf-result:hover           { border-color: var(--azcf-border-strong) !important; }
.azcf-result:focus-visible   { border-color: var(--azcf-accent) !important; }

.azcf-result {
	display: grid;
	grid-template-columns: 96px 1fr auto;
	gap: 16px;
	align-items: center;
	padding: 14px;
	border-radius: var(--azcf-radius);
	text-align: left;
	font-family: inherit;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
	/* Intentionally NO transform on hover — keeps the card from
	   "jumping" if the theme also animates any property in parallel. */
	transition: box-shadow 140ms ease, border-color 140ms ease;
}

.azcf-result:hover {
	box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
}

.azcf-result:focus {
	outline: none;
}

.azcf-result:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--azcf-ring);
}

.azcf-result__media {
	width: 96px;
	height: 96px;
	border-radius: var(--azcf-radius);
	overflow: hidden;
	background: var(--azcf-surface-soft);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--azcf-ink-muted);
	flex-shrink: 0;
}

.azcf-result__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.azcf-result__media--placeholder {
	border: 1px dashed var(--azcf-border-strong);
}

.azcf-result__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.azcf-result__title {
	font-size: 19px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--azcf-ink);
}

.azcf-result__geo {
	font-size: 15px;
	color: var(--azcf-ink-soft);
	font-weight: 500;
}

.azcf-dot {
	margin: 0 8px;
	color: var(--azcf-ink-quiet);
}

.azcf-result__badges {
	margin-top: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.azcf-result__chev {
	color: var(--azcf-ink-quiet);
	display: inline-flex;
	align-items: center;
	padding-right: 4px;
	transition: color 120ms ease, transform 120ms ease;
}

.azcf-result:hover .azcf-result__chev {
	color: var(--azcf-accent);
	transform: translateX(3px);
}

@media (max-width: 520px) {
	.azcf-result {
		grid-template-columns: 76px 1fr auto;
		padding: 12px;
	}
	.azcf-result__media {
		width: 76px;
		height: 76px;
	}
	.azcf-result__title { font-size: 17px; }
}

/* -------- Badges (shared by cards + modal) --------
   Each membership gets its own paired bg + ink color. Colors were chosen to
   stay readable (WCAG AA on the paired bg) and to feel distinct at a glance
   when multiple show up on the same card.
*/

.azcf-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: var(--azcf-radius-pill);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: none;
	line-height: 1.4;
}

.azcf-badge--bi                 { background: #dbeafe; color: #1e3a8a; }
.azcf-badge--mem-allianceq      { background: #fbd7ea; color: #7a1747; }
.azcf-badge--mem-green          { background: #d6ead6; color: #1f5130; }
.azcf-badge--mem-global         { background: #fde8d2; color: #7a3e10; }
.azcf-badge--mem-silver         { background: #e5e7eb; color: #1f2937; }
.azcf-badge--mem-polar          { background: #e0edfb; color: #1e3a8a; }

a.azcf-badge--link {
	text-decoration: none;
	cursor: pointer;
	transition: filter 140ms ease;
}

a.azcf-badge--link:hover {
	text-decoration: underline;
	filter: brightness(0.92);
}

/* -------- Empty state -------- */

.azcf-finder__empty {
	padding: 32px 24px;
	text-align: center;
	color: var(--azcf-ink-soft);
	font-size: 16px;
	border: 1px dashed var(--azcf-border-strong);
	border-radius: var(--azcf-radius);
	background: var(--azcf-surface);
	margin-top: 12px;
}

.azcf-link-btn {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: var(--azcf-accent);
	font-weight: 700;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.azcf-link-btn:hover {
	color: var(--azcf-accent-dark);
}

/* -------- Modal -------- */

.azcf-modal {
	--azcf-accent:        #6b1a3b;
	--azcf-accent-ink:    #ffffff;
	--azcf-accent-dark:   #4e1129;
	--azcf-ring:          rgba(107, 26, 59, 0.22);
	--azcf-ink:           #111827;
	--azcf-ink-soft:      #1f2937;
	--azcf-ink-muted:     #374151;
	--azcf-ink-quiet:     #4b5563;
	--azcf-surface:       #ffffff;
	--azcf-border:        #d4d4cc;
	--azcf-border-strong: #a8a89e;
	--azcf-radius:        12px;
	--azcf-radius-lg:     16px;
	--azcf-radius-pill:   999px;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	color: var(--azcf-ink);
	font-family: inherit;
	font-size: 17px;
	line-height: 1.55;
}

.azcf-modal[hidden] { display: none; }

.azcf-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(5, 7, 12, 0.78);
	/* Frosted-glass effect. Fallback (no-backdrop-filter support) stays
	   readable thanks to the high-opacity base color above. */
	-webkit-backdrop-filter: blur(8px) saturate(110%);
	backdrop-filter: blur(8px) saturate(110%);
	cursor: pointer;
	opacity: 0;
	animation: azcf-fade-in 160ms ease forwards;
}

.azcf-modal__panel {
	position: relative;
	width: min(720px, 100%);
	max-height: calc(100vh - 64px);
	overflow-y: auto;
	background: var(--azcf-surface);
	border-radius: var(--azcf-radius-lg);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
	transform: translateY(10px);
	opacity: 0;
	animation: azcf-rise-in 200ms cubic-bezier(.2,.8,.25,1) forwards;
}

.azcf-modal__panel:focus { outline: none; }

@keyframes azcf-fade-in { to { opacity: 1; } }
@keyframes azcf-rise-in { to { transform: translateY(0); opacity: 1; } }

.azcf-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 5;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	/* Solid-enough background to stand out on any featured image.
	   !important locks out theme button:hover fills. */
	background: rgba(17, 24, 39, 0.82) !important;
	background-image: none !important;
	color: #ffffff !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
	transition: background-color 140ms ease, transform 140ms ease, border-color 140ms ease;
}

.azcf-modal__close:hover {
	background: #111827 !important;
	border-color: #ffffff;
	transform: scale(1.06);
}

.azcf-modal__close:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
}

.azcf-modal__close svg {
	display: block;
	width: 22px;
	height: 22px;
}

/* -------- Modal content -------- */

.azcf-modal__content {
	display: flex;
	flex-direction: column;
}

.azcf-modal__media {
	margin: 0;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: var(--azcf-surface-soft);
	overflow: hidden;
	border-top-left-radius: var(--azcf-radius-lg);
	border-top-right-radius: var(--azcf-radius-lg);
}

.azcf-modal__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.azcf-modal__header {
	padding: 24px 28px 0;
}

.azcf-modal__title {
	margin: 0 0 8px;
	font-size: 28px;
	line-height: 1.2;
	font-weight: 800;
	color: var(--azcf-ink);
	letter-spacing: -0.01em;
}

.azcf-modal__geo {
	font-size: 16px;
	font-weight: 500;
	color: var(--azcf-ink-soft);
	margin-bottom: 10px;
}

.azcf-modal__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.azcf-modal__details {
	padding: 22px 28px 0;
	color: var(--azcf-ink-soft);
	font-size: 17px;
	line-height: 1.6;
}

.azcf-modal__details > :first-child { margin-top: 0; }
.azcf-modal__details > :last-child { margin-bottom: 0; }

.azcf-modal__details p {
	margin: 0 0 12px;
}

.azcf-modal__details a {
	color: var(--azcf-accent);
	font-weight: 600;
	text-decoration: none;
}

.azcf-modal__details a:hover {
	color: var(--azcf-accent-dark);
	text-decoration: underline;
}

.azcf-modal__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 24px 32px;
	padding: 24px 28px 28px;
	margin-top: 20px;
	border-top: 1px solid var(--azcf-border);
}

.azcf-modal__section-title {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--azcf-ink);
}

.azcf-modal__address,
.azcf-modal__worship {
	margin: 0 0 6px;
	font-size: 17px;
	line-height: 1.55;
	color: var(--azcf-ink-soft);
}

.azcf-modal__list,
.azcf-modal__social {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	margin-left: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 17px;
	line-height: 1.55;
}

/* Belt + suspenders: some themes apply ::marker / list-style to every li
   globally, which can leak through into modal content. Force it off at
   the item level too. */
.azcf-modal__list > li,
.azcf-modal__social > li {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	margin-left: 0 !important;
	background: none !important;
}

.azcf-modal__list > li::marker,
.azcf-modal__social > li::marker {
	content: "";
}

.azcf-modal__social {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px;
}

.azcf-modal__social a {
	display: inline-flex;
	margin-left: 0 !important;
	padding: 7px 14px;
	border: 1px solid var(--azcf-border-strong);
	border-radius: var(--azcf-radius-pill);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	color: var(--azcf-ink);
	transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.azcf-modal__social a:hover {
	border-color: var(--azcf-accent);
	color: var(--azcf-accent);
	background: rgba(107, 26, 59, 0.04);
	text-decoration: none;
}

.azcf-modal__list a {
	color: var(--azcf-accent);
	text-decoration: none;
	font-weight: 600;
}

.azcf-modal__list a:hover {
	color: var(--azcf-accent-dark);
	text-decoration: underline;
}

.azcf-link {
	display: inline-block;
	font-size: 15px;
	font-weight: 700;
	color: var(--azcf-accent);
	text-decoration: none;
}

.azcf-link:hover {
	color: var(--azcf-accent-dark);
	text-decoration: underline;
}

/* Mobile: fill the screen */
@media (max-width: 640px) {
	.azcf-modal { padding: 0; }
	.azcf-modal__panel {
		width: 100%;
		max-height: 100vh;
		border-radius: 0;
	}
	.azcf-modal__media {
		border-radius: 0;
	}
	.azcf-modal__header { padding: 20px 20px 0; }
	.azcf-modal__details { padding: 20px 20px 0; }
	.azcf-modal__grid { padding: 20px 20px 24px; }
	.azcf-modal__title { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.azcf-modal__backdrop,
	.azcf-modal__panel {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

body.azcf-modal-open {
	overflow: hidden;
}

/* -------- Leaflet tweaks -------- */

.leaflet-container {
	font-family: inherit;
	font-size: 14px;
}

.leaflet-popup-content-wrapper {
	border-radius: 10px;
}
