/* FloraVivaio AI - Estetica editoriale professionale isolata con prefisso .fv-ai- */
.fv-ai-wrapper {
	--fv-primary: #1e352f;
	--fv-accent: #b85d43;
	--fv-bg: #ffffff;
	--fv-surface: #fbfaf7;
	--fv-surface-alt: #f3f0e8;
	--fv-border: #e2ddd2;
	--fv-border-strong: #cfc8b8;
	--fv-text: #1f2925;
	--fv-muted: #5b6761;
	--fv-serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
	--fv-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
	font-family: var(--fv-sans);
	color: var(--fv-text);
	width: 100%;
	max-width: 100%;
	margin: 0.25rem 0 2rem 0;
	box-sizing: border-box;
}

.fv-ai-wrapper *,
.fv-ai-wrapper *::before,
.fv-ai-wrapper *::after {
	box-sizing: border-box;
}

.fv-ai-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.fv-ai-search-card {
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-top: 3px solid var(--fv-accent);
	border-radius: 10px;
	padding: 2rem 2.25rem;
	box-shadow: 0 8px 28px rgba(30, 53, 47, 0.05);
}

.fv-ai-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-family: var(--fv-sans);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fv-accent);
	margin-bottom: 0.45rem;
}

.fv-ai-eyebrow::before {
	content: "";
	width: 24px;
	height: 1.5px;
	background: var(--fv-accent);
	flex-shrink: 0;
}

.fv-ai-title {
	margin: 0 0 0.45rem 0;
	font-family: var(--fv-serif);
	font-size: clamp(1.7rem, 2.6vw, 2.25rem);
	font-weight: 600;
	line-height: 1.15;
	color: var(--fv-primary);
}

.fv-ai-subtitle {
	margin: 0 0 1.5rem 0;
	font-size: 0.96rem;
	line-height: 1.55;
	color: var(--fv-muted);
	max-width: 72ch;
}

.fv-ai-input-group {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.fv-ai-input {
	flex: 1;
	min-width: 0;
	padding: 0.9rem 1.1rem;
	font-family: var(--fv-sans);
	font-size: 0.98rem;
	border: 1px solid var(--fv-border-strong);
	border-radius: 6px;
	background: var(--fv-bg);
	color: var(--fv-text);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fv-ai-input::placeholder {
	color: #84908a;
}

.fv-ai-input:focus {
	outline: none;
	border-color: var(--fv-primary);
	box-shadow: 0 0 0 3px rgba(30, 53, 47, 0.1);
}

.fv-ai-btn-submit {
	padding: 0.9rem 1.75rem;
	background: var(--fv-primary);
	color: #ffffff;
	border: 1px solid var(--fv-primary);
	border-radius: 6px;
	font-family: var(--fv-sans);
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.fv-ai-btn-submit:hover {
	background: var(--fv-accent);
	border-color: var(--fv-accent);
}

.fv-ai-btn-submit:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.fv-ai-filters {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.65rem;
}

.fv-ai-select {
	width: 100%;
	min-width: 0;
	padding: 0.68rem 0.85rem;
	border: 1px solid var(--fv-border);
	border-radius: 6px;
	background: var(--fv-bg);
	color: var(--fv-text);
	font-family: var(--fv-sans);
	font-size: 0.88rem;
	transition: border-color 0.2s ease;
}

.fv-ai-select:focus {
	outline: none;
	border-color: var(--fv-primary);
}

.fv-ai-btn-reset {
	padding: 0.68rem 0.9rem;
	border: 1px solid var(--fv-border-strong);
	border-radius: 6px;
	background: transparent;
	color: var(--fv-muted);
	font-family: var(--fv-sans);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.fv-ai-btn-reset:hover {
	border-color: var(--fv-accent);
	color: var(--fv-accent);
	background: rgba(184, 93, 67, 0.05);
}

.fv-ai-quick-chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1.15rem;
	padding-top: 1rem;
	border-top: 1px solid var(--fv-border);
}

.fv-ai-chips-label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--fv-muted);
	margin-right: 0.25rem;
}

.fv-ai-chip {
	background: var(--fv-bg);
	border: 1px solid var(--fv-border);
	color: var(--fv-primary);
	padding: 0.38rem 0.82rem;
	border-radius: 999px;
	font-family: var(--fv-sans);
	font-size: 0.82rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.fv-ai-chip:hover {
	background: var(--fv-primary);
	border-color: var(--fv-primary);
	color: #ffffff;
}

.fv-ai-status {
	margin-top: 1rem;
}

.fv-ai-alert {
	padding: 0.95rem 1.2rem;
	border-radius: 6px;
	background: #fdf4f2;
	border: 1px solid #ecc6bc;
	border-left: 4px solid var(--fv-accent);
	color: #7c2d1e;
	font-size: 0.92rem;
	line-height: 1.5;
}

/* Skeleton Loader */
.fv-ai-skeleton {
	margin-top: 1.5rem;
	padding: 1.75rem;
	border: 1px solid var(--fv-border);
	border-radius: 10px;
	background: var(--fv-surface);
}

.fv-ai-skel-status {
	margin: 0 0 1rem 0;
	font-size: 0.86rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	color: var(--fv-primary);
}

.fv-ai-skel-line {
	height: 15px;
	background: linear-gradient(90deg, #efece4 25%, #e3dfd4 50%, #efece4 75%);
	background-size: 200% 100%;
	animation: fv-shimmer 1.4s infinite;
	border-radius: 4px;
	margin-bottom: 12px;
}

.fv-ai-skel-title {
	height: 30px;
	width: 52%;
}

.fv-ai-skel-img {
	height: 220px;
	width: 100%;
	margin-bottom: 18px;
}

@keyframes fv-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Elenco / Suggerimenti */
.fv-ai-list-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--fv-border);
}

.fv-ai-list-header h3 {
	margin: 0;
	font-family: var(--fv-serif);
	font-size: 1.45rem;
	font-weight: 600;
	color: var(--fv-primary);
}

.fv-ai-list-count {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--fv-accent);
	background: #fdf5f2;
	border: 1px solid #ebd0c8;
	padding: 0.28rem 0.75rem;
	border-radius: 999px;
}

.fv-ai-suggestions-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1rem;
	margin-top: 1.25rem;
}

.fv-ai-suggestion-card {
	display: flex;
	flex-direction: column;
	text-align: left;
	background: var(--fv-bg);
	border: 1px solid var(--fv-border);
	border-top: 2.5px solid var(--fv-primary);
	border-radius: 8px;
	padding: 1.15rem 1.2rem;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.fv-ai-suggestion-card:hover {
	border-color: var(--fv-accent);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(30, 53, 47, 0.07);
}

.fv-ai-suggestion-name {
	font-family: var(--fv-serif);
	font-weight: 700;
	color: var(--fv-primary);
	margin: 0 0 0.2rem 0;
	font-size: 1.22rem;
	line-height: 1.25;
}

.fv-ai-suggestion-sci {
	font-style: italic;
	color: var(--fv-muted);
	font-size: 0.86rem;
	margin: 0 0 0.65rem 0;
}

.fv-ai-suggestion-desc {
	font-size: 0.88rem;
	line-height: 1.5;
	margin: 0;
	color: var(--fv-text);
	flex: 1;
}

.fv-ai-suggestion-cta {
	display: inline-block;
	margin-top: 0.85rem;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--fv-accent);
}

/* Scheda Botanica */
.fv-ai-plant-card {
	margin-top: 1.5rem;
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-top: 3px solid var(--fv-primary);
	border-radius: 10px;
	padding: 2rem 2.25rem;
	box-shadow: 0 8px 28px rgba(30, 53, 47, 0.05);
}

.fv-ai-back-bar {
	margin-bottom: 1.25rem;
}

.fv-ai-btn-back {
	background: var(--fv-bg);
	border: 1px solid var(--fv-border-strong);
	color: var(--fv-primary);
	padding: 0.5rem 0.95rem;
	border-radius: 6px;
	font-family: var(--fv-sans);
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.fv-ai-btn-back:hover {
	border-color: var(--fv-accent);
	color: var(--fv-accent);
}

.fv-ai-plant-header {
	display: grid;
	grid-template-columns: 340px minmax(0, 1fr);
	gap: 1.75rem;
	margin-bottom: 1.5rem;
}

.fv-ai-gallery-main {
	width: 100%;
	height: 250px;
	object-fit: cover;
	border-radius: 8px;
	cursor: zoom-in;
	border: 1px solid var(--fv-border);
}

.fv-ai-gallery-thumbs {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.6rem;
}

.fv-ai-gallery-thumb {
	width: 66px;
	height: 50px;
	object-fit: cover;
	border-radius: 5px;
	cursor: pointer;
	border: 2px solid transparent;
	opacity: 0.8;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.fv-ai-gallery-thumb:hover,
.fv-ai-gallery-thumb.active {
	opacity: 1;
	border-color: var(--fv-accent);
}

.fv-ai-photo-credit {
	font-size: 0.75rem;
	color: var(--fv-muted);
	margin-top: 0.45rem;
}

.fv-ai-plant-title {
	margin: 0 0 0.25rem 0;
	font-family: var(--fv-serif);
	font-size: clamp(1.75rem, 2.5vw, 2.2rem);
	font-weight: 600;
	line-height: 1.15;
	color: var(--fv-primary);
}

.fv-ai-plant-sci {
	font-style: italic;
	font-size: 1.05rem;
	color: var(--fv-accent);
	font-weight: 500;
	margin: 0 0 0.9rem 0;
}

.fv-ai-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.fv-ai-badge {
	background: var(--fv-bg);
	border: 1px solid var(--fv-border);
	padding: 0.28rem 0.75rem;
	border-radius: 999px;
	font-size: 0.8rem;
	color: var(--fv-primary);
	font-weight: 600;
}

.fv-ai-section {
	margin-top: 1.6rem;
	padding-top: 1.35rem;
	border-top: 1px solid var(--fv-border);
}

.fv-ai-section h3 {
	margin: 0 0 1rem 0;
	font-family: var(--fv-serif);
	font-size: 1.4rem;
	font-weight: 600;
	color: var(--fv-primary);
}

.fv-ai-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.9rem;
}

.fv-ai-info-box {
	background: var(--fv-bg);
	padding: 0.95rem 1.1rem;
	border-radius: 8px;
	border: 1px solid var(--fv-border);
}

.fv-ai-info-box strong {
	display: block;
	font-size: 0.78rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--fv-primary);
	margin-bottom: 0.3rem;
}

.fv-ai-info-box span {
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--fv-text);
}

/* Lightbox */
.fv-ai-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(20, 32, 28, 0.88);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 1rem;
}

.fv-ai-lightbox.open { display: flex; }

.fv-ai-lightbox-content {
	max-width: 90vw;
	max-height: 90vh;
	text-align: center;
}

.fv-ai-lightbox-content img {
	max-width: 100%;
	max-height: 80vh;
	border-radius: 8px;
}

.fv-ai-lightbox-caption {
	color: #ece8df;
	font-size: 0.85rem;
	margin-top: 0.6rem;
}

.fv-ai-lightbox-close {
	position: absolute;
	top: 1rem;
	right: 1.5rem;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 2.2rem;
	cursor: pointer;
}

@media (max-width: 768px) {
	.fv-ai-search-card,
	.fv-ai-plant-card {
		padding: 1.35rem 1.15rem;
	}
	.fv-ai-input-group { flex-direction: column; }
	.fv-ai-filters { grid-template-columns: 1fr; }
	.fv-ai-plant-header { grid-template-columns: 1fr; }
	.fv-ai-grid-2 { grid-template-columns: 1fr; }
}

/* Porta su il motore di ricerca riducendo gli spazi verticali del tema */
body.page .fv-ai-wrapper {
	margin-top: -0.75rem;
}

/* Opzione per nascondere il titolo principale della pagina del tema se si aggiunge la classe 'fv-hide-page-title' alla pagina */
body.fv-hide-page-title .entry-title,
body.fv-hide-page-title h1.wp-block-post-title,
body.fv-hide-page-title .page-title,
body.fv-hide-page-title .post-title,
body.fv-hide-page-title .site-main > article > header {
	display: none !important;
}

body.fv-hide-page-title .fv-ai-wrapper {
	margin-top: 0.5rem;
}
