/* Form Items cards on single posts */

.ldf-fi-cards {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 32px 0;
}

.ldf-fi-card {
	display: flex;
	gap: 28px;
	align-items: flex-start;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.ldf-fi-card-thumb {
	flex: 0 0 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	min-height: 240px;
}

.ldf-fi-card-img {
	max-width: 100%;
	height: auto;
	display: block;
}

.ldf-fi-card-noimg {
	display: block;
	width: 100%;
	min-height: 240px;
	background:
		linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
}

.ldf-fi-card-body {
	flex: 1 1 auto;
	min-width: 0;
}

.ldf-fi-card-title {
	margin: 0 0 12px;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 700;
	color: #0f172a;
}

.ldf-fi-card-desc {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.65;
	color: #334155;
}

.ldf-fi-card-actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.ldf-fi-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ldf-fi-btn-primary {
	background: #2563eb;
	border: 1px solid #2563eb;
	color: #fff;
}

.ldf-fi-btn-primary:hover,
.ldf-fi-btn-primary:focus {
	background: #1d4ed8;
	border-color: #1d4ed8;
	color: #fff;
}

.ldf-fi-btn-outline {
	background: #fff;
	border: 1px solid #2563eb;
	color: #2563eb;
}

.ldf-fi-btn-outline:hover,
.ldf-fi-btn-outline:focus {
	background: #eff6ff;
	color: #1d4ed8;
}

.ldf-fi-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* The injected "Edit Document" trigger button is redundant — the card's own
   Edit Form button forwards clicks to it. The mount itself must stay
   visible because the editor modal markup lives inside it (position:fixed,
   display:none until .active). */
.ldf-fi-editor-mount .ldf-edit-document-btn {
	display: none !important;
}

@media screen and (max-width: 640px) {
	.ldf-fi-card {
		flex-direction: column;
		gap: 16px;
		padding: 16px;
	}

	.ldf-fi-card-thumb {
		flex: 0 0 auto;
		width: 100%;
		max-width: 420px;
		min-height: 0;
		margin: 0 auto;
	}

	.ldf-fi-card-noimg {
		min-height: 160px;
	}

	.ldf-fi-card-actions .ldf-fi-btn {
		flex: 1 1 auto;
		justify-content: center;
	}
}

/* Lightbox trigger on the card thumbnail */
.ldf-fi-lightbox {
	display: block;
	position: relative;
	width: 100%;
}

.ldf-fi-lightbox img {
	display: block;
	width: 100%;
	height: auto;
}

.ldf-fi-zoom-hint {
	position: absolute;
	right: 8px;
	bottom: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.65);
	color: #fff;
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

.ldf-fi-lightbox:hover .ldf-fi-zoom-hint,
.ldf-fi-lightbox:focus-visible .ldf-fi-zoom-hint {
	opacity: 1;
}

/* Lightbox overlay */
.ldf-fi-lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 40px 24px;
	background: rgba(15, 23, 42, 0.82);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.2s ease;
	cursor: zoom-out;
}

.ldf-fi-lightbox-overlay.is-open {
	opacity: 1;
}

.ldf-fi-lightbox-overlay img {
	max-width: 100%;
	max-height: calc(100vh - 140px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	background: #fff;
	cursor: default;
}

.ldf-fi-lightbox-caption {
	color: #e2e8f0;
	font-size: 14px;
	text-align: center;
	max-width: 80%;
}

.ldf-fi-lightbox-close {
	position: absolute;
	top: 16px;
	right: 20px;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ldf-fi-lightbox-close:hover {
	background: rgba(255, 255, 255, 0.25);
}
