/**
 * Anmka Events Leads — front-end styles.
 *
 * Color resolution order:
 *   1. Plugin setting override (.anmka-scope{--anmka-primary:...} inline)
 *   2. Elementor kit primary (--e-global-color-primary)
 *   3. theme.json preset (--wp--preset--color--primary)
 *   4. Theme link/button color (copied by frontend.js when 1–3 missing)
 *   5. Last-resort fallback below.
 * Fonts are always inherited from the theme.
 */

.anmka-scope {
	--anmka-primary: var(--e-global-color-primary, var(--wp--preset--color--primary, var(--tutor-color-primary, #0e7490)));
	--anmka-on-primary: #fff;
	--anmka-text: #1f2937;
	--anmka-muted: #6b7280;
	--anmka-border: #e5e7eb;
	--anmka-bg-soft: #f8fafc;
	--anmka-error: #dc2626;
	--anmka-success: #15803d;
	--anmka-radius: 14px;
	--anmka-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
	color: var(--anmka-text);
	font-size: 16px;
	line-height: 1.6;
}

.anmka-scope *,
.anmka-scope *::before,
.anmka-scope *::after {
	box-sizing: border-box;
}

.anmka-wrap {
	max-width: 1120px;
	margin-inline: auto;
	padding-inline: 20px;
}

/* ---------- Hero ---------- */

.anmka-hero {
	position: relative;
	padding-block: 64px 48px;
	margin-block-end: 40px;
	background-color: var(--anmka-hero-bg, #6EC1E4);
	background-image: linear-gradient(135deg, var(--anmka-hero-bg, #6EC1E4), color-mix(in srgb, var(--anmka-hero-bg, #6EC1E4) 70%, #000));
	overflow: hidden;
}

.anmka-hero__media {
	position: absolute;
	inset: 0;
}

.anmka-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.25;
}

.anmka-hero__inner {
	position: relative;
	z-index: 1;
}

.anmka-hero__title {
	margin: 0;
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 800;
	line-height: 1.2;
	color: #fff;
}

.anmka-hero__meta {
	margin-block: 12px 0;
	font-size: 17px;
	color: rgba(255, 255, 255, 0.9);
}

.anmka-hero--archive {
	text-align: center;
}

/* ---------- Badges ---------- */

.anmka-badge {
	display: inline-block;
	padding: 4px 14px;
	margin-block-end: 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.anmka-badge--open {
	background: rgba(255, 255, 255, 0.92);
	color: var(--anmka-success);
}

.anmka-badge--closed {
	background: rgba(255, 255, 255, 0.92);
	color: var(--anmka-error);
}

.anmka-event-card .anmka-badge {
	position: absolute;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	margin-block-end: 0;
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ---------- Layout ---------- */

.anmka-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	gap: 40px;
	padding-block-end: 64px;
	align-items: start;
}

.anmka-description {
	font-size: 17px;
}

.anmka-description > :first-child {
	margin-block-start: 0;
}

/* ---------- Info cards ---------- */

.anmka-info-cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin-block-start: 32px;
}

.anmka-info-card {
	display: flex;
	gap: 14px;
	padding: 20px;
	background: var(--anmka-bg-soft);
	border: 1px solid var(--anmka-border);
	border-radius: var(--anmka-radius);
}

.anmka-info-card__icon {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	color: var(--anmka-on-primary, #fff);
	background: var(--anmka-primary);
}

.anmka-info-card__title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--anmka-muted);
}

.anmka-info-card p {
	margin: 0 0 2px;
}

.anmka-muted {
	color: var(--anmka-muted);
}

.anmka-map-link {
	font-weight: 600;
	color: var(--anmka-primary);
}

/* ---------- Registration card ---------- */

.anmka-register-card {
	position: sticky;
	inset-block-start: 32px;
	padding: 28px;
	background: #fff;
	border: 1px solid var(--anmka-border);
	border-radius: var(--anmka-radius);
	box-shadow: var(--anmka-shadow);
}

.anmka-register-card__title {
	margin: 0 0 16px;
	font-size: 21px;
	font-weight: 700;
}

.anmka-seats {
	margin-block: -8px 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--anmka-primary);
}

.anmka-notice {
	padding: 18px;
	border-radius: 10px;
	text-align: center;
	font-weight: 600;
}

.anmka-notice--closed {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: var(--anmka-error);
}

/* ---------- Form ---------- */

.anmka-field {
	margin-block-end: 16px;
}

.anmka-field label {
	display: block;
	margin-block-end: 6px;
	font-size: 14px;
	font-weight: 600;
}

.anmka-req {
	color: var(--anmka-error);
}

.anmka-field input,
.anmka-field select {
	width: 100%;
	padding: 11px 14px;
	font-size: 16px;
	font-family: inherit;
	color: inherit;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.anmka-field input:focus,
.anmka-field select:focus {
	outline: none;
	border-color: var(--anmka-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--anmka-primary) 20%, transparent);
}

.anmka-field input.anmka-invalid,
.anmka-field select.anmka-invalid {
	border-color: var(--anmka-error);
}

.anmka-hint {
	display: block;
	margin-block-start: 4px;
	font-size: 13px;
	color: var(--anmka-muted);
}

.anmka-error {
	display: block;
	min-height: 0;
	margin-block-start: 4px;
	font-size: 13px;
	color: var(--anmka-error);
}

.anmka-error:empty {
	display: none;
}

/* Honeypot — visually hidden but present in DOM. */
.anmka-hp {
	position: absolute;
	inset-inline-start: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.anmka-form-status {
	margin-block-end: 12px;
	font-size: 14px;
	font-weight: 600;
}

.anmka-form-status:empty {
	display: none;
}

.anmka-form-status--error {
	color: var(--anmka-error);
}

/* ---------- Submit button ---------- */

.anmka-submit {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 13px 20px;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	color: var(--anmka-on-primary, #fff);
	background: var(--anmka-primary);
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.anmka-submit:hover {
	filter: brightness(0.9);
}

.anmka-submit:active {
	transform: translateY(1px);
}

.anmka-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.anmka-submit__spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-block-start-color: #fff;
	border-radius: 50%;
	animation: anmka-spin 0.7s linear infinite;
}

.anmka-submit.is-loading .anmka-submit__spinner {
	display: inline-block;
}

@keyframes anmka-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---------- Success ---------- */

.anmka-success {
	padding: 24px 12px;
	text-align: center;
}

.anmka-success__icon {
	display: inline-block;
	color: var(--anmka-success);
}

.anmka-success__msg {
	margin-block: 10px 0;
	font-size: 17px;
	font-weight: 600;
}

/* ---------- Events grid (archive + shortcode) ---------- */

.anmka-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	padding-block-end: 48px;
}

.anmka-section-title {
	margin-block: 8px 20px;
	font-size: 24px;
	font-weight: 700;
}

.anmka-empty {
	padding: 40px 0;
	text-align: center;
	color: var(--anmka-muted);
}

.anmka-event-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--anmka-border);
	border-radius: var(--anmka-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.anmka-event-card:hover {
	box-shadow: var(--anmka-shadow);
	transform: translateY(-3px);
	color: inherit;
}

.anmka-event-card__media {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--anmka-bg-soft);
}

.anmka-event-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.anmka-event-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--anmka-primary);
	opacity: 0.5;
}

.anmka-event-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 20px;
}

.anmka-event-card__title {
	margin: 0 0 10px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

.anmka-event-card__meta {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
	font-size: 14px;
	color: var(--anmka-muted);
}

.anmka-event-card__meta li + li {
	margin-block-start: 2px;
}

.anmka-event-card__excerpt {
	margin: 0 0 14px;
	font-size: 15px;
	color: var(--anmka-muted);
	flex: 1;
}

.anmka-event-card__cta {
	font-weight: 700;
	font-size: 15px;
	color: var(--anmka-primary);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.anmka-layout {
		grid-template-columns: 1fr;
	}

	.anmka-register-card {
		position: static;
	}
}

@media (max-width: 560px) {
	.anmka-hero {
		padding-block: 40px 32px;
	}

	.anmka-info-cards {
		grid-template-columns: 1fr;
	}
}

/* ---------- RTL ---------- */

[dir="rtl"] .anmka-event-card__cta {
	direction: rtl;
}

[dir="rtl"] .anmka-field input[dir="ltr"],
[dir="rtl"] .anmka-field input[dir="ltr"]::placeholder {
	text-align: right;
	direction: ltr;
}
