/* Casi studio in popup — inc/casi-studio.php */
.lv-cs-trigger,
.lv-cs-dialog {
	--lv-cs-brown: #b67532;
	--lv-cs-green: #799800;
	--lv-cs-text: #1a1a1a;
	--lv-cs-muted: #5d5d5d;
	--lv-cs-line: #eadfd2;
	--lv-cs-soft: #fbf6f0;
	--lv-cs-soft-2: #f5ece1;
}

/* ---------- pulsanti nel box della pagina ---------- */
.lv-cs-trigger { display: block; }
.lv-cs-trigger__sub { display: block; font-size: 15px; line-height: 1.5; color: var(--lv-cs-muted); margin: 2px 0 10px; }
.lv-cs-trigger__btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 380px; }

body .lv-cs-chip,
body .lv-cs-dialog button {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
	margin: 0;
	min-height: 0;
	line-height: 1.3;
	-webkit-appearance: none;
	appearance: none;
}
body .lv-cs-chip {
	font-size: 13px;
	font-weight: 600;
	border: 1.5px solid var(--lv-cs-brown);
	color: var(--lv-cs-brown);
	background: #fff;
	border-radius: 999px;
	padding: 5px 2px;
	white-space: nowrap;
	text-align: center;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
body .lv-cs-chip:hover { background: var(--lv-cs-brown); color: #fff; }
/* Salient (button style "slightly_rounded") forza border-radius:4px !important su ogni button */
body .lv-cs-trigger .lv-cs-chip,
body .lv-cs-dialog .lv-cs-tab,
body .lv-cs-dialog .lv-cs-pairnav button { border-radius: 999px !important; }
body .lv-cs-dialog .lv-cs-close { border-radius: 50% !important; }
/* il titolo del box è un <p> con padding-bottom = --nectar-paragraph-bottom-spacing (20px) */
.wpb_text_column p:has(+ .lv-cs-trigger) { margin-bottom: 0; padding-bottom: 4px; }
.lv-cs-chip:focus-visible,
.lv-cs-dialog button:focus-visible,
.lv-cs-dialog a:focus-visible { outline: 2px solid var(--lv-cs-green); outline-offset: 2px; }

/* ---------- popup ---------- */
html.lv-cs-locked, html.lv-cs-locked body { overflow: hidden; }

.lv-cs-dialog {
	border: 0;
	padding: 0;
	margin: auto;
	border-radius: 18px;
	width: min(1180px, calc(100vw - 48px));
	max-width: none;
	max-height: calc(100vh - 48px);
	overflow: hidden;
	background: #fff;
	color: var(--lv-cs-text);
	box-shadow: 0 30px 80px rgba(40, 25, 10, .35);
	font-size: 16px;
	line-height: 1.55;
}
.lv-cs-dialog::backdrop { background: rgba(35, 22, 10, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.lv-cs-dialog[open] { animation: lv-cs-pop .22s ease-out; }
.lv-cs-dialog[open]::backdrop { animation: lv-cs-fade .22s ease-out; }
.lv-cs-dialog:focus, .lv-cs-body:focus { outline: none; }
@keyframes lv-cs-pop { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes lv-cs-fade { from { opacity: 0; } to { opacity: 1; } }

.lv-cs-wrap { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }

.lv-cs-head { display: flex; align-items: center; gap: 18px; padding: 22px 32px; background: var(--lv-cs-soft); border-bottom: 1px solid var(--lv-cs-line); }
.lv-cs-head__icon { width: 48px; height: auto; flex: 0 0 48px; }
.lv-cs-head__txt { flex: 1; min-width: 0; }
.lv-cs-dialog p.lv-cs-eyebrow { margin: 0; padding: 0; font-size: 12px; line-height: 1.4; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--lv-cs-brown); }
.lv-cs-dialog p.lv-cs-title { margin: 0; padding: 0; font-size: 26px; line-height: 1.2; font-weight: 800; color: var(--lv-cs-text); }

.lv-cs-seg { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--lv-cs-line); border-radius: 999px; }
body .lv-cs-dialog .lv-cs-tab { font-size: 14px; font-weight: 700; border: 0; background: transparent; color: var(--lv-cs-brown); border-radius: 999px; padding: 8px 20px; cursor: pointer; white-space: nowrap; }
body .lv-cs-dialog .lv-cs-tab[aria-selected="true"] { background: var(--lv-cs-brown); color: #fff; }

body .lv-cs-dialog .lv-cs-close { flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 1px solid var(--lv-cs-line); background: #fff; color: #333; font-size: 24px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
body .lv-cs-dialog .lv-cs-close:hover { background: var(--lv-cs-soft-2); }

.lv-cs-body { padding: 30px 32px; overflow: auto; overscroll-behavior: contain; }

.lv-cs-case { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 40px; align-items: start; }
.lv-cs-case[hidden], .lv-cs-pair[hidden] { display: none; }

.lv-cs-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lv-cs-dialog .lv-cs-fig { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--lv-cs-soft-2); }
.lv-cs-dialog .lv-cs-img { display: block; width: 100%; height: auto; max-width: none; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 35%; margin: 0; }
.lv-cs-badge { position: absolute; left: 12px; top: 12px; font-size: 12px; line-height: 1.4; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #fff; border-radius: 999px; padding: 4px 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.lv-cs-badge--before { background: rgba(40, 40, 40, .82); }
.lv-cs-badge--after { background: var(--lv-cs-green); }
.lv-cs-arrow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--lv-cs-brown); display: grid; place-items: center; font-size: 22px; font-weight: 700; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); pointer-events: none; }

.lv-cs-pairnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
body .lv-cs-dialog .lv-cs-pairnav button { font-size: 13px; font-weight: 600; border: 1px solid var(--lv-cs-line); background: #fff; color: var(--lv-cs-muted); border-radius: 999px; padding: 4px 14px; cursor: pointer; }
body .lv-cs-dialog .lv-cs-pairnav button[aria-pressed="true"] { border-color: var(--lv-cs-brown); background: var(--lv-cs-brown); color: #fff; }

.lv-cs-dialog ul.lv-cs-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.lv-cs-dialog ul.lv-cs-facts li { margin: 0; padding: 8px 10px; list-style: none; background: var(--lv-cs-soft); border: 1px solid var(--lv-cs-line); border-radius: 8px; font-size: 13px; line-height: 1.35; color: var(--lv-cs-muted); }
.lv-cs-facts b { display: block; font-size: 14px; color: var(--lv-cs-text); }

.lv-cs-steps { position: relative; }
.lv-cs-steps::before { content: ""; position: absolute; left: 4.5px; top: 12px; bottom: 28px; width: 1px; background: var(--lv-cs-line); }
.lv-cs-dialog p.lv-cs-step { position: relative; margin: 0 0 16px; padding: 0 0 0 22px; font-size: 16px; line-height: 1.55; color: var(--lv-cs-text); }
.lv-cs-step::before { content: ""; position: absolute; left: 0; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: #7a7a7a; }
.lv-cs-step--after::before { background: var(--lv-cs-green); }
.lv-cs-step b { display: block; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--lv-cs-muted); }

.lv-cs-dialog p.lv-cs-disclaimer { margin: 6px 0 18px; padding: 14px 0 0; border-top: 1px solid var(--lv-cs-line); font-size: 13px; line-height: 1.5; color: var(--lv-cs-muted); }
.lv-cs-dialog a.lv-cs-cta { display: inline-flex; align-items: center; gap: 8px; background: var(--lv-cs-green); color: #fff; text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.3; border-radius: 4px; padding: 11px 22px; }
.lv-cs-dialog a.lv-cs-cta:hover { color: #fff; filter: brightness(.92); }

.lv-cs-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 32px; border-top: 1px solid var(--lv-cs-line); font-size: 14px; color: var(--lv-cs-muted); }
body .lv-cs-dialog .lv-cs-nav { font-size: 14px; font-weight: 600; border: 0; background: transparent; color: var(--lv-cs-brown); padding: 6px 0; cursor: pointer; }
body .lv-cs-dialog .lv-cs-nav:disabled { color: #c9c9c9; cursor: default; }

@media (max-width: 999px) {
	.lv-cs-head { flex-wrap: wrap; gap: 12px; padding: 16px 20px; }
	.lv-cs-seg { order: 3; width: 100%; }
	body .lv-cs-dialog .lv-cs-tab { flex: 1 1 0; min-width: 0; padding: 8px 6px; }
	.lv-cs-body { padding: 20px; }
	.lv-cs-case { grid-template-columns: minmax(0, 1fr); gap: 24px; }
	.lv-cs-foot { padding: 12px 20px; }
}
@media (max-width: 640px) {
	.lv-cs-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
	.lv-cs-wrap { height: 100dvh; max-height: 100dvh; }
	.lv-cs-body { flex: 1; }
	.lv-cs-head__icon { display: none; }
	.lv-cs-dialog p.lv-cs-title { font-size: 20px; }
	.lv-cs-pair { gap: 8px; }
	.lv-cs-arrow { width: 34px; height: 34px; font-size: 17px; }
	.lv-cs-badge { left: 8px; top: 8px; font-size: 11px; padding: 3px 9px; }
	.lv-cs-dialog ul.lv-cs-facts { gap: 6px; }
	.lv-cs-dialog ul.lv-cs-facts li { font-size: 12px; padding: 6px 8px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
	.lv-cs-pairnav { gap: 6px; }
	body .lv-cs-dialog .lv-cs-pairnav button { padding: 4px 9px; }
}
@media (max-width: 340px) {
	body .lv-cs-trigger .lv-cs-chip { font-size: 12px; padding: 4px 0; }
}
@media (prefers-reduced-motion: reduce) {
	.lv-cs-dialog[open], .lv-cs-dialog[open]::backdrop { animation: none; }
	.lv-cs-chip { transition: none; }
}
