/**
 * Plant Manager Frontend Styles
 * Styles for plant detail pages, navigation, and shortcodes
 */

/* Column sorting */
.plant-sort-controls {
	display: inline-flex;
	gap: 2px;
	margin-left: 4px;
	white-space: nowrap;
}

.plant-list-table .plant-sort-direction {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	min-height: 24px;
	border: 1px solid transparent;
	border-radius: 3px;
	text-decoration: none;
}

.plant-list-table .plant-sort-direction.is-active {
	border-color: currentcolor;
	background-color: #e8f5e9;
}

.plant-list-table .plant-sort-direction:focus-visible {
	outline: 2px solid #1b5e20;
	outline-offset: 2px;
}

/* Complete configured detail pages */
.plant-complete-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
	gap: 16px;
}

.plant-complete-field dt {
	font-weight: 600;
}

.plant-complete-field dd {
	margin: 4px 0 0;
	overflow-wrap: anywhere;
}

/* Plant Navigation */
.plant-navigation {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 15px;
	margin: 30px 0;
	padding: 20px;
	background-color: #f9f9f9;
	border-radius: 8px;
}

.plant-navigation .button {
	display: inline-flex;
	align-items: center;
	padding: 12px 24px;
	background-color: #4caf50;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 500;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
}

.plant-navigation .button:hover {
	background-color: #45a049;
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.plant-navigation .button:active {
	transform: translateY(0);
}

.plant-navigation .plant-nav-prev {
	margin-right: auto;
}

.plant-navigation .plant-nav-next {
	margin-left: auto;
}

/* Single navigation button (when only one exists) */
.plant-navigation .button:only-child {
	margin: 0 auto;
}

/* Plant Detail Fields */
.plant-field {
	margin: 10px 0;
}

.plant-field.plant-name {
	font-size: 1.5em;
	font-weight: 700;
	color: #333;
}

.plant-field.plant-botanical-name {
	font-style: italic;
	color: #666;
}

.plant-field.plant-zone a {
	color: #0073aa;
	text-decoration: none;
	font-weight: 500;
}

.plant-field.plant-zone a:hover {
	text-decoration: underline;
}

/* Plant Gallery (from shortcode) */
.plant-detail-image {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.plant-lightbox-trigger {
	display: inline-block;
	cursor: zoom-in;
}

.plant-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.88);
}

.plant-lightbox.is-open {
	display: flex;
}

.plant-lightbox__figure {
	max-width: min(1100px, 100%);
	max-height: 100%;
	margin: 0;
	text-align: center;
}

.plant-lightbox__image {
	max-width: 100%;
	max-height: calc(100vh - 120px);
	width: auto;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

.plant-lightbox__caption {
	margin-top: 12px;
	color: #fff;
	font-size: 14px;
}

.plant-lightbox__close,
.plant-lightbox__prev,
.plant-lightbox__next {
	position: absolute;
	border: 0;
	color: #fff;
	background: rgba(255, 255, 255, 0.16);
	cursor: pointer;
}

.plant-lightbox__close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 28px;
	line-height: 1;
}

.plant-lightbox__prev,
.plant-lightbox__next {
	top: 50%;
	width: 44px;
	height: 64px;
	border-radius: 6px;
	font-size: 32px;
	transform: translateY(-50%);
}

.plant-lightbox__prev {
	left: 16px;
}

.plant-lightbox__next {
	right: 16px;
}

.plant-lightbox__close:hover,
.plant-lightbox__prev:hover,
.plant-lightbox__next:hover {
	background: rgba(255, 255, 255, 0.28);
}

/* Responsive */
@media (max-width: 768px) {

	.plant-navigation {
		flex-direction: column;
		padding: 15px;
	}

	.plant-navigation .plant-nav-prev,
	.plant-navigation .plant-nav-next {
		width: 100%;
		justify-content: center;
		margin: 0 !important;
	}

	.plant-navigation .button {
		width: 100%;
		text-align: center;
		justify-content: center;
	}

	.plant-lightbox {
		padding: 14px;
	}

	.plant-lightbox__prev,
	.plant-lightbox__next {
		width: 38px;
		height: 52px;
	}
}

/* Print styles */
@media print {

	.plant-navigation {
		display: none;
	}
}

/* Applied criteria are grouped once, above each result list. */
.plant-list-results {
	min-width: 0;
}

.plant-list-filters {
	margin-block: 1rem;
}

.plant-list-filters h3 {
	font-size: 1rem;
}

.plant-list-filters .filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.plant-list-filters .filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	max-width: 100%;
	min-width: 0;
	padding: 0.125rem 0.375rem 0.125rem 0.5rem;
	border: 1px solid #747775;
	border-radius: 0.5rem;
	background: #eef3ee;
	color: #1d251e;
	font-size: 0.8125rem;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.plant-list-filters .remove-filter {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.375rem;
	min-height: 1.375rem;
	border-radius: 50%;
	color: #263e2b;
	font-size: 1.0625rem;
	text-decoration: none;
}

.plant-list-filters .remove-filter:hover {
	background: #cfdfd0;
}

.plant-list-results :focus-visible {
	outline: 2px solid #263e2b;
	outline-offset: 3px;
}

.plant-list-filters .filter-chip-label {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Stripe cells so theme cell backgrounds cannot obscure alternating rows. */
.plant-list-table > tbody > tr:nth-child(odd) > td {
	background-color: #fff;
}

.plant-list-table > tbody > tr:nth-child(even) > td {
	background-color: #f0f4f0;
}

.plant-list-table > tbody > tr:hover > td,
.plant-list-table > tbody > tr:focus-within > td {
	background-color: #e1eae1;
}
