/*
 * ANVIKOS × Elementor bridge.
 * Loaded only on pages built with Elementor, after Elementor's own CSS and before the theme's styles.
 * It makes Elementor containers and widgets follow the theme's spacing, headings, links, buttons and
 * FAQ design, so a page looks the same whether it is shown from blocks or from Elementor.
 * Anything you change in Elementor's Style/Advanced tabs is more specific and still wins.
 */

/* ---------- Text widgets: no outer margins (spacing comes from the container gap, like the theme) ---------- */
:is(.elementor-widget-text-editor, .elementor-widget-html, .elementor-shortcode) > :first-child,
:is(.elementor-widget-text-editor, .elementor-widget-html) > .elementor-widget-container > :first-child { margin-top: 0; }
:is(.elementor-widget-text-editor, .elementor-widget-html, .elementor-shortcode) > :last-child,
:is(.elementor-widget-text-editor, .elementor-widget-html) > .elementor-widget-container > :last-child { margin-bottom: 0; }

/* Shortcode output is laid out like the blocks around it */
.elementor-shortcode > * { margin-block: 0; }
.elementor-shortcode > * + * { margin-block-start: 1.25rem; }
.e-con.anv-card > .elementor-widget-shortcode .elementor-shortcode > * + * { margin-block-start: .7rem !important; }

/* Lists: like the block layout, the first/last item's margin merges into the gap to a neighbouring element */
.elementor-widget-text-editor:not(:first-child) > :is(ul, ol):not(.anv-toc):first-child > li:first-child,
.elementor-widget-text-editor:not(:first-child) > .elementor-widget-container > :is(ul, ol):not(.anv-toc):first-child > li:first-child,
.elementor-widget-shortcode:not(:first-child) .elementor-shortcode > :is(ul, ol):not(.anv-toc):first-child > li:first-child { margin-top: 0; }
.elementor-widget-text-editor:not(:last-child) > :is(ul, ol):not(.anv-toc):last-child > li:last-child,
.elementor-widget-text-editor:not(:last-child) > .elementor-widget-container > :is(ul, ol):not(.anv-toc):last-child > li:last-child,
.elementor-widget-shortcode:not(:last-child) .elementor-shortcode > :is(ul, ol):not(.anv-toc):last-child > li:last-child { margin-bottom: 0; }
.elementor-widget-text-editor:not(:last-child) .anv-logos-title:last-child { margin-bottom: 0 !important; }

/* Widget content sizes like the block version (Elementor switches everything to border-box) */
.elementor :where(.elementor-widget-html, .elementor-widget-text-editor, .elementor-widget-shortcode, .elementor-tab-content) *,
.elementor :where(.elementor-widget-html, .elementor-widget-text-editor, .elementor-widget-shortcode, .elementor-tab-content) *::before,
.elementor :where(.elementor-widget-html, .elementor-widget-text-editor, .elementor-widget-shortcode, .elementor-tab-content) *::after { box-sizing: revert; }

/* Headings keep the theme's line height (Elementor's default is 1) */
.elementor .elementor-widget-heading .elementor-heading-title { line-height: 1.15; }
.elementor .elementor-widget-heading .elementor-heading-title > a { color: inherit; }

/* Links inside text are underlined, as on the rest of the site */
.elementor :is(.elementor-widget-text-editor, .elementor-tab-content) a:not(.elementor-button) { text-decoration: underline; }
.elementor .anv-link a, .elementor .anv-contact-list a { text-decoration: none; }

/* ---------- Bands (full-width sections) ---------- */
.e-con.anv-band { --text-align: inherit; }
.e-con.anv-band + .e-con.anv-band { margin-top: 1.25rem; }
.e-con.anv-band > .e-con-inner { position: relative; z-index: 1; }

/* ---------- Cards and steps: the container gap replaces the theme's child margins ---------- */
.e-con:is(.anv-card, .anv-step, .anv-callout) > .elementor-element { margin-block: 0 !important; }
.e-con.anv-card > .elementor-widget-heading h3 { margin-top: .3rem !important; }
.e-con.anv-card > .elementor-widget-heading:first-child h3 { margin-top: 1rem !important; }
.e-con.anv-card-sm > .elementor-widget-heading h3 { margin-top: .1rem !important; }
.e-con.anv-card-sm > .elementor-widget-heading:first-child h3 { margin-top: .8rem !important; }

/* Extra space the theme adds above some groups (the container gap already gives 1.25rem) */
:is(.e-con, .e-con-inner) > .anv-center-buttons { margin-top: .75rem !important; }
:is(.e-con, .e-con-inner) > .elementor-element.anv-faqs { margin-top: .75rem !important; }
.e-con.anv-spot + .e-con.anv-spot { margin-top: calc(clamp(3rem, 8vw, 6rem) - 1.25rem) !important; }
.elementor :is(.e-con, .e-con-inner) > .elementor-widget.anv-faqs.anv-faq-toggle { max-width: 860px; }

/* ---------- Columns stack below 782px, like the block layout ---------- */
@media (max-width: 781px) {
	.e-con.anv-cols { --flex-direction: column !important; flex-direction: column !important; }
	.e-con.anv-cols > .anv-col { --width: 100% !important; width: 100% !important; }
}

/* ---------- Legal and other text pages ---------- */
.elementor .elementor-widget-heading.anv-page-title .elementor-heading-title { font-size: clamp(2rem, 4vw, 2.8rem); }
.e-con.anv-doc .elementor-widget-heading h2 { margin-top: 1.15rem; }
.e-con.anv-doc .elementor-widget-heading h3 { margin-top: .35rem; }
.e-con.anv-doc .elementor-widget-heading:first-child :is(h2, h3) { margin-top: 0; }

/* ---------- Buttons (same look as the theme's buttons) ---------- */
.elementor .anv-btn .elementor-button {
	display: inline-block;
	background-color: var(--wp--preset--color--brand, #0047AB);
	color: #fff;
	border: 0;
	border-radius: 12px;
	font-family: inherit;
	font-size: clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.227), 1rem);
	font-weight: 700;
	line-height: inherit;
	padding: .8rem 1.4rem;
	text-decoration: none;
	transition: background-color .2s, color .2s, border-color .2s;
}
.elementor .anv-btn .elementor-button:visited { color: #fff; }
.elementor .anv-btn .elementor-button:is(:hover, :focus) { background-color: var(--wp--preset--color--brand-dark, #00307A); color: #fff; }
.elementor .anv-btn .elementor-button .elementor-button-content-wrapper { display: inline; }
.elementor .anv-btn.is-style-outline .elementor-button,
.elementor .anv-btn.is-style-outline .elementor-button:visited { background: #fff; color: var(--anv-ink, #0B1220); border: 1px solid #CBD5E1; padding: .667em 1.333em; }
.elementor .anv-btn.is-style-outline .elementor-button:is(:hover, :focus) { background: #fff; border-color: var(--anv-brand, #0047AB); color: var(--anv-brand, #0047AB); }
.elementor .anv-cta .anv-btn .elementor-button,
.elementor .anv-cta .anv-btn .elementor-button:visited { background: #fff; color: var(--anv-brand, #0047AB); }
.elementor .anv-cta .anv-btn .elementor-button:is(:hover, :focus) { background: #EEF4FF; color: var(--anv-brand, #0047AB); }
.elementor .anv-cta .anv-btn.is-style-outline .elementor-button,
.elementor .anv-cta .anv-btn.is-style-outline .elementor-button:visited { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
@media (max-width: 600px) {
	.e-con:is(.anv-hero, .anv-cta) .e-con.anv-buttons { flex-direction: column; align-items: stretch; }
	.e-con:is(.anv-hero, .anv-cta) .anv-buttons > .anv-btn { width: 100%; }
	.e-con:is(.anv-hero, .anv-cta) .anv-btn .elementor-button { width: 100%; text-align: center; }
}

/* ---------- FAQ (Elementor Toggle) styled like the theme's FAQ ---------- */
.anv-faq-toggle .elementor-toggle-item { background: #fff; border: 1px solid var(--anv-line, #E5E7EB); border-radius: 16px; margin: 0 0 .75rem; overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.anv-faq-toggle .elementor-toggle-item:last-child { margin-bottom: 0; }
.anv-faq-toggle .elementor-toggle-item:has(.elementor-tab-title.elementor-active) { border-color: #C7D6F5; box-shadow: var(--anv-shadow); }
.elementor .anv-faq-toggle .elementor-toggle .elementor-tab-title { position: relative; cursor: pointer; margin: 0; border: 0; padding: 1.1rem 3.2rem 1.1rem 1.25rem; font-weight: 700; font-size: 1.02rem; line-height: 1.65; color: var(--anv-ink, #0B1220); }
.elementor .anv-faq-toggle .elementor-toggle .elementor-tab-title .elementor-toggle-title { color: inherit; text-decoration: none; }
.elementor .anv-faq-toggle .elementor-toggle .elementor-tab-title::after { content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--anv-soft, #EEF4FF); color: var(--anv-brand, #0047AB); display: grid; place-items: center; font-size: 1.2rem; font-weight: 700; line-height: 1; }
.elementor .anv-faq-toggle .elementor-toggle .elementor-tab-title.elementor-active::after { content: "\2212"; }
.elementor .anv-faq-toggle .elementor-toggle .elementor-tab-content { border: 0; padding: 0 1.25rem 1.1rem; color: inherit; }
.elementor .anv-faq-toggle .elementor-tab-content > :first-child { margin-top: 0; }
.elementor .anv-faq-toggle .elementor-tab-content > :last-child { margin-bottom: 0; }
