/* Default BIF CSS
   Scope to plugin containers to avoid theme collisions */

/* --- Base Layout --- */
.bif-interment-search,
.bif-search-results-list,
.bif-interment-edit-accordion,
.bif-cemetery-main {
	max-width: 1280px;
	margin: auto;
	box-sizing: border-box;
}

/* --- Interment Search Form --- */
.bif-interment-search {
	width: 100%;
	margin-top: 0;
}

.bif-interment-search .bif-interment-search-form {
	position: relative;
	width: 100%;
	max-width: none;
	padding: 5px;
	box-sizing: border-box;
	margin: 0;
}

/* Tablet */
@media (max-width: 1024px) {
	.bif-interment-search .bif-interment-search-form::before {
		font-size: 24px;
	}
}

/* Mobile */
@media (max-width: 767px) {
	.bif-interment-search .bif-interment-search-form::before {
		font-size: 18px;
	}
}

/* Grid Rows */
.bif-interment-search .bif-row {
	display: grid;
	gap: 10px;
	margin-bottom: 10px;
}

.bif-interment-search .bif-row:nth-of-type(1) {
	grid-template-columns: 1fr 1fr;
}

.bif-interment-search .bif-row:nth-of-type(1) .bif-search-help {
	grid-column: 1 / -1;
	font-size: 0;
}

.bif-interment-search .bif-row:nth-of-type(1) select {
	grid-column: 1 / -1;
}

.bif-interment-search .bif-row:nth-of-type(2) {
	grid-template-columns: minmax(0, 1fr) 200px;
}

.bif-interment-search .bif-row:nth-of-type(2) label {
	display: none !important;
}

.bif-interment-search .bif-row:nth-of-type(2) input {
	order: 1;
}

.bif-interment-search .bif-row:nth-of-type(2) select {
	order: 2;
}

.bif-interment-search .bif-row:nth-of-type(3),
.bif-interment-search .bif-row:nth-of-type(4) {
	grid-template-columns: 1fr;
}

.bif-interment-search .bif-row:nth-of-type(4) {
	margin-top: 14px;
}

/* Form Elements */
.bif-interment-search input[type="text"],
.bif-interment-search select,
.bif-form-field input,
.bif-form-field select,
.bif-form-field textarea {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #b8b1aa;
	background: rgba(255, 255, 255, 0.55);
	font-size: 14px;
	color: #813811;
	outline: none;
}

.bif-interment-search input[type="text"]::placeholder,
.bif-interment-search input[type="search"]::placeholder,
.bif-interment-search input[type="email"]::placeholder,
.bif-interment-search select,
.bif-interment-search select:focus,
.bif-interment-search select option {
	font-family: 'merriweather', Georgia, serif !important;
	color: #813811 !important;
	font-style: italic !important;
	opacity: 1 !important;
}

.bif-interment-search input[type="text"],
.bif-interment-search input[type="search"],
.bif-interment-search input[type="email"],
.bif-interment-search select,
.bif-form-field input,
.bif-form-field select,
.bif-form-field textarea,

.bif-interment-search input[type="text"]:focus,
.bif-interment-search input[type="search"]:focus,
.bif-interment-search input[type="email"]:focus,
.bif-interment-search select:focus,
.bif-form-field input:focus,
.bif-form-field select:focus,
.bif-form-field textarea:focus {
	color: #813811 !important;
	-webkit-text-fill-color: #813811 !important;
}

.bif-interment-search select option[disabled] {
	color: #7c4b22 !important;
}

.bif-interment-search button.button,
.bif-interment-search .button[type="submit"] {
	width: 100%;
	height: 40px;
	background: #6b2f00;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	border: 0;
}

.bif-interment-search button.button:hover {
	background: #026d30;
}

/* --- Search Results --- */
.bif-interment-group-title .bif-group-title-note {
	display: inline-block;
	margin-top: 4px;
	font-size: 0.72em;
	font-weight: 400;
	line-height: 1.25;
}


.bif-interment-results-wrap {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-top: 0px;
	background-color: #ECE1DC !important;
	clear: both;
}

.bif-interment-results {
	max-width: 1280px;
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
	background-color: transparent !important;
}

.bif-interment-group-title,
.bif-results-group > summary {
	font-family: Georgia, serif;
	font-size: 2rem;
	color: #8c4a22;
	margin-bottom: 18px;
	list-style: none;
	cursor: pointer;
}

.bif-search-results-list {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding-top: 10px;
	margin-bottom: 10px;
}

.bif-results-summary-text {
	margin-bottom: 10px;
}

/* --- Single Interment Page --- */
.bif-single-interment-page {
	background-color: #ECE1DC !important;
}

/* --- Interment Card --- */
.bif-result-card {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
	border: 1px solid #813811;
	background: #f7f4f1;
	max-width: 100%;
	margin: auto;
}

.bif-result-col {
	padding: 20px 10px;
	min-width: 0;
}

.bif-result-col + .bif-result-col {
	border-left: 1px solid #813811;
}

/* --- Typography --- */
.bif-result-name,
.bif-result-subtitle {
	margin: 0;
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-weight: 400;
	color: #813811 !important;
	line-height: 1.2;
}

.bif-result-name {
	font-size: 24px;
	margin-bottom: 6px;
}

.bif-result-name a {
	color: inherit;
	text-decoration: none;
}

.bif-result-name a:hover, .bif-result-cemetery-name a:hover, .bif-other-plot-link a:hover {
	text-decoration: none;
	color: #036632;
}

.bif-result-subtitle {
	font-size: 18px;
	margin-bottom: 5px;
	margin-top: 0;
}

.bif-result-meta,
.bif-result-confidence,
.bif-scan-help {
	font-family: "Open Sans", Helvetica, Arial, Lucida, sans-serif;
	font-size: 14px;
	line-height: 1.3em;
	color: #495254;
}

.bif-result-meta strong,
.bif-result-confidence strong,
.bif-result-cemetery-name strong
 {
	font-family: "Open Sans", Helvetica, Arial, Lucida, sans-serif;
 	font-weight: 700;
	color: #495254;
	text-decoration: none;
}

.bif-result-cemetery-name a  {
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size:16px;
	font-weight: 700;
	color: #036632;
	text-decoration: none;
	transition: color 300ms ease 0ms, font-size 300ms ease 0ms;
}

.bif-result-cemetery-name a:hover {
	font-size:18px;
	text-decoration: none;
	color: #813811;
	transition: color 300ms ease 0ms, font-size 300ms ease 0ms;
}

/* --- Name / Confidence Column --- */
.bif-result-col-name {
	display: flex;
	flex-direction: column;
}

.bif-result-confidence {
	margin-top: auto;
}

/* --- Meta Blocks --- */
.bif-result-meta > div {
	margin: 0;
}

.bif-result-spacer {
	height: 1em;
}

.bif-result-cemetery .bif-result-meta > div {
	max-width: 100%;
}

/* --- Register Page Column --- */
.bif-result-col-scan {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

/* Text */
.bif-result-col-scan .bif-result-subtitle,
.bif-result-col-scan .bif-scan-help {
	margin: 0;
	width: 100%;
}

/* Thumbnail Link */
.bif-register-thumb-link,
.bif-result-col-scan .bif-register-thumb-link {
	display: inline-block;
	margin-top: 5px;
}

/* Thumbnail */
.bif-register-thumb {
	display: block;
	width: 125px;
	height: auto;
	border: 1px solid #813811;
	transition: transform 0.25s ease;
	transform-origin: top left;
}

/* Hover Effect */
.bif-register-thumb:hover {
	transform: scale(1.1);
	position: relative;
	z-index: 20;
}

/* --- Pager --- */
.bif-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.bif-pager-info {
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: 14px;
	color: #495254;
	margin-right: 8px;
}

/* Base buttons */
.bif-pager a.button,
.bif-pager span.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 12px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	border: 1px solid #813811;
	background: #fff;
	color: #813811 !important;
	text-decoration: none !important;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease;
}

/* Normal hover */
.bif-pager a.button:hover,
.bif-pager span.button:hover {
	background: #ece1dc;
	color: #026d30 !important;
	border-color: #026d30;
	text-decoration: none !important;
}

/* Active page */
.bif-pager .button.button-primary,
.bif-pager span.button.button-primary {
	background: #813811 !important;
	color: #fff !important;
	border-color: #813811 !important;
}

/* Active page hover */
.bif-pager .button.button-primary:hover,
.bif-pager span.button.button-primary:hover {
	background: #026d30 !important;
	color: #fff !important;
	border-color: #026d30 !important;
}

/* Disabled buttons */
.bif-pager .button.disabled,
.bif-pager .bif-button-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Allow hover on active span */
.bif-pager .bif-button-static {
	pointer-events: auto !important;
}

/* Others Buried In This Plot */
.bif-others-buried-section {
	margin-top: 10px;
}

.bif-others-buried-title {
	margin-top: 0;
}

.bif-other-plot-note {
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: 16px;
	line-height: 1.3em;
	color: #813811;
	font-weight: 700;
}

/* --- Cemetery Profile & Hero --- */
.bif-cemetery-hero,
.bif-cemetery-profile--overlay .bif-cemetery-hero {
	position: relative;
	overflow: hidden;
	background: #ddd;
	width: 100%;
}

/* --- Hero image 16:9 --- */
.bif-cemetery-hero-media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.bif-cemetery-hero-img {
	width: 100vw;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bif-cemetery-hero-overlay,
.bif-cemetery-profile--overlay .bif-cemetery-hero-overlay {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	/* width: min(680px, 88%); */
	padding: 24px 28px;
	background: rgba(255, 255, 255, 0.88);
	border: 1px solid rgba(166, 93, 51, 0.45);
	text-align: center;
	box-sizing: border-box;
	z-index: 2;
}

.bif-cemetery-hero-title {
	font-family: Georgia, serif;
	font-size: 42px;
	line-height: 1.08;
	color: #8c4a22;
	margin: 0 0 10px;
	text-align: center;
}

.bif-cemetery-profile--overlay .bif-cemetery-hero-title,
.bif-cemetery-profile--overlay .bif-cemetery-hero-subtitle,
.bif-cemetery-profile--overlay .bif-cemetery-hero-address,
.bif-cemetery-profile--overlay .bif-cemetery-hero-gps {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.bif-cemetery-profile--overlay .bif-cemetery-hero-title {
	margin: 0 0 10px;
}

.bif-cemetery-profile--overlay .bif-cemetery-hero-subtitle {
	margin: 0 0 12px;
}

.bif-cemetery-profile--overlay .bif-cemetery-hero-address {
	margin: 0 0 8px;
}

.bif-cemetery-profile--overlay .bif-cemetery-hero-address,
.bif-cemetery-profile--overlay .bif-cemetery-hero-gps {
	max-width: 100%;
}

.bif-cemetery-hero-subtitle {
	margin: 0 0 12px;
	font-size: 20px;
	line-height: 1.2;
	color: #34495e;
	text-align: center;
}

.bif-cemetery-hero-address,
.bif-cemetery-hero-gps {
	font-size: 17px;
	line-height: 1.35;
	color: #34495e;
	text-align: center;
}

.bif-cemetery-hero-gps > div + div {
	margin-top: 4px;
}

/* --- Cemetery Main Layout --- */
.bif-cemetery-main-wrap {
	background-color: #ECE1DC !important;
}

.bif-cemetery-main {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	align-items: start;
	margin: auto;
}

.bif-cemetery-main-col {
	min-width: 0;
}

.bif-cemetery-main-col-content {
	width: 100%;
	padding: 25px 25px 0;
	display: flex;
	flex-direction: column;
	gap: 25px;
	box-sizing: border-box;
}

.bif-cemetery-main-col-map {
	width: 100%;
	padding: 25px;
	display: block;
	height: auto !important;
	min-height: 0 !important;
	box-sizing: border-box;
}

/* Single cemetery map: always 50vh on desktop, tablet, and mobile */
.bif-cemetery-main-col-map .bif-cemetery-map-wrap,
.bif-cemetery-main-col-map .bif-cemetery-map,
.bif-cemetery-main-col-map iframe {
	width: 100% !important;
	height: 50vh !important;
	min-height: 50vh !important;
	max-height: 50vh !important;
	box-sizing: border-box;
}

.bif-cemetery-content {
	flex: 0 0 auto;
	margin-bottom: 25px;
}

.bif-cemetery-other {
	margin-top: auto;
	margin-bottom: 25px;
}

.bif-map-marker-label {
	position: absolute;
	transform: translateZ(0);
	padding: 4px 10px;
	background: rgba(129, 56, 17, 0.92);
	color: #fff;
	font: 600 14px/1.2 Merriweather, Georgia, serif;
	white-space: nowrap;
	border-radius: 4px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.25);
	pointer-events: none;
	z-index: 1000;
}

@media (max-width: 767px) {
	.bif-map-marker-label {
		font-size: 12px;
		padding: 3px 8px;
	}
}

/* --- Action Bar --- */
.bif-cemetery-action-bar {
	width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	background: #813811;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	/* grid-template-columns: 1fr 1.4fr 1fr; --- Use if the stacked links make that middle column look too crowded */
	align-items: start;
	padding-top: 30px;
	padding-bottom: 30px;
	padding-left: max(20px, calc((100vw - 1140px) / 2));
	padding-right: max(20px, calc((100vw - 1140px) / 2));
	box-sizing: border-box;
}

.bif-cemetery-action {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.bif-cemetery-action-icon-wrap {
	width: 85px;
	height: 85px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
}

.bif-cemetery-action-icon {
	display: block;
	max-width: 85px;
	max-height: 85px;
	width: auto;
	height: auto;
	transition: transform 0.25s ease;
	transform-origin: center center;
}

/* Remove hover zoom from all icons */
.bif-cemetery-action:hover .bif-cemetery-action-icon {
	transform: none;
}

/* Base label transition */
.bif-cemetery-action-label {
	transition: all 0.2s ease;
}

/* Hover effect for entire action */
.bif-cemetery-action-label,
.bif-cemetery-action:hover .bif-cemetery-action-label {
	font-weight: 700;
	text-decoration: underline;
}

.bif-cemetery-action-label-links a {
	transition: all 0.2s ease;
}

/* Hover effect */
.bif-cemetery-action:hover .bif-cemetery-action-label,
.bif-cemetery-action-label-links a:hover,
.bif-cemetery-action-label-links a:focus {
	font-weight: 700;
	text-decoration: underline;
	transform: scale(1.1);
}

.bif-cemetery-action-label {
	margin-top: 12px;
	text-align: center;
	line-height: 1.4;
	margin-left: auto;
	margin-right: auto;
}

.bif-cemetery-action,
.bif-cemetery-action a,
.bif-cemetery-action-label {
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: 16px;
	line-height: 1.3em;
	color: rgb(255, 216, 0) !important;
}

.bif-cemetery-action.is-disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* --- Action Bar: interment book download list --- */
.bif-cemetery-action-download-list {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-width: 0;
}

.bif-cemetery-action-download-list .bif-cemetery-action-label {
	margin-top: 12px;
	/* max-width: 320px; */
	width: 100%;
}

.bif-cemetery-action-label-links {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	text-align: center;
}

.bif-cemetery-book-download-link {
	display: block;
	text-decoration: none;
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: 16px;
	line-height: 1.35;
	color: rgb(255, 216, 0) !important;
}

.bif-cemetery-book-download-link:hover,
.bif-cemetery-book-download-link:focus {
	text-decoration: underline;
}

.bif-cemetery-action-download-list .bif-cemetery-action-icon-wrap {
	margin-bottom: 0;
}

.bif-cemetery-action-label,
.bif-cemetery-book-download-link {
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* --- Map info window --- */
.bif-map-infowin-actions {
	text-align: center;
}

.bif-map-infowin-actions a {
	font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: green;
}

.bif-map-infowin-thumb,
.bif-map-infowin-thumb img {
	text-align: center;
	margin: auto;
}

.bif-map-infowin-thumb {
	border: 1px solid #813811;
}

.bif-map-infowin-title {
	font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
	font-size: 14px;
	text-align: center;
}

.bif-map-infowin-title a {
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-weight: 600;
	font-size: 18px;
	color: #7c4b22;
}

/* --- Cemetery Gallery: single full-image slide --- */
.bif-cemetery-gallery,
.bif-cemetery-gallery-slider,
.bif-cemetery-gallery .swiper,
.bif-cemetery-gallery .slick-list,
.bif-cemetery-gallery .gallery-list {
	width: 100vw;
	max-width: 100%;
	margin: 0;
	padding: 0;
	overflow: hidden;
}

.bif-cemetery-gallery .swiper-slide,
.bif-cemetery-gallery .slick-slide,
.bif-cemetery-gallery .gallery-item,
.bif-cemetery-gallery figure {
	width: 100%;
	margin: 0;
	padding: 0;
}

/* --- Gallery images 16:9 --- */
/*
..bif-gallery-slide,
.bif-cemetery-gallery img,
.bif-cemetery-gallery .et_pb_image_wrap,
.bif-cemetery-gallery .swiper-slide,
.bif-cemetery-gallery .slick-slide {
	aspect-ratio: 16 / 9 !important;
	overflow: hidden;
}
*/

.bif-cemetery-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
}

/* --- Cemetery Gallery arrows --- */
.bif-cemetery-gallery .et-pb-arrow-prev,
.bif-cemetery-gallery .et-pb-arrow-next,
.bif-cemetery-gallery .swiper-button-prev,
.bif-cemetery-gallery .swiper-button-next,
.bif-cemetery-gallery .slick-prev,
.bif-cemetery-gallery .slick-next,
.bif-cemetery-gallery .gallery-arrow,
.bif-cemetery-gallery .bif-gallery-arrow,
.bif-cemetery-gallery .bif-slider-arrow,
.bif-cemetery-gallery button[aria-label*="Previous"],
.bif-cemetery-gallery button[aria-label*="Next"] {
	transform: scale(1) !important;
	transform-origin: center center;
}

.bif-cemetery-gallery .et-pb-arrow-prev:before,
.bif-cemetery-gallery .et-pb-arrow-next:before {
	font-size: 46px !important;
}

.bif-cemetery-gallery .swiper-button-prev,
.bif-cemetery-gallery .swiper-button-next,
.bif-cemetery-gallery .slick-prev,
.bif-cemetery-gallery .slick-next {
	width: 84px;
	height: 84px;
	border-radius: 999px;
}

.bif-cemetery-gallery .swiper-button-prev::after,
.bif-cemetery-gallery .swiper-button-next::after {
	font-size: 30px !important;
}

/* Gallery Lightbox */
.bif-gallery-lightbox {
	position: fixed !important;
	inset: 0 !important;
	z-index: 2147483647 !important;
	display: none;
}

.bif-gallery-lightbox.is-open {
	display: block !important;
}

.bif-gallery-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.88);
	z-index: 1;
}

.bif-gallery-lightbox-inner {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
	z-index: 2;
}

.bif-gallery-lightbox-image {
	display: block;
	max-width: 95vw;
	max-height: 90vh;
	width: auto;
	height: auto;
}

.bif-gallery-lightbox-close {
	position: fixed !important;
	top: 20px !important;
	right: 20px !important;
	z-index: 2147483647 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 999px;
	background: rgba(255,255,255,0.96);
	color: #000;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* --- Responsive --- */
@media (max-width: 1180px) {
	.bif-result-card {
		grid-template-columns: 1fr 1.6fr 1.2fr;
		width: 95%;
	}

	.bif-result-col .bif-result-col-interment {
		border-bottom: 1px solid #d8c8bb;
	}

	.bif-result-col-scan {
		grid-column: 1 / -1;
		border-left: 0 !important;
		border-top: 1px solid #7c4b22;
	}

	.bif-register-thumb-link {
		flex-shrink: 0;
		display: block;
		margin-top: 0 !important;
	}

	.bif-register-thumb {
		display: block;
		width: 100px;
		height: auto;
		border: 1px solid #b7793b;
	}
}

@media (max-width: 1024px) {
	.bif-result-card {
		grid-template-columns: 1fr 1fr;
		width: 95%;
	}

	.bif-result-col:nth-child(3) {
		border-left: none;
		border-top: 1px solid #d8c8bb;
	}

	.bif-result-col:nth-child(4) {
		border-top: 1px solid #d8c8bb;
	}

	.bif-result-col .bif-result-col-interment {
		border-bottom: 1px solid #d8c8bb;
	}
	
	.bif-cemetery-action-icon-wrap {
		width: 70px;
		height: 70px;
	}

	.bif-cemetery-action-icon {
		max-width: 70px;
		max-height: 70px;
	}

	.bif-cemetery-action,
	.bif-cemetery-action a,
	.bif-cemetery-action-label,
	.bif-cemetery-book-download-link {
		font-size: 14px;
	}
}

/* Keep search result cards as 4 columns on desktop + tablet */
@media (min-width: 641px) {
	.bif-result-card {
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
		width: 100% !important;
	}

	.bif-result-col {
		grid-column: auto !important;
		border-top: 0 !important;
	}

	.bif-result-col + .bif-result-col {
		border-left: 1px solid #d8c8bb !important;
	}

	.bif-result-col-scan {
		grid-column: auto !important;
		border-top: 0 !important;
		border-left: 1px solid #d8c8bb !important;
	}
}

/* Mobile only: fully stacked */
@media (max-width: 640px) {
	.bif-result-card {
		grid-template-columns: 1fr !important;
		width: 100% !important;
	}

	.bif-result-col {
		grid-column: auto !important;
		border-left: 0 !important;
		border-top: 1px solid #d8c8bb !important;
	}

	.bif-result-col:first-child {
		border-top: 0 !important;
	}
}

@media (max-width: 980px) {
	.bif-cemetery-hero {
		min-height: 0;
	}

	.bif-cemetery-hero-overlay,
	.bif-cemetery-profile--overlay .bif-cemetery-hero-overlay {
		width: min(320px, 86%);
		padding: 18px 20px;
		background: rgba(255, 255, 255, 0.92);
		text-align: center;
	}

	.bif-cemetery-hero-title {
		margin-bottom: 8px;
		font-size: 32px;
		line-height: 1.1;
		word-break: break-word;
		text-align: center;
	}

	.bif-cemetery-hero-subtitle {
		margin-bottom: 10px;
		font-size: 17px;
		line-height: 1.2;
		text-align: center;
	}

	.bif-cemetery-hero-address,
	.bif-cemetery-hero-gps {
		font-size: 15px;
		line-height: 1.35;
		text-align: center;
	}

	.bif-cemetery-hero-gps {
		margin-top: 10px;
	}

	.bif-cemetery-gallery img,
	.bif-cemetery-gallery .swiper-slide img,
	.bif-cemetery-gallery .slick-slide img,
	.bif-cemetery-gallery .gallery-item img {
		width: 100vw;
		min-height: 260px;
	}

	.bif-cemetery-gallery .et-pb-arrow-prev,
	.bif-cemetery-gallery .et-pb-arrow-next,
	.bif-cemetery-gallery .swiper-button-prev,
	.bif-cemetery-gallery .swiper-button-next,
	.bif-cemetery-gallery .slick-prev,
	.bif-cemetery-gallery .slick-next,
	.bif-cemetery-gallery .gallery-arrow,
	.bif-cemetery-gallery .bif-gallery-arrow,
	.bif-cemetery-gallery .bif-slider-arrow,
	.bif-cemetery-gallery button[aria-label*="Previous"],
	.bif-cemetery-gallery button[aria-label*="Next"] {
		transform: scale(0.7) !important;
	}

	.bif-cemetery-gallery .et-pb-arrow-prev:before,
	.bif-cemetery-gallery .et-pb-arrow-next:before {
		font-size: 34px !important;
	}

	.bif-cemetery-gallery .swiper-button-prev::after,
	.bif-cemetery-gallery .swiper-button-next::after {
		font-size: 22px !important;
	}
}

/* --- Mobile/tablet: stack cemetery content and map --- */
@media (max-width: 900px) {
	.bif-cemetery-main {
		grid-template-columns: 1fr;
		align-items: start;
	}

	.bif-cemetery-main-col,
	.bif-cemetery-main-col-content,
	.bif-cemetery-main-col-map {
		display: block;
		height: auto !important;
	}
	
	.bif-cemetery-main-col-map {
		padding: 0;
	}
}

@media (max-width: 767px) {
	.bif-cemetery-gallery .et-pb-arrow-prev,
	.bif-cemetery-gallery .et-pb-arrow-next,
	.bif-cemetery-gallery .swiper-button-prev,
	.bif-cemetery-gallery .swiper-button-next,
	.bif-cemetery-gallery .slick-prev,
	.bif-cemetery-gallery .slick-next,
	.bif-cemetery-gallery .gallery-arrow,
	.bif-cemetery-gallery .bif-gallery-arrow,
	.bif-cemetery-gallery .bif-slider-arrow,
	.bif-cemetery-gallery button[aria-label*="Previous"],
	.bif-cemetery-gallery button[aria-label*="Next"] {
		transform: scale(0.5) !important;
	}

	.bif-cemetery-gallery .et-pb-arrow-prev:before,
	.bif-cemetery-gallery .et-pb-arrow-next:before {
		font-size: 26px !important;
	}

	.bif-cemetery-gallery .swiper-button-prev::after,
	.bif-cemetery-gallery .swiper-button-next::after {
		font-size: 18px !important;
	}

	.bif-interment-search .bif-interment-search-form {
		padding: 16px;
	}
	
	.bif-interment-search .bif-row,
	.bif-interment-search .bif-row:nth-of-type(1),
	.bif-interment-search .bif-row:nth-of-type(2),
	.bif-interment-search .bif-row:nth-of-type(3),
	.bif-interment-search .bif-row:nth-of-type(4) {
		grid-template-columns: 1fr;
	}

	.bif-interment-search .bif-row:nth-of-type(1) .bif-search-help,
	.bif-interment-search .bif-row:nth-of-type(1) select,
	.bif-interment-search .bif-row:nth-of-type(2) input,
	.bif-interment-search .bif-row:nth-of-type(2) select {
		grid-column: auto;
		width: 100%;
		min-width: 0;
	}

	.bif-interment-search input[type="text"],
	.bif-interment-search input[type="search"],
	.bif-interment-search select,
	.bif-interment-search button.button,
	.bif-interment-search .button[type="submit"] {
		height: 44px;
	}
	
	.bif-cemetery-action-bar {
		padding-top: 20px;
		padding-bottom: 20px;
	}

	.bif-cemetery-action-icon-wrap {
		width: 55px;
		height: 55px;
	}

	.bif-cemetery-action-icon {
		max-width: 55px;
		max-height: 55px;
	}

	.bif-cemetery-action,
	.bif-cemetery-action a,
	.bif-cemetery-action-label,
	.bif-cemetery-book-download-link {
		font-size: 13px;
		line-height: 1.25;
	}

	.bif-cemetery-action-label {
		margin-top: 8px;
	}
}

@media (max-width: 640px) {
	.bif-interment-results {
		padding-left: 10px;
		padding-right: 10px;
	}

	.bif-result-card {
		grid-template-columns: 1fr;
		width: 100%;
		margin: 0;
	}

	.bif-result-col + .bif-result-col {
		border-left: none;
		border-top: 1px solid #d8c8bb;
	}

	.bif-result-name {
		margin-bottom: 24px;
	}

	.bif-result-col-scan {
		flex-wrap: wrap;
		gap: 12px;
	}

	.bif-result-col-scan .bif-result-subtitle,
	.bif-result-col-scan .bif-scan-help {
		flex: 1 1 100%;
	}

	.bif-result-col-scan .bif-register-thumb-link {
		flex: 0 0 auto;
		margin-top: 0 !important;
	}

	.bif-result-col-scan .bif-scan-help {
		margin-top: 0;
	}
}

@media (max-width: 480px) {
	.bif-cemetery-hero-overlay,
	.bif-cemetery-profile--overlay .bif-cemetery-hero-overlay {
		/* width: 84%; */
		padding: 14px 14px 12px;
	}

	.bif-cemetery-hero-title {
		font-size: 24px;
		line-height: 1.12;
	}

	.bif-cemetery-hero-subtitle {
		font-size: 14px;
	}

	.bif-cemetery-hero-address,
	.bif-cemetery-hero-gps {
		font-size: 13px;
		line-height: 1.3;
	}
	
	.bif-cemetery-action-icon-wrap {
		width: 35px;
		height: 35px;
	}

	.bif-cemetery-action-icon {
		max-width: 35px;
		max-height: 35px;
	}

	.bif-cemetery-action,
	.bif-cemetery-action a,
	.bif-cemetery-action-label,
	.bif-cemetery-book-download-link {
		font-size: 12px;
	}

	.bif-cemetery-action-label {
		margin-top: 6px;
	}
}

/* --- Downloads table --- */
.bif-downloads .bif-icon-cell { text-align:center; }
.bif-downloads a.bif-dl { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; text-decoration:none; }
.bif-downloads a.bif-dl .dashicons { font-size:22px; width:22px; height:22px; line-height:22px; }
.bif-downloads td.bif-book-cell { text-align:left; }
.bif-book-list { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:6px; }
.bif-book-list a.bif-book-link { display:inline-flex; align-items:center; gap:8px; text-decoration:none; }
.bif-book-list a.bif-book-link .dashicons { font-size:18px; width:18px; height:18px; line-height:18px; }

/* --- Directions modal + map labels --- */
.bif-directions-modal[hidden]{display:none !important;}
.bif-directions-modal{position:fixed;inset:0;z-index:1000000;display:flex;align-items:center;justify-content:center;padding:16px;}
.bif-directions-modal__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.6);z-index:0;}
.bif-directions-modal__dialog{position:relative;z-index:1;width:min(920px,calc(100vw - 32px));max-height:calc(100vh - 32px);overflow:auto;background:#fff;border-radius:16px;padding:24px;box-shadow:0 20px 60px rgba(0,0,0,.3);}
.bif-directions-modal__close{position:absolute;top:12px;right:12px;width:42px;height:42px;border:0;border-radius:999px;background:#fff;font-size:30px;line-height:1;cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,.18);}
.bif-directions-modal__title{margin:0 48px 16px 0;}
.bif-directions-row-modal{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px;}
.bif-directions-row-modal input{flex:1 1 280px;min-width:220px;}
.bif-directions-modal__actions{margin:0 0 10px;}
.bif-directions-help{display:block;margin-bottom:14px;}
.bif-directions-status{margin:0 0 12px;font-size:14px;font-weight:700;color:#813811;}
.bif-directions-steps-modal{max-height:50vh;overflow:auto;}
/* body.bif-directions-modal-open{overflow:hidden;} */
.bif-cemetery-action-directions{cursor:pointer;}

/* --- Gallery slider --- */
.bif-gallery-slider { position: relative; margin: 0; }
.bif-gallery-slider .bif-gallery-stage { position: relative; width: 100%; overflow: hidden; }
.bif-gallery-slider .bif-gallery-slide { display: none; width: 100%; }
.bif-gallery-slider .bif-gallery-slide.is-active { display: block; }
.bif-gallery-slider .bif-gallery-slide a { display: block; text-decoration: none; }
.bif-gallery-slider .bif-gallery-slide img { display: block; width: 100%; height: auto; min-height: 420px; object-fit: cover; object-position: center center; cursor: pointer; aspect-ratio: 16 / 9; }
.bif-gallery-slider .bif-gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 48px; height: 48px; border: 0; border-radius: 999px; background: rgba(255,255,255,0.92); color: #000; font-size: 28px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
.bif-gallery-slider .bif-gallery-prev { left: 20px; }
.bif-gallery-slider .bif-gallery-next { right: 20px; }
.bif-gallery-lightbox { position: fixed !important; inset: 0 !important; z-index: 2147483647 !important; display: none; }
.bif-gallery-lightbox.is-open { display: block !important; }
.bif-gallery-lightbox .bif-gallery-lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.88); z-index: 1; }
.bif-gallery-lightbox .bif-gallery-lightbox-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 30px; z-index: 2; }
.bif-gallery-lightbox .bif-gallery-lightbox-image { display: block; max-width: 95vw; max-height: 90vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }
.bif-gallery-lightbox .bif-gallery-lightbox-close { position: fixed !important; top: 20px !important; right: 20px !important; z-index: 2147483647 !important; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 0; border-radius: 999px; background: rgba(255,255,255,0.96); color: #000; font-size: 32px; line-height: 1; cursor: pointer; padding: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

/* --- Shared lightbox --- */
.bif-lightbox-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.72);z-index:2147483647 !important;display:none;align-items:center;justify-content:center;padding:16px;}
.bif-lightbox-backdrop.is-open{display:flex;}
.bif-lightbox-modal{position:relative;width:95vw;max-width:95vw;height:95vh;max-height:95vh;background:#111;border-radius:12px;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,.5);display:flex;flex-direction:column;}
.bif-lightbox-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#0b0b0b;border-bottom:1px solid rgba(255,255,255,.08);flex:0 0 auto;}
.bif-lightbox-title{color:#fff;font-size:14px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto;}
.bif-lightbox-toolbar-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto;}
.bif-lightbox-fullscreen,.bif-lightbox-close{appearance:none;border:1px solid rgba(255,255,255,.18);background:transparent;color:#fff;font-size:14px;line-height:1;cursor:pointer;padding:8px 10px;border-radius:6px;}
.bif-lightbox-close{font-size:22px;padding:4px 10px;}
.bif-lightbox-body{background:#000;display:flex;align-items:center;justify-content:center;min-height:0;flex:1 1 auto;overflow:hidden;}
.bif-lightbox-body img{max-width:100%;max-height:100%;display:block;}
.bif-lightbox-body iframe{width:100%;height:100%;border:0;background:#fff;display:block;}
.bif-lightbox-actions{padding:10px 12px;background:#0b0b0b;border-top:1px solid rgba(255,255,255,.08);text-align:right;flex:0 0 auto;}
.bif-lightbox-actions a{color:#fff;text-decoration:underline;}
.bif-lightbox-backdrop.is-fullscreen{padding:0;}
.bif-lightbox-backdrop.is-fullscreen .bif-lightbox-modal{width:100vw;max-width:100vw;height:100vh;max-height:100vh;border-radius:0;}

/* --- Admin shared forms --- */
.bif-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.bif-field label{display:block;font-weight:600;margin-bottom:4px;}
.bif-field input[type=text], .bif-field input[type=number], .bif-field select, .bif-field textarea{width:100%;max-width:100%;}
.bif-wide{grid-column:1/-1;}
.bif-media-row{display:flex;gap:12px;align-items:flex-start;}
.bif-media-preview img{max-width:120px;height:auto;display:block;border:1px solid #ddd;padding:2px;background:#fff;}
.bif-media-actions{display:flex;flex-direction:column;gap:8px;}
.bif-admin-flex-list{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start;}
.bif-admin-card-thumb{border:1px solid #ddd;padding:6px;display:flex;flex-direction:column;gap:6px;align-items:flex-start;}
.bif-admin-card-thumb.is-center{align-items:center;}
.bif-admin-card-thumb img.bif-admin-gallery-thumb{width:120px;height:auto;display:block;}
.bif-admin-card-thumb img.bif-admin-book-thumb{width:100px;height:auto;display:block;}
.bif-admin-note-top{margin-top:6px;}
.bif-admin-button-row{margin-top:10px;}
.bif-admin-progress{width:100%;height:18px;}
.bif-admin-input-sm{width:90px !important;}
.bif-admin-input-md{width:120px !important;}
.bif-admin-list-indent{margin-left:18px;}
.bif-admin-no-margin{margin:0;}
.bif-admin-progress-track{background:#e5e5e5;height:12px;border-radius:999px;overflow:hidden;margin:10px 0 0;}
.bif-admin-progress-bar{background:#2271b1;height:12px;}
.bif-admin-top-gap{margin-top:16px;}
.bif-admin-form-top-gap{margin-top:10px;}

/* --- Shortcode generator admin --- */
.bif-scgen { max-width: 980px; background: #fff; border: 1px solid #dcdcde; border-radius: 10px; padding: 16px; margin: 14px 0 18px; }
.bif-scgen h2 { margin-top: 0; }
.bif-scgen .bif-scgen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 10px; }
.bif-scgen .bif-scgen-row { display: flex; flex-direction: column; gap: 6px; }
.bif-scgen label { font-weight: 600; }
.bif-scgen .bif-scgen-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.bif-scgen .bif-scgen-out { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 13px; }
.bif-scgen .bif-scgen-note { color: #646970; margin-top: 10px; }
.bif-scgen .bif-scgen-tabs { display:flex; gap:8px; flex-wrap:wrap; margin: 8px 0 0; }
.bif-scgen .bif-scgen-tab { border: 1px solid #dcdcde; background: #f6f7f7; padding: 6px 10px; border-radius: 999px; cursor: pointer; user-select: none; }
.bif-scgen .bif-scgen-tab.is-active { background: #2271b1; border-color: #2271b1; color: #fff; }
.bif-scgen .bif-scgen-panel { display:none; }
.bif-scgen .bif-scgen-panel.is-active { display:block; }

@media (max-width: 900px) {
	.bif-scgen .bif-scgen-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
	.bif-directions-modal{align-items:flex-end;}
	.bif-directions-modal__dialog{width:min(100vw - 16px,920px);max-height:calc(100vh - 16px);padding:18px;border-radius:16px 16px 0 0;}
	.bif-directions-row-modal{flex-direction:column;align-items:stretch;}
	.bif-directions-row-modal input,.bif-directions-row-modal select,.bif-directions-row-modal button,.bif-directions-google-link{width:100%;}
	.bif-directions-steps-modal{max-height:none;}
	.bif-map-marker-label{font-size:12px;padding:3px 8px;}
	.bif-gallery-slider .bif-gallery-slide img { height: 80vh; width:auto; overflow: hidden; aspect-ratio: 1 /1 !important;}
	.bif-gallery-slider .bif-gallery-prev { left: 10px; }
	.bif-gallery-slider .bif-gallery-next { right: 10px; }
	.bif-lightbox-backdrop{padding:8px;}
	.bif-lightbox-modal{width:95vw;max-width:95vw;height:95vh;max-height:95vh;border-radius:10px;}
	.bif-lightbox-title{font-size:13px;}
	.bif-lightbox-fullscreen{padding:7px 9px;font-size:13px;}
	.bif-grid { grid-template-columns: 1fr; }
}

/* Stack download links */
.bif-interment-book-list.bif-flex-list {
	display: block;
}

.bif-interment-book-list a {
	display: block;
	margin-bottom: 8px;
}

/* Stack flipbook links */
.bif-cemetery-flipbook-links a {
	display: block;
	margin-bottom: 8px;
}

/* Unified refactor helpers */
.bif-inline-label-gap{margin-right:8px;}
.bif-inline-label-gap-lg{margin-right:10px;}
.bif-inline-block-gap{display:inline-block;margin-right:12px;}
.bif-no-margin{margin:0;}
.bif-top-gap-xs{margin-top:6px;}
.bif-top-gap-sm{margin-top:8px;}
.bif-top-gap{margin-top:10px;}
.bif-bottom-gap{margin:0 0 10px;}
.bif-description-top-gap{margin-top:10px;}
.bif-width-full{width:100%;}
.bif-status-gap{margin-left:10px;}
.bif-list-indent{margin-left:18px;}
.bif-form-block-spaced{margin:10px 0 12px;}
.bif-form-block-top{margin:10px 0 0;}
.bif-progress-wrap{max-width:520px;margin:10px 0 6px;}
.bif-progress-bar{width:100%;height:18px;}
.bif-progress-text{margin-top:6px;}
.bif-controls-row{margin:10px 0 6px;}
.bif-input-narrow{width:90px;}
.bif-input-medium{width:120px;}
.bif-input-legacy-id{width:220px;}
.bif-button-disabled{opacity:.5;cursor:not-allowed;}
.bif-button-static{pointer-events:none;}
.bif-is-hidden{display:none!important;}
.bif-feature-thumb{max-width:140px;height:auto;display:block;}
.bif-flex-list,.bif-media-list {display:flex;flex-wrap:wrap;gap:10px;text-align: center;justify-content: center;}
.bif-media-item--centered{display:inline-block;text-align:center;}
.bif-media-label--stacked{display:block;margin:4px auto 0;}
.bif-media-thumb--book{width:100px;height:auto;vertical-align:middle;}
.bif-flex-wrap-top{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;}
.bif-register-scan-preview-box{width:160px;min-height:90px;border:1px solid #dcdcde;border-radius:6px;display:flex;align-items:center;justify-content:center;background:#fff;overflow:hidden;}
.bif-register-scan-preview-img{max-width:160px;height:auto;display:block;}
.bif-register-scan-empty-text{font-size:12px;color:#6b7280;padding:8px;text-align:center;}
.bif-flex-fill-min{flex:1;min-width:260px;}
.bif-inline-actions{margin-top:8px;display:flex;gap:8px;align-items:center;}
.bif-helper-text{display:block;margin-top:6px;opacity:.8;}
.bif-preview-image-large{max-width:420px;height:auto;border:1px solid #ddd;padding:4px;}
.bif-register-preview-image{max-width:120px;height:auto;display:block;}
.bif-register-preview-icon{max-width:32px;height:auto;vertical-align:middle;}
.bif-custom-css-field{width:100%;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace;}
.bif-tax-media-preview-image{max-width:150px;height:auto;}
.bif-media-card{border:1px solid #ddd;padding:6px;display:flex;flex-direction:column;gap:6px;align-items:flex-start;}
.bif-media-card--center{align-items:center;}
.bif-gallery-thumb{width:120px;height:auto;display:block;}
.bif-book-thumb{width:100px;height:auto;display:block;}
.bif-cemetery-map[data-width],.bif-cemeteries-map[data-width]{width:100%;}
.bif-cemetery-map[data-height],.bif-cemeteries-map[data-height]{height:50vh;min-height:50vh;}

.bif-flex-options{display:flex;gap:14px;flex-wrap:wrap;}
.bif-option-label{font-weight:400;display:inline-flex;gap:6px;align-items:center;}
.bif-flex-row-gap{display:flex;gap:10px;}
.bif-admin-rule{max-width:980px;margin:18px 0;}
.bif-admin-table{max-width:980px;}
.bif-admin-col-shortcode{width:340px;}
.bif-admin-note{max-width:980px;margin-top:12px;}
.bif-index-card{max-width:780px;padding:16px 20px;}
.bif-index-progress{background:#e5e5e5;height:12px;border-radius:999px;overflow:hidden;margin:10px 0 0;}
.bif-index-progress-bar{background:#2271b1;height:12px;width:0;}
.bif-index-top-gap{margin-top:16px;}


	.bif-tools-section {
		background: #fff;
		border: 1px solid #ccd0d4;
		border-radius: 4px;
		padding: 18px 20px 20px;
		margin: 20px 0;
		box-shadow: 0 1px 1px rgba(0,0,0,.04);
	}

	.bif-tools-section h2,
	.bif-tools-section h3 {
		margin-top: 0;
	}

	.bif-tools-section-danger {
		border-left: 4px solid #d63638;
	}
/* --- Interment book popup / speech-bubble menus --- */
.bif-book-menu {
	position: relative;
	display: inline-block;
	text-align: center;
	line-height: 1.3;
	z-index: 5;
}

.bif-book-menu.is-open {
	z-index: 9999;
}

.bif-book-menu-trigger {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: inherit;
	font-weight: 700;
	line-height: 1.3;
	color: rgb(255, 216, 0) !important;
	text-align: center;
	text-decoration: none;
	transition:
		color 0.2s ease,
		transform 0.2s ease;
	transform-origin: center center;
}

a .bif-cemetery-directions-link, .bif-cemetery-directions-link {
	display: inline-block;
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: inherit;
	font-weight: 700;
	line-height: 1.3;
	color: rgb(255, 216, 0) !important;
	text-align: center;
	text-decoration: none;
	transition:
		color 0.2s ease,
		transform 0.2s ease;
	transform-origin: center center;
}

a .bif-cemetery-directions-link, .bif-cemetery-directions-link:hover,
a .bif-cemetery-directions-link, .bif-cemetery-directions-link:focus,
.bif-book-menu-trigger:hover,
.bif-book-menu-trigger:focus {
	color: #fff !important;
	text-decoration: none;
	transform: scale(1.1);
}

.bif-book-menu-panel {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 16px);
	transform: translateX(-50%);
	display: none;
	width: max-content;
	min-width: 260px;
	max-width: min(340px, calc(100vw - 32px));
	padding: 8px;
	background: #ece1dc;
	border: 1px solid rgba(255,255,255,0.75);
	box-shadow: 0 4px 14px rgba(0,0,0,0.28);
	box-sizing: border-box;
}

.bif-book-menu.is-open .bif-book-menu-panel {
	display: block;
}

.bif-book-menu-panel::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -14px;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 14px solid transparent;
	border-right: 14px solid transparent;
	border-top: 14px solid #ece1dc;
}

.bif-book-menu-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bif-book-menu-list a,
.bif-book-menu-item {
	display: block;
	padding: 7px 14px;
	background: #813811;
	border: 1px solid rgba(255,255,255,0.45);
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.25;
	color: rgb(255, 216, 0) !important;
	text-align: center;
	text-decoration: none !important;
	white-space: nowrap;
	box-sizing: border-box;
}

.bif-book-menu-list a:hover,
.bif-book-menu-list a:focus,
.bif-book-menu-item:hover,
.bif-book-menu-item:focus {
	text-decoration: underline !important;
}

.bif-cemetery-action .bif-book-menu {
	margin-top: 12px;
}

.bif-cemetery-action .bif-book-menu-trigger {
	font-size: 16px;
}

/* Individual shortcode use outside the brown action bar */
.bif-cemetery-flipbook-links.bif-book-menu,
.bif-interment-book-list.bif-book-menu {
	margin: 0;
}

.bif-cemetery-flipbook-links.bif-book-menu .bif-book-menu-trigger,
.bif-interment-book-list.bif-book-menu .bif-book-menu-trigger {
	color: #ffd800;
}

.bif-cemetery-flipbook-links.bif-book-menu .bif-book-menu-panel,
.bif-interment-book-list.bif-book-menu .bif-book-menu-panel {
	bottom: auto;
	top: calc(100% + 16px);
}

.bif-cemetery-flipbook-links.bif-book-menu .bif-book-menu-panel::after,
.bif-interment-book-list.bif-book-menu .bif-book-menu-panel::after {
	top: -14px;
	bottom: auto;
	border-top: 0;
	border-bottom: 14px solid #ece1dc;
}

@media (max-width: 1024px) {
	.bif-cemetery-action .bif-book-menu-trigger,
	.bif-book-menu-list a,
	.bif-book-menu-item {
		font-size: 14px;
	}
}

@media (max-width: 767px) {
	.bif-cemetery-action .bif-book-menu {
		margin-top: 8px;
	}

	.bif-cemetery-action .bif-book-menu-trigger,
	.bif-book-menu-list a,
	.bif-book-menu-item {
		font-size: 13px;
	}

	.bif-book-menu-panel,
	.bif-cemetery-flipbook-links.bif-book-menu .bif-book-menu-panel,
	.bif-interment-book-list.bif-book-menu .bif-book-menu-panel {
		position: fixed;
		left: 50%;
		top: 50%;
		bottom: auto;
		transform: translate(-50%, -50%);
		min-width: 240px;
		max-width: calc(100vw - 32px);
		z-index: 2147483647;
	}

	.bif-book-menu-panel::after,
	.bif-cemetery-flipbook-links.bif-book-menu .bif-book-menu-panel::after,
	.bif-interment-book-list.bif-book-menu .bif-book-menu-panel::after {
		display: none;
	}
}

/* --- BIF interment book popup: fixed-position overlay to escape Divi stacking/overflow --- */
.bif-book-menu-panel.is-floating {
	position: fixed !important;
	display: block !important;
	z-index: 2147483647 !important;
	bottom: auto !important;
	right: auto !important;
	transform: none !important;
}

.bif-book-menu-panel.is-floating::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	bottom: auto !important;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 14px solid transparent;
	border-right: 14px solid transparent;
	border-top: 14px solid #ece1dc;
	border-bottom: 0 !important;
}

.bif-book-menu-panel.is-floating .bif-book-menu-list a,
.bif-book-menu-panel.is-floating .bif-book-menu-item,
.bif-book-menu-panel.is-floating .kwfb-open-trigger,
.bif-book-menu-panel.is-floating .kwfb-open-link,
.bif-book-menu-panel.is-floating a,
.bif-book-menu-panel.is-floating a:visited {
	color: #ffd800 !important;
}

.bif-book-menu-panel.is-floating .bif-book-menu-list a:hover,
.bif-book-menu-panel.is-floating .bif-book-menu-list a:focus,
.bif-book-menu-panel.is-floating .bif-book-menu-item:hover,
.bif-book-menu-panel.is-floating .bif-book-menu-item:focus,
.bif-book-menu-panel.is-floating .kwfb-open-trigger:hover,
.bif-book-menu-panel.is-floating .kwfb-open-trigger:focus,
.bif-book-menu-panel.is-floating .kwfb-open-link:hover,
.bif-book-menu-panel.is-floating .kwfb-open-link:focus {
	color: #fff !important;
	text-decoration: underline !important;
}

@media (max-width: 767px) {
	.bif-book-menu-panel.is-floating,
	.bif-book-menu-panel.is-floating.is-mobile-floating {
		left: 50% !important;
		top: 50% !important;
		transform: translate(-50%, -50%) !important;
		min-width: 240px;
		max-width: calc(100vw - 32px);
	}

	.bif-book-menu-panel.is-floating::after,
	.bif-book-menu-panel.is-floating.is-mobile-floating::after {
		display: none !important;
	}
}

.bif-result-meta, 
.bif-result-confidence, 
.bif-scan-help,
.bif-result-name, 
.bif-result-subtitle,
.bif-result-col-scan .bif-scan-help {
text-align: left !important;
}

/* --- Cluster map cemetery descriptor panel --- */

.bif-cemeteries-map-wrap .gm-style .gm-style-iw-c {
	width: 364px !important;
	max-width: 364px !important;
	padding: 0 !important;
	border: 1px solid #813811;
	border-radius: 0;
	box-shadow: 0 2px 6px rgba(0,0,0,.28);
	box-sizing: border-box;
	overflow: visible !important;
}

.bif-cemeteries-map-wrap .gm-style .gm-style-iw-d {
	width: 362px !important;
	max-width: 362px !important;
	height: auto !important;
	max-height: none !important;
	overflow: hidden !important;
}

/* --- Remove Google's default white header strip --- */

.bif-cemeteries-map-wrap .gm-style .gm-style-iw-chr {
	position: absolute !important;
	top: 0 !important;
	right: 0 !important;
	width: 0 !important;
	height: 0 !important;
	overflow: visible !important;
	z-index: 20 !important;
}

.bif-cemeteries-map-wrap .gm-style .gm-style-iw-ch {
	display: none !important;
}

/* --- Google close button --- */

.bif-cemeteries-map-wrap .gm-style .gm-ui-hover-effect {
	display: block !important;
	position: absolute !important;
	top: 0 !important;
	right: 0 !important;
	width: 28px !important;
	height: 28px !important;
	margin: 0 !important;
	padding: 0 !important;
	z-index: 30 !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	opacity: 1 !important;
}

.bif-cemeteries-map-wrap .gm-style .gm-ui-hover-effect span {
	width: 20px !important;
	height: 20px !important;
	margin: 4px !important;
	background-color: #813811 !important;
}

/* --- Hide old custom close button --- */

.bif-cemeteries-map-wrap .bif-map-infowin-close {
	display: none !important;
}

/* --- Main panel --- */

.bif-cemeteries-map-wrap .bif-map-infowin--cluster {
	position: relative;
	width: 362px;
	height: auto;
	min-height: 0;
	background: #fff;
	box-sizing: border-box;
	padding: 10px 10px 0;
	text-align: center;
	overflow: hidden;
}

/* --- Featured image --- */

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-thumb {
	width: 340px;
	height: 255px;
	margin: 15px auto 6px;
	overflow: hidden;
	text-align: center;
}

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-thumb img,
.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-feature-thumb {
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center center;
	margin: 0 auto;
}

/* --- Title --- */

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-title {
	margin: 0;
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-title a {
	font-family: Merriweather, Georgia, "Times New Roman", serif;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
	color: #813811 !important;
	text-decoration: none;
}

/* --- Address --- */

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-address {
	margin: 1px 0 8px;
	font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.25;
	color: #495254;
	text-align: center;
}

/* --- Coordinates --- */

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-coords {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 0 0 8px;
	font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.2;
	color: #495254;
	white-space: nowrap;
	flex-wrap: nowrap;
}

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-coords strong {
	color: #813811;
	font-weight: 700;
}

/* --- Button wrapper --- */

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-actions {
	position: relative;
	left: auto;
	right: auto;
	bottom: auto;
	margin: 0 -10px;
	text-align: center;
}

/* --- Button --- */

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-actions a {
	display: block;
	width: 100%;
	padding: 5px 10px 6px;
	box-sizing: border-box;
	background: #813811;
	font-family: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff !important;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color .2s ease;
}

.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-actions a:hover,
.bif-cemeteries-map-wrap .bif-map-infowin--cluster .bif-map-infowin-actions a:focus {
	background: #036632;
	color: #fff !important;
}

/* --- Google Maps pointer triangle --- */

.bif-cemeteries-map-wrap .gm-style .gm-style-iw-tc {
	width: 35px !important;
	height: 25px !important;
	filter: drop-shadow(0 4px 2px rgba(0,0,0,.18));
}

.bif-cemeteries-map-wrap .gm-style .gm-style-iw-tc::after {
	width: 35px !important;
	height: 25px !important;
	background: #813811 !important;

	-webkit-clip-path: polygon(0 0, 50% 100%, 100% 0);
	clip-path: polygon(0 0, 50% 100%, 100% 0);

	top: 0 !important;
	left: 0 !important;
}
/* -------------------------------------------------------------------------
   Mobile fix: stack Register Page content inside interment/result cards
   ------------------------------------------------------------------------- */
.bif-result-card,
.bif-result-card * {
	box-sizing: border-box;
}

.bif-result-col-scan {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	min-width: 0 !important;
	max-width: 100% !important;
	overflow: hidden;
}

.bif-result-col-scan .bif-result-subtitle,
.bif-result-col-scan .bif-scan-help,
.bif-result-col-scan .bif-register-thumb-link {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	flex: 0 0 auto !important;
	white-space: normal !important;
}

.bif-result-col-scan .bif-register-thumb-link {
	margin-top: 5px !important;
}

.bif-result-col-scan .bif-register-thumb {
	display: block !important;
	max-width: 125px !important;
	height: auto !important;
}

@media (max-width: 640px) {
	.bif-search-results-list,
	.bif-interment-results,
	.bif-result-card,
	.bif-result-col,
	.bif-result-col-scan {
		max-width: 100% !important;
		overflow-x: hidden !important;
	}

	.bif-result-card {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) !important;
		width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.bif-result-col {
		width: 100% !important;
		min-width: 0 !important;
		grid-column: 1 / -1 !important;
		border-left: 0 !important;
		border-top: 1px solid #d8c8bb !important;
	}

	.bif-result-col:first-child {
		border-top: 0 !important;
	}

	.bif-result-col-scan {
		gap: 8px !important;
	}

	.bif-result-col-scan .bif-result-subtitle,
	.bif-result-col-scan .bif-scan-help,
	.bif-result-col-scan .bif-register-thumb-link {
		flex-basis: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
}
