/**
 * Starter-template chooser shown inside the Elementor editor.
 *
 * The card grid deliberately matches Eventin's own Gutenberg chooser
 * (wp-event-solution .../starter-templates/StarterTemplateModal.jsx) so the
 * two builders present the same picker.
 *
 * Elementor's UI sits at z-index 9999, so the overlay has to clear it.
 */

.etnadfe-starter-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(17, 24, 39, 0.55);
}

.etnadfe-starter-overlay.is-open {
	display: flex;
}

.etnadfe-starter-box {
	display: flex;
	overflow: hidden;
	width: 62vw;
	max-width: 1060px;
	max-height: 88vh;
	flex-direction: column;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.etnadfe-starter-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	border-bottom: 1px solid #f0f0f0;
}

.etnadfe-starter-head h2 {
	margin: 0;
	color: #111827;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.etnadfe-starter-close {
	display: inline-flex;
	width: 32px;
	height: 32px;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: #6b7280;
	cursor: pointer;
}

.etnadfe-starter-close:hover {
	background: #f3f4f6;
	color: #111827;
}

.etnadfe-starter-grid {
	display: grid;
	overflow-y: auto;
	padding: 24px;
	gap: 20px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 782px) {
	.etnadfe-starter-box {
		width: 94vw;
	}

	.etnadfe-starter-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.etnadfe-starter-card {
	overflow: hidden;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	cursor: pointer;
	transition: box-shadow 0.2s;
}

.etnadfe-starter-card:hover,
.etnadfe-starter-card:focus-visible {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	outline: none;
}

.etnadfe-starter-thumb {
	position: relative;
	␌aspect-ratio: 4 / 3;
	aspect-ratio: 4 / 3;
	background: #f3f4f6;
}

.etnadfe-starter-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.etnadfe-starter-hover {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(17, 24, 39, 0.45);
	gap: 14px;
	inset: 0;
	opacity: 0;
	transition: opacity 0.2s;
}

.etnadfe-starter-card:hover .etnadfe-starter-hover,
.etnadfe-starter-card:focus-visible .etnadfe-starter-hover,
.etnadfe-starter-card.is-applying .etnadfe-starter-hover {
	opacity: 1;
}

.etnadfe-starter-action {
	display: inline-flex;
	width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #111827;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition: background 0.15s;
}

.etnadfe-starter-action.is-primary {
	background: #6c5ce7;
	color: #fff;
}

.etnadfe-starter-action[disabled] {
	cursor: default;
	opacity: 0.7;
}

.etnadfe-starter-card.is-applying .etnadfe-starter-action {
	animation: etnadfe-starter-pulse 1s ease-in-out infinite;
}

@keyframes etnadfe-starter-pulse {
	50% {
		transform: scale(0.88);
	}
}

.etnadfe-starter-name {
	padding: 10px 12px;
	color: #111827;
	font-size: 13px;
	font-weight: 600;
}

/* The canvas entry point inherits Elementor's own add-section button styling;
   only the inline icon needs sizing. */
.etnadfe-starter-canvas-button svg {
	display: block;
}
