/**
 * Bayscape Plants Gallery – front-end styles
 */

/* Wrapper */
.bpg-gallery-wrap {
	--bpg-gap: 1.5rem;
	--bpg-radius: 8px;
	--bpg-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	--bpg-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 var(--bpg-gap);
}

/* Utility: hide section */
.bpg-hidden {
	display: none !important;
}

/* ----- Section 1: Light options (3 cards) ----- */
.bpg-light-options {
	margin-bottom: 2rem;
}

.bpg-light-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--bpg-gap);
}

@media (max-width: 900px) {
	.bpg-light-cards {
		grid-template-columns: 1fr;
	}
}

.bpg-light-card {
	box-shadow: var(--bpg-shadow);
	overflow: hidden;
	transition: all 0.2s ease;
	padding: 1.2em;
}

.bpg-light-card.low-light-card {
	background: #375E1E;
	background: linear-gradient(90deg,rgba(55, 94, 30, 1) 0%, rgba(38, 192, 0, 1) 100%);	
}

.bpg-light-card.medium-light-card {
	background: #26C000;
	background: linear-gradient(90deg,rgba(38, 192, 0, 1) 0%, rgba(169, 155, 46, 1) 100%);
}

.bpg-light-card.high-light-card {
	background: #A99B00;
	background: linear-gradient(90deg,rgba(169, 155, 0, 1) 0%, rgba(235, 218, 26, 1) 100%);
}

.bpg-light-card:hover {
	box-shadow: var(--bpg-shadow-hover);
}

.bpg-light-card-title {
	margin: 0;
	padding-bottom: 10px;
	color:#FFF;
	text-align: center;
	text-shadow: 0 0 3px rgba(0, 0, 0, .8);
}

.bpg-light-card-inner {
	padding: 1.5rem 1.25rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 1rem;
	background: #fff;
}

.bpg-light-card-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bpg-light-card.low-light-card .bpg-light-card-icon {
	color: #375E1E;
}

.bpg-light-card.medium-light-card .bpg-light-card-icon {
	color: #26C000;
}

.bpg-light-card.high-light-card .bpg-light-card-icon {
	color: #A99B00;
}

.bpg-light-card-icon .fas,
.bpg-light-card-icon .fa {
	font-size: 48px;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.bpg-light-card-button {
	font-weight: 600;
	color: #fff;
	border: none;
	cursor: pointer;
	border: 1px solid #324410;
}

/* ----- Section 2: Gallery ----- */
.bpg-gallery-section {
	margin-top: 1rem;
	margin-bottom: 2rem;
}

.bpg-back-link {
	margin: 0 0 1rem 0;
}

.bpg-gallery-title {
	font-weight: 600;
}

.bpg-plants-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: var(--bpg-gap);
}

@media (max-width: 900px) {
	.bpg-plants-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.bpg-plants-grid {
		grid-template-columns: 1fr;
	}
}

.bpg-plant-card {
	border: 1px solid #e0e0e0;
	box-shadow: var(--bpg-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: all 0.2s ease;
}

.bpg-plant-card:hover {
	box-shadow: var(--bpg-shadow-hover);
}

.bpg-plant-card-image {
	aspect-ratio: 1;
	object-fit: cover;
	width: 100%;
}

.bpg-plant-card-body {
	padding: 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.bpg-plant-card-title {
	margin: 0;
	font-weight: 600;
	text-align: center;
}

.bpg-plant-card-title a {
	color: inherit;
	text-decoration: none;
}

.bpg-plant-card-title a:hover {
	text-decoration: underline;
}

.bpg-plant-card-meta {
	margin: 0;
	font-size: 1rem;
	color: #666;
	text-align: center;
}

/* View Details as link (archive) – same look as shortcode button */
a.bpg-plant-card-button {
	display: block;
	text-align: center;
	text-decoration: none;
	font-weight: 600;
	color: #fff;
	background: #375e1e;
	border: 1px solid #324410;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	transition: background 0.2s ease;
}

a.bpg-plant-card-button:hover {
	background: #26C000;
	border-color: #26C000;
	color: #fff;
}

.bpg-plant-card-image-link {
	display: block;
	line-height: 0;
}

.bpg-plant-card-image-placeholder {
	aspect-ratio: 1;
	width: 100%;
	background: #f0f0f0;
}

/* ----- Header spacer (single + archive: space for transparent header) ----- */
.bpg-header-spacer {
	height: 260px;
	background-color: #375e1e;
}

/* ----- Archive page ----- */
.bpg-archive-wrap {
	max-width: 1200px;
	margin: 0 auto 2rem;
	padding: 0 1rem;
}

.bpg-archive-header {
	margin-bottom: 1.5rem;
}

.bpg-archive-title {
	margin: 0;
	font-size: 1.75rem;
}

.bpg-archive-empty {
	margin: 0;
	padding: 2rem;
	text-align: center;
	color: #666;
}

.bpg-archive-wrap .wp-block-query-pagination,
.bpg-archive-wrap .pagination {
	margin-top: 2rem;
}

/* ----- Section 3: Modal ----- */
.bpg-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.bpg-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

/* Prev/next plant – fixed to viewport so they don’t jump when slider/card layout runs */
.bpg-modal-nav-wrap {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 100001;
}
.bpg-modal-nav-wrap .bpg-modal-prev,
.bpg-modal-nav-wrap .bpg-modal-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: auto;
}
.bpg-modal-nav-wrap .bpg-modal-prev {
	left: 20px;
	right: auto;
}
.bpg-modal-nav-wrap .bpg-modal-next {
	right: 20px;
	left: auto;
}

.bpg-modal-prev,
.bpg-modal-next {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 100001;
	width: 48px;
	height: 48px;
	padding: 0;
	font-size: 1.5rem;
	line-height: 1;
	color: #fff;
	background: #375e1e;
	border: 1px solid #375e1e;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
	pointer-events: auto;
}
.bpg-modal-prev {
	left: 20px;
}
.bpg-modal-next {
	right: 20px;
}
.bpg-modal-prev:hover,
.bpg-modal-next:hover {
	background: #26C000;
	border-color: #26C000;
}

.bpg-modal-prev .fa,
.bpg-modal-prev i,
.bpg-modal-next .fa,
.bpg-modal-next i {
	font-size: 2rem;
}

/* Wrapper: auto-size to content, cap at 90vw × 80vh */
.bpg-modal-wrapper {
	position: relative;
	z-index: 1;
	height: auto;
	width: auto;
	max-width: 90vw;
	max-height: 80vh;
}

.bpg-modal-card {
	background: #fff;
	border-radius: var(--bpg-radius);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	max-height: 80vh;
	overflow: hidden;
	padding-bottom: 20px;
}

/* Header: fixed height, close button in flow (does not move) */
.bpg-modal-header {
	flex: 0 0 40px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 12px 0 0;
	background: #fff;
}

.bpg-modal-close {
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 24px;
	line-height: 36px;
	color: #444;
	background: transparent;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.bpg-modal-close:hover {
	background: #f0f0f0;
	color: #000;
}

/* Body: grows with content; scrolls only when content exceeds max height */
.bpg-modal-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	display: flex;
	flex-direction: row;
}

.bpg-modal-unavailable {
	padding: 24px;
	margin: 0;
	min-height: 80px;
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (max-width: 640px) {
	.bpg-modal-body {
		flex-direction: column;
	}
	.bpg-modal-wrapper {
		max-width: 80vw;
	}
	.bpg-modal-nav-wrap .bpg-modal-prev {
		left: 5px;
	}
	.bpg-modal-nav-wrap .bpg-modal-next {
		right: 5px;
	}
}

.bpg-modal-image-wrap {
	flex: 0 0 42%;
	min-width: 0;
	max-height: 500px;
	overflow: hidden;
}

@media (max-width: 640px) {
	.bpg-modal-image-wrap {
		flex: none;
		max-height: 320px; /* tall enough for slider + dot nav (was 280px, clipped dots) */
	}
	.bpg-slider {
		padding-bottom: 2.75rem; /* extra room for dots on small screens */
		max-height: 260px; /* keeps slider + padding within wrap so dots stay visible */
	}
}

.bpg-modal-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bpg-modal-image-placeholder {
	min-height: 200px;
}

/* ----- Modal image slider ----- */
.bpg-slider {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 240px;
	aspect-ratio: 4 / 3;
	max-height: 320px;
	min-height: 180px;
	contain: layout;
	box-sizing: border-box;
	padding-bottom: 2.5rem; /* reserve space so dot nav is never cut off */
}

.bpg-slider-track {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.bpg-slider-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bpg-slider-slide.bpg-slider-slide-active {
	opacity: 1;
	visibility: visible;
}

.bpg-slider-slide img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.bpg-slider-prev,
.bpg-slider-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 44px;
	height: 44px;
	padding: 0;
	line-height: 1;
	color: #26C000;
	background: transparent;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.2s ease;
	pointer-events: auto;
}

.bpg-slider-prev .fa,
.bpg-slider-prev i,
.bpg-slider-next .fa,
.bpg-slider-next i {
	font-size: 2rem;
}

.bpg-slider-prev:hover,
.bpg-slider-next:hover {
	color: #375e1e;
}

.bpg-slider-nav {
	position: absolute;
	inset: 0;
	z-index: 10;
	pointer-events: none;
}

.bpg-slider-prev {
	left: 0.5rem;
}

.bpg-slider-next {
	right: 0.5rem;
}

.bpg-slider-dots {
	position: absolute;
	bottom: 0.75rem;
	left: 0;
	right: 0;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 0.5rem;
}

.bpg-slider-dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(55, 94, 30, .5);
	cursor: pointer;
	transition: background 0.2s ease;
}

.bpg-slider-dot:hover {
	background: rgba(55, 94, 30, 1);
	border: none;
}

.bpg-slider-dot.bpg-slider-dot-active {
	background: #26C000;
}

.bpg-modal-details {
	flex: 1;
	padding: 1.5rem;
	overflow-y: auto;
	min-width: 0;
}

.bpg-modal-details .bpg-modal-field {
	margin-bottom: 1rem;
}

.bpg-modal-details .bpg-modal-field label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #666;
	margin-bottom: 0.25rem;
}

.bpg-modal-details .bpg-modal-field .value {
	margin: 0;
}

.bpg-modal-details .bpg-quick-facts-list {
	margin: 0;
	padding-left: 1.25rem;
}

.bpg-modal-details .bpg-quick-facts-list li {
	margin-bottom: 0.25rem;
}

/* ----- Single plant page (same layout as popup + nav) ----- */
.bpg-single-plant {
	max-width: 1000px;
	margin: 0 auto 2rem;
	padding: 1rem;
}

.bpg-single-plant-inner {
	display: flex;
	flex-direction: row;
	gap: 1.5rem;
	margin-bottom: 2rem;
	align-items: flex-start;
}

.bpg-single-plant .bpg-modal-image-wrap {
	flex: 0 0 42%;
	min-width: 0;
}

.bpg-single-plant .bpg-modal-details {
	flex: 1;
	min-width: 0;
}

.bpg-single-plant-title {
	margin: 0 0 1rem;
	font-size: 1.75rem;
}

.bpg-single-plant-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding-top: 1.5rem;
	border-top: 1px solid #e0e0e0;
}

.bpg-single-plant-nav a {
	color: #375e1e;
	font-weight: 600;
	text-decoration: none;
}

.bpg-single-plant-nav a:hover {
	text-decoration: underline;
}

.bpg-single-nav-empty {
	visibility: hidden;
}

@media (max-width: 640px) {
	.bpg-single-plant-inner {
		flex-direction: column;
	}
	.bpg-single-plant .bpg-modal-image-wrap {
		flex: none;
	}
}
