/* ELDIGITAL Core — logical properties only; colors from theme.json presets with safe fallbacks. */

.eld-visually-hidden,
.eld-hp {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.eld-link-button {
	background: none;
	border: 0;
	padding: 0;
	min-block-size: 44px;
	color: var(--wp--preset--color--primary, #1d4ed8);
	text-decoration: underline;
	font: inherit;
	cursor: pointer;
}

/* Lead form */
.eld-form .eld-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-block: 0 1rem;
}

.eld-form label {
	font-weight: 600;
}

.eld-form .eld-req,
.eld-form .eld-hint {
	font-weight: 400;
	font-size: 0.9em;
	color: var(--wp--preset--color--muted, #4b5563);
}

.eld-form input[type="text"],
.eld-form input[type="tel"],
.eld-form input[type="email"],
.eld-form textarea {
	inline-size: 100%;
	box-sizing: border-box;
	min-block-size: 44px;
	padding: 0.6rem 0.75rem;
	font: inherit;
	color: inherit;
	background: var(--wp--preset--color--base, #fff);
	border: 1px solid var(--wp--preset--color--muted, #4b5563);
	border-radius: var(--wp--custom--radius, 6px);
}

/* LTR fields still align to the page's reading side in RTL. */
[dir="rtl"] .eld-form input[dir="ltr"] {
	text-align: end;
}

.eld-form .eld-check {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.5rem;
	margin-block: 0 1rem;
}

.eld-form .eld-check input {
	inline-size: 1.25rem;
	block-size: 1.25rem;
	margin-block-start: 0.2rem;
	flex: none;
}

.eld-form .eld-check label {
	flex: 1 1 0;
	font-weight: 400;
}

.eld-form__status {
	padding: 0.75rem 1rem;
	border-inline-start: 4px solid;
	background: var(--wp--preset--color--surface, #f3f4f6);
}

.eld-form__status--error {
	border-color: #b91c1c;
}

.eld-form__status--ok {
	border-color: #15803d;
}

/* Legal links */
.eld-legal-links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

/* Consent banner (non-modal) */
.eld-consent {
	position: fixed;
	inset-inline: 1rem;
	inset-block-end: 1rem;
	z-index: 99999;
	max-inline-size: 40rem;
	margin-inline: auto;
	padding: 1rem 1.25rem;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #111827);
	border: 1px solid var(--wp--preset--color--contrast, #111827);
	border-radius: var(--wp--custom--radius, 8px);
	box-shadow: 0 8px 30px rgb(0 0 0 / 20%);
}

.eld-consent[hidden] {
	display: none;
}

.eld-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

/* Accessibility entry */
.eld-a11y-toggle {
	position: fixed;
	inset-inline-start: 0.75rem;
	inset-block-end: 1rem;
	z-index: 99998;
	inline-size: 44px;
	block-size: 44px;
	border-radius: 50%;
	border: 0;
	background: var(--wp--preset--color--primary, #1d4ed8);
	color: var(--wp--preset--color--on-primary, #fff);
	box-shadow: 0 6px 16px rgb(0 0 0 / 25%);
	cursor: pointer;
	display: grid;
	place-items: center;
}

/* Left corner in both directions, like the live site (the contact buttons own the right corner). */
:root[dir="rtl"] .eld-a11y-toggle {
	inset-inline-start: auto;
	inset-inline-end: 0.75rem;
}

.eld-a11y-toggle svg {
	inline-size: 22px;
	block-size: 22px;
}

.eld-a11y {
	max-inline-size: min(28rem, calc(100vw - 2rem));
	border: 1px solid var(--wp--preset--color--contrast, #111827);
	border-radius: var(--wp--custom--radius, 8px);
	padding: 1.25rem;
}

.eld-a11y::backdrop {
	background: rgb(0 0 0 / 50%);
}

.eld-a11y__options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem;
	margin-block: 1rem;
}

.eld-a11y__options button {
	min-block-size: 44px;
	font: inherit;
	border: 2px solid var(--wp--preset--color--contrast, #111827);
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #111827);
	border-radius: var(--wp--custom--radius, 8px);
	cursor: pointer;
}

.eld-a11y__options button[aria-pressed="true"] {
	background: var(--wp--preset--color--contrast, #111827);
	color: var(--wp--preset--color--base, #fff);
}

html.eld-a11y-text {
	font-size: 125%;
}

html.eld-a11y-links a {
	text-decoration: underline !important;
	text-decoration-thickness: 2px !important;
	outline: 1px dashed currentColor;
}

html.eld-a11y-motion *,
html.eld-a11y-motion *::before,
html.eld-a11y-motion *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* Floating contact buttons, like the live site: round icon links in the right corner, the AI assistant above the
   accessibility entry in the left corner (the same physical sides in Hebrew and English). */
.eld-fab {
	position: fixed;
	inset-inline-end: 0.75rem;
	inset-block-end: 1rem;
	z-index: 99997;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

:root[dir="rtl"] .eld-fab {
	inset-inline-end: auto;
	inset-inline-start: 0.75rem;
}

.eld-fab__btn {
	display: grid;
	place-items: center;
	inline-size: 44px;
	block-size: 44px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary, #6b33cc);
	color: #fff;
	box-shadow: 0 6px 16px rgb(0 0 0 / 25%);
	transition: transform 0.3s ease;
}

/* Brand tints darkened just enough for 3:1 against the white icon. */
.eld-fab__btn--whatsapp {
	background: #1da851;
}

.eld-fab__btn--sms {
	background: #2196f3;
}

.eld-fab-chat {
	position: fixed;
	inset-inline-start: 0.75rem;
	inset-block-end: 1rem;
	z-index: 99997;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-block-size: 44px;
	padding-inline: 0.75rem 1rem;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--primary, #6b33cc);
	color: #fff;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 700;
	box-shadow: 0 6px 16px rgb(0 0 0 / 25%);
	cursor: pointer;
	transition: transform 0.3s ease;
}

:root[dir="rtl"] .eld-fab-chat {
	inset-inline-start: auto;
	inset-inline-end: 0.75rem;
}

body:has(.eld-a11y-toggle) .eld-fab-chat {
	inset-block-end: 4.5rem;
}

/* Like live, the buttons stay visible while the cookie banner is open: the banner (z-index 99999) sits above them,
   so its buttons are never covered. Only the open navigation overlay hides them. */
.eld-fab-chat[hidden],
html.has-modal-open .eld-fab,
html.has-modal-open .eld-fab-chat {
	display: none;
}

@media (prefers-reduced-motion: no-preference) {
	.eld-fab__btn:hover,
	.eld-fab-chat:hover {
		transform: scale(1.08);
	}
}

.eld-fab a:focus-visible,
.eld-fab-chat:focus-visible {
	outline: 3px solid var(--wp--preset--color--contrast, #111827);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px #fff;
}
