<!DOCTYPE html>
<html lang="de" prefix="og: https://ogp.me/ns#">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style id="wpconvert-shadcn-vars">
:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --input: 214.3 31.8% 91.4%;
  --border: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
}
.dark, [class*="bg-slate-950"], [class*="bg-gray-950"], [class*="bg-zinc-950"], [class*="bg-neutral-950"] {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 217.2 32.6% 17.5%;
  --card-foreground: 210 40% 98%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  /* EC-NAV-139: Light ink over dark heroes; unlike --primary-foreground in .dark (dark ink for buttons). */
  --wpconvert-transparent-nav-ink: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --input: 217.2 32.6% 17.5%;
  --border: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
}
/* EC-FAQ-DARK-001: FAQ answers keep light-theme text-slate-* utilities on dark pages (html.dark). */
html.dark [data-wp-faq-answer="true"] p.text-slate-300,
html.dark [data-wp-faq-answer="true"] p.text-slate-400,
html.dark [data-wp-faq-answer="true"] p.text-slate-500,
html.dark [data-wp-faq-answer="true"] .text-slate-400,
html.dark [data-wp-faq-answer="true"] .text-slate-500 {
  color: rgba(255, 255, 255, 0.74) !important;
}
</style>

<!-- Suchmaschinen-Optimierung durch Rank Math PRO - https://rankmath.com/ -->
<title>What Is a Studienkolleg? Your Pathway to Studying in Germany &#8211; Studydoor</title>
<meta name="description" content="Discover how Studienkolleg prepares international students for university in Germany, bridges educational gaps and opens the door to a Bachelor’s degree."/>
<meta name="robots" content="follow, index, max-snippet:-1, max-video-preview:-1, max-image-preview:large"/>
<link rel="canonical" href="https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/" />
<meta property="og:locale" content="de_DE" />
<meta property="og:type" content="article" />
<meta property="og:title" content="What Is a Studienkolleg? Your Pathway to Studying in Germany - Studydoor" />
<meta property="og:description" content="Discover how Studienkolleg prepares international students for university in Germany, bridges educational gaps and opens the door to a Bachelor’s degree." />
<meta property="og:url" content="https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/" />
<meta property="og:site_name" content="Studydoor" />
<meta property="article:tag" content="Alemania" />
<meta property="article:tag" content="Estudiar" />
<meta property="article:tag" content="Germany" />
<meta property="article:tag" content="Que es Studienkolleg" />
<meta property="article:tag" content="Studienkolleg" />
<meta property="article:tag" content="Studieren" />
<meta property="article:tag" content="What is Studienkolleg" />
<meta property="article:section" content="Knowledge" />
<meta property="og:updated_time" content="2026-11-19T16:32:53+00:00" />
<meta property="og:image" content="https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-1024x576.jpg" />
<meta property="og:image:secure_url" content="https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-1024x576.jpg" />
<meta property="og:image:width" content="1024" />
<meta property="og:image:height" content="576" />
<meta property="og:image:alt" content="Studienkolleg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="article:published_time" content="2026-11-19T16:30:22+00:00" />
<meta property="article:modified_time" content="2026-11-19T16:32:53+00:00" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="What Is a Studienkolleg? Your Pathway to Studying in Germany - Studydoor" />
<meta name="twitter:description" content="Discover how Studienkolleg prepares international students for university in Germany, bridges educational gaps and opens the door to a Bachelor’s degree." />
<meta name="twitter:image" content="https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-1024x576.jpg" />
<meta name="twitter:label1" content="Verfasst von" />
<meta name="twitter:data1" content="admin" />
<meta name="twitter:label2" content="Lesedauer" />
<meta name="twitter:data2" content="2 Minuten" />
<script type="application/ld+json" class="rank-math-schema">{"@context":"https://schema.org","@graph":[{"@type":["EducationalOrganization","Organization"],"@id":"https://studydoor.de/#organization","name":"Studydoor","url":"https://studydoor.de","email":"info@studydoor.de","logo":{"@type":"ImageObject","@id":"https://studydoor.de/#logo","url":"https://studydoor.de/wp-content/uploads/2026/10/SVG-01.svg","contentUrl":"https://studydoor.de/wp-content/uploads/2026/10/SVG-01.svg","caption":"Studydoor","inLanguage":"de","width":"","height":""},"description":"Studydoor supports international students throughout their journey to German universities, from the first application to the first semester."},{"@type":"WebSite","@id":"https://studydoor.de/#website","url":"https://studydoor.de","name":"Studydoor","publisher":{"@id":"https://studydoor.de/#organization"},"inLanguage":"de"},{"@type":"ImageObject","@id":"https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash.jpg","url":"https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash.jpg","width":"2400","height":"1350","inLanguage":"de"},{"@type":"WebPage","@id":"https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/#webpage","url":"https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/","name":"What Is a Studienkolleg? Your Pathway to Studying in Germany - Studydoor","datePublished":"2026-11-19T16:30:22+00:00","dateModified":"2026-11-19T16:32:53+00:00","isPartOf":{"@id":"https://studydoor.de/#website"},"primaryImageOfPage":{"@id":"https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash.jpg"},"inLanguage":"de"},{"@type":"Person","@id":"https://studydoor.de/author/admin/","name":"admin","url":"https://studydoor.de/author/admin/","image":{"@type":"ImageObject","@id":"https://secure.gravatar.com/avatar/b5dd367a181626064abccc1d0e29dd0971ce73e1ba4a9f06ac85caad846a5f07?s=96&amp;d=mm&amp;r=g","url":"https://secure.gravatar.com/avatar/b5dd367a181626064abccc1d0e29dd0971ce73e1ba4a9f06ac85caad846a5f07?s=96&amp;d=mm&amp;r=g","caption":"admin","inLanguage":"de"},"sameAs":["http://studydoor.de"],"worksFor":{"@id":"https://studydoor.de/#organization"}},{"@type":"BlogPosting","headline":"What Is a Studienkolleg? Your Pathway to Studying in Germany - Studydoor","keywords":"Studienkolleg","datePublished":"2026-11-19T16:30:22+00:00","dateModified":"2026-11-19T16:32:53+00:00","articleSection":"Knowledge","author":{"@id":"https://studydoor.de/author/admin/","name":"admin"},"publisher":{"@id":"https://studydoor.de/#organization"},"description":"Discover how Studienkolleg prepares international students for university in Germany, bridges educational gaps and opens the door to a Bachelor\u2019s degree.","name":"What Is a Studienkolleg? Your Pathway to Studying in Germany - Studydoor","@id":"https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/#richSnippet","isPartOf":{"@id":"https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/#webpage"},"image":{"@id":"https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash.jpg"},"inLanguage":"de","mainEntityOfPage":{"@id":"https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/#webpage"}}]}</script>
<!-- /Rank Math WordPress SEO Plugin -->

<link rel='dns-prefetch' href='//fonts.googleapis.com' />
<link rel="alternate" type="application/rss+xml" title="Studydoor &raquo; Kommentar-Feed zu What Is a Studienkolleg? Your Pathway to Studying in Germany" href="https://studydoor.de/knowledge/what-is-a-studienkolleg-your-pathway-to-studying-in-germany/feed/" />
<link rel="alternate" title="oEmbed (JSON)" type="application/json+oembed" href="https://studydoor.de/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fstudydoor.de%2Fknowledge%2Fwhat-is-a-studienkolleg-your-pathway-to-studying-in-germany%2F" />
<link rel="alternate" title="oEmbed (XML)" type="text/xml+oembed" href="https://studydoor.de/wp-json/oembed/1.0/embed?url=https%3A%2F%2Fstudydoor.de%2Fknowledge%2Fwhat-is-a-studienkolleg-your-pathway-to-studying-in-germany%2F&#038;format=xml" />
<style id="wp-img-auto-sizes-contain-inline-css">
img:is([sizes=auto i],[sizes^="auto," i]){contain-intrinsic-size:3000px 1500px}
/*# sourceURL=wp-img-auto-sizes-contain-inline-css */
</style>
<style id="wp-emoji-styles-inline-css">

	img.wp-smiley, img.emoji {
		display: inline !important;
		border: none !important;
		box-shadow: none !important;
		height: 1em !important;
		width: 1em !important;
		margin: 0 0.07em !important;
		vertical-align: -0.1em !important;
		background: none !important;
		padding: 0 !important;
	}
/*# sourceURL=wp-emoji-styles-inline-css */
</style>
<link rel='stylesheet' id='wp-block-library-css' href='https://studydoor.de/wp-includes/css/dist/block-library/common.min.css?ver=7.1.5' media='all' />
<style id="wp-block-accordion-inline-css">
.wp-block-accordion{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/accordion/style.min.css */
</style>
<style id="wp-block-accordion-item-inline-css">
.wp-block-accordion-item.is-open>.wp-block-accordion-heading .wp-block-accordion-heading__toggle-icon{transform:rotate(45deg)}@media (prefers-reduced-motion:no-preference){.wp-block-accordion-item{transition:grid-template-rows .3s ease-out}.wp-block-accordion-item>.wp-block-accordion-heading .wp-block-accordion-heading__toggle-icon{transition:transform .2s ease-in-out}}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/accordion-item/style.min.css */
</style>
<style id="wp-block-archives-inline-css">
.wp-block-archives{box-sizing:border-box}.wp-block-archives-dropdown label{display:block}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/archives/style.min.css */
</style>
<style id="wp-block-avatar-inline-css">
.wp-block-avatar{line-height:0}.wp-block-avatar,.wp-block-avatar img{box-sizing:border-box}.wp-block-avatar.aligncenter{text-align:center}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/avatar/style.min.css */
</style>
<style id="wp-block-breadcrumbs-inline-css">
.wp-block-breadcrumbs{box-sizing:border-box}.wp-block-breadcrumbs ol{flex-wrap:wrap;list-style:none}.wp-block-breadcrumbs li,.wp-block-breadcrumbs ol{align-items:center;display:flex;margin:0;padding:0}.wp-block-breadcrumbs li:not(:last-child):after{content:var(--separator,"/")/"";margin:0 .5em;opacity:.7}.wp-block-breadcrumbs span{color:inherit}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/breadcrumbs/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-button-css' href='https://studydoor.de/wp-includes/blocks/button/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-calendar-inline-css">
.wp-block-calendar{text-align:center}.wp-block-calendar td,.wp-block-calendar th{border:1px solid;padding:.25em}.wp-block-calendar th{font-weight:400}.wp-block-calendar caption{background-color:inherit}.wp-block-calendar table{border-collapse:collapse;width:100%}.wp-block-calendar table.has-background th{background-color:inherit}.wp-block-calendar table.has-text-color th{color:inherit}.wp-block-calendar :where(table:not(.has-text-color)){color:#40464d}.wp-block-calendar :where(table:not(.has-text-color)) td,.wp-block-calendar :where(table:not(.has-text-color)) th{border-color:#ddd}:where(.wp-block-calendar table:not(.has-background) th){background:#ddd}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/calendar/style.min.css */
</style>
<style id="wp-block-categories-inline-css">
.wp-block-categories{box-sizing:border-box}.wp-block-categories.alignleft{margin-right:2em}.wp-block-categories.alignright{margin-left:2em}.wp-block-categories.wp-block-categories-dropdown.aligncenter{text-align:center}.wp-block-categories .wp-block-categories__label:not(.screen-reader-text){display:block;width:100%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/categories/style.min.css */
</style>
<style id="wp-block-comment-author-name-inline-css">
.wp-block-comment-author-name{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comment-author-name/style.min.css */
</style>
<style id="wp-block-comment-content-inline-css">
.comment-awaiting-moderation{display:block;font-size:.875em;line-height:1.5}.wp-block-comment-content{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comment-content/style.min.css */
</style>
<style id="wp-block-comment-date-inline-css">
.wp-block-comment-date{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comment-date/style.min.css */
</style>
<style id="wp-block-comment-edit-link-inline-css">
.wp-block-comment-edit-link{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comment-edit-link/style.min.css */
</style>
<style id="wp-block-comment-reply-link-inline-css">
.wp-block-comment-reply-link{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comment-reply-link/style.min.css */
</style>
<style id="wp-block-comment-template-inline-css">
.wp-block-comment-template{box-sizing:border-box;list-style:none;margin-bottom:0;max-width:100%;padding:0}.wp-block-comment-template li{clear:both}.wp-block-comment-template ol{list-style:none;margin-bottom:0;max-width:100%;padding-left:2rem}.wp-block-comment-template.alignleft{float:left}.wp-block-comment-template.aligncenter{margin-left:auto;margin-right:auto;width:-moz-fit-content;width:fit-content}.wp-block-comment-template.alignright{float:right}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comment-template/style.min.css */
</style>
<style id="wp-block-comments-inline-css">
.wp-block-post-comments{box-sizing:border-box}.wp-block-post-comments .alignleft{float:left}.wp-block-post-comments .alignright{float:right}.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;margin-top:.5em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}.wp-block-comments{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comments/style.min.css */
</style>
<style id="wp-block-comments-pagination-inline-css">
.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{font-size:inherit}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow{display:inline-block;margin-right:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow{display:inline-block;margin-left:1ch}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination.aligncenter{justify-content:center}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/comments-pagination/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-cover-css' href='https://studydoor.de/wp-includes/blocks/cover/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-details-inline-css">
.wp-block-details{box-sizing:border-box}.wp-block-details summary{cursor:pointer}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/details/style.min.css */
</style>
<style id="wp-block-file-inline-css">
.wp-block-file{box-sizing:border-box}.wp-block-file:not(.wp-element-button){font-size:.8em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file *+.wp-block-file__button{margin-left:.75em}:where(.wp-block-file){margin-bottom:1.5em}.wp-block-file__embed{margin-bottom:1em}:where(.wp-block-file__button){border-radius:2em;display:inline-block;padding:.5em 1em}:where(.wp-block-file__button):where(a):active,:where(.wp-block-file__button):where(a):focus,:where(.wp-block-file__button):where(a):hover,:where(.wp-block-file__button):where(a):visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/file/style.min.css */
</style>
<style id="wp-block-footnotes-inline-css">
.editor-styles-wrapper,.entry-content{counter-reset:footnotes}a[data-fn].fn{counter-increment:footnotes;display:inline-flex;font-size:smaller;text-decoration:none;text-indent:-9999999px;vertical-align:super}a[data-fn].fn:after{content:"[" counter(footnotes) "]";float:left;text-indent:0}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/footnotes/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-gallery-css' href='https://studydoor.de/wp-includes/blocks/gallery/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-heading-inline-css">
h1:where(.wp-block-heading).has-background,h2:where(.wp-block-heading).has-background,h3:where(.wp-block-heading).has-background,h4:where(.wp-block-heading).has-background,h5:where(.wp-block-heading).has-background,h6:where(.wp-block-heading).has-background{padding:1.25em 2.375em}h1.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h1.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h2.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h2.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h3.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h3.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h4.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h4.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h5.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h5.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]),h6.has-text-align-left[style*=writing-mode]:where([style*=vertical-lr]),h6.has-text-align-right[style*=writing-mode]:where([style*=vertical-rl]){rotate:180deg}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/heading/style.min.css */
</style>
<style id="wp-block-icon-inline-css">
.wp-block-icon{line-height:0}.wp-block-icon.aligncenter{display:flex;justify-content:center}.wp-block-icon svg{fill:currentColor;box-sizing:border-box}.wp-block-icon svg.is-flip-horizontal{transform:scaleX(-1)}.wp-block-icon svg.is-flip-vertical{transform:scaleY(-1)}.wp-block-icon svg.is-flip-horizontal.is-flip-vertical{transform:scaleX(-1) scaleY(-1)}:where(.wp-block-icon) svg{height:100%;width:100%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/icon/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-image-css' href='https://studydoor.de/wp-includes/blocks/image/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-latest-comments-inline-css">
:where(.wp-block-latest-comments){padding-left:0}ol.wp-block-latest-comments{box-sizing:border-box;margin-left:0}:where(.wp-block-latest-comments:not([style*=line-height] .wp-block-latest-comments__comment)){line-height:1.1}:where(.wp-block-latest-comments:not([style*=line-height] .wp-block-latest-comments__comment-excerpt p)){line-height:1.8}.has-dates :where(.wp-block-latest-comments:not([style*=line-height])),.has-excerpts :where(.wp-block-latest-comments:not([style*=line-height])){line-height:1.5}.wp-block-latest-comments__comment{list-style:none;margin-bottom:1em}.has-avatars .wp-block-latest-comments__comment{list-style:none;min-height:2.25em}.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt,.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta{margin-left:3.25em}.wp-block-latest-comments__comment-excerpt p{font-size:.875em;margin:.36em 0 1.4em}.wp-block-latest-comments__comment-date{display:block;font-size:.75em}.wp-block-latest-comments .avatar,.wp-block-latest-comments__comment-avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;width:2.5em}.wp-block-latest-comments[class*=-font-size] a,.wp-block-latest-comments[style*=font-size] a{font-size:inherit}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/latest-comments/style.min.css */
</style>
<style id="wp-block-latest-posts-inline-css">
.wp-block-latest-posts{box-sizing:border-box}.wp-block-latest-posts.alignleft{margin-right:2em}.wp-block-latest-posts.alignright{margin-left:2em}.wp-block-latest-posts.wp-block-latest-posts__list{list-style:none}.wp-block-latest-posts.wp-block-latest-posts__list li{clear:both;overflow-wrap:break-word}.wp-block-latest-posts.is-grid:not(.is-layout-grid){display:flex;flex-wrap:wrap}.wp-block-latest-posts.is-grid:not(.is-layout-grid) li{margin:0 1.25em 1.25em 0;width:100%}@media (min-width:600px){.wp-block-latest-posts.columns-2:not(.is-layout-grid) li{width:calc(50% - .625em)}.wp-block-latest-posts.columns-2:not(.is-layout-grid) li:nth-child(2n){margin-right:0}.wp-block-latest-posts.columns-3:not(.is-layout-grid) li{width:calc(33.33333% - .83333em)}.wp-block-latest-posts.columns-3:not(.is-layout-grid) li:nth-child(3n){margin-right:0}.wp-block-latest-posts.columns-4:not(.is-layout-grid) li{width:calc(25% - .9375em)}.wp-block-latest-posts.columns-4:not(.is-layout-grid) li:nth-child(4n){margin-right:0}.wp-block-latest-posts.columns-5:not(.is-layout-grid) li{width:calc(20% - 1em)}.wp-block-latest-posts.columns-5:not(.is-layout-grid) li:nth-child(5n){margin-right:0}.wp-block-latest-posts.columns-6:not(.is-layout-grid) li{width:calc(16.66667% - 1.04167em)}.wp-block-latest-posts.columns-6:not(.is-layout-grid) li:nth-child(6n){margin-right:0}}@media (max-width:600px){.wp-block-latest-posts-is-layout-grid[class*=columns-]:not(.has-native-responsive-grid){grid-template-columns:1fr}}:root :where(.wp-block-latest-posts.is-grid){padding:0}:root :where(.wp-block-latest-posts.wp-block-latest-posts__list){padding-left:0}.wp-block-latest-posts__post-author,.wp-block-latest-posts__post-date{display:block;font-size:.8125em}.wp-block-latest-posts__post-excerpt,.wp-block-latest-posts__post-full-content{margin-bottom:1em;margin-top:.5em}.wp-block-latest-posts__featured-image a{display:inline-block}.wp-block-latest-posts__featured-image img{height:auto;max-width:100%;width:auto}.wp-block-latest-posts__featured-image.alignleft{float:left;margin-right:1em}.wp-block-latest-posts__featured-image.alignright{float:right;margin-left:1em}.wp-block-latest-posts__featured-image.aligncenter{margin-bottom:1em;text-align:center}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/latest-posts/style.min.css */
</style>
<style id="wp-block-list-inline-css">
ol,ul{box-sizing:border-box}:root :where(.wp-block-list.has-background){padding:1.25em 2.375em}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/list/style.min.css */
</style>
<style id="wp-block-loginout-inline-css">
.wp-block-loginout{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/loginout/style.min.css */
</style>
<style id="wp-block-media-text-inline-css">
.wp-block-media-text{box-sizing:border-box;direction:ltr;display:grid;grid-template-columns:50% 1fr;grid-template-rows:auto}.wp-block-media-text.has-media-on-the-right{grid-template-columns:1fr 50%}.wp-block-media-text.is-vertically-aligned-top>.wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-top>.wp-block-media-text__media{align-self:start}.wp-block-media-text.is-vertically-aligned-center>.wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-center>.wp-block-media-text__media,.wp-block-media-text>.wp-block-media-text__content,.wp-block-media-text>.wp-block-media-text__media{align-self:center}.wp-block-media-text.is-vertically-aligned-bottom>.wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-bottom>.wp-block-media-text__media{align-self:end}.wp-block-media-text>.wp-block-media-text__media{grid-column:1;grid-row:1;margin:0}.wp-block-media-text>.wp-block-media-text__content{direction:ltr;grid-column:2;grid-row:1;padding:0 8%;word-break:break-word}.wp-block-media-text.has-media-on-the-right>.wp-block-media-text__media{grid-column:2;grid-row:1}.wp-block-media-text.has-media-on-the-right>.wp-block-media-text__content{grid-column:1;grid-row:1}.wp-block-media-text__media a{display:block}.wp-block-media-text__media img,.wp-block-media-text__media video{height:auto;max-width:unset;vertical-align:middle;width:100%}.wp-block-media-text.is-image-fill>.wp-block-media-text__media{background-size:cover;height:100%;min-height:250px}.wp-block-media-text.is-image-fill>.wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill>.wp-block-media-text__media img{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.wp-block-media-text.is-image-fill-element>.wp-block-media-text__media{height:100%;min-height:250px;position:relative}.wp-block-media-text.is-image-fill-element>.wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill-element>.wp-block-media-text__media img{height:100%;-o-object-fit:cover;object-fit:cover;position:absolute;width:100%}@media (max-width:600px){.wp-block-media-text.is-stacked-on-mobile{grid-template-columns:100%!important}.wp-block-media-text.is-stacked-on-mobile>.wp-block-media-text__media{grid-column:1;grid-row:1}.wp-block-media-text.is-stacked-on-mobile>.wp-block-media-text__content{grid-column:1;grid-row:2}}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/media-text/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-navigation-css' href='https://studydoor.de/wp-includes/blocks/navigation/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-navigation-link-inline-css">
.wp-block-navigation .wp-block-navigation-item__label{overflow-wrap:break-word}.wp-block-navigation .wp-block-navigation-item__description{display:none}.link-ui-tools{outline:1px solid #f0f0f0;padding:8px}.link-ui-block-inserter{padding-top:8px}.link-ui-block-inserter__back{margin-left:8px;text-transform:uppercase}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/navigation-link/style.min.css */
</style>
<style id="wp-block-navigation-overlay-close-inline-css">
.wp-block-navigation-overlay-close{align-items:center;background:transparent;border:none;cursor:pointer;display:inline-flex;gap:.5em;justify-content:center;padding:0;text-decoration:none}.wp-block-navigation-overlay-close:focus{outline-offset:2px}.wp-block-navigation-overlay-close svg{fill:currentColor;display:block;flex-shrink:0;height:24px;width:24px}.wp-block-navigation-overlay-close .wp-block-navigation-overlay-close__text{align-items:center;display:inline-flex}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/navigation-overlay-close/style.min.css */
</style>
<style id="wp-block-page-list-inline-css">
.wp-block-navigation .wp-block-page-list{align-items:var(--navigation-layout-align,initial);background-color:inherit;display:flex;flex-direction:var(--navigation-layout-direction,initial);flex-wrap:var(--navigation-layout-wrap,wrap);justify-content:var(--navigation-layout-justify,initial)}.wp-block-navigation .wp-block-navigation-item{background-color:inherit}.wp-block-page-list{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/page-list/style.min.css */
</style>
<style id="wp-block-paragraph-inline-css">
.is-small-text{font-size:.875em}.is-regular-text{font-size:1em}.is-large-text{font-size:2.25em}.is-larger-text{font-size:3em}.has-drop-cap:not(:focus):first-letter{float:left;font-size:8.4em;font-style:normal;font-weight:100;line-height:.68;margin:.05em .1em 0 0;text-transform:uppercase}body.rtl .has-drop-cap:not(:focus):first-letter{float:none;margin-left:.1em}p.has-drop-cap.has-background{overflow:hidden}:root :where(p.has-background){padding:1.25em 2.375em}:where(p.has-text-color:not(.has-link-color)) a{color:inherit}p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[style*="writing-mode:vertical-rl"]{rotate:180deg}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/paragraph/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-playlist-css' href='https://studydoor.de/wp-includes/blocks/playlist/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-playlist-track-inline-css">
.wp-block-playlist-track:has([aria-current=true]){background-color:color-mix(in srgb,currentColor 10%,transparent)}.wp-block-playlist-track:hover{background-color:color-mix(in srgb,currentColor 15%,transparent)}.wp-block-playlist__tracklist-show-numbers .wp-block-playlist-track{counter-increment:playlist-track}.wp-block-playlist-track .wp-block-playlist-track__button{align-items:center;background-color:transparent;border:0;color:inherit;cursor:pointer;display:flex;font-family:inherit;font-size:inherit;outline-offset:2px;padding:var(--wp--preset--spacing--20,.5em);text-align:left;width:100%}.wp-block-playlist__tracklist-show-numbers .wp-block-playlist-track .wp-block-playlist-track__button:before{content:counter(playlist-track);font-size:.85em;margin-right:var(--wp--preset--spacing--20,.5em);opacity:.7;width:2ch}.wp-block-playlist-track .wp-block-playlist-track__button .wp-block-playlist-track__image{border:1px solid rgba(0,0,0,.08);box-sizing:border-box;flex:0 0 50px;height:50px;margin-right:var(--wp--preset--spacing--20,.5em);-o-object-fit:cover;object-fit:cover;width:50px}.wp-block-playlist-track .wp-block-playlist-track__button .wp-block-playlist-track__content{flex:1 1 0;min-width:0}.wp-block-playlist-track .wp-block-playlist-track__button .wp-block-playlist-track__title{display:block}.wp-block-playlist-track .wp-block-playlist-track__button .wp-block-playlist-track__artist{display:block;font-size:.85em;margin-top:.125em;opacity:.7}.wp-block-playlist-track .wp-block-playlist-track__button .wp-block-playlist-track__length{font-size:.85em;margin-left:auto;opacity:.7}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/playlist-track/style.min.css */
</style>
<style id="wp-block-post-author-inline-css">
.wp-block-post-author{box-sizing:border-box;display:flex;flex-wrap:wrap}.wp-block-post-author__byline{font-size:.5em;margin-bottom:0;margin-top:0;width:100%}.wp-block-post-author__avatar{margin-right:1em}.wp-block-post-author__bio{font-size:.7em;margin-bottom:.7em}.wp-block-post-author__content{flex-basis:0;flex-grow:1}.wp-block-post-author__name{margin:0}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-author/style.min.css */
</style>
<style id="wp-block-post-author-biography-inline-css">
.wp-block-post-author-biography{box-sizing:border-box;white-space:pre-wrap}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-author-biography/style.min.css */
</style>
<style id="wp-block-post-author-name-inline-css">
.wp-block-post-author-name{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-author-name/style.min.css */
</style>
<style id="wp-block-post-comments-count-inline-css">
.wp-block-post-comments-count{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-comments-count/style.min.css */
</style>
<style id="wp-block-post-comments-form-inline-css">
:where(.wp-block-post-comments-form input:not([type=submit])),:where(.wp-block-post-comments-form textarea){border:1px solid #949494;font-family:inherit;font-size:1em}:where(.wp-block-post-comments-form input:where(:not([type=submit]):not([type=checkbox]))),:where(.wp-block-post-comments-form textarea){padding:calc(.667em + 2px)}.wp-block-post-comments-form{box-sizing:border-box}.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form :where(input[type=submit]){box-shadow:none;cursor:pointer;display:inline-block;overflow-wrap:break-word;text-align:center}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-comments-form/style.min.css */
</style>
<style id="wp-block-buttons-inline-css">
.wp-block-buttons{box-sizing:border-box}.wp-block-buttons.is-vertical{flex-direction:column}.wp-block-buttons.is-vertical>.wp-block-button:last-child{margin-bottom:0}.wp-block-buttons>.wp-block-button{display:inline-block;margin:0}.wp-block-buttons.is-content-justification-left{justify-content:flex-start}.wp-block-buttons.is-content-justification-left.is-vertical{align-items:flex-start}.wp-block-buttons.is-content-justification-center{justify-content:center}.wp-block-buttons.is-content-justification-center.is-vertical{align-items:center}.wp-block-buttons.is-content-justification-right{justify-content:flex-end}.wp-block-buttons.is-content-justification-right.is-vertical{align-items:flex-end}.wp-block-buttons.is-content-justification-space-between{justify-content:space-between}.wp-block-buttons.aligncenter{text-align:center}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block-button.aligncenter{margin-left:auto;margin-right:auto;width:100%}.wp-block-buttons[style*=text-decoration] .wp-block-button,.wp-block-buttons[style*=text-decoration] .wp-block-button__link{text-decoration:inherit}.wp-block-buttons.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons .wp-block-button__link{width:100%}.wp-block-button.aligncenter{text-align:center}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/buttons/style.min.css */
</style>
<style id="wp-block-post-comments-link-inline-css">
.wp-block-post-comments-link{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-comments-link/style.min.css */
</style>
<style id="wp-block-post-content-inline-css">
.wp-block-post-content{display:flow-root}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-content/style.min.css */
</style>
<style id="wp-block-post-date-inline-css">
.wp-block-post-date{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-date/style.min.css */
</style>
<style id="wp-block-post-excerpt-inline-css">
:where(.wp-block-post-excerpt){box-sizing:border-box;margin-bottom:var(--wp--style--block-gap);margin-top:var(--wp--style--block-gap)}.wp-block-post-excerpt__excerpt{margin-bottom:0;margin-top:0}.wp-block-post-excerpt__more-text{margin-bottom:0;margin-top:var(--wp--style--block-gap)}.wp-block-post-excerpt__more-link{display:inline-block}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-excerpt/style.min.css */
</style>
<style id="wp-block-post-featured-image-inline-css">
.wp-block-post-featured-image{margin-left:0;margin-right:0}.wp-block-post-featured-image a{display:block;height:100%}.wp-block-post-featured-image :where(img){box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom;width:100%}.wp-block-post-featured-image.alignfull img,.wp-block-post-featured-image.alignwide img{width:100%}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim{background-color:#000;inset:0;position:absolute}.wp-block-post-featured-image{position:relative}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-gradient{background-color:transparent}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-0{opacity:0}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-10{opacity:.1}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-20{opacity:.2}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-30{opacity:.3}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-40{opacity:.4}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-50{opacity:.5}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-60{opacity:.6}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-70{opacity:.7}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-80{opacity:.8}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-90{opacity:.9}.wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100{opacity:1}.wp-block-post-featured-image:where(.alignleft,.alignright){width:100%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-featured-image/style.min.css */
</style>
<style id="wp-block-post-navigation-link-inline-css">
.wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-previous{display:inline-block;margin-right:1ch}.wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-previous:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-next{display:inline-block;margin-left:1ch}.wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-next:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-post-navigation-link.has-text-align-left[style*="writing-mode: vertical-lr"],.wp-block-post-navigation-link.has-text-align-right[style*="writing-mode: vertical-rl"]{rotate:180deg}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-navigation-link/style.min.css */
</style>
<style id="wp-block-post-template-inline-css">
.wp-block-post-template{box-sizing:border-box;list-style:none;margin-bottom:0;margin-top:0;max-width:100%;padding:0}.wp-block-post-template.is-flex-container{display:flex;flex-direction:row;flex-wrap:wrap;gap:1.25em}.wp-block-post-template.is-flex-container>li{margin:0;width:100%}@media (min-width:600px){.wp-block-post-template.is-flex-container.is-flex-container.columns-2>li{width:calc(50% - .625em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-3>li{width:calc(33.33333% - .83333em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-4>li{width:calc(25% - .9375em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-5>li{width:calc(20% - 1em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-6>li{width:calc(16.66667% - 1.04167em)}}@media (max-width:600px){.wp-block-post-template-is-layout-grid[class*=columns-]:not(.has-native-responsive-grid){grid-template-columns:1fr}}.wp-block-post-template-is-layout-constrained>li>.alignright,.wp-block-post-template-is-layout-flow>li>.alignright{float:right;margin-inline-end:0;margin-inline-start:2em}.wp-block-post-template-is-layout-constrained>li>.alignleft,.wp-block-post-template-is-layout-flow>li>.alignleft{float:left;margin-inline-end:2em;margin-inline-start:0}.wp-block-post-template-is-layout-constrained>li>.aligncenter,.wp-block-post-template-is-layout-flow>li>.aligncenter{margin-inline-end:auto;margin-inline-start:auto}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-template/style.min.css */
</style>
<style id="wp-block-post-terms-inline-css">
.wp-block-post-terms{box-sizing:border-box}.wp-block-post-terms .wp-block-post-terms__separator{white-space:pre-wrap}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-terms/style.min.css */
</style>
<style id="wp-block-post-time-to-read-inline-css">
.wp-block-post-time-to-read{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-time-to-read/style.min.css */
</style>
<style id="wp-block-post-title-inline-css">
.wp-block-post-title{box-sizing:border-box;word-break:break-word}.wp-block-post-title :where(a){display:inline-block;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/post-title/style.min.css */
</style>
<style id="wp-block-query-pagination-inline-css">
.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-next:last-of-type{margin-inline-start:auto}.wp-block-query-pagination.is-content-justification-space-between>.wp-block-query-pagination-previous:first-child{margin-inline-end:auto}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow{display:inline-block;margin-right:1ch}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-query-pagination .wp-block-query-pagination-next-arrow{display:inline-block;margin-left:1ch}.wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-query-pagination.aligncenter{justify-content:center}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/query-pagination/style.min.css */
</style>
<style id="wp-block-query-title-inline-css">
.wp-block-query-title{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/query-title/style.min.css */
</style>
<style id="wp-block-query-total-inline-css">
.wp-block-query-total{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/query-total/style.min.css */
</style>
<style id="wp-block-read-more-inline-css">
.wp-block-read-more{display:block;width:-moz-fit-content;width:fit-content}.wp-block-read-more:where(:not([style*=text-decoration])){text-decoration:none}.wp-block-read-more:where(:not([style*=text-decoration])):active,.wp-block-read-more:where(:not([style*=text-decoration])):focus{text-decoration:none}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/read-more/style.min.css */
</style>
<style id="wp-block-rss-inline-css">
ul.wp-block-rss.alignleft{margin-right:2em}ul.wp-block-rss.alignright{margin-left:2em}ul.wp-block-rss.is-grid{display:flex;flex-wrap:wrap;padding:0}ul.wp-block-rss.is-grid li{margin:0 1em 1em 0;width:100%}@media (min-width:600px){ul.wp-block-rss.columns-2 li{width:calc(50% - 1em)}ul.wp-block-rss.columns-3 li{width:calc(33.33333% - 1em)}ul.wp-block-rss.columns-4 li{width:calc(25% - 1em)}ul.wp-block-rss.columns-5 li{width:calc(20% - 1em)}ul.wp-block-rss.columns-6 li{width:calc(16.66667% - 1em)}}.wp-block-rss__item-author,.wp-block-rss__item-publish-date{display:block;font-size:.8125em}.wp-block-rss{box-sizing:border-box;list-style:none;padding:0}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/rss/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-search-css' href='https://studydoor.de/wp-includes/blocks/search/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-site-logo-inline-css">
.wp-block-site-logo{box-sizing:border-box;line-height:0}.wp-block-site-logo a{display:inline-block;line-height:0}.wp-block-site-logo.is-default-size img{height:auto;width:120px}.wp-block-site-logo img{height:auto;max-width:100%}.wp-block-site-logo a,.wp-block-site-logo img{border-radius:inherit}.wp-block-site-logo.aligncenter{margin-left:auto;margin-right:auto;text-align:center}:root :where(.wp-block-site-logo.is-style-rounded){border-radius:9999px}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/site-logo/style.min.css */
</style>
<style id="wp-block-site-tagline-inline-css">
.wp-block-site-tagline{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/site-tagline/style.min.css */
</style>
<style id="wp-block-site-title-inline-css">
.wp-block-site-title{box-sizing:border-box}.wp-block-site-title :where(a){color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/site-title/style.min.css */
</style>
<style id="wp-block-tab-list-inline-css">
:where(.wp-block-tab-list button){-moz-appearance:none;appearance:none;-webkit-appearance:none;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:block;flex-basis:inherit!important;flex-grow:inherit!important;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:var(--wp--preset--spacing--20,.5em) var(--wp--preset--spacing--30,1em);position:relative;text-align:inherit;text-decoration:none;text-transform:inherit;width:-moz-max-content;width:max-content}:where(.wp-block-tab-list button)[aria-selected=true]:before{border-bottom:2px solid;bottom:0;content:"";left:0;pointer-events:none;position:absolute;width:100%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/tab-list/style.min.css */
</style>
<style id="wp-block-tab-panel-inline-css">
.wp-block-tab-panel:empty,.wp-block-tab-panel[hidden]{display:none!important}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/tab-panel/style.min.css */
</style>
<style id="wp-block-tabs-inline-css">
.wp-block-tabs{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/tabs/style.min.css */
</style>
<style id="wp-block-tag-cloud-inline-css">
.wp-block-tag-cloud{box-sizing:border-box}.wp-block-tag-cloud.aligncenter{justify-content:center;text-align:center}.wp-block-tag-cloud a{display:inline-block;margin-right:5px}.wp-block-tag-cloud span{display:inline-block;margin-left:5px;text-decoration:none}:root :where(.wp-block-tag-cloud.is-style-outline){display:flex;flex-wrap:wrap;gap:1ch}:root :where(.wp-block-tag-cloud.is-style-outline a){border:1px solid;font-size:unset!important;margin-right:0;padding:1ch 2ch;text-decoration:none!important}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/tag-cloud/style.min.css */
</style>
<style id="wp-block-term-count-inline-css">
.wp-block-term-count{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/term-count/style.min.css */
</style>
<style id="wp-block-term-description-inline-css">
:where(.wp-block-term-description){box-sizing:border-box;margin-bottom:var(--wp--style--block-gap);margin-top:var(--wp--style--block-gap)}.wp-block-term-description p{margin-bottom:0;margin-top:0}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/term-description/style.min.css */
</style>
<style id="wp-block-term-name-inline-css">
.wp-block-term-name{box-sizing:border-box}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/term-name/style.min.css */
</style>
<style id="wp-block-term-template-inline-css">
.wp-block-term-template{box-sizing:border-box;list-style:none;margin-bottom:0;margin-top:0;max-width:100%;padding:0}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/term-template/style.min.css */
</style>
<style id="wp-block-video-inline-css">
.wp-block-video{box-sizing:border-box}.wp-block-video video{height:auto;vertical-align:middle;width:100%}@supports (position:sticky){.wp-block-video [poster]{-o-object-fit:cover;object-fit:cover}}.wp-block-video.aligncenter{text-align:center}.wp-block-video :where(figcaption){margin-bottom:1em;margin-top:.5em}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/video/style.min.css */
</style>
<style id="wp-block-accordion-heading-inline-css">
.wp-block-accordion-heading__toggle{align-items:center;background:none;border:none;color:inherit;cursor:pointer;display:flex;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;overflow:hidden;padding:var(--wp--preset--spacing--20,1em) 0;text-align:inherit;text-decoration:inherit;text-transform:inherit;width:100%;word-spacing:inherit}.wp-block-accordion-heading__toggle:not(:focus-visible){outline:none}.wp-block-accordion-heading__toggle:hover .wp-block-accordion-heading__toggle-title{text-decoration:underline}.wp-block-accordion-heading__toggle-title{flex:1}.wp-block-accordion-heading__toggle-icon{align-items:center;display:flex;height:1.2em;justify-content:center;width:1.2em}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/accordion-heading/style.min.css */
</style>
<style id="wp-block-accordion-panel-inline-css">
.wp-block-accordion-panel[hidden]{border:none!important;box-shadow:none!important;margin-block-start:0;padding:0!important}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/accordion-panel/style.min.css */
</style>
<style id="wp-block-audio-inline-css">
.wp-block-audio{box-sizing:border-box}.wp-block-audio :where(figcaption){margin-bottom:1em;margin-top:.5em}.wp-block-audio audio{min-width:300px;width:100%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/audio/style.min.css */
</style>
<style id="wp-block-code-inline-css">
.wp-block-code{box-sizing:border-box}.wp-block-code code{direction:ltr;display:block;font-family:inherit;overflow-wrap:break-word;text-align:initial;white-space:break-spaces}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/code/style.min.css */
</style>
<style id="wp-block-columns-inline-css">
.wp-block-columns{box-sizing:border-box;display:flex;flex-wrap:wrap!important}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap!important}}.wp-block-columns{align-items:normal!important}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}@media (max-width:781px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important}}@media (min-width:782px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column[style*=flex-basis]{flex-grow:0}}.wp-block-columns.is-not-stacked-on-mobile{flex-wrap:nowrap!important}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column[style*=flex-basis]{flex-grow:0}:where(.wp-block-columns){margin-bottom:1.75em}:where(.wp-block-columns.has-background){padding:1.25em 2.375em}.wp-block-column{flex-grow:1;min-width:0;overflow-wrap:break-word;word-break:break-word}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-stretch{align-self:stretch}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/columns/style.min.css */
</style>
<style id="wp-block-embed-inline-css">
.wp-block-embed.alignleft,.wp-block-embed.alignright,.wp-block[data-align=left]>[data-type="core/embed"],.wp-block[data-align=right]>[data-type="core/embed"]{max-width:360px;width:100%}.wp-block-embed.alignleft .wp-block-embed__wrapper,.wp-block-embed.alignright .wp-block-embed__wrapper,.wp-block[data-align=left]>[data-type="core/embed"] .wp-block-embed__wrapper,.wp-block[data-align=right]>[data-type="core/embed"] .wp-block-embed__wrapper{min-width:280px}.wp-block-cover .wp-block-embed{min-height:240px;min-width:320px}.wp-block-group.is-layout-flex .wp-block-embed{flex:1 1 0%;min-width:0}.wp-block-embed{overflow-wrap:break-word}.wp-block-embed :where(figcaption){margin-bottom:1em;margin-top:.5em}.wp-block-embed iframe{max-width:100%}.wp-block-embed__wrapper{position:relative}.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper:before{content:"";display:block;padding-top:50%}.wp-embed-responsive .wp-has-aspect-ratio iframe{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.wp-embed-responsive .wp-embed-aspect-21-9 .wp-block-embed__wrapper:before{padding-top:42.85%}.wp-embed-responsive .wp-embed-aspect-18-9 .wp-block-embed__wrapper:before{padding-top:50%}.wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper:before{padding-top:56.25%}.wp-embed-responsive .wp-embed-aspect-4-3 .wp-block-embed__wrapper:before{padding-top:75%}.wp-embed-responsive .wp-embed-aspect-1-1 .wp-block-embed__wrapper:before{padding-top:100%}.wp-embed-responsive .wp-embed-aspect-9-16 .wp-block-embed__wrapper:before{padding-top:177.77%}.wp-embed-responsive .wp-embed-aspect-1-2 .wp-block-embed__wrapper:before{padding-top:200%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/embed/style.min.css */
</style>
<style id="wp-block-group-inline-css">
.wp-block-group{box-sizing:border-box}:where(.wp-block-group.wp-block-group-is-layout-constrained){position:relative}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/group/style.min.css */
</style>
<style id="wp-block-math-inline-css">
.wp-block-math{overflow-x:auto;overflow-y:hidden}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/math/style.min.css */
</style>
<style id="wp-block-preformatted-inline-css">
.wp-block-preformatted{box-sizing:border-box;white-space:pre-wrap}:where(.wp-block-preformatted.has-background){padding:1.25em 2.375em}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/preformatted/style.min.css */
</style>
<style id="wp-block-pullquote-inline-css">
.wp-block-pullquote{box-sizing:border-box;margin:0 0 1em;overflow-wrap:break-word;padding:4em 0;text-align:center}.wp-block-pullquote blockquote,.wp-block-pullquote p{color:inherit}.wp-block-pullquote blockquote{margin:0}.wp-block-pullquote p{margin-top:0}.wp-block-pullquote p:last-child{margin-bottom:0}.wp-block-pullquote.alignleft,.wp-block-pullquote.alignright{max-width:420px}.wp-block-pullquote cite,.wp-block-pullquote footer{position:relative}.wp-block-pullquote .has-text-color a{color:inherit}.wp-block-pullquote.has-text-align-left blockquote{text-align:left}.wp-block-pullquote.has-text-align-right blockquote{text-align:right}.wp-block-pullquote.has-text-align-center blockquote{text-align:center}.wp-block-pullquote.is-style-solid-color{border:none}.wp-block-pullquote.is-style-solid-color blockquote{margin-left:auto;margin-right:auto;max-width:60%}.wp-block-pullquote.is-style-solid-color blockquote p{font-size:2em;margin-bottom:0;margin-top:0}.wp-block-pullquote.is-style-solid-color blockquote cite{font-style:normal;text-transform:none}.wp-block-pullquote :where(cite){color:inherit;display:block}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/pullquote/style.min.css */
</style>
<style id="wp-block-quote-inline-css">
.wp-block-quote{box-sizing:border-box;overflow-wrap:break-word}.wp-block-quote.is-large:where(:not(.is-style-plain)),.wp-block-quote.is-style-large:where(:not(.is-style-plain)){margin-bottom:1em;padding:0 1em}.wp-block-quote.is-large:where(:not(.is-style-plain)) p,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p{font-size:1.5em;font-style:italic;line-height:1.6}.wp-block-quote.is-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-large:where(:not(.is-style-plain)) footer,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer{font-size:1.125em;text-align:right}.wp-block-quote>cite{display:block}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/quote/style.min.css */
</style>
<style id="wp-block-separator-inline-css">
@charset "UTF-8";.wp-block-separator{border:none;border-top:2px solid}:root :where(.wp-block-separator.is-style-dots){height:auto;line-height:1;text-align:center}:root :where(.wp-block-separator.is-style-dots):before{color:currentColor;content:"···";font-family:serif;font-size:1.5em;letter-spacing:2em;padding-left:2em}.wp-block-separator.is-style-dots{background:none!important;border:none!important}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/separator/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-social-links-css' href='https://studydoor.de/wp-includes/blocks/social-links/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-spacer-inline-css">
.wp-block-spacer{clear:both}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/spacer/style.min.css */
</style>
<link rel='stylesheet' id='wp-block-table-css' href='https://studydoor.de/wp-includes/blocks/table/style.min.css?ver=7.1.5' media='all' />
<style id="wp-block-text-columns-inline-css">
.wp-block-text-columns,.wp-block-text-columns.aligncenter{display:flex}.wp-block-text-columns .wp-block-column{margin:0 1em;padding:0}.wp-block-text-columns .wp-block-column:first-child{margin-left:0}.wp-block-text-columns .wp-block-column:last-child{margin-right:0}.wp-block-text-columns.columns-2 .wp-block-column{width:50%}.wp-block-text-columns.columns-3 .wp-block-column{width:33.3333333333%}.wp-block-text-columns.columns-4 .wp-block-column{width:25%}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/text-columns/style.min.css */
</style>
<style id="wp-block-verse-inline-css">
pre.wp-block-verse{box-sizing:border-box;min-width:1em;overflow:auto;white-space:pre-wrap;word-break:break-word}:where(pre.wp-block-verse){font-family:inherit}
/*# sourceURL=https://studydoor.de/wp-includes/blocks/verse/style.min.css */
</style>
<link rel='stylesheet' id='wpconvert-style-css' href='https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/style.css?ver=2.0.0' media='all' />
<link rel='stylesheet' id='wpconvert-site-styles-css' href='https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/css/style.css?ver=2.0.0' media='all' />
<link rel='stylesheet' id='wpconvert-external-0-css' href='https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&#038;display=swap' media='all' />
<style id="wpconvert-ecnav088-inline-css">
/* EC-ANIM-008c/009: carousel-only scroll-reveal override */.scroll-fade-up:has([aria-roledescription="carousel"]),.scroll-fade-up:has([data-wpconvert-blog-filter-bar]),.scroll-fade-left:has([aria-roledescription="carousel"]),.scroll-fade-right:has([aria-roledescription="carousel"]),.scroll-scale-in:has([aria-roledescription="carousel"]){opacity:1!important;transform:none!important}/* EC-ACCORDION-STATE: Sync panel visibility with trigger state — Puppeteer snapshots *//* can capture panels as data-state=open while their trigger is data-state=closed */h3[data-state="closed"]+[role="region"],h3[data-state="closed"]+[data-state][role="region"]{display:none!important;max-height:0!important;overflow:hidden!important;animation:none!important}
/*# sourceURL=wpconvert-ecnav088-inline-css */
</style>
<script id="jquery-core-js-extra">
var wpConvertThemeData = {"templateUri":"https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme","homeUrl":"https://studydoor.de"};
//# sourceURL=jquery-core-js-extra
</script>
<script id="jquery-core-js" src="https://studydoor.de/wp-includes/js/jquery/jquery.min.js?ver=3.7.1"></script>
<script id="jquery-migrate-js" src="https://studydoor.de/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1"></script>
<script id="jquery-js-before">
// Prevent React createRoot/hydrateRoot from executing if root element doesn't exist
        (function() {
            if (typeof window !== "undefined") {
                // Intercept createRoot calls before React loads
                var originalCreateRoot = null;
                var originalHydrateRoot = null;
                
                // Override when React loads
                Object.defineProperty(window, 'React', {
                    set: function(value) {
                        if (value && value.createRoot) {
                            originalCreateRoot = value.createRoot;
                            value.createRoot = function(container) {
                                if (!container || !document.contains(container)) {
                                    console.warn("[WPConvert] React createRoot prevented - container not found");
                                    return { render: function() {}, unmount: function() {} };
                                }
                                return originalCreateRoot.call(this, container);
                            };
                        }
                        this._react = value;
                    },
                    get: function() {
                        return this._react;
                    }
                });
                
                Object.defineProperty(window, 'ReactDOM', {
                    set: function(value) {
                        if (value) {
                            if (value.createRoot) {
                                originalCreateRoot = value.createRoot;
                                value.createRoot = function(container) {
                                    if (!container || !document.contains(container)) {
                                        console.warn("[WPConvert] ReactDOM createRoot prevented");
                                        return { render: function() {}, unmount: function() {} };
                                    }
                                    return originalCreateRoot.call(this, container);
                                };
                            }
                            if (value.hydrateRoot) {
                                originalHydrateRoot = value.hydrateRoot;
                                value.hydrateRoot = function(container) {
                                    if (!container || !document.contains(container)) {
                                        console.warn("[WPConvert] ReactDOM hydrateRoot prevented");
                                        return { render: function() {}, unmount: function() {} };
                                    }
                                    return originalHydrateRoot.call(this, container);
                                };
                            }
                        }
                        this._reactDOM = value;
                    },
                    get: function() {
                        return this._reactDOM;
                    }
                });
            }
        })();
        (function() {
            // Run as early as possible, before DOMContentLoaded
            function revealHiddenElements() {
                console.log('[WPConvert] Running animation fallback to reveal hidden sections...');
                
                var revealed = 0;
                var elements = document.querySelectorAll('*');
                
                elements.forEach(function(el) {
                    // Skip elements that should stay hidden
                    var tagName = el.tagName.toLowerCase();
                    if (tagName === 'script' || tagName === 'style' || tagName === 'noscript') {
                        return;
                    }
                    
                    // Skip WordPress admin bar and menus
                    if (el.id === 'wpadminbar' || 
                        el.classList.contains('sub-menu') || 
                        el.classList.contains('submenu') ||
                        el.hasAttribute('data-wpconvert-popup-disabled')) {
                        return;
                    }
                    
                    // EC-GALLERY-FLASH-001: Skip elements inside stacked gallery containers.
                    // These images intentionally use opacity:0 for crossfade transitions.
                    // Revealing them causes a flash before the carousel handler resets them.
                    if (el.closest('[data-wpconvert-stacked-gallery]') ||
                        el.closest('[data-wpc-carousel]')) {
                        return;
                    }

                    // EC-NAV-240: Skip rotating-headline words — they intentionally use
                    // opacity:0 / translateY between frames; revealing them stacks every word.
                    if (el.closest('.hero-rotate, #heroRotate')) {
                        return;
                    }
                    
                    var style = el.style;
                    var computedStyle = window.getComputedStyle(el);
                    var hasHidingStyle = false;

                    // EC-OVERLAY-REVEAL-001: Never force-reveal a CLOSED overlay/modal.
                    // A dismissible overlay (global-search popup, command palette,
                    // dialog, popover, tooltip) is parked at the canonical closed
                    // resting state — inline opacity:0 + pointer-events:none on a
                    // positioned (fixed/absolute/sticky) element — so it is both
                    // invisible AND non-interactive until the framework runtime opens
                    // it. That is fundamentally different from a scroll-reveal entrance
                    // (opacity:0 + transform, but STILL interactive / in normal flow,
                    // pointer-events untouched). Without the runtime that toggles it,
                    // blindly forcing opacity:1 leaves the overlay permanently stuck on
                    // screen (the TIST "Global Search" popup covering the navbar). The
                    // triple signal (opacity:0 + pointer-events:none + positioned) is a
                    // strict overlay marker, so no genuine scroll-reveal block matches.
                    if ((style.opacity === '0' || style.opacity === '0.0') &&
                        style.pointerEvents === 'none') {
                        var __pos = computedStyle.position;
                        if (__pos === 'fixed' || __pos === 'absolute' || __pos === 'sticky') {
                            return;
                        }
                    }

                    // Check for hiding inline styles (Framer Motion patterns)
                    if (style.opacity === '0' || style.opacity === '0.0') {
                        // Only reveal if element has content/dimensions
                        if (el.offsetHeight > 0 || el.offsetWidth > 0 || el.textContent.trim().length > 0) {
                            style.opacity = '1';
                            hasHidingStyle = true;
                        }
                    }
                    
                    // Check for visibility hidden
                    if (style.visibility === 'hidden' && computedStyle.display !== 'none') {
                        style.visibility = 'visible';
                        hasHidingStyle = true;
                    }
                    
                    // Check for transform that moves element off-screen
                    if (style.transform && (
                        style.transform.includes('translateY') || 
                        style.transform.includes('translateX') ||
                        style.transform.includes('scale(0)')
                    )) {
                        // EC-CAROUSEL-009: Embla/shadcn carousels set translateX on the flex track via WPConvert JS.
                        // Stripping it (especially on the delayed run) breaks the culture image slider.
                        if (el.closest('[aria-roledescription="carousel"]')) {
                            /* skip */
                        } else {
                        // Reset problematic transforms (preserve intentional ones like rotate)
                        // EC-SCRUB-004: PRESERVE the centering idiom translateX/Y(±50%)
                        // (paired with left/top:50%). Only zero pixel/length entrance
                        // offsets — blindly zeroing translateX(-50%) shifts centered
                        // overlays right/down by half their size (e.g. the scroll-scrub
                        // "SCROLL — WATCH THE TRANSFORMATION" hint on Manchester Roofing Pro).
                        var transform = style.transform;
                        var isCentering50 = function(v) { return /^\s*-?50(?:\.0+)?%\s*$/.test(v); };
                        transform = transform.replace(/translateY\(([^)]*)\)/g, function(m, v) { return isCentering50(v) ? m : 'translateY(0)'; });
                        transform = transform.replace(/translateX\(([^)]*)\)/g, function(m, v) { return isCentering50(v) ? m : 'translateX(0)'; });
                        transform = transform.replace(/scale\(0(?:\.\d+)?\)/g, 'scale(1)');
                        
                        if (transform !== style.transform) {
                            style.transform = transform;
                            hasHidingStyle = true;
                        }
                        }
                    }
                    
                    if (hasHidingStyle) {
                        revealed++;
                    }
                });
                
                if (revealed > 0) {
                    console.log('[WPConvert] ✅ Revealed ' + revealed + ' hidden elements (Framer Motion fallback)');
                }
            }
            
            // Run immediately (for inline styles in initial HTML)
            if (document.readyState === 'loading') {
                document.addEventListener('DOMContentLoaded', revealHiddenElements);
            } else {
                revealHiddenElements();
            }
            
            // Also run after a short delay to catch late-loading elements
            setTimeout(revealHiddenElements, 100);
        })();
//# sourceURL=jquery-js-before
</script>
<script id="jquery-js-after">
jQuery(document).ready(function($) {
            try { // EC-LINK-002: external links open in a new tab
            function addTargetBlank(link) {
                var href = (link && link.getAttribute ? link.getAttribute('href') : '') || '';
                href = String(href).trim();
                if (!href || href === '#' || /^javascript:/i.test(href) || /^mailto:/i.test(href) || /^tel:/i.test(href)) return;
                try {
                    var url = new URL(href, window.location.href);
                    if (url.protocol !== 'http:' && url.protocol !== 'https:') return;
                    if (!url.hostname) return;
                    if (url.origin !== window.location.origin) {
                        link.setAttribute('target', '_blank');
                        if (!link.getAttribute('rel')) link.setAttribute('rel', 'noopener noreferrer');
                    }
                } catch (e) { /* skip invalid href */ }
            }
            function addTargetBlankToExternalLinks() {
                document.querySelectorAll('a[href]').forEach(addTargetBlank);
            }
            if (document.readyState === 'loading') {
                document.addEventListener('DOMContentLoaded', addTargetBlankToExternalLinks);
            } else {
                addTargetBlankToExternalLinks();
            }
            } catch(e) { console.warn("[WPConvert] External link target error:", e.message); }
            // EC-TESTIMONIAL-004b: Shared by universal carousel + EC-CAROUSEL-002 — skip only inner JSON testimonial card
            function wpcInsideJsonTestimonialCard($el) {
                var $tsec = $el.closest("[data-wpconvert-testimonials]");
                if (!$tsec.length) return false;
                var $ariaPrev = $tsec.find('button[aria-label*="Prev"], button[aria-label*="Previous"], button[aria-label*="previous"]').first();
                if (!$ariaPrev.length) return true;
                var $innerCard = $ariaPrev.closest('[class*="rounded-3xl"],[class*="rounded-2xl"],[class*="rounded-xl"]').first();
                if (!$innerCard.length) return true;
                return $el.closest($innerCard).length > 0;
            }
            try { // [WPConvert: Smooth Scrolling]
            // Smooth scrolling for anchor links
            // EC-EDITOR-005: Skip when WPConvert editor is active to avoid scroll conflict
            $('a[href^="#"]').on("click", function(e) {
                if (window.location.search.indexOf("wpc_edit=1") !== -1) return;
                // EC-NAV-286: Never hijack Bootstrap/Mobirise interactive control anchors.
                // This jQuery handler is the twin of the vanilla handleAnchorClick guarded by
                // EC-NAV-285 — both run on every a[href^="#"] click. Carousel/lightbox prev-next
                // controls (<a class="carousel-control-next" data-bs-slide="next" href="#lb-xxxx">),
                // gallery thumbnails, and collapse/modal/tab/dropdown togglers point at hidden
                // targets that sit at offset top 0. Letting this handler preventDefault + animate
                // to $target.offset().top - 80 yanks the page to the top — and a gallery that
                // auto-advances via a synthetic click every few seconds makes it "keep scrolling
                // to the top". Skip these so Bootstrap/Mobirise own them; only real in-page nav
                // links smooth-scroll.
                if (this.matches && this.matches(
                    '.carousel-control, .carousel-control-next, .carousel-control-prev, ' +
                    '[data-bs-slide], [data-slide], [data-bs-slide-to], [data-slide-to], ' +
                    '[data-bs-toggle], [data-toggle], [data-bs-dismiss], [data-dismiss], ' +
                    '.dropdown-toggle, .navbar-toggler'
                )) {
                    return;
                }
                e.preventDefault();
                var target = $(this).attr("href");
                if (target === "#") return;
                
                var $target = $(target);
                if ($target.length) {
                    $("html, body").animate({
                        scrollTop: $target.offset().top - 80
                    }, 800);
                }
            });
            } catch(e) { console.warn("[WPConvert] Smooth scrolling error:", e); }
            
            try { // [WPConvert: Accordion/Collapsible]
            // Universal accordion/collapsible functionality
            // Works for Radix UI, Material UI, Bootstrap, Ant Design, custom accordions
            // CRITICAL: Only target actual trigger elements (buttons, summary) - NOT wrapper divs with data-state
            // Using [data-state] in selector caused double-firing because parent wrappers also have data-state
            // EC-ACCORDION-011: Also target h3[data-state] > a — Radix accordion triggers
            // that were converted from <button> to <a> during snapshot processing.
            $(document).on("click", "button[aria-controls], button[aria-expanded], h3[data-state] > button, h3[data-state] > a, .accordion-trigger, summary", function(e) {
                e.stopPropagation(); // Prevent event bubbling to parent wrappers
                
                var $trigger = $(this);
                
                // EC-ACCORDION-012: image-card CTA buttons (e.g. MenuCard "+ Tilføj")
                // are explicitly guarded — never treat them as accordion triggers.
                if ($trigger.attr("data-wpc-no-accordion-trigger") === "1") {
                    return;
                }

                // EC-NAV-476: a captured mobile-menu section carries aria-expanded and so
                // matches the selector above, but it already has an owner — the handler
                // header.php ships alongside the panel, which pairs trigger to contents by
                // id. Two handlers on document each flip aria-expanded, so the second
                // undoes the first and the section can be opened but never closed.
                if ($trigger.attr("data-wpc-mobile-accordion")) {
                    return;
                }
                
                // CRITICAL: Only handle actual trigger elements (button, summary, a inside accordion h3, or explicit accordion-trigger)
                if (!$trigger.is("button, summary, a") && !$trigger.hasClass("accordion-trigger")) {
                    console.log("Skipping non-trigger element:", $trigger.prop("tagName"));
                    return;
                }

                // EC-ACCORDION-016: Native <details>/<summary> rows are toggled by the
                // browser (the [open] attribute shows/hides the panel) and the icon is
                // owned by EC-ACCORDION-007 + the source CSS. If this universal handler
                // also ran it would grab the <summary>'s sibling answer panel, see it as
                // "visible" right after the native open, and take the HIDE branch below —
                // forcing max-height:0/opacity:0 so the answer disappears while the marker
                // still rotates to "×" (KaliHub: "only 1 FAQ has answers"). Let the
                // browser own native details entirely.
                if ($trigger.is("summary") && $trigger.closest("details").length) {
                    return;
                }
                
                // EC-ACCORDION-011: Track <a> accordion triggers — defer preventDefault
                // until we confirm a content panel exists. If no panel, let the link navigate.
                var isAccordionLink = $trigger.is("a") && $trigger.closest("h3[data-state]").length;
                
                // CRITICAL: Skip menu/hamburger buttons - these are handled separately
                var ariaLabel = ($trigger.attr("aria-label") || "").toLowerCase();
                if (ariaLabel.indexOf("menu") !== -1 || $trigger.hasClass("menu-toggle") || $trigger.hasClass("hamburger-menu")) {
                    console.log("Skipping accordion handler for menu button");
                    return; // Let the hamburger menu handler deal with this
                }

                // EC-NAV-451: the guard above reads the aria-label and the class name,
                // so a captured site toggle whose only "menu" signal is its visible TEXT
                // slips through — N0BS ships <button class="converter-mobile-toggle"
                // aria-controls="primary-navigation">Menu</button>. This delegate then
                // resolves the site's navigation as accordion content (Method 1), and
                // because the site's own listener is bound directly to the button it has
                // already opened the menu by the time this bubbles, so the HIDE branch
                // stamps max-height:0/opacity:0 on it. The hamburger looks dead.
                //
                // Key the opt-out on the PANEL rather than on the trigger: a navigation
                // container is never accordion content, whoever points at it. That is the
                // rule EC-NAV-MOBILE-011 already applies on the hamburger side — the
                // site's own panel is present, so it owns this click. Keying on the
                // trigger instead would need a "looks like a hamburger" heuristic, which
                // is what has repeatedly missed (EC-NAV-284, EC-NAV-411, this one).
                //
                // getElementById, not a selector, so an id with CSS-significant
                // characters cannot throw here.
                var wpcNavPanelId = $trigger.attr("aria-controls");
                var wpcNavPanel = wpcNavPanelId ? document.getElementById(wpcNavPanelId) : null;
                if (wpcNavPanel && $(wpcNavPanel).is('nav, [role="navigation"], [data-wpconvert-nav-container]')) {
                    console.log("Skipping accordion handler for navigation container (EC-NAV-451):", wpcNavPanelId);
                    return;
                }

                // EC-NAV-411: the guard above is label-based, so a localized
                // hamburger label ("Meni", "Menü", "メニュー") slips through and this
                // handler grabs the EC-NAV-408 fullscreen overlay as its panel,
                // collapsing it to height:0 immediately after the inline onclick
                // opened it. The overlay owns its own open/close state.
                if ($trigger.attr("data-wpc-fs-toggle")) {
                    return;
                }

                // EC-NAV-284: Skip the native Bootstrap/Mobirise navbar toggler. It is a
                // <button class="navbar-toggler" data-bs-toggle="collapse" aria-expanded
                // ="false" aria-label="Toggle navigation"> — matched by the
                // button[aria-expanded] selector above — but its aria-label is "Toggle
                // navigation" (no "menu"), so the guard above misses it. Without this
                // skip, the universal accordion handler grabs the .navbar-collapse panel
                // and fights Bootstrap: the first tap flips the hamburger to an X but the
                // menu stays closed, the next tap opens it while showing the wrong icon
                // (the "needs two clicks / inverted icon" mobile bug). The native toggler
                // and .navbar-collapse are owned by Bootstrap + navbar-dropdown.js.
                if ($trigger.is('.navbar-toggler, [data-toggle="collapse"], [data-bs-toggle="collapse"]') ||
                    $trigger.closest('.navbar-toggler, .navbar-collapse').length) {
                    return;
                }

                var targetId = $trigger.attr("aria-controls");
                var triggerId = $trigger.attr("id");
                var $content = null;
                
                console.log("Accordion clicked, targetId:", targetId, "triggerId:", triggerId);
                
                // Method 1: aria-controls attribute points to content ID
                if (targetId) {
                    $content = $(document.getElementById(targetId));
                    if ($content.length) {
                        console.log("Found content via aria-controls");
                    }
                }
                
                // Method 2: Radix UI pattern - look for [role="region"] sibling with aria-labelledby matching trigger
                if ((!$content || !$content.length) && triggerId) {
                    var $radixContent = $trigger.siblings('[role="region"][aria-labelledby="' + triggerId + '"]');
                    if ($radixContent.length) {
                        $content = $radixContent;
                        console.log("Found content via Radix aria-labelledby");
                    }
                }
                
                // Method 3: Look for next sibling with [role="region"] or [data-state] (Radix pattern)
                if (!$content || !$content.length) {
                    var $radixSibling = $trigger.next('[role="region"], [data-state]');
                    if ($radixSibling.length) {
                        $content = $radixSibling;
                        console.log("Found content via Radix sibling role/data-state");
                    }
                }
                
                // Method 4: Look for next sibling element (FAQ-style accordions)
                // Common pattern: <button aria-expanded="false">Question</button><div style="max-height:0">Answer</div>
                if (!$content || !$content.length) {
                    var $nextSibling = $trigger.next('div, [class*="content"], [class*="panel"], [class*="answer"]');
                    if ($nextSibling.length) {
                        $content = $nextSibling;
                        console.log("Using sibling element as accordion content");
                    }
                }
                
                // Method 5: Content is inside a parent container, sibling of the trigger wrapper
                if (!$content || !$content.length) {
                    var $parent = $trigger.parent();
                    var $siblingContent = $parent.next('div, [role="region"], [class*="content"], [class*="panel"]');
                    if ($siblingContent.length) {
                        $content = $siblingContent;
                        console.log("Using parent sibling as accordion content");
                    }
                }
                
                // Method 6: Look within the accordion item container for content
                if (!$content || !$content.length) {
                    var $accordionItem = $trigger.closest('[data-state], [class*="accordion-item"], [class*="AccordionItem"]');
                    if ($accordionItem.length) {
                        var $itemContent = $accordionItem.find('[role="region"], [data-state="open"], [data-state="closed"], [class*="content"], [class*="panel"]').not($trigger);
                        if ($itemContent.length) {
                            $content = $itemContent.first();
                            console.log("Found content within accordion item container");
                        }
                    }
                }
                
                // Method 7: Global search for aria-labelledby matching trigger ID (Radix UI)
                if ((!$content || !$content.length) && triggerId) {
                    var $globalContent = $('[aria-labelledby="' + triggerId + '"]');
                    if ($globalContent.length) {
                        $content = $globalContent.first();
                        console.log("Found content via global aria-labelledby search");
                    }
                }
                
                // Method 8: Last resort - find any sibling div that has content
                if (!$content || !$content.length) {
                    var $anySibling = $trigger.siblings('div').filter(function() {
                        return $(this).text().trim().length > 20;
                    });
                    if ($anySibling.length) {
                        $content = $anySibling.first();
                        console.log("Found content via any sibling div with content");
                    }
                }
                
                if ($content && $content.length) {
                    // EC-ACCORDION-014: Grid-rows accordions are managed by the
                    // dedicated vanilla handler (wpconvert_accordion_enqueue),
                    // which owns single-open + opacity. Skip them here so the two
                    // handlers don't double-toggle (open then immediately close).
                    if ($content.is('[data-wpconvert-grid-accordion]')) {
                        return;
                    }

                    // EC-NAV-411: never treat the fullscreen menu overlay as a
                    // collapsible panel, whichever trigger resolved to it.
                    if ($content.is('[data-wpc-fs-menu], #wpconvert-fullscreen-menu')) {
                        return;
                    }

                    // EC-ACCORDION-011: Now that we confirmed a panel exists,
                    // prevent <a> link navigation so the accordion can toggle
                    if (isAccordionLink) e.preventDefault();
                    
                    // Also update data-state on the parent h3 trigger wrapper
                    var $h3 = $trigger.closest("h3[data-state]");
                    
                    // Detect if this accordion uses CSS max-height/opacity transitions
                    var usesMaxHeight = $content.css("max-height") !== undefined && $content.css("max-height") !== "none";
                    var currentMaxHeight = $content.css("max-height");
                    var currentHeight = $content.css("height");
                    var isHidden = $content.attr("hidden") !== undefined || 
                                   $content.css("display") === "none" ||
                                   (usesMaxHeight && (currentMaxHeight === "0px" || currentMaxHeight === "0")) ||
                                   (currentHeight === "0px" || currentHeight === "0");
                    
                    // EC-ACCORDION-022: aria-expanded on the trigger is the sole source of
                    // truth when present. Radix snapshots can leave role="region" panels
                    // at data-state="open" (with display:block) while the trigger still
                    // shows aria-expanded="false". Honouring panel data-state makes the
                    // handler think the panel is already visible → first click closes
                    // instead of opens (the "double-click to open" symptom).
                    var expandedAttr = $trigger.attr("aria-expanded");
                    if (expandedAttr === "false") {
                        isHidden = true;
                    } else if (expandedAttr === "true") {
                        isHidden = false;
                    } else {
                        // Legacy accordions without aria-expanded — fall back to panel state.
                        if ($content.attr("data-state") === "closed") {
                            isHidden = true;
                        } else if ($content.attr("data-state") === "open") {
                            isHidden = false;
                        }
                    }
                    
                    if (isHidden) {
                        // Show - handle both hidden attribute and CSS transitions
                        // CRITICAL: Remove ALL hiding first, then measure, then apply final styles
                        $content.removeAttr("hidden");
                        $content.removeAttr("aria-hidden");
                        
                        // CRITICAL: Must make element visible BEFORE measuring scrollHeight
                        // Otherwise scrollHeight will be 0 for display:none elements
                        $content.css({
                            "display": "block",
                            "visibility": "visible",
                            "opacity": "1",
                            "height": "auto",
                            "max-height": "none",
                            "overflow": "visible",
                            "animation": "none"
                        });
                        
                        // Now get scroll height (element is visible so this will work)
                        var scrollHeight = $content.prop("scrollHeight");
                        console.log("Accordion scrollHeight:", scrollHeight);
                        
                        // If scrollHeight is still 0, the content might be truly empty
                        // In that case, just leave it visible with auto height
                        if (scrollHeight === 0) {
                            console.log("Warning: scrollHeight is 0, content may be empty");
                        }
                        
                        $content.attr("data-state", "open");
                        $content.removeAttr("aria-hidden");
                        $trigger.attr("aria-expanded", "true");
                        $trigger.attr("data-state", "open");
                        if ($h3 && $h3.length) $h3.attr("data-state", "open");
                        
                        // Rotate chevron icon if present
                        $trigger.find('svg, .chevron, [class*="chevron"]').css("transform", "rotate(180deg)");
                        if ($h3 && $h3.length) $h3.find('svg').last().css("transform", "rotate(180deg)");
                        
                        console.log("Accordion expanded");
                    } else {
                        // Hide - handle both hidden attribute and CSS transitions
                        $content.css({
                            "max-height": "0px",
                            "height": "0px",
                            "opacity": "0",
                            "overflow": "hidden",
                            "display": "block",
                            "animation": "none"
                        });
                        
                        $content.attr("data-state", "closed");
                        $trigger.attr("aria-expanded", "false");
                        $trigger.attr("data-state", "closed");
                        if ($h3 && $h3.length) $h3.attr("data-state", "closed");
                        
                        // Reset chevron icon rotation
                        $trigger.find('svg, .chevron, [class*="chevron"]').css("transform", "rotate(0deg)");
                        if ($h3 && $h3.length) $h3.find('svg').last().css("transform", "rotate(0deg)");
                        
                        console.log("Accordion collapsed");
                    }
                } else {
                    console.warn("Content div not found for accordion trigger");
                }
            });
            
            // On page load, check for empty accordion content
            $("[aria-controls]").each(function() {
                var targetId = $(this).attr("aria-controls");
                if (targetId) {
                    var $content = $(document.getElementById(targetId));
                    if ($content.length && $content.html().trim() === "") {
                        console.warn("Empty accordion content detected for:", targetId);
                    }
                }
            });
            } catch(e) { console.warn("[WPConvert] Accordion error:", e); }
            
            try { // [WPConvert: CSS Max-Height Accordion] EC-FAQ-002b
            // Handles FAQ/accordion buttons that use CSS max-h-0/max-h-96 toggling
            // instead of aria attributes. These buttons have a sibling div with
            // Tailwind max-height + opacity transition classes.
            (function() {
                function isCssAccordionBtn(btn) {
                    var $btn = $(btn);
                    var $sib = $btn.next("div");
                    if (!$sib.length) return false;
                    var cls = " " + ($sib.attr("class") || "") + " ";
                    return (cls.indexOf("max-h-0") !== -1 || cls.indexOf("max-h-96") !== -1) && cls.indexOf("transition") !== -1;
                }
                
                $(document).on("click", "button", function(e) {
                    var btn = this;
                    // EC-ACCORDION-012: image-card CTA buttons are guarded.
                    if ($(btn).attr("data-wpc-no-accordion-trigger") === "1") return;
                    if (!isCssAccordionBtn(btn)) return;
                    
                    // Already handled by aria accordion handler
                    if ($(btn).attr("aria-controls") || $(btn).attr("aria-expanded")) return;
                    
                    e.preventDefault();
                    e.stopPropagation();
                    
                    var $btn = $(btn);
                    var $content = $btn.next("div");
                    var cls = $content.attr("class") || "";
                    var isOpen = cls.indexOf("max-h-96") !== -1 && cls.indexOf("max-h-0") === -1;
                    
                    // Close all siblings in the same container first (accordion behavior)
                    var $container = $btn.parent().parent();
                    $container.find("> div > button").each(function() {
                        if (this === btn) return;
                        var $otherContent = $(this).next("div");
                        var otherCls = $otherContent.attr("class") || "";
                        if (otherCls.indexOf("max-h-96") !== -1) {
                            $otherContent.attr("class", otherCls.replace(/max-h-96/g, "max-h-0").replace(/opacity-100/g, "opacity-0"));
                            // Reset icon rotation
                            $(this).find(".rotate-45").removeClass("rotate-45");
                            $(this).find(".bg-primary.text-white").removeClass("bg-primary text-white");
                            // Reset parent border
                            var $item = $(this).closest("div[class*='border']");
                            if ($item.length) {
                                var ic = $item.attr("class") || "";
                                $item.attr("class", ic.replace(/border-primary(?!\/)(?! shadow)/g, "border-primary/5").replace(/ shadow-md/g, ""));
                            }
                            // Reset question text style
                            var $qspan = $(this).find("span").first();
                            var qc = $qspan.attr("class") || "";
                            $qspan.attr("class", qc.replace(/text-primary font-bold/, "text-primary/70"));
                        }
                    });
                    
                    if (isOpen) {
                        // Close this item
                        $content.attr("class", cls.replace(/max-h-96/g, "max-h-0").replace(/opacity-100/g, "opacity-0"));
                        $btn.find(".rotate-45").removeClass("rotate-45");
                        $btn.find(".bg-primary.text-white").removeClass("bg-primary text-white");
                        var $parentItem = $btn.closest("div[class*='border']");
                        if ($parentItem.length) {
                            var pc = $parentItem.attr("class") || "";
                            $parentItem.attr("class", pc.replace(/border-primary(?!\/)(?! shadow)/g, "border-primary/5").replace(/ shadow-md/g, ""));
                        }
                        var $qs = $btn.find("span").first();
                        var qsc = $qs.attr("class") || "";
                        $qs.attr("class", qsc.replace(/text-primary font-bold/, "text-primary/70"));
                    } else {
                        // Open this item
                        $content.attr("class", cls.replace(/max-h-0/g, "max-h-96").replace(/opacity-0/g, "opacity-100"));
                        // Rotate plus icon to X
                        var $iconSpan = $btn.find("span").last();
                        if ($iconSpan.find("svg").length) {
                            $iconSpan.addClass("rotate-45 bg-primary text-white");
                        }
                        var $parentItem = $btn.closest("div[class*='border']");
                        if ($parentItem.length) {
                            var pc = $parentItem.attr("class") || "";
                            $parentItem.attr("class", pc.replace(/border-primary\/5/g, "border-primary") + " shadow-md");
                        }
                        var $qs = $btn.find("span").first();
                        var qsc = $qs.attr("class") || "";
                        $qs.attr("class", qsc.replace(/text-primary\/70/, "text-primary font-bold"));
                    }
                });
            })();
            } catch(e) { console.warn("[WPConvert] CSS accordion error:", e); }
            
            try { // [WPConvert: Pill Tab Group Toggle] EC-FAQ-002b
            // Handles pill-style tab button groups (rounded-full buttons in a flex container)
            // where one button is "active" (bg-primary text-white) and others are inactive.
            // Toggles active styling on click. Content filtering is separate (EC-FILTER-001).
            (function() {
                $("button.rounded-full, button[class*='rounded-full']").each(function() {
                    var $btn = $(this);
                    var $container = $btn.parent();
                    if ($container.data("wpc-pill-init")) return;
                    if ($container.closest("[data-wpc-bill-scope]").length) return; // EC-PRICING-TOGGLE-001: yield to injector
                    var $pills = $container.find("> button[class*='rounded-full']");
                    if ($pills.length < 3) return;
                    // Verify it's a pill group: check for flex container + buttons with similar sizing
                    var containerCls = $container.attr("class") || "";
                    if (containerCls.indexOf("flex") === -1) return;
                    $container.data("wpc-pill-init", true);
                    
                    // Find active and inactive class patterns
                    var activeBtn = null, inactiveBtn = null;
                    $pills.each(function() {
                        var cls = $(this).attr("class") || "";
                        if (cls.indexOf("bg-primary") !== -1 && cls.indexOf("text-white") !== -1 && cls.indexOf("text-white/") === -1) activeBtn = this;
                        else if (!inactiveBtn) inactiveBtn = this;
                    });
                    if (!activeBtn || !inactiveBtn) return;
                    
                    var activeCls = $(activeBtn).attr("class");
                    var inactiveCls = $(inactiveBtn).attr("class");
                    
                    $pills.on("click", function(e) {
                        e.preventDefault();
                        $pills.each(function() { $(this).attr("class", inactiveCls); });
                        $(this).attr("class", activeCls);
                        var cat = $(this).attr("data-wpconvert-faq-cat");
                        if (cat) {
                            var $faq = $("#faq");
                            if ($faq.length) {
                                $faq.find("[data-wpconvert-faq-panel]").each(function() {
                                    var on = ($(this).attr("data-wpconvert-faq-panel") || "") === cat;
                                    $(this).toggle(on);
                                });
                            }
                        }
                    });
                });
            })();
            } catch(e) { console.warn("[WPConvert] Pill tab error:", e); }
            
            try { // [WPConvert: Category/Filter Buttons]
            // EC-FILTER-001: Universal category/filter button functionality
            // Detects filter button groups near grids/lists and enables click-to-filter
            // Searches section, main, container, and generic wrapper elements
            (function() {
                var filterInitialized = {};

                // EC-FILTER-023: "show all" is not an English-only idea. Sylani's pill
                // reads "TOUT", which read as a category matching no card and — worse —
                // left hasAllBtn false, which is a precondition for the filter binding
                // at all. Whole words only: a prefix rule would swallow a real category
                // called "Tous les paniers".
                // The same word list as lib/theme/show-all-label.js, spelled out rather
                // than interpolated because this block must stay free of template
                // substitutions — a test asserts that, and a second test asserts the
                // two copies still agree.
                function wpcIsShowAll(t) {
                    if (!t) return false;
                    if (/^all\b/.test(t)) return true;
                    return ["all", "view all", "show all", "everything",
                        "tout", "tous", "toutes",
                        "todo", "todos", "todas",
                        "alle", "alles", "allt",
                        "tutti", "tutte", "tudo"].indexOf(t) !== -1;
                }

                function initFilter($btnGroup, $gridContainer, allowNoAll) {
                    var groupId = $btnGroup.get(0);
                    if (filterInitialized[groupId]) return;
                    if ($btnGroup.attr("data-wpc-filter-group")) return;
                    // EC-PRICING-TOGGLE-001: never treat the source-driven pricing
                    // toggle as a category filter (would hide pricing cards on click).
                    if ($btnGroup.find("[data-wpc-bill-set]").length || $btnGroup.closest("[data-wpc-bill-scope]").length) return;
                    // EC-RADIO-001: an ARIA radio group has its own runtime; it is a choice, not a filter.
                    if ($btnGroup.is("[role='radiogroup']") && $btnGroup.find("[role='radio'][aria-checked]").length) return;

                    var $filterButtons = $btnGroup.find("> button, > [role='button'], > a").filter(function() {
                        var t = $(this).text().trim();
                        return t.length > 0 && t.length < 30 && !/submit|send|cancel|close|search|login|sign/i.test(t);
                    });
                    // EC-FILTER-006: Allow 2+ buttons when explicitly permitted (tab-style groups)
                    if ($filterButtons.length < 2) return;
                    if ($filterButtons.length < 3 && !allowNoAll) return;

                    var hasAllBtn = false;
                    $filterButtons.each(function() {
                        var t = $(this).text().trim().toLowerCase();
                        // EC-FILTER-010: also match "all products", "all items", etc.
                        if (wpcIsShowAll(t)) hasAllBtn = true;
                    });
                    // EC-FILTER-006: Skip "All" requirement when caller explicitly allows it
                    if (!hasAllBtn && !allowNoAll) return;

                    var $filterableItems = $gridContainer.find("[class*='card'], [class*='product'], [class*='item'], article");
                    if ($filterableItems.length === 0) {
                        $filterableItems = $gridContainer.children("a, div, article, li");
                    }
                    if ($filterableItems.length < 2) return;

                    filterInitialized[groupId] = true;
                    console.log("[WPConvert] Category filter detected:", $filterButtons.length, "buttons,", $filterableItems.length, "items");

                    // EC-FILTER-004: Inject category badges at runtime for cards with data-category
                    $filterableItems.each(function() {
                        var $item = $(this);
                        var cat = $item.attr("data-category");
                        if (!cat) return;
                        // EC-FILTER-023: a category recovered from a lookup record was
                        // never printed on the card, so painting it here invents content.
                        if ($item.attr("data-wpc-no-badge") || $item.closest("[data-wpc-no-badge]").length) return;
                        if ($item.find(".wpconvert-category-badge").length) return;
                        var $imgBox = $item.find("[class*='aspect-video']").first();
                        if (!$imgBox.length) $imgBox = $item.find("div.relative").filter(function() { return $(this).find("img").length > 0; }).first();
                        if (!$imgBox.length) $imgBox = $item.find("div").filter(function() { return $(this).find("img").length > 0; }).first();
                        if ($imgBox.length) {
                            if ($imgBox.css("position") !== "absolute" && $imgBox.css("position") !== "relative") $imgBox.css("position", "relative");
                            $imgBox.append('<div class="wpconvert-category-badge" style="position:absolute;top:1rem;right:1rem;padding:0.25rem 0.75rem;border-radius:9999px;font-size:0.75rem;font-weight:500;z-index:10;pointer-events:none;background:var(--primary,hsl(186 100% 50%));color:var(--primary-foreground,#000);opacity:0.9">' + $("<span>").text(cat).html() + "</div>");
                        }
                    });

                    function matchesCategory($item, filterText) {
                        var dataCat = ($item.attr("data-category") || $item.attr("data-filter") || $item.attr("data-type") || "").toLowerCase();
                        if (dataCat && dataCat === filterText) return true;
                        if (dataCat && dataCat.indexOf(filterText) !== -1) return true;

                        var fullText = $item.text().toLowerCase();
                        var imgAlts = [];
                        $item.find("img").each(function() { imgAlts.push(($(this).attr("alt") || "").toLowerCase()); });
                        var searchText = fullText + " " + imgAlts.join(" ") + " " + ($item.attr("href") || "").toLowerCase() + " " + ($item.attr("class") || "").toLowerCase();

                        if (searchText.indexOf(filterText) !== -1) return true;

                        var words = filterText.split(/\s+/).filter(function(w) { return w.length > 1; });
                        if (words.length > 1) {
                            var allMatch = true;
                            for (var i = 0; i < words.length; i++) {
                                var w = words[i];
                                if (searchText.indexOf(w) === -1) {
                                    var stem = w.replace(/s$/, "");
                                    if (stem.length > 2 && searchText.indexOf(stem) !== -1) continue;
                                    allMatch = false; break;
                                }
                            }
                            if (allMatch) return true;
                        }
                        return false;
                    }

                    var origBtnStyles = [];
                    $filterButtons.each(function() { origBtnStyles.push($(this).attr("class") || ""); });

                    // EC-FILTER-021: with no data-category to read, matchesCategory falls back to
                    // matching the BUTTON's words against the CELL's text, which only works when
                    // the two share a vocabulary. On a wall of quotes badged "Ancient Pharmacopeia"
                    // / "Founding Father" under pills reading "Ancient & Founding", they share
                    // none: every real category matched nothing and every click blanked the whole
                    // section. Dry-run the categories first; if not one of them can claim a single
                    // cell, this heuristic does not describe this grid, so leave it alone rather
                    // than wire a filter whose only outcome is an empty page.
                    // A filter may legitimately have ONE empty bucket, so the bar is that ALL of
                    // them come up empty — which is also the only case where standing down costs
                    // nothing, since such a filter could not have filtered anything anyway.
                    // EC-FILTER-023: the same dry-run, remembered PER BUTTON. Sylani's
                    // "NOUVAUTÉS" pill is decided in the original by an isNew flag, not
                    // by the category, so no card can ever satisfy it — and one pill
                    // being unsatisfiable is not grounds for standing the whole filter
                    // down, so EC-FILTER-021's all-or-nothing guard let it through and
                    // the click blanked the page.
                    //
                    // Whether that is a bug depends on what the grid knows about itself.
                    // Where every cell carries data-category the category set is COMPLETE,
                    // so a pill matching none of them is not an empty category — it is not
                    // a category at all, and showing the honest superset beats blanking
                    // the page. Where the cells carry nothing and the match is a text
                    // guess, an empty bucket is just an empty bucket and must still show
                    // nothing, which is what EC-FILTER-021 settled.
                    var authoritative = $gridContainer.children().length > 0;
                    $gridContainer.children().each(function() {
                        var $c = $(this);
                        if (!$c.is("[data-category]") && !$c.find("[data-category]").length) {
                            authoritative = false;
                            return false;
                        }
                    });

                    var btnClaims = [];
                    var canDiscriminate = false;
                    $filterButtons.each(function(i) {
                        var t = $(this).text().trim().toLowerCase();
                        if (wpcIsShowAll(t)) { btnClaims[i] = true; return; }
                        var claims = false;
                        $gridContainer.children().each(function() {
                            var $cell = $(this);
                            var $primary = $cell.is("[data-category]") ? $cell : $cell.find("[data-category]").first();
                            if (!$primary.length) $primary = $cell;
                            if (matchesCategory($primary, t)) { claims = true; return false; }
                        });
                        btnClaims[i] = claims;
                        if (claims) canDiscriminate = true;
                    });
                    if (!canDiscriminate) {
                        console.log("[EC-FILTER-021] No category matches any grid cell - the label heuristic cannot read this grid; leaving it unfiltered");
                        return;
                    }

                    $filterButtons.on("click", function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        var $clicked = $(this);
                        var filterText = $clicked.text().trim().toLowerCase();

                        $filterButtons.each(function(i) {
                            $(this).attr("class", origBtnStyles[i]);
                            $(this).css("opacity", "0.6");
                        });
                        $clicked.css("opacity", "1");

                        // EC-FILTER-005: Iterate grid children (not filterable items) so
                        // each cell is toggled exactly once. Finds the categorized element
                        // inside each cell for matching, hides/shows the cell itself so
                        // CSS Grid reflows with no gaps from empty wrapper divs.
                        // EC-FILTER-006/010: Also check if this is the "show all" equivalent
                        // EC-FILTER-023: …or, on a grid that knows all its own categories,
                        // a pill that is not one of them.
                        if (wpcIsShowAll(filterText) ||
                            (authoritative && btnClaims[$filterButtons.index($clicked)] === false)) {
                            $gridContainer.children().each(function() {
                                $(this).css("display", "");
                            });
                            return;
                        }
                        // EC-FILTER-006: For tab-style groups without "All", if no grid items
                        // match ANY button text, treat buttons as content panel toggles instead
                        // of category filters (handled by pricing toggle / tab toggle below)

                        var visibleCount = 0;
                        $gridContainer.children().each(function() {
                            var $cell = $(this);
                            var $primary = $cell.is("[data-category]") ? $cell : $cell.find("[data-category]").first();
                            if (!$primary.length) $primary = $cell;
                            if (matchesCategory($primary, filterText)) {
                                $cell.css("display", "");
                                visibleCount++;
                            } else {
                                $cell.css("display", "none");
                            }
                        });
                        console.log("[WPConvert] Filtered to", filterText + ":", visibleCount, "items visible");
                    });
                }

                // Search broad set of containers (not just section)
                $("section, main, [role='main'], [class*='container'], [class*='wrapper'], [class*='content'], [class*='page']").each(function() {
                    var $root = $(this);

                    // Strategy 1: Find div with 3+ child buttons (one being "All") followed by a grid
                    $root.find("div, [class*='flex'], [class*='tabs'], [class*='button-group'], [class*='filter']").each(function() {
                        var $candidate = $(this);
                        var directBtns = $candidate.find("> button, > [role='button'], > a[class*='button']");
                        if (directBtns.length < 3) return;
                        var hasAll = false;
                        directBtns.each(function() {
                            var t = $(this).text().trim().toLowerCase();
                            // EC-FILTER-010: also match "all products", "all items", etc.
                            if (wpcIsShowAll(t)) hasAll = true;
                        });
                        if (!hasAll) return;

                        // Find the grid: next sibling, parent siblings, ancestors, or section-wide
                        var $grid = $candidate.nextAll("[class*='grid']").first();
                        if (!$grid.length) $grid = $candidate.nextAll("div").find("[class*='grid']").first();
                        if (!$grid.length) $grid = $candidate.parent().find("[class*='grid'], [class*='list']").not($candidate).first();
                        if (!$grid.length) $grid = $candidate.parent().nextAll("[class*='grid']").first();
                        if (!$grid.length) $grid = $candidate.parent().parent().find("> [class*='grid']").first();
                        if (!$grid.length) $grid = $candidate.closest("section, [class*='container'], [class*='wrapper']").find("[class*='grid']").filter(function() { return $(this).children().length >= 2; }).first();
                        // EC-FILTER-010: cross-section — grid may be in the next sibling section
                        if (!$grid.length) {
                            var $sect = $candidate.closest("section");
                            if ($sect.length) $grid = $sect.next("section").find("[class*='grid']").filter(function() { return $(this).children().length >= 2; }).first();
                        }
                        if (!$grid.length) $grid = $candidate.nextAll("div, ul").first();
                        if ($grid.length) initFilter($candidate, $grid);
                    });

                    // Strategy 2: Heading-based detection (original approach, broadened)
                    var $heading = $root.find("h1, h2, h3").first();
                    if (!$heading.length) return;
                    var $headingParent = $heading.parent();
                    var $btnGroup = $headingParent.next("div, [class*='flex']").filter(function() {
                        return $(this).find("> button, > [role='button']").length >= 3;
                    }).first();
                    if (!$btnGroup.length) {
                        $btnGroup = $headingParent.nextAll("div, [class*='flex']").filter(function() {
                            return $(this).find("> button, > [role='button']").length >= 3;
                        }).first();
                    }
                    if ($btnGroup.length) {
                        var $grid = $btnGroup.nextAll("[class*='grid'], [class*='list'], div").first();
                        if (!$grid.length) $grid = $btnGroup.parent().nextAll("[class*='grid']").first();
                        if (!$grid.length) $grid = $btnGroup.closest("section, [class*='container']").find("[class*='grid']").filter(function() { return $(this).children().length >= 2; }).first();
                        if ($grid.length) initFilter($btnGroup, $grid);
                    }
                });

                // EC-FILTER-006 Strategy 3: Tab-style button groups without "All" button
                // Detects 2+ sibling buttons in a flex container near a grid, even without "All"
                // EC-FILTER-008: Only initializes when grid items have data-category attributes,
                // preventing false positives on tab-panel UIs (services, pricing) where clicking
                // a tab should switch content panels, not filter a grid.
                $("section, main, [role='main']").each(function() {
                    var $root = $(this);
                    $root.find("div, [class*='flex'], [class*='tabs']").each(function() {
                        var $candidate = $(this);
                        if (filterInitialized[$candidate.get(0)]) return;
                        if ($candidate.attr("data-wpc-filter-group")) return;
                        var directBtns = $candidate.find("> button, > [role='button'], > a[class*='button']").filter(function() {
                            var t = $(this).text().trim();
                            return t.length > 0 && t.length < 30 && !/submit|send|cancel|close|search|login|sign/i.test(t);
                        });
                        if (directBtns.length < 2 || directBtns.length > 8) return;
                        // Must NOT already have an "All" button (handled by strategies 1/2)
                        var hasAll = false;
                        directBtns.each(function() {
                            var t = $(this).text().trim().toLowerCase();
                            // EC-FILTER-010: also match "all products", "all items", etc.
                            if (wpcIsShowAll(t)) hasAll = true;
                        });
                        if (hasAll) return;
                        // Look for a nearby grid
                        var $grid = $candidate.nextAll("[class*='grid']").first();
                        if (!$grid.length) $grid = $candidate.parent().find("[class*='grid']").not($candidate).first();
                        if (!$grid.length) $grid = $candidate.parent().nextAll("[class*='grid']").first();
                        if (!$grid.length) $grid = $candidate.parent().parent().find("> [class*='grid']").first();
                        if (!$grid.length) $grid = $candidate.closest("section, [class*='container']").find("[class*='grid']").filter(function() { return $(this).children().length >= 2; }).first();
                        // EC-FILTER-010: cross-section — grid may be in the next sibling section
                        if (!$grid.length) {
                            var $sect = $candidate.closest("section");
                            if ($sect.length) $grid = $sect.next("section").find("[class*='grid']").filter(function() { return $(this).children().length >= 2; }).first();
                        }
                        if (!$grid.length) $grid = $candidate.nextAll("div").first();
                        if ($grid.length && $grid.children().length >= 2) {
                            // EC-FILTER-008: Only initialize as filter when items are actually
                            // categorized. Tab panels (service tabs, pricing tabs) have a single
                            // content area without data-category — filtering would hide everything.
                            var categorizedCount = 0;
                            $grid.children().each(function() {
                                if ($(this).is("[data-category]") || $(this).find("[data-category]").length) categorizedCount++;
                            });
                            if (categorizedCount < 2) {
                                console.log("[WPConvert] Strategy 3 skipped: only " + categorizedCount + " categorized items in grid (need 2+). Likely a tab panel, not a filter.");
                                return;
                            }
                            initFilter($candidate, $grid, true);
                        }
                    });
                });
            })();
            } catch(e) { console.warn("[WPConvert] Category filter error:", e); }
            
            try { // [WPConvert: EC-PRICING-001 Pricing Toggle]
            // EC-PRICING-001: Universal pricing toggle (Monthly/Annual, Monthly/Yearly, etc.)
            // Handles Radix Switch (button[role="switch"]) and 2-button/label toggle patterns
            (function() {
                var periodRx = /monthly|annual|yearly|quarterly|weekly/i;
                function findPricingGrid($from) {
                    var $g = $from.nextAll("[class*='grid']").first();
                    if (!$g.length) $g = $from.parent().nextAll("[class*='grid']").first();
                    if (!$g.length) $g = $from.parent().parent().find("[class*='grid']").filter(function() { return $(this).children().length >= 2; }).first();
                    if (!$g.length) $g = $from.closest("section").find("[class*='grid']").filter(function() { return $(this).children().length >= 2; }).first();
                    // EC-PRICING-002: Also search the NEXT sibling section.
                    // Common pattern: hero section has the toggle, separate pricing section has the grid.
                    if (!$g.length) {
                        var $sec = $from.closest("section");
                        if ($sec.length) {
                            $g = $sec.nextAll("section").first().find("[class*='grid']").filter(function() {
                                return $(this).children().length >= 2;
                            }).first();
                        }
                    }
                    return $g;
                }
                // Pattern A: Radix Switch — span(Monthly) + button[role=switch] + span(Annual)
                $('button[role="switch"]').each(function() {
                    var $sw = $(this);
                    if ($sw.data("pricing-wired")) return;
                    // EC-PRICING-TOGGLE-001: skip toggles already owned by the
                    // source-driven pricing injector (it handles prices + active
                    // styling). Double-handling here inverts the active button.
                    if ($sw.closest("[data-wpc-bill-scope]").length || $sw.find("[data-wpc-bill-set]").length) return;
                    var $parent = $sw.parent();
                    var kids = $parent.children();
                    var labels = [];
                    kids.each(function() {
                        var tag = (this.tagName || "").toLowerCase();
                        var txt = $(this).text().trim();
                        if ((tag === "span" || tag === "label" || tag === "p") && periodRx.test(txt)) {
                            labels.push({ el: $(this), text: txt.toLowerCase() });
                        }
                    });
                    if (labels.length < 2) return;
                    var $grid = findPricingGrid($parent);
                    if (!$grid.length) return;
                    $sw.data("pricing-wired", true);
                    var isAnnual = $sw.attr("data-state") === "checked" || $sw.attr("aria-checked") === "true";
                    // Read pricing data from section attribute if available
                    var pricingData = null;
                    var rawPD = $sw.closest("section, [class*='pricing']").attr("data-wpconvert-pricing");
                    // EC-PRICING-002: Also check the grid's parent section (toggle may be in hero,
                    // pricing data attribute on the pricing section)
                    if (!rawPD && $grid.length) rawPD = $grid.closest("section, [class*='pricing']").attr("data-wpconvert-pricing");
                    if (rawPD) try { pricingData = JSON.parse(rawPD); } catch(e) {}
                    // Find price elements in each card
                    var cardPrices = [];
                    $grid.children().each(function(ci) {
                        var $card = $(this);
                        var $priceEl = $card.find("span, div").filter(function() {
                            return /^\$[\d,]+/.test($(this).text().trim()) && $(this).children().length === 0;
                        }).first();
                        if (!$priceEl.length) $priceEl = $card.find("[class*='font-black'], [class*='font-extrabold']").filter(function() {
                            return /\$/.test($(this).text().trim());
                        }).first();
                        var monthly = null, annual = null;
                        if (pricingData && pricingData[ci]) {
                            monthly = pricingData[ci].monthly;
                            annual = pricingData[ci].annual;
                        }
                        cardPrices.push({ el: $priceEl, monthly: monthly, annual: annual });
                    });
                    // Toggle label styling
                    function updateLabels(ann) {
                        labels.forEach(function(l) {
                            var isMonthly = /month/i.test(l.text);
                            if ((isMonthly && !ann) || (!isMonthly && ann)) {
                                l.el.removeClass("text-slate-500 text-gray-500 text-muted").addClass("text-white");
                            } else {
                                l.el.removeClass("text-white").addClass("text-slate-500");
                            }
                        });
                    }
                    function updatePrices(ann) {
                        cardPrices.forEach(function(cp) {
                            if (!cp.el.length) return;
                            var price = ann ? cp.annual : cp.monthly;
                            if (price !== null) cp.el.text("$" + Number(price).toLocaleString());
                        });
                    }
                    $sw.on("click", function() {
                        isAnnual = !isAnnual;
                        var newState = isAnnual ? "checked" : "unchecked";
                        $sw.attr("data-state", newState).attr("aria-checked", String(isAnnual));
                        $sw.find("[data-state]").attr("data-state", newState);
                        updateLabels(isAnnual);
                        updatePrices(isAnnual);
                        console.log("[EC-PRICING-001] Switch toggled:", isAnnual ? "annual" : "monthly");
                    });
                    console.log("[EC-PRICING-001] Radix Switch pricing toggle initialized, cards:", cardPrices.length);
                });
                // Pattern B: Two buttons/labels with pricing period text (non-switch)
                $("section, [class*='pricing']").each(function() {
                    var $sec = $(this);
                    if ($sec.data("pricing-toggle-init")) return;
                    $sec.find("div").each(function() {
                        var $group = $(this);
                        // EC-PRICING-TOGGLE-001: yield to the source-driven pricing
                        // injector. It already wires these buttons (prices + active
                        // styling); the generic handler below mis-derives the active
                        // class set (treats btn[0] as active) and inverts the
                        // highlight, so skip any group it owns.
                        if ($group.find("[data-wpc-bill-set]").length || $group.closest("[data-wpc-bill-scope]").length) return;
                        // EC-RADIO-001: an ARIA radio group has its own runtime.
                        if ($group.is("[role='radiogroup']") && $group.find("[role='radio'][aria-checked]").length) return;
                        var $btns = $group.find("> button, > [role='button'], > label, > a").filter(function() {
                            return periodRx.test($(this).text().trim());
                        });
                        if ($btns.length !== 2) return;
                        if ($btns.filter('[role="switch"]').length > 0) return;
                        var $grid = findPricingGrid($group);
                        if (!$grid.length) return;
                        $sec.data("pricing-toggle-init", true);
                        var pricingData = null;
                        var rawPD = $sec.attr("data-wpconvert-pricing");
                        if (rawPD) try { pricingData = JSON.parse(rawPD); } catch(e) {}
                        var cardPrices = [];
                        $grid.children().each(function(ci) {
                            var $card = $(this);
                            var $priceEl = $card.find("span, div").filter(function() {
                                return /^\$[\d,]+/.test($(this).text().trim()) && $(this).children().length === 0;
                            }).first();
                            var monthly = null, annual = null;
                            if (pricingData && pricingData[ci]) {
                                monthly = pricingData[ci].monthly;
                                annual = pricingData[ci].annual;
                            }
                            cardPrices.push({ el: $priceEl, monthly: monthly, annual: annual });
                        });
                        var fc = ($btns.eq(0).attr("class")||"").split(/\s+/);
                        var sc = ($btns.eq(1).attr("class")||"").split(/\s+/);
                        var ao = fc.filter(function(c){return sc.indexOf(c)===-1&&c;});
                        var io = sc.filter(function(c){return fc.indexOf(c)===-1&&c;});
                        $btns.on("click", function(e) {
                            e.preventDefault();
                            var idx = $btns.index($(this));
                            var ann = idx === 1;
                            $btns.each(function(bi) {
                                var $b = $(this);
                                if (bi === idx) { io.forEach(function(c){$b.removeClass(c);}); ao.forEach(function(c){$b.addClass(c);}); }
                                else { ao.forEach(function(c){$b.removeClass(c);}); io.forEach(function(c){$b.addClass(c);}); }
                            });
                            cardPrices.forEach(function(cp) {
                                if (!cp.el.length) return;
                                var price = ann ? cp.annual : cp.monthly;
                                if (price !== null) cp.el.text("$" + Number(price).toLocaleString());
                            });
                        });
                        console.log("[EC-PRICING-001] Button pricing toggle initialized");
                    });
                });
            })();
            } catch(e) { console.warn("[WPConvert] Pricing toggle error:", e); }
            
            try { // [WPConvert: EC-BLOG-030 Inline Blog Search]
            // EC-BLOG-030: Wire inline search inputs near post/card grids for client-side filtering
            // Covers static blog pages where search input exists but isn't connected to anything
            // EC-BLOG-030b: Skip inputs inside [data-wpconvert-form], skip <form> grids,
            // and use word boundaries for "post" so "Postcode" does not false-positive.
            (function() {
                var allInputs = $('input[type="text"], input[type="search"], input:not([type])').not('#wpconvert-search-input');
                allInputs.each(function() {
                    var $inp = $(this);
                    if ($inp.data("wpc-search-init")) return;
                    if ($inp.closest("[data-wpconvert-form]").length) return;
                    var ph = ($inp.attr("placeholder") || "").toLowerCase();
                    if (!/search|filter|find|blog|\bposts?\b|article/i.test(ph)) return;
                    // Find nearby card grid (skip <form> elements — they are real forms, not card grids)
                    var $section = $inp.closest("section, main, [class*='container']");
                    if (!$section.length) $section = $inp.parent().parent().parent();
                    var $grid = $section.find("[class*='grid']").filter(function() {
                        return $(this).children().length >= 2 && !$(this).is("form");
                    }).first();
                    if (!$grid.length) return;
                    var $cards = $grid.children();
                    if ($cards.length < 2) return;
                    $inp.data("wpc-search-init", true);
                    var debounce;
                    $inp.on("input", function() {
                        clearTimeout(debounce);
                        debounce = setTimeout(function() {
                            var q = $inp.val().trim().toLowerCase();
                            $cards.each(function() {
                                var text = $(this).text().toLowerCase();
                                $(this).toggle(!q || text.indexOf(q) !== -1);
                            });
                        }, 150);
                    });
                    console.log("[EC-BLOG-030] Blog search input wired:", $cards.length, "cards");
                });
            })();
            } catch(e) { console.warn("[WPConvert] Blog search error:", e); }
            
            try { // [WPConvert: Nav Link Injection]
            // Inject navigation links from menus.json (for React/Vite sites with direct <a> links)
            var $navContainer = $("[data-wpconvert-nav-container]");
            if ($navContainer.length) {
                // EC-NAV-315: Idempotency guard. generate.js preserves ALL captured
                // desktop links directly in header.php AND marks the container with a
                // data-wpconvert-nav-template placeholder. If the menu group already
                // holds real <a> links besides that single placeholder, the nav is
                // fully rendered — re-injecting menus.json items here would DUPLICATE
                // the entire row (base44/Lovable ZonaVita showed every item twice on
                // WordPress Playground). Only inject when the group has nothing but the
                // template placeholder (the React/Vite path this feature was built for).
                var $njTemplate = $navContainer.find("[data-wpconvert-nav-template]");
                // EC-NAV-338: never treat a logo/brand link as a menu-link template.
                // When the desktop menu is server-rendered (wp_nav_menu) into a nested
                // group, the container's only direct <a> is the brand logo, so
                // generate.js marks the LOGO with data-wpconvert-nav-template. Injecting
                // then (1) $template.remove() DELETES the logo and (2) clones the logo's
                // classes per menus.json item, appending an unstyled duplicate menu to
                // the far right (Carmichael Law, project-9028848). A template that wraps
                // an <img>/<svg> is the logo → skip injection entirely.
                var njTemplateIsLogo = $njTemplate.length > 0 && $njTemplate.find("img, svg").length > 0;
                // EC-NAV-315/338 (generalised): skip when the container already holds
                // real menu links ANYWHERE (server-rendered wp_nav_menu, possibly in a
                // nested group — not just the template's direct siblings). Count text
                // anchors that are neither the template nor a brand/logo/home link.
                var $njExistingLinks = $navContainer.find("a").filter(function() {
                    var $njA = $(this);
                    if ($njTemplate.length && $njA.is($njTemplate)) return false;
                    if ($njA.find("img, svg").length > 0) return false;
                    var njHref = ($njA.attr("href") || "").replace(/^s+|s+$/g, "");
                    if (njHref === "" || njHref === "#" || njHref === "/") return false;
                    return $njA.text().replace(/s+/g, " ").replace(/^s+|s+$/g, "").length > 0;
                });
                if (njTemplateIsLogo || $njExistingLinks.length > 0) {
                    console.log("[EC-NAV-315/338] Nav already rendered (" + (njTemplateIsLogo ? "logo-only template" : $njExistingLinks.length + " server link(s)") + "); skipping menus.json injection to avoid a duplicate menu / removing the logo");
                } else {
                console.log("Found navigation container, loading menu items...");
                
                // Load menu data
                $.getJSON(((window.wpConvertThemeData && wpConvertThemeData.templateUri) || "") + "/assets/data/menus.json", function(menuData) {
                    if (menuData && menuData.primary && menuData.primary.items) {
                        var items = menuData.primary.items;
                        var $template = $navContainer.find("[data-wpconvert-nav-template]");
                        var templateClasses = $template.attr("class") || "";
                        var $parent = $template.parent();
                        
                        console.log("Menu items to inject:", items.length);
                        
                        // Remove the template link
                        $template.remove();
                        
                        // Inject menu items
                        items.forEach(function(item) {
                            var $link = $("<a></a>");
                            $link.attr("href", item.url);
                            $link.text(item.title);
                            
                            // Preserve original classes from template
                            if (item.classes && item.classes.length > 0) {
                                $link.attr("class", item.classes.join(" "));
                            } else {
                                $link.attr("class", templateClasses);
                            }
                            
                            // Add any custom attributes
                            if (item.attributes) {
                                Object.keys(item.attributes).forEach(function(key) {
                                    if (key !== "href" && key !== "class") {
                                        $link.attr(key, item.attributes[key]);
                                    }
                                });
                            }
                            
                            $parent.append($link);
                        });
                        
                        console.log("Navigation links injected successfully");
                    }
                }).fail(function() {
                    console.warn("Could not load menus.json, navigation may not work correctly");
                });
                }
            }
            } catch(e) { console.warn("[WPConvert] Nav link injection error:", e); }
            
            try { // [WPConvert: Slide-out Panels & Sidebar Layout]
            // EC-SB-001: Handle slide-out navigation panels (sidebar-controlled menus)
            // These are full-height panels that slide in from the side, controlled by sidebar buttons
            var $slideOutPanels = $('nav[data-wpconvert-slideout-panel="true"]');
            var $slideOutToggleButtons = $('button[data-wpconvert-slideout-toggle]');
            
            // EC-SB-003: Hide default footer for full-viewport sidebar layouts
            // These sites have fixed sidebar + full-height content - no traditional footer
            var hasFixedSidebar = false;
            var hasFullHeightLayout = false;
            
            // Check for fixed sidebar - look for aside with fixed positioning classes
            $('aside').each(function() {
                var classes = ($(this).attr('class') || '');
                if (classes.indexOf('fixed') !== -1 && 
                    (classes.indexOf('left-0') !== -1 || classes.indexOf('left-') !== -1)) {
                    hasFixedSidebar = true;
                    console.log("EC-SB-003: Found fixed sidebar");
                    return false;
                }
            });
            
            // Also check for slide-out panels as indicator of sidebar layout
            if ($('nav[data-wpconvert-slideout-panel]').length > 0) {
                hasFixedSidebar = true;
                console.log("EC-SB-003: Found slide-out panel (indicates sidebar layout)");
            }
            
            // Check for full-height elements in content area
            $('div, section, article, main').each(function() {
                var classes = ($(this).attr('class') || '');
                if (classes.indexOf('h-screen') !== -1 || 
                    classes.indexOf('min-h-screen') !== -1 ||
                    (classes.indexOf('h-full') !== -1 && $(this).closest('aside, nav').length === 0)) {
                    hasFullHeightLayout = true;
                    return false;
                }
            });
            
            // Also check if main content has full viewport height via fixed positioning
            // EC-CANVAS-001: exclude <canvas> — NeonScrollLine-style overlays use fixed inset-0 but are not layout shells
            if ($('[class*="fixed"][class*="w-full"][class*="h-screen"]').not('canvas').length > 0 ||
                $('[class*="fixed"][class*="inset-0"]').not('canvas').length > 0) {
                hasFullHeightLayout = true;
            }
            
            console.log("EC-SB-003: hasFixedSidebar=" + hasFixedSidebar + ", hasFullHeightLayout=" + hasFullHeightLayout);
            
            if (hasFixedSidebar && hasFullHeightLayout) {
                console.log("EC-SB-003: Hiding default footer for full-viewport sidebar layout");
                // Hide the fallback footer for full-viewport layouts
                $('footer.site-footer').hide();
                $('.site-info').hide();
                
                // Remove padding/margin that creates white space
                $('main.site-main, .site-main, #primary, .content-area, body, html').css({
                    'padding-bottom': '0',
                    'margin-bottom': '0'
                });
                
                // Hide any footer containing default text
                $('footer').each(function() {
                    var footerText = $(this).text().toLowerCase();
                    if (footerText.indexOf('all rights reserved') !== -1 || 
                        footerText.indexOf('converted theme') !== -1) {
                        $(this).hide();
                        console.log("EC-SB-003: Hidden footer with default text");
                    }
                });
                
                // Also ensure the main wrapper doesn't create scroll space
                $('#primary, .content-area').css({
                    'min-height': '0',
                    'overflow': 'hidden'
                });
            }
            
            // EC-SB-001: Slide-out panel handling DISABLED - using WPConvert mobile nav instead
            // The sidebar menu button will be wired to the mobile nav by hamburger detection
            if (false && $slideOutPanels.length > 0 && $slideOutToggleButtons.length > 0) {
                console.log("EC-SB-001: Found slide-out navigation panel(s):", $slideOutPanels.length);
                
                $slideOutToggleButtons.each(function() {
                    var $btn = $(this);
                    var targetId = $btn.attr("data-wpconvert-slideout-toggle");
                    var $targetPanel = targetId ? $("#" + targetId) : $slideOutPanels.first();
                    
                    if ($targetPanel.length === 0) {
                        $targetPanel = $slideOutPanels.first();
                    }
                    
                    console.log("EC-SB-001: Wiring slide-out toggle button to panel:", targetId || "first-panel");
                    
                    // Set initial state
                    var isInitiallyOpen = $targetPanel.attr("aria-hidden") !== "true";
                    $btn.attr("aria-expanded", isInitiallyOpen ? "true" : "false");
                    
                    // Create close button inside panel if not exists
                    if ($targetPanel.find(".wpconvert-slideout-close").length === 0) {
                        var closeBtn = $('<button class="wpconvert-slideout-close absolute top-4 right-4 p-2 text-slate-600 hover:text-slate-900 z-50" aria-label="Menü schließen">' +
                            '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg>' +
                        '</button>');
                        $targetPanel.prepend(closeBtn);
                    }
                    
                    // Toggle function - SIMPLE: just toggle display none/block
                    // Panel was captured with correct open-state positioning classes
                    // We simply show/hide it with display property
                    function toggleSlideOutPanel(open) {
                        // Re-select panel each time to ensure we have the right element
                        var $panel = $("#" + targetId);
                        if ($panel.length === 0) {
                            $panel = $('nav[data-wpconvert-slideout-panel="true"]').first();
                        }
                        
                        console.log("EC-SB-001: toggleSlideOutPanel called with open=" + open + ", panel found=" + $panel.length);
                        
                        if ($panel.length === 0) {
                            console.error("EC-SB-001: Could not find slide-out panel!");
                            return;
                        }
                        
                        if (open) {
                            $panel.attr("aria-hidden", "false");
                            // Use multiple methods to ensure visibility
                            $panel.css({
                                "display": "block",
                                "visibility": "visible",
                                "opacity": "1",
                                "z-index": "9998"  // High z-index to ensure it's on top
                            });
                            $panel.show();
                            $btn.attr("aria-expanded", "true");
                            // Change to X icon
                            var $svg = $btn.find("svg");
                            if ($svg.length > 0) {
                                $svg.attr("class", "lucide lucide-x w-8 h-8");
                                $svg.html('<path d="M18 6 6 18"></path><path d="m6 6 12 12"></path>');
                            }
                            console.log("EC-SB-001: Slide-out panel OPENED, display=" + $panel.css("display"));
                        } else {
                            $panel.attr("aria-hidden", "true");
                            $panel.css({
                                "display": "none",
                                "visibility": "hidden"
                            });
                            $panel.hide();
                            $btn.attr("aria-expanded", "false");
                            // Change to Menu icon
                            var $svg = $btn.find("svg");
                            if ($svg.length > 0) {
                                $svg.attr("class", "lucide lucide-menu w-8 h-8");
                                $svg.html('<line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line>');
                            }
                            console.log("EC-SB-001: Slide-out panel CLOSED");
                        }
                    }
                    
                    // Toggle button click handler - use event delegation on document to survive DOM changes
                    $(document).off("click.wpconvert-slideout-" + targetId).on("click.wpconvert-slideout-" + targetId, '[data-wpconvert-slideout-toggle="' + targetId + '"]', function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        e.stopImmediatePropagation();
                        var $clickedBtn = $(this);
                        var isOpen = $clickedBtn.attr("aria-expanded") === "true";
                        toggleSlideOutPanel(!isOpen);
                        return false;
                    });
                    
                    // Close button click handler - use delegation
                    $(document).off("click.wpconvert-slideout-close-" + targetId).on("click.wpconvert-slideout-close-" + targetId, "#" + targetId + " .wpconvert-slideout-close", function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        toggleSlideOutPanel(false);
                        return false;
                    });
                    
                    // Close when clicking a link inside the panel (but allow navigation)
                    $targetPanel.find("a").on("click.wpconvert-slideout-nav", function() {
                        // Close panel after a brief delay to allow navigation
                        setTimeout(function() {
                            toggleSlideOutPanel(false);
                        }, 100);
                    });
                    
                    // Simple initialization: ensure panel is hidden via display:none
                    $targetPanel.css("display", "none");
                    $targetPanel.attr("aria-hidden", "true");
                    $btn.attr("aria-expanded", "false");
                    
                    console.log("EC-SB-001: Panel initialized in CLOSED state (display:none)");
                });
            }
            } catch(e) { console.warn("[WPConvert] Slide-out panels error:", e); }
            
            try { // [WPConvert: Hamburger Menu]
            // EC-MOBILE-DRAWER: Skip entire hamburger handler when preserved drawer exists.
            // The preserved drawer's inline script handles all toggle logic independently.
            if (document.querySelector('[data-wpc-preserved-drawer]')) {
                console.log('[EC-MOBILE-DRAWER] Preserved drawer detected — skipping fallback hamburger handler');
                throw 'skip'; // jumps to catch block, which just warns and continues
            }
            // EC-NAV-333: Stand down when there is NO injected drawer to operate. This handler
            // exists solely to open/close #wpconvert-mobile-nav; that element is only omitted when
            // a native/preserved mobile menu was detected (EC-NAV-282 Bootstrap navbar,
            // EC-STATIC-003 Alpine, EC-NAV-333 hand-coded .menu-toggle → .nav.open, PHP custom
            // headers, …). Binding this fallback to the site's OWN hamburger would then fight the
            // source's script (two menus / a dead tap). With no drawer present there is nothing to
            // open, so let the native menu own the toggle.
            if (!document.getElementById('wpconvert-mobile-nav')) {
                console.log('[EC-NAV-333] No injected #wpconvert-mobile-nav present — native/preserved mobile menu owns the toggle; skipping fallback hamburger handler');
                throw 'skip';
            }
            // Fix empty hamburger menu buttons (React icon components not captured during snapshot)
            // Inject SVG icon and make menu functional
            // EXPANDED SELECTOR: Also detect Tailwind mobile buttons (lg:hidden, md:hidden) and data-wpconvert-trigger
            // EC-SB-001: EXCLUDE buttons with data-wpconvert-slideout-toggle (those are handled above)
            var hamburgerSelector = [
                'button[aria-label*="Menu"]',
                'button[aria-label*="menu"]',
                'button[aria-label*="navigation" i]',
                'button[aria-label*="toggle" i]',
                '.menu-toggle',
                '.hamburger-menu',
                '[class*="hamburger"]',
                'button[data-wpconvert-trigger]',
                'button.lg\\:hidden',
                'button.md\\:hidden',
                'button[class*="lg:hidden"]',
                'button[class*="md:hidden"]'
            ].join(', ');

            // EC-NAV-MOBILE-011: every rule above is English vocabulary or one of two
            // Tailwind breakpoints, so a localized trigger (aria-label="Sulje valikko",
            // wrapper class xl:hidden) matches nothing and the drawer never opens.
            // Recognize the trigger by SHAPE instead: an icon-only button carrying a
            // hamburger glyph whose aria-controls panel is NOT in the document — the
            // panel was a React portal rendered only while open, so the capture has the
            // button and no panel. A button whose disclosure DID survive is left alone,
            // which is what makes this impossible to mis-target.
            function wpcIsHamburgerGlyph(el) {
                var markup = (el.getAttribute('class') || '') + ' ' + (el.innerHTML || '');
                if (/lucide[- ]menu\b|hamburger|menu-icon|navbar-toggler-icon|fa-bars\b|bi-list\b/i.test(markup)) return true;
                // Three stacked horizontal strokes: <line y1=y2>, <rect>, or empty CSS bars.
                var bars = 0;
                var nodes = el.querySelectorAll('line, rect, span, i, div');
                for (var i = 0; i < nodes.length; i++) {
                    var node = nodes[i];
                    var tag = (node.tagName || '').toLowerCase();
                    if (tag === 'line') {
                        var y1 = node.getAttribute('y1');
                        if (y1 !== null && y1 === node.getAttribute('y2')) bars++;
                    } else if (tag === 'rect') {
                        bars++;
                    } else if ((node.textContent || '').trim() === '' && node.children.length === 0) {
                        bars++;
                    }
                }
                return bars >= 3;
            }
            var $hamburgers = $(hamburgerSelector);
            $('button[aria-controls], [role="button"][aria-controls]').each(function() {
                var panelId = this.getAttribute('aria-controls') || '';
                if (!panelId || /^radix-/.test(panelId)) return;
                // The site's own panel is present — it owns this click (preserved drawer,
                // captured off-canvas menu, hydrated SPA). Two menus would open otherwise.
                if (document.getElementById(panelId)) return;
                if ((this.textContent || '').trim() !== '') return;
                if (!wpcIsHamburgerGlyph(this)) return;
                if ($(this).closest('#wpconvert-mobile-nav').length > 0) return;
                console.log('[EC-NAV-MOBILE-011] Wiring hamburger by shape (aria-controls="' + panelId + '" panel absent from capture)');
                $hamburgers = $hamburgers.add(this);
            });

            $hamburgers.each(function() {
                var $btn = $(this);
                
                // EC-NAV-MOBILE-010: Never treat buttons that live INSIDE our own injected mobile
                // drawer as hamburger triggers. The drawer's close button has aria-label="Close menu"
                // (matched by button[aria-label*="menu"]); without this guard it gets a competing
                // toggle handler that fights its inline onclick (close -> reopen = two taps to close).
                if ($btn.closest("#wpconvert-mobile-nav").length > 0 || $btn.hasClass("close-btn")) {
                    console.log("Skipping mobile-drawer button (EC-NAV-MOBILE-010)");
                    return;
                }

                // EC-NAV-282: Never hijack a NATIVE Bootstrap/Mobirise responsive navbar
                // hamburger. These live inside a .navbar-toggler (data-toggle/data-bs-toggle
                // ="collapse") that Bootstrap + navbar-dropdown.js already wire to the
                // .navbar-collapse. The hamburger selector matches the toggler's inner
                // .hamburger / .hamburger-bar bars; attaching our drawer handler would
                // (a) open a duplicate menu and (b) overwrite the CSS-drawn bars with a
                // replacement SVG. Let the native toggler own it.
                if ($btn.closest('.navbar-toggler, [data-toggle="collapse"], [data-bs-toggle="collapse"]').length > 0 ||
                    $btn.is('.navbar-toggler, [data-toggle="collapse"], [data-bs-toggle="collapse"]')) {
                    console.log("Skipping native Bootstrap navbar toggler/hamburger (EC-NAV-282)");
                    return;
                }
                
                // EC-SB-001: Skip buttons that have inline onclick for slide-out toggle
                if ($btn.attr("onclick") && $btn.attr("onclick").indexOf("main-menu") !== -1) {
                    console.log("Skipping button with inline slide-out toggle (EC-SB-001)");
                    return;
                }
                
                // EC-NAV-MOBILE-003: Skip buttons that already have an inline onclick for wpconvert-mobile-nav.
                // EC-NAV-MOBILE-002 injects inline onclick on hamburger buttons for jQuery-free reliability.
                // If we also attach a jQuery handler, the two conflict: inline opens the menu, then
                // jQuery sees aria-expanded="true" and immediately closes it in the same click cycle.
                if ($btn.attr("onclick") && $btn.attr("onclick").indexOf("wpconvert-mobile-nav") !== -1) {
                    console.log("Skipping button with inline mobile nav toggle (EC-NAV-MOBILE-003)");
                    return;
                }

                // EC-NAV-408: same skip for the fullscreen overlay toggle so jQuery
                // cannot immediately close what the inline onclick just opened.
                if ($btn.attr("onclick") && $btn.attr("onclick").indexOf("wpconvert-fullscreen-menu") !== -1) {
                    console.log("Skipping button with inline fullscreen menu toggle (EC-NAV-408)");
                    return;
                }
                
                // CRITICAL: Skip buttons inside <aside> elements - they use inline onclick handlers
                if ($btn.closest("aside").length > 0) {
                    console.log("Skipping button inside <aside> - uses inline onclick");
                    return;
                }
                
                // EC-SB-001: Skip cookie/settings buttons - these should NOT get hamburger icons
                var ariaLabel = ($btn.attr("aria-label") || "").toLowerCase();
                var btnHtml = ($btn.html() || "").toLowerCase();
                var btnText = ($btn.text() || "").toLowerCase();
                var isCookieButton = ariaLabel.indexOf("cookie") !== -1 || 
                                     btnText.indexOf("cookie") !== -1 ||
                                     btnHtml.indexOf("lucide-cookie") !== -1 ||
                                     ariaLabel.indexOf("datenschutz") !== -1 ||
                                     ariaLabel.indexOf("privacy") !== -1;
                
                if (isCookieButton) {
                    console.log("Skipping cookie button - not a hamburger menu:", ariaLabel || btnText.substring(0, 30));
                    return;
                }

                // EC-THEME-002b: Skip dark/light mode toggle buttons.
                // Theme toggles use 'aria-label="Toggle dark mode"' (matched by the
                // 'button[aria-label*="toggle" i]' selector) and a sun/moon SVG.
                // EC-THEME-002 wires its own click handler in header.php; if the
                // hamburger handler also attaches, the first user click opens the
                // mobile menu and the theme only toggles on the second click.
                if ($btn.attr("data-wpc-theme-toggle")) {
                    console.log("Skipping theme toggle button - has data-wpc-theme-toggle (EC-THEME-002b):", ariaLabel);
                    return;
                }
                var isThemeToggleByAria = /toggle\s*(?:to\s*)?(?:dark|theme|mode|light)/.test(ariaLabel) ||
                                          /\b(?:dark|light|theme)\s*mode\b/.test(ariaLabel) ||
                                          /switch\s*(?:dark|theme|mode|light)/.test(ariaLabel);
                var isThemeToggleByIcon = btnHtml.indexOf("lucide-sun") !== -1 ||
                                          btnHtml.indexOf("lucide-moon") !== -1;
                if (isThemeToggleByAria || isThemeToggleByIcon) {
                    console.log("Skipping theme toggle button by shape (EC-THEME-002b):", ariaLabel || btnText.substring(0, 30));
                    return;
                }
                
                // CRITICAL: Skip SEARCH buttons - these should open search modal, not hamburger menu
                // Detect by: aria-label containing "search", or button contains search SVG icon
                var ariaLabel = ($btn.attr("aria-label") || "").toLowerCase();
                var btnHtml = ($btn.html() || "").toLowerCase();
                var isSearchButton = ariaLabel.indexOf("search") !== -1 || 
                                     (btnHtml.indexOf("circle") !== -1 && btnHtml.indexOf("m21 21") !== -1) || // Lucide search icon path
                                     btnHtml.indexOf("lucide-search") !== -1;
                
                if (isSearchButton) {
                    console.log("Skipping search button (will be handled by search modal):", ariaLabel);
                    return; // Skip - this is a search button, not a hamburger menu
                }
                
                // EC-NAV-MOBILE-001: Skip Radix Sheet/Dialog/Select triggers
                // These are component triggers (e.g., mobile filter panels) that should NOT open the hamburger menu
                var ariaHaspopup = ($btn.attr("aria-haspopup") || "").toLowerCase();
                if (ariaHaspopup === "dialog" || ariaHaspopup === "listbox" || ariaHaspopup === "menu") {
                    console.log("Skipping Radix component trigger (aria-haspopup=" + ariaHaspopup + "):", $btn.text().trim().substring(0, 30));
                    return;
                }
                // Skip buttons with data-state + aria-controls pointing to Radix IDs (pattern: radix-:rN:)
                var ariaControls = ($btn.attr("aria-controls") || "");
                if ($btn.attr("data-state") && /^radix-/.test(ariaControls)) {
                    console.log("Skipping Radix-controlled button (aria-controls=" + ariaControls + ")");
                    return;
                }
                // Skip buttons whose text content is clearly a filter/sort trigger
                var btnTextLower = ($btn.text() || "").trim().toLowerCase();
                if (/^filter/i.test(btnTextLower) || /^sort/i.test(btnTextLower)) {
                    console.log("Skipping filter/sort trigger button:", btnTextLower.substring(0, 30));
                    return;
                }
                
                // CRITICAL: Skip dropdown trigger buttons - these should NOT open the mobile nav
                // Dropdown triggers are buttons inside .group/.relative containers that have a sibling dropdown panel
                // This prevents the "first click opens sidebar instead of dropdown" bug
                var $parent = $btn.parent();
                var parentClasses = ($parent.attr("class") || "").toLowerCase();
                var isInsideDropdownGroup = parentClasses.indexOf("group") !== -1 || parentClasses.indexOf("relative") !== -1;
                
                if (isInsideDropdownGroup) {
                    // Check if there's a sibling dropdown panel (div with absolute/invisible/opacity-0/scale-y-0 classes)
                    var $siblingDropdown = $btn.siblings("div").filter(function() {
                        var sibClasses = ($(this).attr("class") || "").toLowerCase();
                        return sibClasses.indexOf("absolute") !== -1 || 
                               sibClasses.indexOf("invisible") !== -1 || 
                               sibClasses.indexOf("opacity-0") !== -1 || 
                               sibClasses.indexOf("scale-y-0") !== -1;
                    });
                    
                    if ($siblingDropdown.length > 0) {
                        console.log("Skipping dropdown trigger button (has sibling dropdown panel):", $btn.text().trim().substring(0, 30));
                        return; // Skip this button - it's a dropdown trigger, not a hamburger menu
                    }
                }
                
                // Also skip if button has ChevronDown icon (common dropdown indicator)
                var hasChevronIcon = $btn.find("svg").length > 0 && $btn.text().trim().length > 0;
                var btnText = $btn.text().trim().toLowerCase();
                var looksLikeDropdownTrigger = hasChevronIcon && (
                    btnText.indexOf("services") !== -1 ||
                    btnText.indexOf("products") !== -1 ||
                    btnText.indexOf("solutions") !== -1 ||
                    btnText.indexOf("resources") !== -1 ||
                    btnText.indexOf("about") !== -1 ||
                    btnText.indexOf("more") !== -1
                );
                
                if (looksLikeDropdownTrigger && isInsideDropdownGroup) {
                    console.log("Skipping dropdown trigger button (has chevron + nav text):", btnText.substring(0, 30));
                    return;
                }
                
                // Check if button is empty or has no visible content
                if ($.trim($btn.html()) === "" || $btn.children().length === 0) {
                    console.log("Found empty menu button, injecting hamburger icon");
                    
                    // Inject hamburger SVG icon (matching lucide-react Menu icon style)
                    var hamburgerSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-8 h-8"><line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line></svg>';
                    $btn.html(hamburgerSvg);
                }
                
                // Detect which side of the screen the hamburger button is on
                var $mobileNav = $("#wpconvert-mobile-nav");
                var btnRect = $btn[0].getBoundingClientRect();
                var windowWidth = $(window).width();
                var btnCenterX = btnRect.left + (btnRect.width / 2);
                
                // If button is in left half of screen, slide menu from left; otherwise from right
                if (btnCenterX < windowWidth / 2) {
                    $mobileNav.removeClass("slide-right").addClass("slide-left");
                    console.log("Hamburger on LEFT side - menu will slide from left");
                } else {
                    $mobileNav.removeClass("slide-left").addClass("slide-right");
                    console.log("Hamburger on RIGHT side - menu will slide from right");
                }
                
                // Make the button toggle a mobile navigation menu
                $btn.off("click.wpconvert").on("click.wpconvert", function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    
                    var isOpen = $btn.attr("aria-expanded") === "true";
                    
                    if (isOpen) {
                        // Close menu
                        $mobileNav.removeClass("open").addClass("closed");
                        $btn.attr("aria-expanded", "false");
                        $("body").removeClass("mobile-nav-open");
                    } else {
                        // Open menu
                        $mobileNav.removeClass("closed").addClass("open");
                        $btn.attr("aria-expanded", "true");
                        $("body").addClass("mobile-nav-open");
                    }
                });
            });
            } catch(e) { console.warn("[WPConvert] Hamburger menu error:", e); }
            
            try { // [WPConvert: Search Modal]
            // UNIVERSAL SEARCH MODAL - works for any site with search icons
            // Handles search button clicks, Ctrl+K shortcut, and provides live search
            (function() {
                var $searchModal = $("#wpconvert-search-modal");
                var $searchInput = $("#wpconvert-search-input");
                var $searchResults = $("#wpconvert-search-results");
                var searchData = null;
                
                if (!$searchModal.length) return;
                
                // Load searchable pages from routes.json and menus.json
                function loadSearchData() {
                    if (searchData && searchData.length > 0) return Promise.resolve(searchData);
                    
                    searchData = [];
                    var promises = [];
                    
                    // Load routes.json (can be object or array)
                    promises.push(
                        $.getJSON(((window.wpConvertThemeData && wpConvertThemeData.templateUri) || "") + "/assets/data/routes.json")
                            .then(function(routes) {
                                if (routes) {
                                    // Handle both object format {"/path": {...}} and array format [{...}]
                                    if (Array.isArray(routes)) {
                                        routes.forEach(function(route) {
                                            if (route.path && route.title) {
                                                searchData.push({
                                                    title: route.title,
                                                    path: route.path || route.url,
                                                    keywords: (route.title + " " + (route.path || route.url || "")).toLowerCase()
                                                });
                                            }
                                        });
                                    } else if (typeof routes === "object") {
                                        // Object format: {"/path": {title, url, slug}}
                                        Object.keys(routes).forEach(function(path) {
                                            var route = routes[path];
                                            if (route && route.title && !path.includes(":")) { // Skip dynamic routes
                                                searchData.push({
                                                    title: route.title,
                                                    path: path,
                                                    keywords: (route.title + " " + path).toLowerCase()
                                                });
                                            }
                                        });
                                    }
                                }
                            })
                            .catch(function() { /* routes.json may not exist */ })
                    );
                    
                    // Also load menus.json
                    promises.push(
                        $.getJSON(((window.wpConvertThemeData && wpConvertThemeData.templateUri) || "") + "/assets/data/menus.json")
                            .then(function(menus) {
                                if (menus && menus.primary && menus.primary.items) {
                                    menus.primary.items.forEach(function(item) {
                                        if (item.url && !searchData.some(function(s) { return s.path === item.url; })) {
                                            searchData.push({
                                                title: item.title,
                                                path: item.url,
                                                keywords: item.title.toLowerCase()
                                            });
                                        }
                                        // Add children
                                        if (item.children && Array.isArray(item.children)) {
                                            item.children.forEach(function(child) {
                                                if (child.url && !searchData.some(function(s) { return s.path === child.url; })) {
                                                    searchData.push({
                                                        title: child.title,
                                                        path: child.url,
                                                        keywords: (child.title + " " + item.title).toLowerCase()
                                                    });
                                                }
                                            });
                                        }
                                    });
                                }
                                // Also check footer menu
                                if (menus && menus.footer && menus.footer.items) {
                                    menus.footer.items.forEach(function(item) {
                                        if (item.url && !searchData.some(function(s) { return s.path === item.url; })) {
                                            searchData.push({
                                                title: item.title,
                                                path: item.url,
                                                keywords: item.title.toLowerCase()
                                            });
                                        }
                                    });
                                }
                            })
                            .catch(function() { /* menus.json may not exist */ })
                    );
                    
                    return Promise.all(promises).then(function() {
                        console.log("WPConvert Search: Loaded " + searchData.length + " searchable pages");
                        return searchData;
                    });
                }
                
                function openSearch() {
                    $searchModal.addClass("open");
                    $searchInput.val("").focus();
                    $searchResults.empty();
                    $("body").css("overflow", "hidden");
                    loadSearchData();
                }
                
                function closeSearch() {
                    $searchModal.removeClass("open");
                    $("body").css("overflow", "");
                }
                
                function performSearch(query) {
                    if (!query || query.length < 1) {
                        $searchResults.empty();
                        return;
                    }
                    
                    loadSearchData().then(function(data) {
                        var q = query.toLowerCase();
                        var results = data.filter(function(item) {
                            return item.keywords.indexOf(q) !== -1 || 
                                   item.title.toLowerCase().indexOf(q) !== -1;
                        }).slice(0, 8);
                        
                        $searchResults.empty();
                        
                        if (results.length === 0) {
                            $searchResults.html('<div style="padding: 1rem; text-align: center; color: hsl(var(--muted-foreground));">No results found for "' + query + '"</div>');
                        } else {
                            results.forEach(function(item) {
                                var $result = $('<a class="wpconvert-search-result" href="' + (((window.wpConvertThemeData && wpConvertThemeData.homeUrl) || "")) + item.path + '"></a>');
                                $result.html('<div class="wpconvert-search-result-title">' + item.title + '</div><div class="wpconvert-search-result-url">' + item.path + '</div>');
                                $result.on("click", function() {
                                    closeSearch();
                                });
                                $searchResults.append($result);
                            });
                        }
                    });
                }
                
                // Expose global functions
                window.wpconvertOpenSearch = openSearch;
                window.wpconvertCloseSearch = closeSearch;
                
                // Bind close button and backdrop AFTER functions are defined
                $("#wpconvert-search-close").off("click.wpconvert").on("click.wpconvert", function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    closeSearch();
                });
                
                $("#wpconvert-search-backdrop").off("click.wpconvert").on("click.wpconvert", function(e) {
                    e.preventDefault();
                    closeSearch();
                });
                
                // Handle search button clicks - find search buttons in HEADER/NAV only
                // EC-SEARCH-002: Restrict .lucide-search matching to header/nav context
                // to avoid false positives on content buttons (e.g. "SEO Optimization" tab
                // with a search icon triggers modal instead of filtering)
                var searchSelector = [
                    'header button[aria-label*="Search" i]',
                    'nav button[aria-label*="Search" i]',
                    'header button[aria-label*="search" i]',
                    'nav button[aria-label*="search" i]',
                    '[data-wpconvert-trigger][aria-label*="search" i]',
                    'header button:has(.lucide-search)',
                    'nav button:has(.lucide-search)',
                    '[class*="navbar"] button:has(.lucide-search)',
                    'header a[aria-label*="Search" i]',
                    'nav a[aria-label*="Search" i]'
                ].join(", ");
                
                $(searchSelector).off("click.wpconvert-search").on("click.wpconvert-search", function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    openSearch();
                });
                
                // Keyboard shortcuts
                $(document).on("keydown.wpconvert-search", function(e) {
                    // Ctrl+K or Cmd+K to open
                    if ((e.ctrlKey || e.metaKey) && e.key === "k") {
                        e.preventDefault();
                        openSearch();
                    }
                    // Escape to close
                    if (e.key === "Escape" && $searchModal.hasClass("open")) {
                        closeSearch();
                    }
                });
                
                // Search input handler
                var searchTimeout;
                $searchInput.on("input", function() {
                    clearTimeout(searchTimeout);
                    var query = $(this).val();
                    searchTimeout = setTimeout(function() {
                        performSearch(query);
                    }, 150);
                });
                
                // Enter key on input navigates to first result
                $searchInput.on("keydown", function(e) {
                    if (e.key === "Enter") {
                        var $firstResult = $searchResults.find("a").first();
                        if ($firstResult.length) {
                            window.location.href = $firstResult.attr("href");
                        }
                    }
                });
                
                console.log("WPConvert Search Modal initialized");
            })();
            } catch(e) { console.warn("[WPConvert] Search modal error:", e); }
            
            try { // [WPConvert: Mobile Menu Toggle]
            // UNIVERSAL MOBILE MENU TOGGLE (for preserved mobile menus with data-wpc-* attributes)
            // This handles mobile menus that were preserved from the original site with wp_nav_menu() integration
            (function() {
                var toggles = document.querySelectorAll("[data-wpc-menu-toggle]");
                var panel = document.querySelector("[data-wpc-menu-panel]");
                var overlay = document.querySelector("[data-wpc-menu-overlay]");
                
                if (!toggles.length || !panel) return;
                
                console.log("WPC Mobile Menu: Found preserved mobile menu with data attributes");
                
                // EC-NAV-490: release a full-screen sheet from its ancestors.
                //
                // "position: fixed" resolves against the viewport only while no
                // ancestor establishes a containing block - and backdrop-filter,
                // filter, transform and perspective all do. EC-NAV-009 applies
                // backdrop-filter to the scrolled header, and glass headers do it
                // themselves, so a drawer adopted INTO the header (EC-NAV-486)
                // collapses to the header's own height once the page is scrolled:
                // the navy background becomes a band across the top and the rows
                // spill over the page. At the top of the page it looks perfect,
                // which is why it reads as random.
                //
                // Gated on a MEASUREMENT, never on a class name: only a panel that
                // asks to cover the viewport and does not is treated as trapped. An
                // anchored dropdown written "absolute inset-x-0 top-full" is
                // positioned against one of these ancestors on purpose (EC-NAV-474),
                // and stripping a transform would move it - so it is never touched.
                //
                // No backslash escapes anywhere below (EC-NAV-487).
                var WPC_TRAP_PROPS = ["backdropFilter", "webkitBackdropFilter", "filter", "transform", "perspective"];
                var wpcReleased = [];

                function wpcSeeksViewport(el) {
                    var c = window.getComputedStyle(el);
                    return c.position === "fixed" && c.top === "0px" && c.bottom === "0px";
                }

                function wpcFindViewportSheet() {
                    if (wpcSeeksViewport(panel)) return panel;
                    var kids = panel.children;
                    for (var i = 0; i < kids.length; i++) {
                        if (wpcSeeksViewport(kids[i])) return kids[i];
                    }
                    return null;
                }

                function wpcReleaseTrappingAncestors() {
                    var sheet = wpcFindViewportSheet();
                    if (!sheet) return;
                    // Already covering the viewport: nothing is trapping it.
                    if (Math.round(sheet.getBoundingClientRect().height) >= window.innerHeight - 1) return;
                    for (var el = sheet.parentElement; el && el !== document.body; el = el.parentElement) {
                        var cs = window.getComputedStyle(el);
                        var traps = false;
                        for (var p = 0; p < WPC_TRAP_PROPS.length; p++) {
                            var v = cs[WPC_TRAP_PROPS[p]];
                            if (v && v !== "none") { traps = true; break; }
                        }
                        if (!traps) continue;
                        wpcReleased.push({ el: el, style: el.getAttribute("style") });
                        // setProperty with "important": EC-NAV-009 ships the
                        // scrolled header's backdrop-filter as !important, which a
                        // plain inline assignment cannot outrank.
                        el.style.setProperty("backdrop-filter", "none", "important");
                        el.style.setProperty("-webkit-backdrop-filter", "none", "important");
                        el.style.setProperty("filter", "none", "important");
                        el.style.setProperty("transform", "none", "important");
                        el.style.setProperty("perspective", "none", "important");
                    }
                }

                function wpcRestoreTrappingAncestors() {
                    for (var i = 0; i < wpcReleased.length; i++) {
                        var saved = wpcReleased[i];
                        if (saved.style === null) {
                            saved.el.removeAttribute("style");
                        } else {
                            saved.el.setAttribute("style", saved.style);
                        }
                    }
                    wpcReleased = [];
                }

                // EC-NAV-511: the icon and label the site's button shows while open,
                // recorded by the capture as base64.
                function wpcShowToggleState(open) {
                    toggles.forEach(function(t) {
                        var enc = t.getAttribute("data-wpc-open-icon");
                        if (!enc) return;
                        if (t.wpcClosedHtml === undefined) {
                            t.wpcClosedHtml = t.innerHTML;
                            t.wpcClosedLabel = t.getAttribute("aria-label");
                        }
                        var html;
                        try { html = decodeURIComponent(escape(window.atob(enc))); } catch (err) { return; }
                        t.innerHTML = open ? html : t.wpcClosedHtml;
                        var label = t.getAttribute("data-wpc-open-label");
                        if (!label) return;
                        if (open) t.setAttribute("aria-label", label);
                        else if (t.wpcClosedLabel !== null) t.setAttribute("aria-label", t.wpcClosedLabel);
                    });
                }

                function openMenu() {
                    panel.classList.add("is-open");
                    if (overlay) overlay.classList.add("is-open");
                    document.body.classList.add("wpc-menu-open");
                    toggles.forEach(function(t) { t.setAttribute("aria-expanded", "true"); });
                    wpcShowToggleState(true);
                    wpcReleaseTrappingAncestors();
                }
                
                function closeMenu() {
                    panel.classList.remove("is-open");
                    if (overlay) overlay.classList.remove("is-open");
                    document.body.classList.remove("wpc-menu-open");
                    toggles.forEach(function(t) { t.setAttribute("aria-expanded", "false"); });
                    wpcShowToggleState(false);
                    wpcRestoreTrappingAncestors();
                }
                
                function toggleMenu() {
                    if (panel.classList.contains("is-open")) {
                        closeMenu();
                    } else {
                        openMenu();
                    }
                }
                
                // Toggle button click
                toggles.forEach(function(toggle) {
                    toggle.addEventListener("click", function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        toggleMenu();
                    });
                });
                
                // EC-NAV-486: the site's own close control, inside the panel.
                // A preserved full-screen sheet ships with its own X, whose React
                // handler did not survive the capture. Without this the only way
                // out of it on a phone is to follow a link: Escape needs a
                // keyboard, and a sheet that covers the viewport has no backdrop
                // beside it to tap.
                //
                // EC-NAV-487: no backslash escapes below, and no regex literals.
                // This block is emitted through a JS template literal, which
                // processes escapes once before the browser ever sees them - a
                // word-boundary test written here ships as a literal backspace
                // character and matches nothing at all. indexOf says the same
                // thing and survives the trip.
                var WPC_CLOSE_WORDS = ["close", "dismiss", "stäng", "schließen", "cerrar", "fermer", "chiudi", "sluiten"];
                var WPC_CLOSE_GLYPHS = ["×", "✕", "✖", "✗"];
                panel.querySelectorAll("button, [role=button]").forEach(function(btn) {
                    if (btn.hasAttribute("data-wpc-menu-toggle")) return;
                    if (btn.hasAttribute("data-wpc-mobile-accordion")) return; // EC-NAV-476
                    var name = ((btn.getAttribute("aria-label") || "") + " " + (btn.getAttribute("title") || "")).toLowerCase();
                    var isClose = false;
                    for (var wi = 0; wi < WPC_CLOSE_WORDS.length; wi++) {
                        if (name.indexOf(WPC_CLOSE_WORDS[wi]) !== -1) { isClose = true; break; }
                    }
                    if (!isClose) {
                        var text = (btn.textContent || "").trim();
                        if (text.length <= 2) {
                            for (var gi = 0; gi < WPC_CLOSE_GLYPHS.length; gi++) {
                                if (text.indexOf(WPC_CLOSE_GLYPHS[gi]) !== -1) { isClose = true; break; }
                            }
                        }
                    }
                    if (!isClose) return;
                    btn.addEventListener("click", function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        closeMenu();
                    });
                });

                // Close on overlay click
                if (overlay) {
                    overlay.addEventListener("click", closeMenu);
                }
                
                // Close on ESC key
                document.addEventListener("keydown", function(e) {
                    if (e.key === "Escape" && panel.classList.contains("is-open")) {
                        closeMenu();
                    }
                });
                
                // Close on link click (important for mobile UX - menu closes after navigation)
                panel.querySelectorAll("a").forEach(function(link) {
                    // EC-NAV-476: unless it is an accordion trigger that EC-NAV-122
                    // left as an anchor. It opens a section of this menu; closing the
                    // menu is the one thing it must not do.
                    if (link.hasAttribute("data-wpc-mobile-accordion")) return;
                    link.addEventListener("click", function() {
                        // Small delay to allow navigation to start
                        setTimeout(closeMenu, 100);
                    });
                });
            })();
            } catch(e) { console.warn("[WPConvert] Mobile menu toggle error:", e); }
            
            try { // [WPConvert: URL Tab Switching]
            // URL-based tab switching (for services, contact pages with ?tab= parameter)
            // GENERIC: Works with any color scheme by detecting active/inactive classes dynamically
            var urlParams = new URLSearchParams(window.location.search);
            var activeTab = urlParams.get("tab");
            if (activeTab) {
                console.log("URL has tab parameter:", activeTab);
                
                // Find tab container (group of sibling buttons)
                var $tabGroups = $("button").parent().filter(function() {
                    return $(this).find("button").length >= 2;
                });
                
                $tabGroups.each(function() {
                    var $container = $(this);
                    var $buttons = $container.find("button");
                    
                    // Detect active/inactive classes from existing buttons
                    // First button is typically "active" by default, others are "inactive"
                    var $firstBtn = $buttons.first();
                    var $otherBtn = $buttons.eq(1);
                    
                    if ($firstBtn.length && $otherBtn.length) {
                        var activeClasses = $firstBtn.attr("class") || "";
                        var inactiveClasses = $otherBtn.attr("class") || "";
                        
                        // Find and activate the matching tab
                        $buttons.each(function() {
                            var $tabBtn = $(this);
                            var btnText = $tabBtn.text().toLowerCase().trim().replace(/\s+/g, "-");
                            var tabMatch = btnText.includes(activeTab.toLowerCase()) || 
                                           btnText.replace(/[^a-z0-9]/g, "").includes(activeTab.toLowerCase().replace(/[^a-z0-9]/g, "")) ||
                                           $tabBtn.attr("data-tab") === activeTab ||
                                           $tabBtn.attr("id") === "tab-" + activeTab;
                            
                            if (tabMatch) {
                                console.log("Found matching tab button:", btnText);
                                
                                // Swap classes: make all buttons inactive, then make matched one active
                                $buttons.attr("class", inactiveClasses);
                                $tabBtn.attr("class", activeClasses);
                                
                                // Trigger click for any JavaScript handlers
                                $tabBtn.trigger("click");
                            }
                        });
                    }
                });
            }
            } catch(e) { console.warn("[WPConvert] URL tab switching error:", e); }
            
            try { // [WPConvert: Universal Carousel]
            // Universal Carousel/Slider Functionality
            // Detects and enables carousels/sliders (testimonials, product sliders, etc.)
            
            // Helper function to initialize carousel behavior
            function initializeCarousel($carousel, $prevBtn, $nextBtn) {
                // EC-GALLERY-FLASH-001: Never carousel-ify a stacked gallery section.
                if ($carousel.closest("[data-wpconvert-stacked-gallery-section]").length ||
                    $carousel.find("[data-wpconvert-stacked-gallery]").length) {
                    return;
                }
                // EC-HERO-CAROUSEL-014: Never re-process the stacked-opacity hero
                // carousel already wired by wpconvert-hero-carousel.js. The universal
                // EC-CAROUSEL-002/003 handler matches the hero's prev/next arrows,
                // then showCurrentItems() .hide()s the slides' inner blocks — which
                // display:none's the title overlay (image shows, title vanishes) and
                // flashes the bg-zinc-950 container black. .closest() includes self,
                // so this covers both the hero container and any slide passed in.
                if ($carousel.closest("[data-wpc-carousel]").length ||
                    $carousel.find("[data-wpc-slide]").length) {
                    return;
                }
                // EC-CAROUSEL-041: nor the crossfade hero EC-HERO-CAROUSEL-019
                // captured. Same shape, different marker: its arrows are named
                // "Previous slide"/"Next slide", so Method 1 claims the section,
                // and a hero holds no grid and no track class — so the fallback
                // took $carousel.children(), which on Nana Enterprise 2 meant the
                // two <img> slides AND the .home-hero-shade gradient the copy is
                // read against. Nothing shows the shade again, so the hero text
                // sat on an unshaded photograph while the two runtimes fought over
                // the images every six seconds. .closest() includes self, so the
                // hero, a slide and the copy column are all covered.
                if ($carousel.closest("[data-wpc-xfade]").length ||
                    $carousel.find("[data-wpc-xfade]").length) {
                    return;
                }
                // EC-CAROUSEL-029: Never touch Owl Carousel instances. Owl uses .item as
                // its slide class and an .owl-nav with prev/next buttons (or navText icons
                // like .icon-arrow-left/right), so both the prev/next discovery (Method 1)
                // and the [class*=carousel] scan (Method 2) match an owl carousel — then
                // showCurrentItems() runs $items.hide(), inline display:none on every
                // .item and collapsing the cards to 0px (section shows 1-2 cards, flashes,
                // or nothing). Owl fully owns slide visibility. [data-owl-options] is in the
                // source HTML regardless of init timing; the owl-* classes appear post-init.
                // .closest() includes self, so a passed-in container, slide, or wrapper is all
                // covered.
                if ($carousel.is("[data-owl-options], .owl-carousel, .owl-loaded") ||
                    $carousel.closest("[data-owl-options], .owl-carousel, .owl-loaded").length ||
                    $carousel.find("[data-owl-options], .owl-carousel, .owl-stage, .owl-stage-outer, .owl-loaded").length) {
                    return;
                }
                // EC-CAROUSEL-031: Never touch a Bootstrap carousel either. bootstrap.js
                // ships and is enqueued with these themes, so Bootstrap already drives the
                // slides by toggling .active on the .carousel-item elements. Meanwhile BOTH
                // discovery methods claim the container: its .carousel-control-prev/next
                // anchors look like our prev/next buttons (Method 1) and "carousel" is in
                // its class list (Method 2). We then pick our own "slides" — including the
                // control anchors — and showCurrentItems() display:none's them, so the whole
                // hero blanks out the moment the image advances (Butterfly Cancer Care
                // Foundation). .carousel-inner / .carousel-item are structural markers that
                // exist in the source HTML before any JS runs; data-ride / data-bs-ride
                // cover the Bootstrap 4 and 5 spellings. .closest() includes self, so a
                // container, a slide, or a wrapping section are all covered.
                if ($carousel.is('.carousel, [data-ride="carousel"], [data-bs-ride="carousel"]') ||
                    $carousel.closest('.carousel, [data-ride="carousel"], [data-bs-ride="carousel"]').length ||
                    $carousel.find(".carousel-inner, .carousel-item, .carousel-control-prev, .carousel-control-next").length) {
                    return;
                }
                // EC-GALLERY-002d: the injected gallery lightbox owns its own prev/next.
                // Adopting them makes this carousel disable the arrows once it decides
                // there is nothing to cycle, and a disabled <button> fires no click at all,
                // so the modal's arrows died silently while the keyboard still worked.
                if ($carousel.closest("[data-wpc-gallery-modal-root]").length ||
                    $prevBtn.closest("[data-wpc-gallery-modal-root]").length ||
                    $nextBtn.closest("[data-wpc-gallery-modal-root]").length) {
                    return;
                }
                // EC-GALLERY-002e: and so does a lightbox the SITE wrote. Same failure,
                // recognised from the other side: the build marked these arrows because
                // the preserved script addresses them by id, so their handler shipped
                // with the theme and still runs. This pass stands in for JS that was
                // lost; it has nothing to add here, and plenty to break — a modal holds
                // one image, so "nothing to cycle" disables both arrows, and a disabled
                // <button> fires no click, which killed the site's own handler while the
                // keyboard bindings beside it kept working. Ownership is per-control.
                if ($prevBtn.is("[data-wpc-site-owned]") || $nextBtn.is("[data-wpc-site-owned]") ||
                    $prevBtn.closest("[data-wpc-site-owned]").length ||
                    $nextBtn.closest("[data-wpc-site-owned]").length) {
                    return;
                }
                // EC-CAROUSEL-040: the static-grid / visibility pass (EC-CAROUSEL-022,
                // EC-CAROUSEL-039) already wired these arrows with a handler that knows
                // what they operate. This universal path traces back from the SAME arrows
                // to whatever ancestor it can find — on the "Legalize It!" hero, the whole
                // <section> — and paginates that instead. Ownership is per-button, so the
                // check is on the arrows rather than the container: a section may hold a
                // wired carousel and an unrelated legacy one, and only the former is spoken for.
                // Ordered last among the bail-outs (they are all plain returns) so it does
                // not displace the Owl/Bootstrap markers earlier guards are asserted on.
                if ($prevBtn.closest("[data-wpconvert-static-carousel]").length ||
                    $nextBtn.closest("[data-wpconvert-static-carousel]").length ||
                    $carousel.closest("[data-wpconvert-static-carousel]").length) {
                    return;
                }

                var $track = null;
                var $items = null;
                
                $track = $carousel.find('[class*="grid"]').first();
                if ($track.length) {
                    $items = $track.children().filter(function() {
                        var $el = $(this);
                        // Include items that have testimonial/review content (quotes, names, ratings)
                        var hasContent = $el.find('p, h1, h2, h3, h4, h5, h6, [class*="quote"], [class*="testimonial"], [class*="review"]').length > 0;
                        var isNotButton = !$el.is("button") && !$el.find("button[aria-label]").length;
                        return isNotButton && hasContent;
                    });
                    console.log("Found " + $items.length + " carousel items in grid");
                }
                
                // EC-CAROUSEL-040: match the class TOKEN, not a substring. '[class*="items"]'
                // also matches Tailwind's items-center/items-start, and '[class*="track"]'
                // matches tracking-tight/tracking-widest — so inside any flex-centred hero
                // the first "track" found is the hero's own text column, and its children
                // become slides on a timer. A real track token is track/items/slides/
                // slider-inner, optionally BEM-prefixed (carousel-items, slider__track);
                // an alignment utility merely STARTS with the word and can never match.
                function wpcLooksLikeTrackClass(className) {
                    var toks = String(className || "").split(/s+/);
                    for (var i = 0; i < toks.length; i++) {
                        if (/^(?:[a-z0-9]+[-_]{1,2})*(?:track|items|slides|slider-inner)$/i.test(toks[i])) return true;
                    }
                    return false;
                }

                if (!$items || $items.length <= 1) {
                    $track = $carousel.find("[class]").filter(function() {
                        return wpcLooksLikeTrackClass(this.getAttribute("class"));
                    }).first();
                    if ($track.length) {
                        $items = $track.children().not("button");
                    }
                }
                
                if (!$items || $items.length <= 1) {
                    $items = $carousel.children().not("button").filter(function() {
                        var $el = $(this);
                        return !$el.find("button[aria-label]").length;
                    });
                }
                
                if (!$items || $items.length === 0) {
                    return;
                }
                
                var totalItems = $items.length;
                
                function parseColumns($el) {
                    var configs = { base: null, sm: null, md: null, lg: null, xl: null };
                    var classString = ($el.attr("class") || "") + " " + ($el.parent().attr("class") || "");
                    classString.split(/\s+/).forEach(function(cls) {
                        var match = cls.match(/^(sm:|md:|lg:|xl:)?grid-cols-(\d+)/);
                        if (match) {
                            var bp = match[1] ? match[1].replace(":", "") : "base";
                            configs[bp] = parseInt(match[2], 10);
                        }
                    });
                    return configs;
                }
                
                function columnsForWidth(configs, width) {
                    if (width >= 1280 && configs.xl) return configs.xl;
                    if (width >= 1024 && configs.lg) return configs.lg;
                    if (width >= 768 && configs.md) return configs.md;
                    if (width >= 640 && configs.sm) return configs.sm;
                    return configs.base || configs.lg || configs.md || 1;
                }
                
                var columnConfig = parseColumns($track.length ? $track : $carousel);
                var itemsPerView = Math.max(1, Math.min(totalItems, columnsForWidth(columnConfig, window.innerWidth)));
                var currentIndex = 0;
                
                function updateDots(activeIndex) {
                    var $dots = $carousel.find('[class*="dot"], [class*="pagination"] button, button[role="tab"]');
                    if ($dots.length === 0) return;
                    $dots.removeClass("active bg-arta-red w-6");
                    $dots.eq(activeIndex % $dots.length).addClass("active bg-arta-red w-6");
                }
                
                function showCurrentItems() {
                    $items.hide();
                    for (var i = 0; i < itemsPerView; i++) {
                        var idx = (currentIndex + i) % totalItems;
                        $items.eq(idx).fadeIn(200);
                    }
                    updateDots(currentIndex);
                }
                
                function recalcItemsPerView() {
                    var newView = Math.max(1, Math.min(totalItems, columnsForWidth(columnConfig, window.innerWidth)));
                    if (newView !== itemsPerView) {
                        itemsPerView = newView;
                        currentIndex = 0;
                        showCurrentItems();
                    }
                }
                
                // EC-CAROUSEL-002 FIX: Remove stale disabled attrs from React initial state
                $prevBtn.removeAttr("disabled").css("opacity", "");
                $nextBtn.removeAttr("disabled").css("opacity", "");

                var autoAdvanceInterval = null;
                
                if (totalItems > itemsPerView) {
                    showCurrentItems();
                    autoAdvanceInterval = setInterval(function() {
                        currentIndex = (currentIndex + itemsPerView) % totalItems;
                        showCurrentItems();
                    }, 6000);
                } else {
                    $items.show();
                    updateDots(0);
                    // When all items fit, disable buttons since there's nothing to cycle
                    $prevBtn.prop("disabled", true).css("opacity", 0.3);
                    $nextBtn.prop("disabled", true).css("opacity", 0.3);
                    console.log("All carousel items fit on screen, buttons disabled");
                }
                
                $items.each(function(index) {
                    $(this).attr('data-original-index', index);
                });

                $prevBtn.off("click.wpconvertCarousel").on("click.wpconvertCarousel", function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    if (totalItems <= itemsPerView) return;
                    if (autoAdvanceInterval) clearInterval(autoAdvanceInterval);
                    
                    var $last = $items.last();
                    $items = $items.not($last);
                    
                    $last.hide().prependTo($track).fadeIn(300);
                    $items = $last.add($items);
                    
                    var currentOriginalIndex = parseInt($items.first().attr('data-original-index') || 0);
                    updateDots(currentOriginalIndex);
                    
                    if (totalItems > itemsPerView) {
                        startAutoAdvance();
                    }
                });
                
                $nextBtn.off("click.wpconvertCarousel").on("click.wpconvertCarousel", function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    if (totalItems <= itemsPerView) return;
                    if (autoAdvanceInterval) clearInterval(autoAdvanceInterval);
                    
                    var $first = $items.first();
                    $items = $items.not($first);
                    
                    $first.hide().appendTo($track).fadeIn(300);
                    $items = $items.add($first);
                    
                    var currentOriginalIndex = parseInt($items.first().attr('data-original-index') || 0);
                    updateDots(currentOriginalIndex);
                    
                    if (totalItems > itemsPerView) {
                        startAutoAdvance();
                    }
                });
                
                function startAutoAdvance() {
                    autoAdvanceInterval = setInterval(function() {
                        $nextBtn.trigger('click');
                    }, 6000);
                }
                
                if (totalItems > itemsPerView) {
                    startAutoAdvance();
                }
                
                var $dots = $carousel.find('[class*="dot"], [class*="pagination"] button, button[role="tab"]');
                if ($dots.length > 0) {
                    $dots.on("click", function(e) {
                        e.preventDefault();
                        clearInterval(autoAdvanceInterval);
                        currentIndex = $(this).index();
                        showCurrentItems();
                    });
                }
                
                var resizeTimer = null;
                $(window).on("resize.wpconvertCarousel", function() {
                    clearTimeout(resizeTimer);
                    resizeTimer = setTimeout(function() {
                        recalcItemsPerView();
                    }, 200);
                });
                
                // CRITICAL: Add drag/swipe support for touch and mouse
                var isDragging = false;
                var startX = 0;
                var startY = 0;
                var scrollLeft = 0;
                var scrollTop = 0;
                
                // Mouse drag support
                $track.on("mousedown.wpconvertCarousel", function(e) {
                    isDragging = true;
                    startX = e.pageX - $(this).offset().left;
                    startY = e.pageY - $(this).offset().top;
                    scrollLeft = $(this).scrollLeft();
                    scrollTop = $(this).scrollTop();
                    $(this).css("cursor", "grabbing");
                });
                
                $(document).on("mousemove.wpconvertCarousel", function(e) {
                    if (!isDragging) return;
                    e.preventDefault();
                    var x = e.pageX - $track.offset().left;
                    var y = e.pageY - $track.offset().top;
                    var walkX = (x - startX) * 2;
                    var walkY = (y - startY) * 2;
                    
                    // If horizontal drag is greater than vertical, it's a swipe
                    if (Math.abs(walkX) > Math.abs(walkY) && Math.abs(walkX) > 50) {
                        if (walkX > 0) {
                            // Swipe right = previous
                            $prevBtn.trigger("click");
                        } else {
                            // Swipe left = next
                            $nextBtn.trigger("click");
                        }
                        isDragging = false;
                        $track.css("cursor", "");
                    }
                });
                
                $(document).on("mouseup.wpconvertCarousel", function() {
                    isDragging = false;
                    $track.css("cursor", "");
                });
                
                // Touch swipe support
                var touchStartX = 0;
                var touchStartY = 0;
                
                $track.on("touchstart.wpconvertCarousel", function(e) {
                    var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
                    touchStartX = touch.clientX;
                    touchStartY = touch.clientY;
                });
                
                $track.on("touchend.wpconvertCarousel", function(e) {
                    var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
                    if (!touch) {
                        touch = e.originalEvent.changedTouches[0];
                    }
                    if (!touch) return;
                    
                    var touchEndX = touch.clientX;
                    var touchEndY = touch.clientY;
                    var diffX = touchStartX - touchEndX;
                    var diffY = touchStartY - touchEndY;
                    
                    // If horizontal swipe is greater than vertical, it's a swipe
                    if (Math.abs(diffX) > Math.abs(diffY) && Math.abs(diffX) > 50) {
                        if (diffX > 0) {
                            // Swipe left = next
                            $nextBtn.trigger("click");
                        } else {
                            // Swipe right = previous
                            $prevBtn.trigger("click");
                        }
                    }
                });
            }
            
            // Method 1: Find all buttons with Previous/Next aria-labels and trace back to their carousel container
            $("button[aria-label*='Previous'], button[aria-label*='Prev'], button[aria-label*='previous']").each(function() {
                var $prevBtn = $(this);
                if ($prevBtn.data("carousel-processed")) return;
                // EC-CAROUSEL-004 + EC-TESTIMONIAL-004b: Skip inner testimonial card only (EC-CAROUSEL-001)
                if (wpcInsideJsonTestimonialCard($prevBtn)) return;
                // EC-CAROUSEL-016: Skip stacked-image / video galleries (crossfade, NOT horizontal carousels).
                // Buttons like "Previous photo", "Previous video" live inside a container where 2+
                // children are absolutely positioned at inset-0. Wrapping the parent grid in a flex
                // track causes blank flashes and layout glitches.
                var prevLabel = ($prevBtn.attr("aria-label") || "").toLowerCase();
                if (/\bphoto\b|\bvideo\b|\bimage\b|\bpicture\b|\bgallery\b|\bslide\b/.test(prevLabel)) {
                    var $galBox = $prevBtn.parent();
                    // EC-GALLERY-003: source-recovered GalleryCarousel stacks own their runtime.
                    if ($galBox.attr("data-wpc-gallery-carousel") === "true") {
                        $prevBtn.data("carousel-processed", true);
                        $galBox.find("button").data("carousel-processed", true);
                        return;
                    }
                    var stackedImgs = $galBox.find("img.absolute, img[class*='absolute'][class*='inset'], video.absolute, video[class*='absolute'][class*='inset'], [class*='absolute'][class*='inset-0']");
                    if (stackedImgs.length >= 2) {
                        $prevBtn.data("carousel-processed", true);
                        var $sibNext = $galBox.find("button[aria-label*='Next'], button[aria-label*='next']").not($prevBtn);
                        if ($sibNext.length) $sibNext.data("carousel-processed", true);
                        // EC-CAROUSEL-016f: Wire a proper opacity-cycle handler instead
                        // of leaving dead buttons. Crossfade between stacked images.
                        // EC-CAROUSEL-016i: also wire "Go to photo N" dots, footer
                        // Prev/Next text buttons, and the "N / M" counter (Melana GalleryCarousel).
                        (function($box, $prev, $next) {
                            var $imgs = $box.find("img.absolute, img[class*='absolute'][class*='inset-0'], video.absolute, video[class*='absolute'][class*='inset-0']");
                            if ($imgs.length < 2) return;
                            var idx = 0;
                            $imgs.css({ transition: "opacity 0.5s ease" });
                            $imgs.each(function(i) { $(this).css("opacity", i === 0 ? 1 : 0); });
                            var $dots = $box.find("button[aria-label*='View'], button[aria-label*='Go to photo'], button[aria-label*='Go to image'], button[aria-label*='Go to picture'], button[aria-label*='Go to slide']");
                            var $card = $box.parent();
                            var $counter = $card.find("span").filter(function() { return /^\s*\d+\s*\/\s*\d+\s*$/.test($(this).text() || ""); }).first();
                            var $footerPrev = $card.find("button").filter(function() {
                                var t = (($(this).text() || "").replace(/\s+/g, " ").trim());
                                return /^(prev|previous)$/i.test(t);
                            }).not($prev);
                            var $footerNext = $card.find("button").filter(function() {
                                var t = (($(this).text() || "").replace(/\s+/g, " ").trim());
                                return /^next$/i.test(t);
                            }).not($next);
                            function show(n) {
                                idx = ((n % $imgs.length) + $imgs.length) % $imgs.length;
                                $imgs.each(function(i) { $(this).css("opacity", i === idx ? 1 : 0); });
                                if ($dots.length) $dots.each(function(i) {
                                    var $d = $(this);
                                    $d.css("opacity", i === idx ? 1 : 0.5);
                                    if (i === idx) $d.css("width", "1.25rem"); else $d.css("width", "0.5rem");
                                });
                                if ($counter.length) $counter.text((idx + 1) + " / " + $imgs.length);
                            }
                            show(0);
                            $prev.off("click.wpcGallery").on("click.wpcGallery", function(e) { e.preventDefault(); e.stopPropagation(); clearInterval(timer); show(idx - 1); startTimer(); });
                            $next.off("click.wpcGallery").on("click.wpcGallery", function(e) { e.preventDefault(); e.stopPropagation(); clearInterval(timer); show(idx + 1); startTimer(); });
                            $footerPrev.add($footerNext).data("carousel-processed", true);
                            $footerPrev.off("click.wpcGallery").on("click.wpcGallery", function(e) { e.preventDefault(); e.stopPropagation(); clearInterval(timer); show(idx - 1); startTimer(); });
                            $footerNext.off("click.wpcGallery").on("click.wpcGallery", function(e) { e.preventDefault(); e.stopPropagation(); clearInterval(timer); show(idx + 1); startTimer(); });
                            $dots.each(function(i) { $(this).data("carousel-processed", true).css("cursor","pointer").off("click.wpcGallery").on("click.wpcGallery", function(e) { e.preventDefault(); clearInterval(timer); show(i); startTimer(); }); });
                            var timer = setInterval(function() { show(idx + 1); }, 5000);
                            function startTimer() { clearInterval(timer); timer = setInterval(function() { show(idx + 1); }, 5000); }
                            $box.data("carousel-processed", true).on("mouseenter", function() { clearInterval(timer); }).on("mouseleave", function() { startTimer(); });
                            // EC-CAROUSEL-016h: Mark the ENTIRE enclosing section as carousel-processed.
                            // The stacked gallery lives inside a grid column. Without this guard,
                            // later carousel methods (3/5/6) can find other buttons or overflow-hidden
                            // elements in the same section and call initializeOverflowCarousel on a
                            // parent container — turning the hero grid itself into a carousel that
                            // scrolls the text and gallery columns as separate "slides."
                            var $galSection = $box.closest("section");
                            if ($galSection.length) {
                                $galSection.find("button, .overflow-hidden, [style*='overflow']").data("carousel-processed", true);
                            }
                            console.log("[EC-CAROUSEL-016f/016i] Stacked gallery opacity-cycle: " + $imgs.length + " images");
                        })($galBox, $prevBtn, $sibNext.length ? $sibNext.first() : $());
                        return;
                    }
                    // EC-CAROUSEL-016d: Also skip horizontal thumbnail scroll controls.
                    // Buttons labelled "Previous video" / "Next photo" sit beside an
                    // overflow-x-auto scrollable strip of thumbnails — they are scroll
                    // controls, not carousel prev/next buttons.
                    var $scrollSibling = $galBox.find("[class*='overflow-x-auto'], [class*='overflow-auto'], [class*='scrollbar-hide']");
                    if ($scrollSibling.length && $scrollSibling.find("button, a").length >= 2) {
                        $prevBtn.data("carousel-processed", true);
                        var $sibNext2 = $galBox.find("button[aria-label*='Next'], button[aria-label*='next']").not($prevBtn);
                        if ($sibNext2.length) $sibNext2.data("carousel-processed", true);
                        console.log("[EC-CAROUSEL-016d] Skipped thumbnail scroll strip (aria-label: " + prevLabel + ")");
                        return;
                    }
                }
                
                // Find the common parent container (usually a div with "relative" class that contains both buttons and grid)
                var $parentContainer = $prevBtn.parent();
                
                // Find the corresponding Next button - check siblings first (most common case)
                var $nextBtn = $prevBtn.siblings("button[aria-label*='Next'], button[aria-label*='next'], button[aria-label*='testimonial']");
                if (!$nextBtn.length) {
                    // If not siblings, search within the parent container
                    $nextBtn = $parentContainer.find("button[aria-label*='Next'], button[aria-label*='next']").not($prevBtn);
                }
                
                if (!$nextBtn.length) return; // No next button found
                
                // Find the grid/carousel container - look for grid within the parent container
                // CRITICAL: The carousel container should be the parent that contains BOTH buttons AND grid
                var $gridContainer = $parentContainer.find('[class*="grid"], [class*="carousel"], [class*="slider"]').first();
                
                // Use the parent container as carousel if it contains a grid (buttons are siblings of grid)
                // Otherwise, try to find a section parent
                var $carousel = $gridContainer.length ? $parentContainer : $prevBtn.closest('section, [class*="carousel"], [class*="slider"], [class*="testimonial"], [class*="client"]');
                
                // Final fallback: use parent container if nothing else found
                if (!$carousel.length) {
                    $carousel = $parentContainer;
                }
                
                if ($nextBtn.length && $carousel.length) {
                    // EC-CAROUSEL-028b: Real multi-slide flex/aria carousels must use
                    // initializeOverflowCarousel (translateX track), not the legacy
                    // initializeCarousel hide/show grid path — which also leaves
                    // flex-wrap:wrap on the track and stacks all slides.
                    var $flexScope = $carousel.closest("section").length ? $carousel.closest("section") : $carousel;
                    if ($flexScope.find('[data-wpconvert-flex-carousel="track"]').length ||
                        $flexScope.find('[aria-roledescription="carousel"]').length) {
                        console.log("[EC-CAROUSEL-028b] Skip Method 1 grid carousel: multi-slide flex/aria track present");
                        return;
                    }

                    console.log("Found carousel with prev/next buttons:", {
                        carousel: $carousel.attr("class"),
                        prevBtn: $prevBtn.attr("aria-label"),
                        nextBtn: $nextBtn.attr("aria-label"),
                        hasGrid: $gridContainer.length > 0,
                        carouselLength: $carousel.length,
                        nextBtnLength: $nextBtn.length
                    });
                    
                    try {
                        $prevBtn.data("carousel-processed", true);
                        $nextBtn.data("carousel-processed", true);
                        initializeCarousel($carousel.first(), $prevBtn.first(), $nextBtn.first());
                        console.log("✅ Carousel initialized successfully");
                    } catch (error) {
                        console.error("❌ Error initializing carousel:", error);
                    }
                } else {
                    console.log("⚠️ Carousel not initialized - missing requirements:", {
                        hasNextBtn: $nextBtn.length > 0,
                        hasCarousel: $carousel.length > 0
                    });
                }
            });
            
            // Method 2: Detect by class name patterns (fallback)
            var $carousels = $('[class*="carousel"], [class*="slider"], [class*="swiper"], [data-carousel]');
            console.log("Found " + $carousels.length + " potential carousels by class");
            $carousels.each(function() {
                var $carousel = $(this);
                if ($carousel.data("carousel-processed")) return;
                if (wpcInsideJsonTestimonialCard($carousel)) return;
                
                var $prevBtn = $carousel.find('button[aria-label*="Previous"], button[aria-label*="Prev"], [class*="prev"], [class*="left"]');
                var $nextBtn = $carousel.find('button[aria-label*="Next"], [class*="next"], [class*="right"]');
                
                if ($prevBtn.length && $nextBtn.length) {
                    console.log("Found carousel by class pattern:", $carousel.attr("class"));
                    $carousel.data("carousel-processed", true);
                    initializeCarousel($carousel, $prevBtn.first(), $nextBtn.first());
                }
            });
            } catch(e) { console.warn("[WPConvert] Universal carousel error:", e); }
            
            try { // [WPConvert: EC-CAROUSEL-002 SVG Arrow + Overflow Carousel Detection]
            // EC-CAROUSEL-002: Enhanced carousel detection for AI-builder patterns
            // Covers: Embla/ShadCN (overflow-hidden+flex), Lucide/Heroicon SVG buttons,
            // sr-only text, and generic scrollable card containers.

            function initializeOverflowCarousel($region, $viewport, $track, $slides, $prevBtn, $nextBtn) {
                if (!$slides.length) return;
                // EC-CAROUSEL-016h: Never convert a section that contains a stacked gallery
                // into an overflow carousel — the gallery already has its own 016f handler.
                if ($region.closest("[data-wpconvert-stacked-gallery-section]").length ||
                    $viewport.closest("[data-wpconvert-stacked-gallery-section]").length) {
                    console.log("[EC-CAROUSEL-016h] Skipped initializeOverflowCarousel inside stacked gallery section");
                    return;
                }
                var currentSlide = 0;

                // Remove stale inline onclick handlers and take full control
                [$prevBtn, $nextBtn].forEach(function($b) {
                    var oc = $b.attr("onclick") || "";
                    if (oc) {
                        var fnName = oc.split("(")[0].replace(/[^a-zA-Z0-9_$]/g, "");
                        if (fnName && typeof window[fnName] === "function") {
                            $b[0].onclick = null;
                        }
                    }
                    $b.removeAttr("onclick");
                });

                // EC-CAROUSEL-003: Clear stale Embla/ShadCN inline transforms
                // Embla loop mode applies translate3d() on both the track AND individual slides
                // at runtime. Puppeteer captures these mid-animation values, positioning slides
                // off-screen on initial load (blank carousel). We must clear them before init.
                $track.css("transform", "");
                $slides.css("transform", "");

                // Ensure viewport has overflow hidden (might be set via CSS class or style)
                if ($viewport.css("overflow") !== "hidden") {
                    $viewport.css("overflow", "hidden");
                }
                // Ensure track is a single-row flex strip for translateX to work.
                // EC-CAROUSEL-028: ALWAYS force flex-wrap:nowrap — many converted themes ship a
                // generic site-level .flex rule with flex-wrap:wrap in style.css (non-Tailwind
                // site CSS) that collides with Tailwind .flex (display only). flex-wrap:wrap then
                // persists on carousel tracks and all slides wrap into a multi-row grid (JOY
                // What Our Clients Say 2x4 stacked layout). Previously we only set nowrap when
                // display was not already flex, which missed this case.
                if ($track.css("display") !== "flex" && $track.css("display") !== "inline-flex") {
                    $track.css("display", "flex");
                }
                $track.css("flexWrap", "nowrap");

                // Detect dot/pagination elements within the region
                var $dots = $region.find('[class*="dot"], [class*="pagination"] > *, [class*="progress"] > *').filter(function() {
                    var $d = $(this);
                    if ($d.find("p, h1, h2, h3, img").length) return false;
                    if ($d.children().length > 3) return false;
                    return true;
                });

                function perViewFromBasis($slide) {
                    var cls = ($slide.attr("class") || "");
                    var w = window.innerWidth || 0;
                    if (w >= 1024) {
                        if (/\blg:basis-1\/3\b/.test(cls)) return 3;
                        if (/\blg:basis-1\/2\b/.test(cls)) return 2;
                        if (/\blg:basis-1\/4\b/.test(cls)) return 4;
                    }
                    if (w >= 768) {
                        if (/\bmd:basis-1\/3\b/.test(cls)) return 3;
                        if (/\bmd:basis-1\/2\b/.test(cls)) return 2;
                    }
                    if (/\bbasis-full\b/.test(cls)) return 1;
                    if (/\bw-1\/3\b|\bmd:w-1\/3\b/.test(cls)) return 3;
                    return 0;
                }

                function getMetrics() {
                    var vw = $viewport.outerWidth();
                    var sw = $slides.first().outerWidth(true);
                    if (!sw) sw = vw;
                    // Account for flex gap (not included in outerWidth)
                    var gap = parseFloat($track.css("gap") || $track.css("column-gap")) || 0;
                    var step = sw + gap;
                    var basisPerView = perViewFromBasis($slides.first());
                    var perView = basisPerView > 0
                        ? basisPerView
                        : Math.max(1, Math.round(vw / step));
                    var maxIdx = Math.max(0, $slides.length - perView);
                    var usePercent = basisPerView > 0 || ($track.attr("class") || "").indexOf("-ml-") >= 0;
                    return { slideWidth: step, perView: perView, maxIdx: maxIdx, usePercent: usePercent };
                }

                // EC-CAROUSEL-014: Images/layout can report 0 width for one frame after paint;
                // translating with bad metrics blanks the hero or shifts the wrong flex row.
                var wpcMetricsRetries = 0;
                function goTo(idx) {
                    var m = getMetrics();
                    var bad = !m.slideWidth || m.slideWidth < 2 || !isFinite(m.slideWidth) || !isFinite(m.maxIdx);
                    if (bad && wpcMetricsRetries < 32) {
                        wpcMetricsRetries++;
                        window.setTimeout(function() { goTo(idx); }, 40);
                        return;
                    }
                    wpcMetricsRetries = 0;
                    if (!m.slideWidth || m.slideWidth < 2 || !isFinite(m.slideWidth)) {
                        console.warn("[EC-CAROUSEL-014] Overflow carousel: slide metrics invalid after retries, skip transform");
                        return;
                    }
                    currentSlide = Math.max(0, Math.min(idx, m.maxIdx));
                    var offset;
                    if (m.usePercent && m.perView > 0) {
                        offset = -(currentSlide * (100 / m.perView));
                        $track.css({ transform: "translateX(" + offset + "%)", transition: "transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94)" });
                    } else {
                        offset = -(currentSlide * m.slideWidth);
                        $track.css({ transform: "translateX(" + offset + "px)", transition: "transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94)" });
                    }
                    $prevBtn.prop("disabled", currentSlide <= 0).css("opacity", currentSlide <= 0 ? 0.3 : 1);
                    $nextBtn.prop("disabled", currentSlide >= m.maxIdx).css("opacity", currentSlide >= m.maxIdx ? 0.3 : 1);
                    // Update dots
                    if ($dots.length) {
                        $dots.removeClass("active");
                        var dotIdx = Math.min(currentSlide, $dots.length - 1);
                        $dots.eq(dotIdx).addClass("active");
                    }
                }

                $prevBtn.off("click.wpcOverflow").on("click.wpcOverflow", function(e) {
                    e.preventDefault(); e.stopPropagation();
                    goTo(currentSlide - 1);
                });
                $nextBtn.off("click.wpcOverflow").on("click.wpcOverflow", function(e) {
                    e.preventDefault(); e.stopPropagation();
                    goTo(currentSlide + 1);
                });

                // Dot click navigation
                if ($dots.length) {
                    $dots.css("cursor", "pointer").on("click.wpcOverflow", function(e) {
                        e.preventDefault();
                        goTo($(this).index());
                    });
                }

                // Touch/swipe support
                var touchX = 0;
                $viewport.on("touchstart.wpcOverflow", function(e) {
                    touchX = (e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]).clientX;
                });
                $viewport.on("touchend.wpcOverflow", function(e) {
                    var t = e.originalEvent.changedTouches[0]; if (!t) return;
                    var diff = touchX - t.clientX;
                    if (Math.abs(diff) > 50) goTo(currentSlide + (diff > 0 ? 1 : -1));
                });

                $(window).on("resize.wpcOverflow", function() { goTo(currentSlide); });
                goTo(0);
                console.log("[EC-CAROUSEL-002] ✅ Overflow carousel: " + $slides.length + " slides, dots: " + $dots.length);
            }

            // Detect left/right arrow icon inside a button
            function classifyArrowBtn($btn) {
                var iconCls = "";
                $btn.find("svg, i").each(function() { iconCls += " " + ($(this).attr("class") || ""); });
                iconCls = iconCls.toLowerCase();
                var srText = ($btn.find(".sr-only").text() || "").toLowerCase();
                var btnText = ($btn.text() || "").replace(/\s+/g, "").toLowerCase();

                var leftPats = ["chevron-left", "arrow-left", "angle-left", "caret-left", "move-left"];
                var rightPats = ["chevron-right", "arrow-right", "angle-right", "caret-right", "move-right"];

                for (var i = 0; i < leftPats.length; i++) {
                    if (iconCls.indexOf(leftPats[i]) >= 0) return "prev";
                }
                for (var i = 0; i < rightPats.length; i++) {
                    if (iconCls.indexOf(rightPats[i]) >= 0) return "next";
                }
                if (/\bprev|previous\b/.test(srText)) return "prev";
                if (/\bnext\b/.test(srText)) return "next";
                if (/^[<‹←]$/.test(btnText)) return "prev";
                if (/^[>›→]$/.test(btnText)) return "next";
                // Check inline onclick for carousel function calls (e.g., slideCards(-1), slideCards(1))
                var oc = ($btn.attr("onclick") || "");
                if (/slide|scroll|carousel|rotate/i.test(oc)) {
                    if (/\(\s*-/.test(oc) || /prev|back|left/i.test(oc)) return "prev";
                    if (/\(\s*1\b/.test(oc) || /next|forward|right/i.test(oc)) return "next";
                }
                return null;
            }

            // EC-CAROUSEL-008: Prefer direct-child overflow viewport (Embla/ShadCN). A plain .find() can match
            // slide-inner .overflow-hidden before the real track wrapper in some DOM orders.
            // EC-CAROUSEL-014: The first .overflow-hidden in a wide section may be a 2-col grid shell;
            // translating that track shifts copy + images together (blank or "flipped" layout on slide change).
            function wpcResolveCarouselViewport($root) {
                function scoreViewport($vp) {
                    var cls = $vp.attr("class") || "";
                    if (/\bgrid\b/.test(cls) && /grid-cols-/.test(cls)) return -100;
                    var $track = $vp.children().first();
                    if (!$track.length) return 0;
                    var trackCls = $track.attr("class") || "";
                    var disp = ($track.css("display") || "").toLowerCase();
                    var flexLike = trackCls.indexOf("flex") >= 0 || disp.indexOf("flex") >= 0;
                    var $kids = $track.children();
                    if ($kids.length < 2) return flexLike ? 6 : 0;
                    // EC-CAROUSEL-015: Two-column hero (image track + prose) — not a horizontal slide strip;
                    // translating this viewport blanks the image column or shifts copy with the flex row.
                    if ($kids.length === 2) {
                        var withImg = 0, textHeavy = 0;
                        $kids.each(function() {
                            var imgs = $(this).find("img").length;
                            if (imgs > 0) withImg++;
                            var tl = $(this).text().trim().length;
                            if (imgs === 0 && tl > 100) textHeavy++;
                        });
                        if (withImg === 1 && textHeavy >= 1) return -80;
                    }
                    var ariaSlides = $track.children('[aria-roledescription="slide"]').length;
                    var slideLike = 0;
                    $kids.each(function() {
                        var c = $(this).attr("class") || "";
                        if (c.indexOf("shrink-0") >= 0 || c.indexOf("min-w-") >= 0 || c.indexOf("basis-") >= 0) slideLike++;
                        if ($(this).find("img").length) slideLike++;
                    });
                    var score = 0;
                    if (flexLike) score += 20;
                    if (ariaSlides >= 2) score += 45;
                    else score += 12;
                    if (slideLike >= 2) score += 28;
                    if ($vp.closest('[role="region"][aria-roledescription="carousel"]').length) score += 32;
                    return score;
                }
                var $all = $root.find(".overflow-hidden");
                var best = null, bestS = -9999;
                if ($all.length) {
                    $all.each(function() {
                        var $cand = $(this);
                        var s = scoreViewport($cand);
                        if (s > bestS) { bestS = s; best = $cand; }
                    });
                }
                if (best && bestS >= 20) {
                    console.log("[EC-CAROUSEL-014] wpcResolveCarouselViewport picked score=" + bestS);
                    return best;
                }
                var $vp = $root.children(".overflow-hidden").first();
                if ($vp.length) return $vp;
                $vp = $root.find("> .overflow-hidden").first();
                if ($vp.length) return $vp;
                return $root.find(".overflow-hidden").first();
            }

            // Method 3: Detect by SVG icon class on buttons (lucide, heroicons, FA)
            // EC-CAROUSEL-013: Also match <i> with arrow icon classes (Remix Icon, etc.)
            var svgProcessed = [];
            $("button:has(svg), button:has(i[class*='fa-']), button:has(i[class*='arrow'])").each(function() {
                var $btn = $(this);
                if ($btn.data("carousel-processed")) return;
                if ($btn.closest("[data-wpconvert-stacked-gallery]").length) { $btn.data("carousel-processed", true); return; }
                /* EC-MSTEP-021: a multi-step wizard's Zurück / Weiter are a left
                   arrow and a right arrow side by side, so by every test below
                   they are carousel controls. Following them turns the wizard's
                   first question into a scroll strip and hides its options from
                   the code that makes them clickable. Marked processed so no
                   later method picks them up either. Both attributes are stamped
                   at BUILD time by the multi-step injector, so this does not
                   depend on which runtime happened to run first. */
                if ($btn.closest("[data-wpc-form-step], .wpconvert-multistep-form").length) {
                    $btn.data("carousel-processed", true);
                    return;
                }
                if (wpcInsideJsonTestimonialCard($btn)) return;
                // EC-CAROUSEL-016e: Skip Radix/HeadlessUI accordion/collapsible triggers.
                // These have data-state="open"/"closed" + aria-controls and use rotated
                // chevrons that classifyArrowBtn would wrongly classify as carousel arrows.
                if ($btn.attr("data-state") && $btn.attr("aria-controls")) return;
                var role = classifyArrowBtn($btn);
                if (role !== "prev") return; // start from prev buttons

                // Find matching next button: sibling buttons or nearby buttons in same parent
                var $nextBtn = null;
                $btn.parent().children("button").each(function() {
                    if ($(this).is($btn)) return;
                    if (classifyArrowBtn($(this)) === "next") { $nextBtn = $(this); return false; }
                });

                if (!$nextBtn || !$nextBtn.length) {
                    // Try grandparent scope (buttons may be in separate wrapper divs)
                    $btn.parent().parent().find("button").each(function() {
                        if ($(this).is($btn)) return;
                        if ($(this).data("carousel-processed")) return;
                        if (classifyArrowBtn($(this)) === "next") { $nextBtn = $(this); return false; }
                    });
                }
                if (!$nextBtn || !$nextBtn.length) return;

                // EC-CAROUSEL-016b: Skip stacked-image/video galleries in Method 3 too.
                // The button pair lives inside a container where 2+ children overlap at inset-0
                // (opacity-crossfade). Treating it as a horizontal carousel causes blank flashes.
                var $galParent = $btn.parent();
                var stackedKids = $galParent.find("[class*='absolute'][class*='inset-0']");
                if (stackedKids.length >= 2 && $galParent.find("img, video").length >= 2) {
                    $btn.data("carousel-processed", true);
                    $nextBtn.data("carousel-processed", true);
                    svgProcessed.push("skip-stacked-gallery");
                    console.log("[EC-CAROUSEL-016b] Method 3 skipped stacked gallery (" + stackedKids.length + " layers)");
                    return;
                }

                // EC-CAROUSEL-016c: Skip category filter bar sections. A sticky/scrollable
                // row of <button> pills with chevron scroll arrows is NOT a carousel.
                // Detect: closest section has overflow-x-auto child with 3+ buttons and no card grid.
                var $closestSec = $btn.closest("section");
                if ($closestSec.length) {
                    var $scrollRow = $closestSec.find("[class*='overflow-x-auto'], [class*='overflow-auto'], [class*='scrollbar-hide']");
                    if ($scrollRow.length && $scrollRow.find("button").length >= 3) {
                        var sectionHasCardGrid = $closestSec.find("[class*='grid-cols']").length > 0;
                        if (!sectionHasCardGrid) {
                            $btn.data("carousel-processed", true);
                            $nextBtn.data("carousel-processed", true);
                            svgProcessed.push("skip-filter-bar");
                            console.log("[EC-CAROUSEL-016c] Method 3 skipped category filter bar section");
                            return;
                        }
                    }
                }

                // Find the carousel container — walk up to section or a container with cards
                var $container = $btn.closest('[role="region"][aria-roledescription="carousel"]');
                if (!$container.length) $container = $btn.closest("section");
                if (!$container.length) $container = $btn.parent().parent().parent();
                if ($container.data("carousel-processed")) return;

                // EC-CAROUSEL-021: Native horizontal scroll-snap row with EXTERNAL arrow buttons.
                // Some React sources (e.g. ZonaVita TreatmentsSection) render a flex track with
                // overflow-x-auto + snap-x + snap-mandatory and a pair of chevron <button>s in the
                // section header that call scrollRef.scrollBy({left: ±amount}). Every card stays in
                // the DOM; the user scrolls horizontally. Without this guard, the code below calls
                // wpcResolveCarouselViewport($container), which picks the FIRST nested
                // .overflow-hidden (a single card's image wrapper) as the "viewport" and treats the
                // card's <img> + gradient overlay as two slides — so clicking the arrows only flips
                // the FIRST card's image (user report: "arrows only change the first photo").
                // Instead, wire the buttons to scroll the row natively (faithful to the source
                // scrollBy) and skip slideshow init. This is the Method-3 analog of the native
                // overflow-x scroll-row skip that Method 7 performs.
                var $nativeScrollRow = $container.find(
                    '[class*="overflow-x-auto"], [class*="overflow-x-scroll"], [class*="snap-x"], [class*="scrollbar-hide"]'
                ).filter(function() {
                    var c = $(this).attr("class") || "";
                    if (!/\boverflow-x-(auto|scroll)\b|\bsnap-x\b|\bscrollbar-hide\b/i.test(c)) return false;
                    return $(this).children().length >= 2; // a flex row carrying the cards
                }).first();
                if ($nativeScrollRow.length &&
                    $nativeScrollRow[0] !== $btn[0] &&
                    !$nativeScrollRow[0].contains($btn[0])) {
                    $btn.data("carousel-processed", true);
                    $nextBtn.data("carousel-processed", true);
                    $container.data("carousel-processed", true);
                    var wpcRowEl = $nativeScrollRow[0];
                    var wpcScrollAmount = function() {
                        // EC-CAROUSEL-021b: scroll by one real CARD width, not the
                        // leading spacer. The source row often starts with a spacer
                        // <div class="flex-shrink-0 w-4 sm:w-6 lg:w-[calc((100vw-80rem)/2+2.5rem)]">
                        // that measures >60px at desktop widths, so "first child wider
                        // than 60" wrongly returned the spacer width (≈144 incl. gap).
                        // For snap rows that only matters for crispness, but for native
                        // overflow rows WITHOUT snap-mandatory it makes each click scroll
                        // a fraction of a card. Prefer a snap-aligned child (the card),
                        // else the most common child width (cards are identical; spacers
                        // are the odd ones out).
                        var kids = [];
                        $nativeScrollRow.children().each(function() {
                            var w = this.getBoundingClientRect ? this.getBoundingClientRect().width : 0;
                            kids.push({ w: w, cls: (this.getAttribute && this.getAttribute("class")) || "" });
                        });
                        // 1. First snap-aligned card (skips spacers, which carry no snap class).
                        for (var i = 0; i < kids.length; i++) {
                            if (kids[i].w > 60 && kids[i].cls.indexOf("snap-") !== -1) return kids[i].w + 24;
                        }
                        // 2. Most common width among non-trivial children = the card width.
                        var counts = {}, bestW = 0, bestN = 0;
                        for (var j = 0; j < kids.length; j++) {
                            if (kids[j].w <= 60) continue;
                            var key = Math.round(kids[j].w);
                            counts[key] = (counts[key] || 0) + 1;
                            if (counts[key] > bestN || (counts[key] === bestN && key > bestW)) { bestN = counts[key]; bestW = key; }
                        }
                        if (bestW > 60) return bestW + 24;
                        // 3. Fallbacks: first child > 60, else most of the viewport.
                        for (var k = 0; k < kids.length; k++) { if (kids[k].w > 60) return kids[k].w + 24; }
                        return Math.max(240, Math.round(wpcRowEl.clientWidth * 0.8));
                    };
                    // EC-CAROUSEL-021c: a leading CENTERING spacer (e.g.
                    // <div class="flex-shrink-0 w-[calc((100vw-80rem)/2+2.5rem)]">, which
                    // aligns the first card under a max-w-7xl heading) combined with
                    // scroll-snap-type:mandatory PINS the row at its maximum scroll on wide
                    // viewports: the first card's snap point sits beyond the scrollable range,
                    // so scroll-snap can never rest before it and BOTH arrows become inert
                    // (user report: "I click the arrows and nothing happens" on a wide monitor,
                    // all cards already visible). Neutralize mandatory snapping on this row so
                    // scrollBy works at every width — per-card scrollBy (wpcScrollAmount) keeps
                    // the cards aligned without needing CSS snap. Only do this for the exact
                    // pin pattern (mandatory snap + a leading non-snap spacer) so ordinary
                    // snap carousels keep their snapping.
                    try {
                        var wpcCS = (typeof window !== "undefined" && window.getComputedStyle) ? window.getComputedStyle(wpcRowEl) : null;
                        var wpcSnapType = wpcCS ? (wpcCS.scrollSnapType || "") : (wpcRowEl.style ? wpcRowEl.style.scrollSnapType || "" : "");
                        var $wpcFirstChild = $nativeScrollRow.children().first();
                        var wpcFirstCls = ($wpcFirstChild.attr("class") || "");
                        var wpcHasLeadingSpacer = wpcFirstCls.indexOf("snap-") === -1 &&
                            (wpcFirstCls.indexOf("w-[calc") !== -1 ||
                             wpcFirstCls.indexOf("flex-shrink-0") !== -1 ||
                             wpcFirstCls.indexOf("shrink-0") !== -1);
                        if (wpcSnapType.indexOf("mandatory") !== -1 && wpcHasLeadingSpacer) {
                            wpcRowEl.style.scrollSnapType = "none";
                            console.log("[EC-CAROUSEL-021c] Neutralized mandatory scroll-snap (leading centering spacer would pin the row on wide viewports)");
                        }
                    } catch (e) { /* non-fatal: arrows still call scrollBy */ }
                    $btn.off("click.wpcScrollRow").on("click.wpcScrollRow", function(e) {
                        e.preventDefault(); e.stopPropagation();
                        wpcRowEl.scrollBy({ left: -wpcScrollAmount(), behavior: "smooth" });
                    });
                    $nextBtn.off("click.wpcScrollRow").on("click.wpcScrollRow", function(e) {
                        e.preventDefault(); e.stopPropagation();
                        wpcRowEl.scrollBy({ left: wpcScrollAmount(), behavior: "smooth" });
                    });
                    svgProcessed.push("native-scroll-row:" + $nativeScrollRow.children().length);
                    console.log("[EC-CAROUSEL-021] Method 3 wired native overflow-x scroll row (" + $nativeScrollRow.children().length + " children) — scrollBy, not slideshow");
                    return;
                }

                // EC-CAROUSEL-013b: Run centered-transform detection BEFORE overflow-carousel.
                // wpcResolveCarouselViewport uses the first .overflow-hidden in the section; nested
                // card chrome inside slides matches first and wrongly triggers flex-overflow mode.
                var centeredTransformOk = (function() {
                    // EC-CAROUSEL-013: Centered-transform carousel — absolutely-positioned
                    // slides using translateX/scale for a "card fan" effect.
                    var $wrapper = null;
                    $container.find(".absolute.inset-0").each(function() {
                        var $w = $(this);
                        var absKids = $w.children(".absolute[style*='translateX'], .absolute[style*='translate']");
                        if (absKids.length >= 2) { $wrapper = $w; return false; }
                    });
                    if (!$wrapper) return false;

                    var $slides = $wrapper.children(".absolute");
                    if ($slides.length < 2) return false;

                    var positions = [];
                    $slides.each(function(idx) {
                        var s = $(this).attr("style") || "";
                        var tx = 0, sc = 1, op = 1, z = 10;
                        var txM = s.match(/translateX(([^)]+))/);
                        if (txM) tx = parseFloat(txM[1]) || 0;
                        var scM = s.match(/scale(([^)]+))/);
                        if (scM) sc = parseFloat(scM[1]) || 1;
                        var opM = s.match(/opacity:s*([0-9.]+)/);
                        if (opM) op = parseFloat(opM[1]);
                        var zM = s.match(/z-index:s*(d+)/);
                        if (zM) z = parseInt(zM[1], 10);
                        positions.push({ idx: idx, tx: tx, scale: sc, opacity: op, zIndex: z });
                    });

                    positions.sort(function(a, b) { return Math.abs(a.tx) - Math.abs(b.tx); });
                    var centerOrigIdx = positions[0].idx;
                    var sorted = positions.slice().sort(function(a, b) { return a.tx - b.tx; });
                    var gap = sorted.length > 1 ? Math.abs(sorted[1].tx - sorted[0].tx) : 768;

                    var scaleCenter = 1, scaleAdj = 0.83, scaleFar = 0.68;
                    var opCenter = 1, opAdj = 0.7, opFar = 0.35;
                    var zCenter = 30, zAdj = 20, zFar = 10;

                    $btn.data("carousel-processed", true);
                    $nextBtn.data("carousel-processed", true);
                    $container.data("carousel-processed", true);

                    var total = $slides.length;
                    var current = centerOrigIdx;
                    // Dots live in the row below the slider (sibling of .relative wrapper), not inside $container.find(all rounded-full)
                    var $dotRow = $btn.parent().nextAll("div").filter(function() {
                        return $(this).find("button.rounded-full").length >= 2;
                    }).first();
                    var $dots = $dotRow.length ? $dotRow.find("button.rounded-full") : $();

                    function renderTransform(idx) {
                        $slides.each(function(si) {
                            var offset = si - idx;
                            var absOff = Math.abs(offset);
                            var tx = offset * gap;
                            var sc = absOff === 0 ? scaleCenter : absOff === 1 ? scaleAdj : scaleFar;
                            var op = absOff === 0 ? opCenter : absOff === 1 ? opAdj : opFar;
                            var z = absOff === 0 ? zCenter : absOff === 1 ? zAdj : zFar;
                            $(this).css({
                                transform: "translateX(" + tx + "px) scale(" + sc + ")",
                                opacity: op,
                                zIndex: z,
                                pointerEvents: absOff <= 1 ? "auto" : "none"
                            });
                        });
                        if ($dots.length) {
                            $dots.css({ width: "8px" }).removeClass("bg-revo-orange bg-white").addClass("bg-white/20");
                            $dots.eq(idx % $dots.length).css({ width: "32px" }).removeClass("bg-white/20").addClass("bg-revo-orange");
                        }
                    }

                    $btn.off("click.wpcTransform").on("click.wpcTransform", function(e) {
                        e.preventDefault(); e.stopPropagation();
                        current = (current - 1 + total) % total;
                        renderTransform(current);
                    });
                    $nextBtn.off("click.wpcTransform").on("click.wpcTransform", function(e) {
                        e.preventDefault(); e.stopPropagation();
                        current = (current + 1) % total;
                        renderTransform(current);
                    });
                    if ($dots.length) {
                        $dots.css("cursor", "pointer").on("click.wpcTransform", function(e) {
                            e.preventDefault();
                            current = $(this).index();
                            renderTransform(current);
                        });
                    }

                    renderTransform(current);
                    console.log("[EC-CAROUSEL-013] ✅ Centered-transform carousel: " + total + " slides, gap=" + gap);
                    return true;
                })();

                if (centeredTransformOk) {
                    svgProcessed.push("centered-transform:" + $container.find(".absolute.inset-0 > .absolute").length);
                } else {
                var $viewport = wpcResolveCarouselViewport($container);
                var $track = $viewport.children().first();
                var $slides = $track.children('[aria-roledescription="slide"]');

                if ($viewport.length && $track.length && $slides.length > 1) {
                    $btn.data("carousel-processed", true);
                    $nextBtn.data("carousel-processed", true);
                    $container.data("carousel-processed", true);
                    initializeOverflowCarousel($container, $viewport, $track, $slides, $btn, $nextBtn);
                    svgProcessed.push("overflow:" + $slides.length);
                } else if ($viewport.length && $track.length && $track.children().length > 1) {
                    $slides = $track.children();
                    $btn.data("carousel-processed", true);
                    $nextBtn.data("carousel-processed", true);
                    $container.data("carousel-processed", true);
                    initializeOverflowCarousel($container, $viewport, $track, $slides, $btn, $nextBtn);
                    svgProcessed.push("flex-overflow:" + $slides.length);
                } else {
                    // No overflow viewport found — check for a CSS grid with cards
                    // and convert it to a scrollable overflow carousel
                    var $grid = $container.find('[class*="grid"]').first();
                    /* EC-MSTEP-021: never rebuild a wizard step's question as a
                       carousel. The arrow guard above should mean we never get
                       here with one, but this is the operation that does the
                       damage, so it refuses on its own account too. */
                    if ($grid.closest("[data-wpc-form-step], .wpconvert-multistep-form").length) {
                        $btn.data("carousel-processed", true);
                        $nextBtn.data("carousel-processed", true);
                        $container.data("carousel-processed", true);
                        $grid = $();
                    }
                    if ($grid.length && $grid.children().length >= 2) {
                        // EC-CAROUSEL-016: Two-column hero (copy + stacked image gallery with chevrons) — never
                        // re-wrap the section grid as a horizontal overflow track (blank flashes, copy/image swap sides).
                        var skipHeroGrid = (function() {
                            var $kids = $grid.children();
                            if ($kids.length !== 2) return false;
                            var galleryIdx = -1;
                            $kids.each(function(i) {
                                if ($.contains(this, $btn[0])) { galleryIdx = i; return false; }
                            });
                            if (galleryIdx < 0) return false;
                            var $gal = $kids.eq(galleryIdx);
                            if ($gal.find("img").length < 2) return false;
                            var $copy = $kids.not($gal).first();
                            if (!$copy.length || $copy.find("h1,h2").length === 0) return false;
                            if (($copy.text() || "").trim().length < 80) return false;
                            return true;
                        })();
                        if (skipHeroGrid) {
                            $btn.data("carousel-processed", true);
                            $nextBtn.data("carousel-processed", true);
                            $container.data("carousel-processed", true);
                            svgProcessed.push("skip-hero-grid");
                        } else {
                        var containerW = $grid.outerWidth();
                        var numKids = $grid.children().length;
                        var origChildW = $grid.children().first().outerWidth();
                        var gapVal = parseFloat($grid.css("gap") || $grid.css("column-gap")) || 20;

                        // Size children so at least one is partially off-screen
                        // (shows N-1 full items, ensuring the carousel has content to scroll)
                        var idealW = numKids > 1 ? (containerW / Math.max(1, numKids - 1)) * 0.95 : origChildW;
                        var childW = Math.max(origChildW, idealW);

                        // Wrap all children in a new flex track
                        $grid.children().wrapAll('<div class="wpc-carousel-track" style="display:flex;gap:' + gapVal + 'px;flex-wrap:nowrap;transition:transform 0.5s cubic-bezier(0.25,0.46,0.45,0.94)"></div>');
                        var $newTrack = $grid.find(".wpc-carousel-track");
                        $newTrack.children().css({ flexShrink: 0, width: childW + "px" });

                        // Convert grid container to overflow viewport
                        var oldCls = $grid.attr("class") || "";
                        $grid.attr("class", oldCls.replace(/\b(grid|grid-cols-\S+|gap-\S+)\b/g, "").trim());
                        $grid.css({ overflow: "hidden", display: "block" });

                        $btn.data("carousel-processed", true);
                        $nextBtn.data("carousel-processed", true);
                        $container.data("carousel-processed", true);
                        initializeOverflowCarousel($container, $grid, $newTrack, $newTrack.children(), $btn, $nextBtn);
                        svgProcessed.push("grid-to-overflow:" + $newTrack.children().length);
                        }
                    } else {
                        $btn.data("carousel-processed", true);
                        $nextBtn.data("carousel-processed", true);
                        $container.data("carousel-processed", true);
                        initializeCarousel($container, $btn, $nextBtn);
                        svgProcessed.push("grid:" + ($container.find('[class*="grid"]').first().children().length || "?"));
                    }
                }
                }
            });
            if (svgProcessed.length) console.log("[EC-CAROUSEL-002] Method 3 (SVG icons): " + svgProcessed.join(", "));

            // Method 4: Detect by aria-roledescription="carousel" (Embla/ShadCN semantic)
            $('[role="region"][aria-roledescription="carousel"]').each(function() {
                var $region = $(this);
                if ($region.data("carousel-processed")) return;

                var $viewport = wpcResolveCarouselViewport($region);
                var $track = $viewport.children().first();
                var $slides = $track.children('[aria-roledescription="slide"]');
                if (!$slides.length) $slides = $track.children();
                if ($slides.length < 2) return;

                var $prevBtn = $region.find("button").filter(function() { return classifyArrowBtn($(this)) === "prev"; }).first();
                var $nextBtn = $region.find("button").filter(function() { return classifyArrowBtn($(this)) === "next"; }).first();

                if (!$prevBtn.length || !$nextBtn.length) {
                    // Embla buttons may be outside the overflow container but inside region
                    $prevBtn = $region.children("button").filter(function() { return classifyArrowBtn($(this)) === "prev"; }).first();
                    $nextBtn = $region.children("button").filter(function() { return classifyArrowBtn($(this)) === "next"; }).first();
                }

                if ($prevBtn.length && $nextBtn.length && $viewport.length && $track.length) {
                    $region.data("carousel-processed", true);
                    $prevBtn.data("carousel-processed", true);
                    $nextBtn.data("carousel-processed", true);
                    initializeOverflowCarousel($region, $viewport, $track, $slides, $prevBtn, $nextBtn);
                    console.log("[EC-CAROUSEL-002] Method 4 (ARIA): " + $slides.length + " slides");
                }
            });

            // Method 5: Generic overflow-hidden scrollable containers with nearby arrow buttons
            $(".overflow-hidden, [style*='overflow: hidden'], [style*='overflow:hidden']").each(function() {
                var $viewport = $(this);
                if ($viewport.data("carousel-processed")) return;
                if ($viewport.attr("data-wpconvert-stacked-gallery")) return;
                var $track = $viewport.children().first();
                if (!$track.length) return;
                var $children = $track.children();
                if ($children.length < 3) return;

                // Check if children form a horizontal row (flex or inline)
                var hasFlex = ($track.attr("class") || "").indexOf("flex") >= 0;
                var hasInline = ($track.css("display") || "").indexOf("flex") >= 0;
                if (!hasFlex && !hasInline) return;

                // Check children have shrink-0 or min-w-0 (carousel slide indicators)
                var looksLikeSlides = $children.filter(function() {
                    var cls = $(this).attr("class") || "";
                    return cls.indexOf("shrink-0") >= 0 || cls.indexOf("min-w-0") >= 0 || cls.indexOf("basis-") >= 0;
                }).length >= 2;
                if (!looksLikeSlides) return;

                // Find nearby arrow buttons (sibling of viewport, or in parent)
                var $parent = $viewport.parent();
                var $prevBtn = $parent.find("button").filter(function() { return classifyArrowBtn($(this)) === "prev"; }).first();
                var $nextBtn = $parent.find("button").filter(function() { return classifyArrowBtn($(this)) === "next"; }).first();
                if (!$prevBtn.length || !$nextBtn.length) return;
                if ($prevBtn.data("carousel-processed") || $nextBtn.data("carousel-processed")) return;

                $viewport.data("carousel-processed", true);
                $prevBtn.data("carousel-processed", true);
                $nextBtn.data("carousel-processed", true);
                initializeOverflowCarousel($parent, $viewport, $track, $children, $prevBtn, $nextBtn);
                console.log("[EC-CAROUSEL-002] Method 5 (generic overflow): " + $children.length + " items");
            });

            // Method 6: onclick handlers + text arrow buttons + computed CSS overflow
            // Catches custom-coded carousels (not React/Tailwind based) like FormAcademy
            $("button").each(function() {
                var $btn = $(this);
                if ($btn.data("carousel-processed")) return;
                if ($btn.closest("[data-wpconvert-stacked-gallery-section]").length) { $btn.data("carousel-processed", true); return; }
                if ($btn.find("svg").length > 0) return;
                var role = classifyArrowBtn($btn);
                if (role !== "prev") return;

                var $nextBtn = null;
                $btn.siblings("button").each(function() {
                    if ($(this).is($btn) || $(this).data("carousel-processed")) return;
                    if (classifyArrowBtn($(this)) === "next") { $nextBtn = $(this); return false; }
                });
                if (!$nextBtn || !$nextBtn.length) {
                    $btn.parent().parent().find("button").not($btn).each(function() {
                        if ($(this).data("carousel-processed")) return;
                        if (classifyArrowBtn($(this)) === "next") { $nextBtn = $(this); return false; }
                    });
                }
                if (!$nextBtn || !$nextBtn.length) return;

                var $section = $btn.closest("section");
                if (!$section.length) $section = $btn.parent().parent().parent();
                if ($section.data("carousel-processed")) return;

                // EC-CAROUSEL-036: The scroll row IS its own scrollport.
                //
                // Both strategies below assume a two-element structure: an outer
                // clipping viewport plus an inner track. Some exporters (Claude
                // Design Export / dc-runtime, SAOG Cyber) emit ONE element that is
                // simultaneously the scrollport and the flex track:
                //
                //   <div class="carousel-track"
                //        style="display:flex;gap:24px;overflow-x:auto;
                //               scroll-snap-type:x mandatory">
                //     <a style="flex:0 0 320px;scroll-snap-align:start">…</a> x6
                //   </div>
                //
                // Strategy 1 needs a parent with overflow:hidden; Strategy 2 needs a
                // "viewport|slider-wrap|…" name on the parent. Neither exists here, so
                // Method 6 used to fall through and the arrows stayed dead.
                //
                // We deliberately key off COMPUTED style (jQuery .css()) rather than
                // class tokens, so this covers Tailwind utilities (overflow-x-auto,
                // snap-x) and inline styles identically. EC-CAROUSEL-021 solves the
                // same shape for SVG-icon arrows but matches class names only, which
                // is why an inline-styled track slipped past it.
                //
                // Faithful behaviour: the source handler is
                // el.scrollBy({left: ±(cardWidth + gap), behavior:"smooth"}), so we
                // scroll natively by one card instead of rebuilding a slideshow.
                var $selfScrollRow = null;
                $section.find("div, ul").each(function() {
                    var $row = $(this);
                    if ($row.data("carousel-processed")) return;
                    // External-arrow pattern only: a row must never be scrolled by
                    // buttons nested inside it (that is a scrollable toolbar).
                    if (this.contains($btn[0]) || this.contains($nextBtn[0])) return;
                    var ovx = ($row.css("overflow-x") || "").toLowerCase();
                    var snap = ($row.css("scroll-snap-type") || "").toLowerCase();
                    if (ovx !== "auto" && ovx !== "scroll" && snap.indexOf("x") === -1) return;
                    var disp = ($row.css("display") || "").toLowerCase();
                    if (disp !== "flex" && disp !== "inline-flex") return;
                    var $kids = $row.children();
                    if ($kids.length < 2) return;
                    // Must actually overflow, else the arrows have nothing to scroll
                    // and claiming them would only suppress other handlers.
                    if (this.scrollWidth <= this.clientWidth + 2) return;
                    // A row whose children are mostly <button> is a category filter
                    // bar or toolbar, not a card carousel (cf. EC-CAROUSEL-016c).
                    if ($kids.filter("button").length * 2 >= $kids.length) return;
                    $selfScrollRow = $row;
                    return false;
                });
                if ($selfScrollRow && $selfScrollRow.length) {
                    var wpc036Row = $selfScrollRow[0];
                    // Scroll amount is derived, never assumed: the most common child
                    // width is the card (leading/trailing spacers are the outliers),
                    // and the gap comes from computed column-gap.
                    var wpc036Amount = function() {
                        var gap = parseFloat($selfScrollRow.css("column-gap") || "0") || 0;
                        if (!gap) gap = parseFloat($selfScrollRow.css("gap") || "0") || 0;
                        var kids = $selfScrollRow.children();
                        var counts = {}, bestW = 0, bestN = 0;
                        for (var ci = 0; ci < kids.length; ci++) {
                            var cw = kids[ci].getBoundingClientRect ? kids[ci].getBoundingClientRect().width : 0;
                            if (cw <= 60) continue;
                            var ck = Math.round(cw);
                            counts[ck] = (counts[ck] || 0) + 1;
                            if (counts[ck] > bestN || (counts[ck] === bestN && ck > bestW)) {
                                bestN = counts[ck]; bestW = ck;
                            }
                        }
                        if (bestW > 60) return bestW + gap;
                        return Math.max(240, Math.round(wpc036Row.clientWidth * 0.8));
                    };
                    $btn.data("carousel-processed", true);
                    $nextBtn.data("carousel-processed", true);
                    // Mark the ROW but never the whole section: a page may hold two
                    // independent self-scrollport carousels in one section.
                    $selfScrollRow.data("carousel-processed", true);
                    $btn.off("click.wpc036").on("click.wpc036", function(e) {
                        e.preventDefault(); e.stopPropagation();
                        wpc036Row.scrollBy({ left: -wpc036Amount(), behavior: "smooth" });
                    });
                    $nextBtn.off("click.wpc036").on("click.wpc036", function(e) {
                        e.preventDefault(); e.stopPropagation();
                        wpc036Row.scrollBy({ left: wpc036Amount(), behavior: "smooth" });
                    });
                    console.log("[EC-CAROUSEL-036] Wired self-scrollport scroll row (" + $selfScrollRow.children().length + " children) — native scrollBy");
                    return;
                }

                var $viewport = null, $track = null, $slides = null;
                // Strategy 1: detect by computed CSS overflow + flex
                $section.find("div").each(function() {
                    var $el = $(this);
                    if ($el.data("carousel-processed")) return;
                    var ov = $el.css("overflow") || $el.css("overflow-x") || "";
                    var hasOverflow = ov === "hidden" || $el.hasClass("overflow-hidden");
                    if (!hasOverflow) return;
                    var $t = $el.children().first();
                    if (!$t.length) return;
                    var disp = $t.css("display") || "";
                    if (disp !== "flex" && disp !== "inline-flex") return;
                    if ($t.children().length < 2) return;
                    $viewport = $el;
                    $track = $t;
                    $slides = $t.children();
                    return false;
                });
                // Strategy 2: detect by element ID / class name patterns (fallback for CSS timing)
                if (!$viewport || !$viewport.length || !$slides || $slides.length < 2) {
                    $viewport = null; $track = null; $slides = null;
                    var vpPat = /viewport|slider-?wrap|carousel-?wrap|slide-?contain/i;
                    var trPat = /track|slider-?inner|carousel-?inner|slides-?row/i;
                    $section.find("div").each(function() {
                        var $el = $(this);
                        var elId = $el.attr("id") || "";
                        var elCls = $el.attr("class") || "";
                        if (!vpPat.test(elId) && !vpPat.test(elCls)) return;
                        var $t = $el.children().first();
                        if (!$t.length || $t.children().length < 2) return;
                        var tId = $t.attr("id") || "";
                        var tCls = $t.attr("class") || "";
                        if (trPat.test(tId) || trPat.test(tCls) || $t.css("display") === "flex") {
                            $viewport = $el;
                            $track = $t;
                            $slides = $t.children();
                            return false;
                        }
                    });
                }

                if (!$viewport || !$viewport.length || !$slides || $slides.length < 2) return;

                $btn.data("carousel-processed", true);
                $nextBtn.data("carousel-processed", true);
                $section.data("carousel-processed", true);
                initializeOverflowCarousel($section, $viewport, $track, $slides, $btn, $nextBtn);
                console.log("[EC-CAROUSEL-002] Method 6 (onclick/text): " + $slides.length + " items");
            });

            // EC-CAROUSEL-003: Method 7 — Testimonial/card grids WITHOUT arrow buttons
            // Detects sections with 3+ similar child elements (testimonial cards, review cards)
            // in a grid that exceeds the viewport, and enables auto-advance carousel with dots/swipe
            $("section").each(function() {
                var $sec = $(this);
                if ($sec.data("carousel-processed")) return;
                var secCls = ($sec.attr("class") || "").toLowerCase();
                var secText = ($sec.find("h2, h3").first().text() || "").toLowerCase();
                var isTestimonialSection = /testimonial|review|feedback|client|what.*say|hear.*from/i.test(secCls + " " + secText);
                if (!isTestimonialSection) return;
                // Must have NO prev/next buttons already (those are handled above)
                var hasPrevNext = $sec.find("button").filter(function() {
                    return classifyArrowBtn($(this)) !== null;
                }).length >= 2;
                if (hasPrevNext) return;
                // EC-CAROUSEL-032: Skip flex-carousel tracks tagged by cleanEmblaSnapshotState
                // (EC-STATIC-010b). Mobile Theatre "What practices say" has no prev/next buttons, so
                // initializeOverflowCarousel never runs; without this guard Method 7 treats the flex
                // track as a testimonial grid (columnConfig.base=1 → perView=1 showItems hides cards).
                if ($sec.find('[data-wpconvert-flex-carousel="track"]').length) {
                    console.log("[EC-CAROUSEL-032] Skipped EC-CAROUSEL-003 Method 7: flex-carousel track already tagged");
                    return;
                }
                // Find the grid/flex container with 3+ card children
                var $grid = $sec.find("[class*='grid'], [class*='flex']").filter(function() {
                    var kids = $(this).children();
                    if (kids.length < 3) return false;
                    // Children should be similarly sized (cards)
                    var hasContent = kids.filter(function() {
                        return $(this).find("p, blockquote, [class*='quote']").length > 0;
                    }).length >= 3;
                    return hasContent;
                }).first();
                if (!$grid.length) return;
                var $items = $grid.children();
                if ($items.length < 3) return;
                var totalItems = $items.length;
                var currentIndex = 0;
                var columnConfig = { base: 1, sm: 1, md: null, lg: null, xl: null };
                var cls = $grid.attr("class") || "";
                cls.split(/\s+/).forEach(function(c) {
                    var m = c.match(/^(sm:|md:|lg:|xl:)?grid-cols-(\d+)/);
                    if (m) {
                        var bp = m[1] ? m[1].replace(":", "") : "base";
                        columnConfig[bp] = parseInt(m[2], 10);
                    }
                    // EC-CAROUSEL-018: Parse non-Tailwind CSS grid class names (grid--2, grid--3, etc.)
                    var cssGridMatch = c.match(/^grid--(\d+)$/);
                    if (cssGridMatch) {
                        var n = parseInt(cssGridMatch[1], 10);
                        if (n > (columnConfig.base || 1)) columnConfig.base = n;
                    }
                });
                // EC-CAROUSEL-006: Skip sections where the grid already shows all items.
                // If any breakpoint defines enough columns to display all items,
                // this is a static testimonial grid, not a carousel.
                var maxCols = Math.max(
                    columnConfig.base || 1, columnConfig.sm || 0,
                    columnConfig.md || 0, columnConfig.lg || 0, columnConfig.xl || 0
                );
                // EC-CAROUSEL-006b: For CSS-defined grids (no Tailwind grid-cols-N classes),
                // check computed gridTemplateColumns to detect multi-column layouts.
                // Sites built with custom CSS (e.g. Claude/AI-generated static HTML) define
                // columns via stylesheet rules, not utility classes.
                if (maxCols <= 1 && $grid[0]) {
                    try {
                        var gtc = window.getComputedStyle($grid[0]).gridTemplateColumns;
                        if (gtc && gtc !== "none") {
                            var cssCols = gtc.split(/\s+/).filter(function(v) { return v && v !== "0px"; }).length;
                            if (cssCols > maxCols) {
                                maxCols = cssCols;
                                console.log("[EC-CAROUSEL-006b] Detected " + cssCols + " CSS grid columns via computed style");
                            }
                        }
                    } catch(e) {}
                }
                if (maxCols >= totalItems) {
                    console.log("[EC-CAROUSEL-006] Skipped static testimonial grid: " + totalItems + " items, max " + maxCols + " cols");
                    return;
                }
                // EC-CAROUSEL-007/018: Multi-row grids with 2+ cols that fit in ≤4 rows are static.
                // Testimonial grids often have 4+ rows (e.g. 8 items in 2 cols) — these are
                // intentional scrollable page sections, not carousels.
                if (maxCols >= 2 && totalItems <= maxCols * 4) {
                    console.log("[EC-CAROUSEL-007] Skipped static multi-row testimonial grid: " + totalItems + " items, max " + maxCols + " cols");
                    return;
                }
                // EC-CAROUSEL-003 FIX: Skip flex-row layouts — these render all items
                // side-by-side at the responsive breakpoint, not as a scrollable carousel.
                // Flex-row has no grid-cols-N classes, so columnConfig stays at {base:1}
                // which falsely makes it look like it needs a carousel.
                var gridCls = cls;
                if (/\b(flex-row|md:flex-row|lg:flex-row|sm:flex-row)\b/.test(gridCls)) {
                    console.log("[EC-CAROUSEL-003] Skipped flex-row testimonial layout (" + totalItems + " items) — static side-by-side display");
                    return;
                }
                // Also check the parent: flex flex-col md:flex-row means items are rows on mobile
                // but side-by-side on md+. The grid container itself may be the flex parent.
                var parentCls = ($grid.parent().attr("class") || "");
                if (/\b(flex-row|md:flex-row|lg:flex-row|sm:flex-row)\b/.test(parentCls)) {
                    console.log("[EC-CAROUSEL-003] Skipped flex-row testimonial layout via parent (" + totalItems + " items)");
                    return;
                }
                // EC-CAROUSEL-019: Skip CSS marquee tracks. A marquee is already an
                // auto-scrolling carousel (translateX animation on a width:max-content
                // flex track) — it is NOT a paginated grid. If we treat it like one,
                // showItems() hides all-but-perView siblings with display:none, which
                // collapses the track from sum-of-card-widths down to a single card's
                // width. The remaining card then animates -50% (~ -170px) and snaps
                // back, producing the "one card sliding left, then switching" symptom
                // (Lovable / shadcn site marquees: .marquee-track, .marquee-track-*).
                var isMarqueeTrack = /\bmarquee\b|\bmarquee-[a-z0-9_-]+\b|\bw-max\b/i.test(cls);
                if (!isMarqueeTrack && $grid[0]) {
                    try {
                        var gcs = window.getComputedStyle($grid[0]);
                        var animName = gcs.animationName;
                        var widthBag = (gcs.width || "") + " " + (gcs.minWidth || "") + " " + (gcs.maxWidth || "");
                        // width:max-content + a running CSS animation = unambiguous marquee
                        if (animName && animName !== "none" && /max-content|fit-content/.test(widthBag)) {
                            isMarqueeTrack = true;
                        }
                    } catch(e) {}
                }
                if (isMarqueeTrack) {
                    console.log("[EC-CAROUSEL-019] Skipped marquee track (" + totalItems + " items) — CSS auto-scrolling animation, not a paginated carousel");
                    return;
                }
                // EC-CAROUSEL-020: Skip native horizontal-scroll testimonial rows.
                // Lovable / shadcn projects emit testimonials as a flex track with
                // overflow-x-auto + scrollbar-hide + snap-x + snap-mandatory and
                // child cards carrying flex-shrink-0 + w-[Npx] + snap-start. The
                // user scrolls horizontally with the trackpad / touch / programmatic
                // arrow buttons; every card is meant to be visible by design.
                //
                // Earlier skips do NOT catch this:
                //   - EC-CAROUSEL-006/007/018 (grid math): no grid-cols-N classes,
                //     so columnConfig stays base:1 and maxCols < totalItems.
                //   - EC-CAROUSEL-003 flex-row: class is "flex" not "flex-row".
                //   - EC-CAROUSEL-019 marquee: no marquee/w-max class, no CSS animation.
                //
                // Without this guard EC-CAROUSEL-003 calls items.hide() and
                // showItems(perView=1) — only the first card stays visible while a
                // 5-second autoplay rotates the rest, replacing the original
                // multi-card scrolling layout with a single-item slideshow.
                //
                // Detection (cheap class check first, then computed style):
                //   - track class contains overflow-x-auto, overflow-x-scroll,
                //     snap-x, or scrollbar-hide
                //   - OR computed overflow-x is auto or scroll
                var isOverflowScrollRow = /\boverflow-x-(auto|scroll)\b|\bsnap-x\b|\bscrollbar-hide\b/i.test(cls);
                if (!isOverflowScrollRow && $grid[0]) {
                    try {
                        var ovs = window.getComputedStyle($grid[0]);
                        var overflowX = ovs.overflowX || "";
                        if (/^(auto|scroll)$/.test(overflowX)) {
                            isOverflowScrollRow = true;
                        }
                    } catch(e) {}
                }
                if (isOverflowScrollRow) {
                    console.log("[EC-CAROUSEL-020] Skipped native overflow-x scroll row (" + totalItems + " items) — horizontal scroll-snap layout, not a paginated carousel");
                    return;
                }
                $sec.data("carousel-processed", true);
                function colsForWidth(w) {
                    if (w >= 1280 && columnConfig.xl) return columnConfig.xl;
                    if (w >= 1024 && columnConfig.lg) return columnConfig.lg;
                    if (w >= 768 && columnConfig.md) return columnConfig.md;
                    if (w >= 640 && columnConfig.sm) return columnConfig.sm;
                    return columnConfig.base || columnConfig.lg || columnConfig.md || 1;
                }
                var perView = Math.max(1, Math.min(totalItems, colsForWidth(window.innerWidth)));
                function showItems() {
                    $items.hide();
                    for (var i = 0; i < perView; i++) {
                        $items.eq((currentIndex + i) % totalItems).fadeIn(200);
                    }
                    // Update dots if present
                    var $dots = $sec.find("[class*='dot'], [class*='pagination'] button");
                    if ($dots.length > 0) {
                        $dots.css("opacity", "0.4");
                        $dots.eq(currentIndex % $dots.length).css("opacity", "1");
                    }
                }
                if (totalItems > perView) {
                    showItems();
                    var autoInterval = setInterval(function() {
                        currentIndex = (currentIndex + perView) % totalItems;
                        showItems();
                    }, 5000);
                    // Touch swipe support
                    var touchX = 0;
                    $grid.on("touchstart.wpcTestimonial", function(e) {
                        var t = e.originalEvent.touches[0];
                        if (t) touchX = t.clientX;
                    });
                    $grid.on("touchend.wpcTestimonial", function(e) {
                        var t = e.originalEvent.changedTouches[0]; if (!t) return;
                        var diff = touchX - t.clientX;
                        if (Math.abs(diff) > 50) {
                            clearInterval(autoInterval);
                            currentIndex = (currentIndex + (diff > 0 ? perView : -perView) + totalItems) % totalItems;
                            showItems();
                            autoInterval = setInterval(function() {
                                currentIndex = (currentIndex + perView) % totalItems;
                                showItems();
                            }, 5000);
                        }
                    });
                    // Dot click
                    $sec.find("[class*='dot'], [class*='pagination'] button").on("click", function(e) {
                        e.preventDefault();
                        clearInterval(autoInterval);
                        currentIndex = $(this).index();
                        showItems();
                        autoInterval = setInterval(function() {
                            currentIndex = (currentIndex + perView) % totalItems;
                            showItems();
                        }, 5000);
                    });
                    $(window).on("resize.wpcTestimonial", function() {
                        var newView = Math.max(1, Math.min(totalItems, colsForWidth(window.innerWidth)));
                        if (newView !== perView) { perView = newView; currentIndex = 0; showItems(); }
                    });
                    console.log("[EC-CAROUSEL-003] Testimonial carousel (no arrows): " + totalItems + " items, " + perView + " per view");
                }
            });

            } catch(e) { console.warn("[WPConvert] EC-CAROUSEL-002 error:", e); }
            
            try { // [WPConvert: EC-CAROUSEL-001 Testimonials]
            // EC-CAROUSEL-001: Single-item testimonial carousel handler
            // React state-based carousels only render one item — data is injected
            // as a JSON attribute by the snapshot phase.
            $("section[data-wpconvert-testimonials]").each(function() {
                var $section = $(this);
                if ($section.data("carousel-processed")) return;
                
                var rawData = $section.attr("data-wpconvert-testimonials");
                if (!rawData) return;

                // EC-CAROUSEL-027: Do NOT rehydrate a section that already renders all of its
                // slides as a real multi-slide carousel — a custom flex slider tagged
                // data-wpconvert-flex-carousel (JOY "What Our Clients Say") or a shadcn/embla
                // aria carousel. Those are driven by initializeOverflowCarousel; running the
                // single-item JSON swap on top of them double-wires prev/next (the track
                // translates AND the first card's text is overwritten with unrelated testimonial
                // data), which is exactly the reported "What Our Clients Say" breakage. The
                // single-item path is only for React carousels that render ONE card in the DOM.
                if ($section.find('[data-wpconvert-flex-carousel="track"]').length ||
                    $section.find('[aria-roledescription="carousel"]').length) {
                    $section.data("carousel-processed", true);
                    console.log("[EC-CAROUSEL-027] Skip single-item testimonial rehydrate: section is already a multi-slide carousel");
                    return;
                }

                // EC-CAROUSEL-017: Decode Base64-encoded JSON (prevents cheerio mangling double quotes).
                // Fallback: try raw JSON for legacy themes.
                var testimonials;
                try {
                    testimonials = JSON.parse(decodeURIComponent(escape(atob(rawData))));
                } catch (e) {
                    try { testimonials = JSON.parse(rawData); } catch (e2) { return; }
                }
                if (!testimonials || testimonials.length < 2) return;

                // EC-TESTIMONIAL-007: Defence in depth for STATIC testimonial grids.
                // A section is only a single-item slider if the DOM holds one slide; the
                // rest of the quotes live solely in the JSON. A static grid/masonry
                // renders every quote at once, and older builds tagged those on heading
                // wording alone. Rehydrating one then rewrites a card's quote on the 8s
                // timer below, so a section that was never a carousel visibly changes by
                // itself. Count how many payload quotes are already on the page: 2+ means
                // static, so leave it exactly as the source rendered it. The tagging fix
                // lives in lib/render/snapshot.js + lib/theme/testimonials-inject.js;
                // this guard also covers themes generated before that fix.
                var wpcSectionText = ($section.text() || "").replace(/s+/g, " ").toLowerCase();
                var wpcRenderedQuotes = 0;
                for (var wpcQi = 0; wpcQi < testimonials.length; wpcQi++) {
                    var wpcNeedle = String((testimonials[wpcQi] && testimonials[wpcQi].quote) || "")
                        .replace(/s+/g, " ").trim().slice(0, 40).toLowerCase();
                    if (wpcNeedle.length < 40) continue;
                    if (wpcSectionText.indexOf(wpcNeedle) !== -1) wpcRenderedQuotes++;
                }
                if (wpcRenderedQuotes >= 2) {
                    $section.data("carousel-processed", true);
                    console.log("[EC-TESTIMONIAL-007] Skip testimonial rehydrate: static grid already renders " + wpcRenderedQuotes + " of " + testimonials.length + " quotes");
                    return;
                }

                console.log("[WPConvert] Initializing testimonial carousel with " + testimonials.length + " items");
                
                var activeIndex = 0;
                
                // EC-TESTIMONIAL-004: Prefer aria-label Prev/Next (inner quote card) before any <i> scan.
                // Revo nests an outer slide track (first ri-arrow-* in DOM) + inner card controls; scanning
                // icons first bound the wrong buttons and .first() rounded-xl matched empty slide cards.
                var $prevBtn = $section.find('button[aria-label*="Previous"], button[aria-label*="Prev"], button[aria-label*="previous"]').first();
                var $nextBtn = $section.find('button[aria-label*="Next"], button[aria-label*="next"]').first();
                
                // Prev/Next buttons: find buttons containing chevron SVGs
                if (!$prevBtn.length || !$nextBtn.length) {
                    $prevBtn = null;
                    $nextBtn = null;
                    $section.find("button").each(function() {
                        var $btn = $(this);
                        var $svg = $btn.find("svg");
                        if (!$svg.length) return;
                        var svgClass = $svg.attr("class") || "";
                        var pathD = "";
                        $svg.find("path").each(function() { pathD += ($(this).attr("d") || ""); });
                        if (/chevron-left|lucide-chevron-left/.test(svgClass) || /m\s*15\s+18|15\s*18\s*-6\s*-6/i.test(pathD)) {
                            if (!$prevBtn) $prevBtn = $btn;
                        }
                        if (/chevron-right|lucide-chevron-right/.test(svgClass) || /m\s*9\s+18|9\s*18\s*6\s*-6/i.test(pathD)) {
                            if (!$nextBtn) $nextBtn = $btn;
                        }
                    });
                }
                
                // EC-TESTIMONIAL-002: <i> icon arrow buttons (Remix Icon, etc.) — only if aria/SVG pair missing
                if (!$prevBtn || !$prevBtn.length || !$nextBtn || !$nextBtn.length) {
                    $prevBtn = null;
                    $nextBtn = null;
                    $section.find("button").each(function() {
                        var $btn = $(this);
                        var $icon = $btn.find("i");
                        if (!$icon.length) return;
                        var iconCls = ($icon.attr("class") || "").toLowerCase();
                        if (/arrow-left|chevron-left|angle-left|caret-left/.test(iconCls)) {
                            if (!$prevBtn) $prevBtn = $btn;
                        }
                        if (/arrow-right|chevron-right|angle-right|caret-right/.test(iconCls)) {
                            if (!$nextBtn) $nextBtn = $btn;
                        }
                    });
                }
                
                if (!$prevBtn || !$prevBtn.length || !$nextBtn || !$nextBtn.length) {
                    console.log("[WPConvert] Testimonial carousel: no prev/next buttons found");
                    return;
                }
                
                // Card = rounded shell that contains the quote/author content.
                // First try: card that contains the button (buttons inside card).
                var $cardArea = $prevBtn.closest('[class*="rounded-3xl"], [class*="rounded-2xl"], [class*="rounded-xl"], blockquote').first();
                // Fallback: buttons may be siblings of the card (e.g. Bloom layout where
                // prev/next sit below the card in a separate flex row). Find the first
                // rounded card within the section that contains quote-length text.
                if (!$cardArea.length || $cardArea.is($section)) {
                    $cardArea = $section.find('[class*="rounded-3xl"], [class*="rounded-2xl"], [class*="rounded-xl"]').filter(function() {
                        return $(this).find("p").length > 0 && $(this).text().trim().length > 40;
                    }).first();
                }
                if (!$cardArea.length) $cardArea = $section;
                
                // Author name: bold/semibold text inside author area
                var $authorContainer = $cardArea.find('[class*="items-center"]').filter(function() {
                    return $(this).find("button").length === 0;
                }).first();
                if (!$authorContainer.length) $authorContainer = $cardArea.find('[class*="items-center"]').first();
                
                // Quote: longest <p> in card, excluding paragraphs inside the author row
                var $quoteEl = null;
                var bestQLen = 0;
                $cardArea.find("p").each(function() {
                    var $p = $(this);
                    if ($authorContainer.length && $p.closest($authorContainer).length) return;
                    var txt = $p.text().trim();
                    if (txt.length > bestQLen && txt.length > 40) {
                        bestQLen = txt.length;
                        $quoteEl = $p;
                    }
                });
                if (!$quoteEl || !$quoteEl.length) {
                    $cardArea.find("blockquote").each(function() {
                        var txt = $(this).text().trim();
                        if (txt.length > bestQLen && txt.length > 40) {
                            bestQLen = txt.length;
                            $quoteEl = $(this);
                        }
                    });
                    if (!$quoteEl && $cardArea.is("blockquote") && $cardArea.text().trim().length > 40) {
                        $quoteEl = $cardArea;
                    }
                }
                
                if (!$quoteEl || !$quoteEl.length) {
                    console.log("[WPConvert] Testimonial carousel: no quote element found");
                    return;
                }
                
                var $authorName = null;
                var $authorMeta = null;
                
                // Search for author name/role in the author container (items-center flex row)
                var $authorSearchArea = $authorContainer.length ? $authorContainer : null;
                if ($authorSearchArea) {
                    $authorSearchArea.find("p, div, span, h4, h5").each(function() {
                        var cls = $(this).attr("class") || "";
                        if (/font-semibold|font-bold|font-extrabold|font-medium/.test(cls) && !$authorName) {
                            var txt = $(this).text().trim();
                            if (txt.length > 1 && txt.length < 60) $authorName = $(this);
                        } else if (/text-sm|text-xs|opacity|text-cream|text-gray|text-slate|text-muted/.test(cls) && !$authorMeta) {
                            $authorMeta = $(this);
                        }
                    });
                }
                
                // EC-CAROUSEL-017b: Fallback — when no items-center container exists,
                // search directly in the card area for bold author names and small/muted role text.
                // Skip elements that are already identified as the quote or inside buttons.
                if (!$authorName) {
                    $cardArea.find("p, h4, h5, span").each(function() {
                        var $el = $(this);
                        if ($el.closest("button").length) return;
                        if ($quoteEl && $el.is($quoteEl)) return;
                        if ($quoteEl && $el.find($quoteEl).length) return;
                        var cls = $el.attr("class") || "";
                        var txt = $el.text().trim();
                        if (/font-semibold|font-bold|font-extrabold|font-medium/.test(cls) && !$authorName) {
                            if (txt.length > 1 && txt.length < 60 && txt.length < bestQLen) $authorName = $el;
                        }
                    });
                }
                if (!$authorMeta) {
                    $cardArea.find("p, span").each(function() {
                        var $el = $(this);
                        if ($el.closest("button").length) return;
                        if ($quoteEl && $el.is($quoteEl)) return;
                        if ($authorName && $el.is($authorName)) return;
                        var cls = $el.attr("class") || "";
                        var txt = $el.text().trim();
                        if (/text-sm|text-xs|opacity|text-cream|text-gray|text-slate|text-muted/.test(cls) && !$authorMeta) {
                            if (txt.length > 0 && txt.length < 60) $authorMeta = $el;
                        }
                    });
                }
                
                var $avatarImg = ($authorSearchArea || $cardArea).find("img[class*='rounded-full'], img[class*='rounded']").first();
                var $avatar = null;
                if (!$avatarImg.length) {
                    $avatar = ($authorSearchArea || $cardArea).find('[class*="rounded-full"]').filter(function() {
                        return $(this).text().trim().length <= 2 && $(this).children("img").length === 0;
                    }).first();
                }
                
                var $dots = $section.find("button").filter(function() {
                    var cls = $(this).attr("class") || "";
                    return /rounded-full/.test(cls) && /w-2|h-2/.test(cls);
                });
                
                $section.data("carousel-processed", true);
                
                function updateTestimonial(index) {
                    var item = testimonials[index];
                    if (!item) return;
                    
                    // Animate out then in
                    var $fadeTargets = $quoteEl;
                    if ($authorName) $fadeTargets = $fadeTargets.add($authorName);
                    if ($authorMeta) $fadeTargets = $fadeTargets.add($authorMeta);
                    
                    $fadeTargets.animate({ opacity: 0 }, 150, function() {
                        // Update quote
                        var quoteText = item.quote;
                        if (!/^[""“]/.test(quoteText)) quoteText = "“" + quoteText;
                        if (!/[""”]$/.test(quoteText)) quoteText = quoteText + "”";
                        $quoteEl.text(quoteText);
                        
                        // Update author
                        if ($authorName) $authorName.text(item.author);
                        
                        // Update meta (role + location)
                        // EC-CAROUSEL-017b: Only update meta text if the new value is non-empty.
                        // Some sites have a static label (e.g. "Parent") that applies to all
                        // testimonials — clearing it when role is empty looks broken.
                        if ($authorMeta) {
                            var meta = "";
                            if (item.role) meta += item.role;
                            if (item.role && item.location) meta += " • ";
                            if (item.location) meta += item.location;
                            if (meta) $authorMeta.text(meta);
                        }
                        
                        // Update avatar (img src or text initial)
                        if ($avatarImg && $avatarImg.length && item.avatar) {
                            $avatarImg.attr("src", item.avatar);
                            if (item.author) $avatarImg.attr("alt", item.author);
                        } else if ($avatar && $avatar.length && item.author) {
                            $avatar.text(item.author.charAt(0).toUpperCase());
                        }
                        
                        $fadeTargets.animate({ opacity: 1 }, 200);
                    });
                    
                    // Update dots
                    if ($dots.length >= testimonials.length) {
                        $dots.each(function(i) {
                            var $dot = $(this);
                            if (i === index) {
                                $dot.addClass("w-8").css("background-color", "");
                                $dot.removeClass("bg-cream/30");
                            } else {
                                $dot.removeClass("w-8");
                            }
                        });
                    }
                }
                
                // Wire up prev/next
                if ($prevBtn && $prevBtn.length) {
                    $prevBtn.off("click.wpconvertTestimonial").on("click.wpconvertTestimonial", function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        activeIndex = (activeIndex - 1 + testimonials.length) % testimonials.length;
                        updateTestimonial(activeIndex);
                    });
                }
                
                if ($nextBtn && $nextBtn.length) {
                    $nextBtn.off("click.wpconvertTestimonial").on("click.wpconvertTestimonial", function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        activeIndex = (activeIndex + 1) % testimonials.length;
                        updateTestimonial(activeIndex);
                    });
                }
                
                // Wire up dot clicks
                if ($dots.length >= testimonials.length) {
                    $dots.each(function(i) {
                        $(this).off("click.wpconvertTestimonial").on("click.wpconvertTestimonial", function(e) {
                            e.preventDefault();
                            e.stopPropagation();
                            if (i < testimonials.length) {
                                activeIndex = i;
                                updateTestimonial(activeIndex);
                            }
                        });
                    });
                }
                
                // Optional auto-advance every 8 seconds
                var autoTimer = setInterval(function() {
                    activeIndex = (activeIndex + 1) % testimonials.length;
                    updateTestimonial(activeIndex);
                }, 8000);
                
                // Pause auto-advance on hover
                $section.on("mouseenter.wpconvertTestimonial", function() { clearInterval(autoTimer); });
                $section.on("mouseleave.wpconvertTestimonial", function() {
                    autoTimer = setInterval(function() {
                        activeIndex = (activeIndex + 1) % testimonials.length;
                        updateTestimonial(activeIndex);
                    }, 8000);
                });
                
                // Touch swipe support
                var touchStartX = 0;
                $cardArea.on("touchstart.wpconvertTestimonial", function(e) {
                    touchStartX = (e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]).clientX;
                });
                $cardArea.on("touchend.wpconvertTestimonial", function(e) {
                    var touch = e.originalEvent.changedTouches[0];
                    if (!touch) return;
                    var diff = touchStartX - touch.clientX;
                    if (Math.abs(diff) > 50) {
                        if (diff > 0) { activeIndex = (activeIndex + 1) % testimonials.length; }
                        else { activeIndex = (activeIndex - 1 + testimonials.length) % testimonials.length; }
                        updateTestimonial(activeIndex);
                    }
                });
                
                console.log("[WPConvert] ✅ Testimonial carousel ready: " + testimonials.length + " items, prev=" + !!($prevBtn && $prevBtn.length) + ", next=" + !!($nextBtn && $nextBtn.length) + ", dots=" + $dots.length);
            });
            } catch(e) { console.warn("[WPConvert] Testimonial carousel error:", e); }
            
            
            // No parallax libraries detected - skipping parallax initialization
            
            
            
            // No animation libraries detected - skipping animation initialization
            
            
            try { // EC-TAB-004: React useState tab panels (hidden/block in DOM)
            (function() {
  'use strict';
  function splitCls(s) { return (s || '').split(/\s+/).filter(Boolean); }
  function diffCls(activeBtn, inactiveBtn) {
    var a = new Set(splitCls(activeBtn.className));
    var b = new Set(splitCls(inactiveBtn.className));
    return {
      activeOnly: splitCls(activeBtn.className).filter(function(c) { return !b.has(c); }),
      inactiveOnly: splitCls(inactiveBtn.className).filter(function(c) { return !a.has(c); })
    };
  }
  document.querySelectorAll('[data-wpc-react-tab-group]').forEach(function(group) {
    var btns = group.querySelectorAll('[data-wpc-react-tab-btn]');
    if (btns.length < 2) return;
    var scope = group.closest('section') || group.parentElement || document;
    var panels = scope.querySelectorAll('[data-wpc-react-tab-panel]');
    if (!panels.length) return;
    // Snapshot active vs inactive button classes ONCE (from the captured DOM).
    var activeBtn = null;
    btns.forEach(function(b) {
      if (b.classList.contains('border-b-2') || b.classList.contains('border-primary')) activeBtn = b;
    });
    if (!activeBtn) activeBtn = btns[0];
    var inactiveBtn = btns[1] || btns[0];
    for (var bi = 0; bi < btns.length; bi++) {
      if (btns[bi] !== activeBtn) { inactiveBtn = btns[bi]; break; }
    }
    var clsDiff = diffCls(activeBtn, inactiveBtn);
    function showPanel(idx) {
      btns.forEach(function(btn, i) {
        var on = i === idx;
        btn.setAttribute('aria-selected', on ? 'true' : 'false');
        clsDiff.activeOnly.forEach(function(c) { btn.classList[on ? 'add' : 'remove'](c); });
        clsDiff.inactiveOnly.forEach(function(c) { btn.classList[on ? 'remove' : 'add'](c); });
      });
      panels.forEach(function(panel, i) {
        var on = i === idx;
        ['hidden', 'block', 'opacity-0', 'opacity-100', 'scale-95', 'scale-100', 'pointer-events-none', 'pointer-events-auto'].forEach(function(c) {
          panel.classList.remove(c);
        });
        if (on) {
          panel.classList.add('block', 'opacity-100', 'scale-100', 'pointer-events-auto');
        } else {
          panel.classList.add('hidden', 'scale-95', 'pointer-events-none');
        }
      });
    }
    btns.forEach(function(btn) {
      btn.style.cursor = 'pointer';
      btn.addEventListener('click', function(e) {
        e.preventDefault();
        showPanel(parseInt(btn.getAttribute('data-wpc-react-tab-btn'), 10) || 0);
      });
    });
  });
})();
            } catch(e) { console.warn("[WPConvert] React tab panels error:", e); }

            try { // EC-TAB-005: React sidebar list + stacked opacity detail panels
            (function() {
  'use strict';
  function splitCls(s) { return (s || '').split(/\s+/).filter(Boolean); }
  function diffCls(activeBtn, inactiveBtn) {
    var a = new Set(splitCls(activeBtn.className));
    var b = new Set(splitCls(inactiveBtn.className));
    return {
      activeOnly: splitCls(activeBtn.className).filter(function(c) { return !b.has(c); }),
      inactiveOnly: splitCls(inactiveBtn.className).filter(function(c) { return !a.has(c); })
    };
  }
  document.querySelectorAll('[data-wpc-sidebar-group]').forEach(function(group) {
    var btns = group.querySelectorAll('[data-wpc-sidebar-btn]');
    var panels = group.querySelectorAll('[data-wpc-sidebar-panel]');
    if (btns.length < 2 || !panels.length) return;

    // Snapshot active vs inactive button classes ONCE from the captured DOM.
    var activeBtn = btns[0];
    btns.forEach(function(b) {
      if (b.getAttribute('data-wpc-sidebar-active') === 'true') activeBtn = b;
    });
    var inactiveBtn = btns[1] || btns[0];
    for (var bi = 0; bi < btns.length; bi++) {
      if (btns[bi] !== activeBtn) { inactiveBtn = btns[bi]; break; }
    }
    var clsDiff = diffCls(activeBtn, inactiveBtn);

    function showPanel(idx) {
      btns.forEach(function(btn, i) {
        var on = i === idx;
        btn.setAttribute('data-wpc-sidebar-active', on ? 'true' : 'false');
        btn.setAttribute('aria-expanded', on ? 'true' : 'false');
        clsDiff.activeOnly.forEach(function(c) { btn.classList[on ? 'add' : 'remove'](c); });
        clsDiff.inactiveOnly.forEach(function(c) { btn.classList[on ? 'remove' : 'add'](c); });
        // Mobile accordion panel (sibling of the button), if present.
        var mobile = btn.nextElementSibling;
        if (mobile && /\blg:hidden\b/.test(mobile.className || '')) {
          if (on) {
            mobile.classList.add('max-h-[2000px]', 'opacity-100');
            mobile.classList.remove('max-h-0', 'opacity-0');
          } else {
            mobile.classList.add('max-h-0');
            mobile.classList.remove('max-h-[2000px]', 'opacity-100');
          }
        }
      });
      panels.forEach(function(panel, i) {
        var on = i === idx;
        if (on) {
          // Show: clear the stripper-proof inline hide and put the panel back in flow.
          panel.style.opacity = '';
          panel.style.pointerEvents = '';
          panel.classList.add('opacity-100', 'relative');
          panel.classList.remove('opacity-0', 'absolute', 'inset-0', 'pointer-events-none');
          panel.removeAttribute('aria-hidden');
        } else {
          // Hide: inline opacity/pointer-events do not depend on stripped Tailwind classes.
          panel.style.opacity = '0';
          panel.style.pointerEvents = 'none';
          panel.classList.add('absolute', 'inset-0', 'pointer-events-none');
          panel.classList.remove('opacity-100', 'relative', 'opacity-0');
          panel.setAttribute('aria-hidden', 'true');
        }
      });
    }

    btns.forEach(function(btn) {
      btn.style.cursor = 'pointer';
      btn.addEventListener('click', function(e) {
        e.preventDefault();
        showPanel(parseInt(btn.getAttribute('data-wpc-sidebar-btn'), 10) || 0);
      });
    });

    // Enforce the initial state on load. The server-side hidden classes/attrs are stripped
    // by EC-ANIM-001 / EC-NAVBAR-006, so without this the panels render stacked until the
    // first click. Default to the marked-active button, else the first.
    var initialIdx = 0;
    for (var ai = 0; ai < btns.length; ai++) {
      if (btns[ai].getAttribute('data-wpc-sidebar-active') === 'true') { initialIdx = ai; break; }
    }
    showPanel(initialIdx);
  });
})();
            } catch(e) { console.warn("[WPConvert] React sidebar panels error:", e); }

            try { // EC-TAB-006: Capability selector (single sticky panel)
            (function() {
  'use strict';
  function esc(s) {
    var d = document.createElement('div');
    d.textContent = s == null ? '' : String(s);
    return d.innerHTML;
  }
  function renderPanel(panel, item) {
    if (!panel || !item) return;
    var h3 = panel.querySelector('h3');
    if (h3) h3.textContent = item.title || '';
    var shorts = panel.querySelectorAll('p');
    for (var si = 0; si < shorts.length; si++) {
      var p = shorts[si];
      var cls = p.className || '';
      if (/text-\[var\(--ember\)\]/.test(cls) || /\btext-lg\b/.test(cls)) {
        p.textContent = item.short || '';
        break;
      }
    }
    for (var bi = 0; bi < shorts.length; bi++) {
      var bp = shorts[bi];
      var bcls = bp.className || '';
      if (/text-white\/75/.test(bcls) || /leading-relaxed/.test(bcls)) {
        bp.textContent = item.body || '';
        break;
      }
    }
    var tagHost = panel.querySelector('.mt-8.flex.flex-wrap');
    if (tagHost && Array.isArray(item.tags)) {
      tagHost.innerHTML = item.tags.map(function(t) {
        return '<span class="px-3 py-1.5 border border-white/15 font-mono text-[11px] uppercase tracking-wider text-white/70">' + esc(t) + '</span>';
      }).join('');
    }
  }
  document.querySelectorAll('[data-wpc-capability-selector]').forEach(function(grid) {
    var data = [];
    try {
      data = JSON.parse(grid.getAttribute('data-wpc-capability-data') || '[]');
    } catch (e) { data = []; }
    var btns = grid.querySelectorAll('[data-wpc-capability-btn]');
    var panel = grid.querySelector('[data-wpc-capability-panel]');
    if (!btns.length || !panel) return;

    var activeBtn = btns[0];
    var inactiveBtn = btns[1] || btns[0];
    btns.forEach(function(b) {
      if (b.getAttribute('data-wpc-capability-active') === 'true') activeBtn = b;
    });
    for (var bi = 0; bi < btns.length; bi++) {
      if (btns[bi] !== activeBtn) { inactiveBtn = btns[bi]; break; }
    }
    var activeCls = new Set((activeBtn.className || '').split(/\s+/).filter(Boolean));
    var inactiveCls = new Set((inactiveBtn.className || '').split(/\s+/).filter(Boolean));
    var activeOnly = (activeBtn.className || '').split(/\s+/).filter(function(c) { return c && !inactiveCls.has(c); });
    var inactiveOnly = (inactiveBtn.className || '').split(/\s+/).filter(function(c) { return c && !activeCls.has(c); });

    function setActive(idx) {
      btns.forEach(function(btn, i) {
        var on = i === idx;
        btn.setAttribute('data-wpc-capability-active', on ? 'true' : 'false');
        activeOnly.forEach(function(c) { btn.classList[on ? 'add' : 'remove'](c); });
        inactiveOnly.forEach(function(c) { btn.classList[on ? 'remove' : 'add'](c); });
        var trail = btn.querySelector('span.font-display.text-2xl, span.text-2xl');
        if (trail) trail.textContent = on ? '\u25CF' : '\u2192';
      });
      if (data[idx]) renderPanel(panel, data[idx]);
    }

    btns.forEach(function(btn, i) {
      btn.addEventListener('click', function(e) {
        e.preventDefault();
        setActive(i);
      });
    });
  });
})();
            } catch(e) { console.warn("[WPConvert] React capability selector error:", e); }

            try { // EC-VISION-001: Generic effect slider (gradient / blur / opacity)
            (function() {
  'use strict';
  function clamp(n, lo, hi) { return Math.max(lo, Math.min(hi, n)); }
  function cfgOf(root) {
    try { var r = root.getAttribute('data-wpc-fx-config'); return r ? JSON.parse(r) : {}; }
    catch (e) { return {}; }
  }
  function applyFrac(root, frac, cfg) {
    frac = clamp(frac, 0, 1);
    var lo = typeof cfg.min === 'number' ? cfg.min : 0;
    var hi = typeof cfg.max === 'number' ? cfg.max : 100;
    var target = root.querySelector('[data-wpc-fx-target]');
    if (target) {
      if (cfg.effect === 'gradient') {
        var inner = Math.max(0, (cfg.innerAtZero || 0) * (1 - frac));
        var outer = Math.max(0, (cfg.outerAtZero || 0) * (1 - frac));
        var fn = cfg.gradientFn || 'radial-gradient';
        var geom = cfg.gradientGeom || 'circle at center';
        var color = cfg.gradientColor || '#000';
        target.style.background = fn + '(' + geom + ', transparent ' + inner + '%, ' + color + ' ' + outer + '%)';
      } else if (cfg.effect === 'blur') {
        target.style.filter = 'blur(' + Math.max(0, (cfg.blurAtFull || 0) * frac) + 'px)';
      } else if (cfg.effect === 'opacity') {
        target.style.opacity = String(clamp((cfg.opacityAtFull || 0) * frac, 0, 1));
      }
    }
    var nativeVal = lo + frac * (hi - lo);
    var thumb = root.querySelector('[data-wpc-fx-thumb]');
    if (thumb) thumb.setAttribute('aria-valuenow', String(Math.round(nativeVal)));
    var label = root.querySelector('[data-wpc-fx-label]');
    if (label && cfg.labelPrefix != null) {
      var v;
      if (cfg.labelPct) { v = cfg.labelInvert ? (100 - frac * 100) : (frac * 100); }
      else { v = cfg.labelInvert ? (hi - frac * (hi - lo)) : nativeVal; }
      label.textContent = (cfg.labelPrefix || '') + Math.round(v) + (cfg.labelSuffix || '');
    }
    var thumbWrap = root.querySelector('[data-wpc-fx-thumbwrap]');
    if (thumbWrap && thumbWrap.style) thumbWrap.style.left = 'calc(' + (frac * 100) + '% + 1px)';
    var fill = root.querySelector('[data-wpc-fx-fill]');
    if (fill && fill.style) {
      if (cfg.fillProp === 'right') fill.style.right = (100 - frac * 100) + '%';
      else fill.style.width = (frac * 100) + '%';
    }
  }
  function trackRect(root) {
    var t = root.querySelector('[data-wpc-fx-track]')
      || root.querySelector('[data-orientation="horizontal"]')
      || root;
    var rect = t.getBoundingClientRect();
    var w = rect.width || t.offsetWidth;
    if (!w && t.parentElement) {
      var pr = t.parentElement.getBoundingClientRect();
      return { left: pr.left, width: pr.width || t.parentElement.offsetWidth };
    }
    return { left: rect.left, width: w };
  }
  function wire(root) {
    var cfg = cfgOf(root);
    var thumb = root.querySelector('[data-wpc-fx-thumb]');
    if (!thumb) return;
    var dragging = false;
    function move(x) {
      var r = trackRect(root);
      if (!r.width) return;
      applyFrac(root, (x - r.left) / r.width, cfg);
    }
    thumb.addEventListener('pointerdown', function(e) {
      dragging = true;
      try { thumb.setPointerCapture(e.pointerId); } catch (_) {}
      move(e.clientX);
      e.preventDefault();
    });
    thumb.addEventListener('pointermove', function(e) { if (dragging) move(e.clientX); });
    thumb.addEventListener('pointerup', function() { dragging = false; });
    root.addEventListener('pointerdown', function(e) {
      if (e.target === thumb || (thumb.contains && thumb.contains(e.target))) return;
      move(e.clientX);
    });
    thumb.addEventListener('keydown', function(e) {
      var lo = typeof cfg.min === 'number' ? cfg.min : 0;
      var hi = typeof cfg.max === 'number' ? cfg.max : 100;
      var cur = parseFloat(thumb.getAttribute('aria-valuenow'));
      if (isNaN(cur)) cur = lo;
      var frac = (hi > lo) ? (cur - lo) / (hi - lo) : 0;
      if (e.key === 'ArrowRight' || e.key === 'ArrowUp') { applyFrac(root, frac + 0.01, cfg); e.preventDefault(); }
      if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') { applyFrac(root, frac - 0.01, cfg); e.preventDefault(); }
    });
    var lo0 = typeof cfg.min === 'number' ? cfg.min : 0;
    var hi0 = typeof cfg.max === 'number' ? cfg.max : 100;
    var cur0 = parseFloat(thumb.getAttribute('aria-valuenow'));
    var initFrac;
    if (!isNaN(cur0)) initFrac = (hi0 > lo0) ? (cur0 - lo0) / (hi0 - lo0) : 0;
    else if (typeof cfg.init === 'number') initFrac = cfg.init;
    else initFrac = 0;
    applyFrac(root, initFrac, cfg);
  }
  document.querySelectorAll('[data-wpc-fx-slider]').forEach(wire);
})();
            } catch(e) { console.warn("[WPConvert] Effect slider error:", e); }

            try { // EC-TAB-007: Content-swap tab row + single detail panel
            (function() {
  'use strict';
  function parseData(grid) {
    try {
      var raw = grid.getAttribute('data-wpc-content-swap-data');
      return raw ? JSON.parse(raw) : [];
    } catch (e) { return []; }
  }
  function diffCls(activeBtn, inactiveBtn) {
    var a = new Set((activeBtn.className || '').split(/\s+/).filter(Boolean));
    var b = new Set((inactiveBtn.className || '').split(/\s+/).filter(Boolean));
    return {
      activeOnly: (activeBtn.className || '').split(/\s+/).filter(function(c) { return c && !b.has(c); }),
      inactiveOnly: (inactiveBtn.className || '').split(/\s+/).filter(function(c) { return c && !a.has(c); })
    };
  }
  function parseDecls(css) {
    var out = {};
    (css || '').split(';').forEach(function(decl) {
      var i = decl.indexOf(':');
      if (i > 0) out[decl.slice(0, i).trim()] = decl.slice(i + 1).trim();
    });
    return out;
  }
  // EC-TAB-007d: inline-styled tabs express active/inactive purely in `style`.
  function diffStyle(activeBtn, inactiveBtn) {
    var a = parseDecls(activeBtn.getAttribute('style'));
    var b = parseDecls(inactiveBtn.getAttribute('style'));
    var activeOnly = {};
    var inactiveOnly = {};
    Object.keys(a).forEach(function(k) { if (b[k] !== a[k]) activeOnly[k] = a[k]; });
    Object.keys(b).forEach(function(k) { if (a[k] !== b[k]) inactiveOnly[k] = b[k]; });
    return { activeOnly: activeOnly, inactiveOnly: inactiveOnly };
  }
  function applyDecls(btn, decls) {
    Object.keys(decls).forEach(function(k) {
      try { btn.style.setProperty(k, decls[k]); } catch (e) {}
    });
  }
  function renderPanel(panel, item) {
    if (!panel || !item) return;
    var title = panel.querySelector('[data-wpc-content-swap-title]');
    if (title) title.textContent = item.title || item.heading || item.name || '';
    var label = panel.querySelector('[data-wpc-content-swap-label]');
    if (label) {
      var itemLabel = item.label || '';
      var itemTitle = item.title || item.heading || item.name || '';
      if (itemLabel && itemLabel !== itemTitle) label.textContent = itemLabel;
    }
    var detail = panel.querySelector('[data-wpc-content-swap-detail]');
    if (detail) {
      detail.textContent = item.detail || item.body || item.description || item.text || item.content || '';
    }
  }
  function detectActiveBtn(btns, grid) {
    var idx = parseInt(grid.getAttribute('data-wpc-content-swap-active') || '0', 10);
    if (!isNaN(idx) && btns[idx]) return btns[idx];
    for (var i = 0; i < btns.length; i++) {
      if (btns[i].getAttribute('aria-pressed') === 'true' || btns[i].getAttribute('aria-selected') === 'true') {
        return btns[i];
      }
    }
    return btns[0];
  }
  document.querySelectorAll('[data-wpc-content-swap-tabs]').forEach(function(grid) {
    var btns = grid.querySelectorAll('[data-wpc-content-swap-btn]');
    if (btns.length < 2) return;
    // The panel may CONTAIN the tab row (EC-TAB-007d sibling shape) rather than sit
    // beside it, so look upward before looking sideways.
    var panel = grid.closest && grid.closest('[data-wpc-content-swap-panel]');
    if (!panel) panel = grid.parentElement && grid.parentElement.querySelector('[data-wpc-content-swap-panel]');
    if (!panel) panel = grid.nextElementSibling;
    if (!panel || !panel.matches('[data-wpc-content-swap-panel]')) return;
    var data = parseData(grid);
    var activeBtn = detectActiveBtn(btns, grid);
    var inactiveBtn = btns[0];
    for (var bi = 0; bi < btns.length; bi++) {
      if (btns[bi] !== activeBtn) { inactiveBtn = btns[bi]; break; }
    }
    var clsDiff = diffCls(activeBtn, inactiveBtn);
    var styleDiff = diffStyle(activeBtn, inactiveBtn);
    function setActive(idx) {
      btns.forEach(function(btn, i) {
        var on = i === idx;
        clsDiff.activeOnly.forEach(function(c) { btn.classList[on ? 'add' : 'remove'](c); });
        clsDiff.inactiveOnly.forEach(function(c) { btn.classList[on ? 'remove' : 'add'](c); });
        applyDecls(btn, on ? styleDiff.activeOnly : styleDiff.inactiveOnly);
        var underline = btn.querySelector('span[class*="bottom"]');
        if (underline) underline.style.display = on ? '' : 'none';
      });
      if (data[idx]) renderPanel(panel, data[idx]);
    }
    btns.forEach(function(btn, i) {
      btn.addEventListener('mouseenter', function() { setActive(i); });
      btn.addEventListener('click', function(e) { e.preventDefault(); setActive(i); });
    });
  });
})();
            } catch(e) { console.warn("[WPConvert] Content-swap tabs error:", e); }

            try { // EC-TAB-008: Tab row + single media/text preview slot
            (function() {
  'use strict';
  var groups = document.querySelectorAll('[data-wpc-mediaswap-group]');
  if (!groups.length) return;
  groups.forEach(function(g) {
    if (g.getAttribute('data-wpc-mediaswap-bound') === '1') return;
    g.setAttribute('data-wpc-mediaswap-bound', '1');
    var scope = g.closest('section') || g.parentElement;
    if (!scope) return;
    var holder = scope.querySelector('[data-wpc-mediaswap-data]');
    if (!holder) return;
    var data;
    try { data = JSON.parse(holder.textContent || '[]'); } catch (e) { return; }
    if (!data || !data.length) return;

    var btns = g.querySelectorAll('[data-wpc-mediaswap]');
    if (!btns.length) return;
    var aCls = (g.getAttribute('data-wpc-mediaswap-active-cls') || '').split(' ').filter(Boolean);
    var iCls = (g.getAttribute('data-wpc-mediaswap-inactive-cls') || '').split(' ').filter(Boolean);
    var dotBox = scope.querySelector('[data-wpc-mediaswap-dot-active]');
    var dots = scope.querySelectorAll('[data-wpc-mediaswap-dot]');
    var dCls = dotBox ? (dotBox.getAttribute('data-wpc-mediaswap-dot-active') || '').split(' ').filter(Boolean) : [];
    var dICls = dotBox ? (dotBox.getAttribute('data-wpc-mediaswap-dot-inactive') || '').split(' ').filter(Boolean) : [];

    function apply(idx) {
      var v = data[idx];
      if (!v) return;
      for (var bi = 0; bi < btns.length; bi++) {
        var b = btns[bi];
        var on = b.getAttribute('data-wpc-mediaswap') === String(idx);
        b.setAttribute('aria-pressed', on ? 'true' : 'false');
        for (var ai = 0; ai < aCls.length; ai++) b.classList[on ? 'add' : 'remove'](aCls[ai]);
        for (var ii = 0; ii < iCls.length; ii++) b.classList[on ? 'remove' : 'add'](iCls[ii]);
      }
      for (var di = 0; di < dots.length; di++) {
        var d = dots[di];
        var don = d.getAttribute('data-wpc-mediaswap-dot') === String(idx);
        for (var da = 0; da < dCls.length; da++) d.classList[don ? 'add' : 'remove'](dCls[da]);
        for (var dii = 0; dii < dICls.length; dii++) d.classList[don ? 'remove' : 'add'](dICls[dii]);
      }
      var slots = scope.querySelectorAll('[data-wpc-mediaswap-slot]');
      for (var si = 0; si < slots.length; si++) {
        var el = slots[si];
        var key = el.getAttribute('data-wpc-mediaswap-slot');
        if (key === 'image') {
          if (v.image && el.getAttribute('src')) {
            el.setAttribute('src', el.getAttribute('src').replace(/[^\/]+$/, v.image));
          }
          if (v.alt) el.setAttribute('alt', v.alt);
          continue;
        }
        if (typeof v[key] !== 'string') continue;
        el.textContent = el.getAttribute('data-wpc-mediaswap-case') === 'upper'
          ? v[key].toUpperCase()
          : v[key];
      }
    }

    for (var i = 0; i < btns.length; i++) {
      (function(btn) {
        btn.style.cursor = 'pointer';
        btn.addEventListener('click', function(e) {
          if (e && e.preventDefault) e.preventDefault();
          apply(parseInt(btn.getAttribute('data-wpc-mediaswap'), 10) || 0);
        });
      })(btns[i]);
    }
  });
})();
            } catch(e) { console.warn("[WPConvert] Media-swap tabs error:", e); }

            try { // EC-DIAG-001: multi-step estimate wizard
            (function() {
  'use strict';
  var roots = document.querySelectorAll('[data-wpc-diag-wizard]');
  if (!roots.length) return;

  Array.prototype.forEach.call(roots, function(root) {
    if (root.getAttribute('data-wpc-diag-bound') === '1') return;
    root.setAttribute('data-wpc-diag-bound', '1');

    var holder = root.querySelector('script[data-wpc-diag-data]');
    if (!holder) return;
    var data;
    try { data = JSON.parse(holder.textContent || 'null'); } catch (e) { return; }
    if (!data || !data.issues || !data.issues.length || !data.model) return;

    var issueBtns = root.querySelectorAll('[data-wpc-diag-issue]');
    var body = root.querySelector('[data-wpc-diag-body]');
    var questionView = root.querySelector('[data-wpc-diag-question-view]');
    var questionEl = root.querySelector('[data-wpc-diag-question]');
    var optionRow = root.querySelector('[data-wpc-diag-options]');
    var titleEl = root.querySelector('[data-wpc-diag-title]');
    var progressEl = root.querySelector('[data-wpc-diag-progress]');
    var controlsEl = root.querySelector('[data-wpc-diag-controls]');
    if (!issueBtns.length || !body || !questionView || !questionEl || !optionRow) return;

    var labels = data.labels || {};
    var templates = data.templates || {};
    var state = { issueId: data.activeIssueId, step: 0, answers: [], showResult: false };
    var resultPanel = null;

    function issueById(id) {
      for (var i = 0; i < data.issues.length; i++) {
        if (data.issues[i].id === id) return data.issues[i];
      }
      return data.issues[0];
    }

    function fromHtml(html) {
      var wrap = document.createElement('div');
      wrap.innerHTML = String(html || '').trim();
      return wrap.firstElementChild;
    }

    function round(mode, value) {
      if (mode === 'floor') return Math.floor(value);
      if (mode === 'ceil') return Math.ceil(value);
      return Math.round(value);
    }

    function estimate() {
      var issue = issueById(state.issueId);
      var product = 1;
      var recommendations = [];
      for (var q = 0; q < state.answers.length; q++) {
        var question = issue.questions[q];
        var option = question && question.options[state.answers[q]];
        if (option) {
          product *= option.multiplier;
          if (option.recommendation) recommendations.push(option.recommendation);
        }
      }
      var price = issue.basePrice * product;
      var m = data.model;
      var lower = round(m.lower.mode, price * m.lower.factor);
      var upper = round(m.upper.mode, price * m.upper.factor);
      return {
        text: (m.prefix || '') + lower + (m.separator || '') + (m.prefix || '') + upper + (m.suffix || ''),
        recommendations: recommendations
      };
    }

    function applyStateClasses(el, selected) {
      var mode = el.getAttribute('data-wpc-cls-mode');
      var active = el.getAttribute('data-wpc-active-cls') || '';
      var inactive = el.getAttribute('data-wpc-inactive-cls') || '';
      if (!mode) return;
      if (mode === 'full') {
        el.className = selected ? active : inactive;
        return;
      }
      var add = (selected ? active : inactive).split(' ').filter(Boolean);
      var remove = (selected ? inactive : active).split(' ').filter(Boolean);
      remove.forEach(function(c) { el.classList.remove(c); });
      add.forEach(function(c) { el.classList.add(c); });
    }

    function renderIssues() {
      Array.prototype.forEach.call(issueBtns, function(btn) {
        var selected = btn.getAttribute('data-wpc-diag-issue') === state.issueId;
        btn.setAttribute('aria-pressed', selected ? 'true' : 'false');
        applyStateClasses(btn, selected);
        var icon = btn.querySelector('[data-wpc-diag-icon]');
        if (icon) applyStateClasses(icon, selected);
      });
    }

    function renderLabels() {
      var issue = issueById(state.issueId);
      if (titleEl && labels.titleTemplate) {
        titleEl.textContent = labels.titleTemplate.replace('{{title}}', issue.title);
      }
      if (progressEl) {
        if (state.showResult && labels.resultLabel) {
          progressEl.textContent = labels.resultLabel;
        } else if (labels.progressTemplate) {
          progressEl.textContent = labels.progressTemplate
            .replace('{{step}}', String(state.step + 1))
            .replace('{{total}}', String(issue.questions.length));
        }
      }
    }

    function renderQuestion() {
      var issue = issueById(state.issueId);
      var question = issue.questions[state.step];
      if (!question) return;
      questionEl.textContent = question.text;

      optionRow.innerHTML = '';
      question.options.forEach(function(option, index) {
        var btn = fromHtml(templates.option);
        if (!btn) return;
        btn.removeAttribute('id');
        btn.setAttribute('data-wpc-diag-option', String(index));
        var label = btn.querySelector('span') || btn;
        label.textContent = option.text;
        btn.addEventListener('click', function(event) {
          event.preventDefault();
          state.answers[state.step] = index;
          state.answers.length = state.step + 1;
          if (state.step < issue.questions.length - 1) state.step += 1;
          else state.showResult = true;
          render();
        });
        optionRow.appendChild(btn);
      });
    }

    function renderResult() {
      if (resultPanel && resultPanel.parentNode) resultPanel.parentNode.removeChild(resultPanel);
      resultPanel = null;
      if (!state.showResult) {
        questionView.style.display = '';
        return;
      }

      questionView.style.display = 'none';
      var priced = estimate();
      var html = String(templates.result || '');

      var items = '';
      if (templates.recommendation) {
        items = priced.recommendations.map(function(rec) {
          return templates.recommendation.replace('{{text}}', rec);
        }).join('');
      }
      html = html.split('{{recommendations}}').join(items);
      html = html.split('{{price}}').join(priced.text);

      resultPanel = document.createElement('div');
      resultPanel.setAttribute('data-wpc-diag-result', 'true');
      resultPanel.innerHTML = html;
      body.appendChild(resultPanel);
    }

    function renderControls() {
      if (!controlsEl) return;
      controlsEl.innerHTML = '';

      if (state.step > 0 && !state.showResult && templates.back) {
        var back = fromHtml(templates.back);
        if (back) {
          back.removeAttribute('id');
          back.addEventListener('click', function(event) {
            event.preventDefault();
            state.step -= 1;
            state.answers.pop();
            render();
          });
          controlsEl.appendChild(back);
        }
      }

      if (state.showResult && templates.reset) {
        var reset = fromHtml(templates.reset);
        if (reset) {
          reset.removeAttribute('id');
          reset.addEventListener('click', function(event) {
            event.preventDefault();
            state.step = 0;
            state.answers = [];
            state.showResult = false;
            render();
          });
          controlsEl.appendChild(reset);
        }
      }
    }

    function render() {
      renderIssues();
      renderLabels();
      if (!state.showResult) renderQuestion();
      renderResult();
      renderControls();
    }

    Array.prototype.forEach.call(issueBtns, function(btn) {
      btn.addEventListener('click', function(event) {
        event.preventDefault();
        var id = btn.getAttribute('data-wpc-diag-issue');
        if (!id) return;
        state.issueId = id;
        state.step = 0;
        state.answers = [];
        state.showResult = false;
        render();
      });
    });

    render();
  });
})();
            } catch(e) { console.warn("[WPConvert] Estimate wizard error:", e); }

            try { // EC-FLOW-001: human-in-the-loop agent workflow demo
            
            } catch(e) { console.warn("[WPConvert] Workflow demo error:", e); }

            try { // EC-NAV-MEGA-004: state selector inside a captured mega panel
            (function () {
  var SWITCH = 'data-wpc-panel-switch';

  function payloadFor(el) {
    var host = el.closest('.wpconvert-nav-rich-panel, [data-wpc-rich-panel]');
    if (!host) return null;
    var tag = host.querySelector('script.wpconvert-panel-states');
    if (!tag) return null;
    if (!host.__wpcPanelStates) {
      try { host.__wpcPanelStates = JSON.parse(tag.textContent); }
      catch (e) { host.__wpcPanelStates = { states: [] }; }
    }
    var data = host.__wpcPanelStates;
    if (!data || !data.states || data.states.length < 2) return null;
    return { host: host, data: data };
  }

  // The captured panel root is the element the controls live inside; swapping
  // its innerHTML leaves the root element — and therefore its classes, which
  // EC-NAV-MEGA-003's full-bleed CSS keys off — completely untouched.
  function rootFor(host, control) {
    var wrap = host.querySelector('.wpconvert-rich-panel-content') || host;
    var node = control;
    while (node && node.parentElement && node.parentElement !== wrap) {
      node = node.parentElement;
    }
    return node && node.parentElement === wrap ? node : wrap.firstElementChild;
  }

  function apply(control) {
    var found = payloadFor(control);
    if (!found) return false;
    var idx = parseInt(control.getAttribute(SWITCH), 10);
    if (isNaN(idx) || idx < 0 || idx >= found.data.states.length) return false;
    var root = rootFor(found.host, control);
    if (!root) return false;
    var html = found.data.states[idx].innerHtml;
    if (typeof html !== 'string' || root.innerHTML === html) return true;
    root.innerHTML = html;
    return true;
  }

  function controlFrom(target) {
    return target && target.closest ? target.closest('[' + SWITCH + ']') : null;
  }

  document.addEventListener('click', function (e) {
    var control = controlFrom(e.target);
    if (!control) return;
    // Mirror the source: the href is decorative, the click only swaps state.
    e.preventDefault();
    apply(control);
  }, false);

  document.addEventListener('mouseover', function (e) {
    var control = controlFrom(e.target);
    if (!control) return;
    apply(control);
  }, false);
})();
            } catch(e) { console.warn("[WPConvert] Mega panel state selector error:", e); }

            try { // EC-GALLERY-002: GalleryModal photo lightbox
            (function() {
  'use strict';
  var root = document.querySelector('[data-wpc-gallery-modal-root]');
  var dataEl = document.querySelector('[data-wpc-gallery-modal-data]');
  if (!root || !dataEl) return;
  if (root.getAttribute('data-wpc-gallery-bound') === '1') return;
  root.setAttribute('data-wpc-gallery-bound', '1');

  // EC-GALLERY-002d: portal to <body>, the way the source component's React portal did.
  // The theme wraps page templates in <main class="site-main">, which is positioned with
  // a z-index and therefore opens a stacking context: a z-index set on anything inside it
  // is resolved *within* main, so the modal could never paint over the sibling
  // <nav class="fixed z-50">. Moving the node keeps its listeners; we bind afterwards.
  if (document.body && root.parentNode !== document.body) {
    document.body.appendChild(root);
  }

  var galleries;
  try { galleries = JSON.parse(dataEl.textContent || '[]'); } catch (e) { return; }
  if (!galleries || !galleries.length) return;
  var byId = {};
  for (var gi = 0; gi < galleries.length; gi++) byId[galleries[gi].id] = galleries[gi];

  var titleEl = root.querySelector('[data-wpc-gallery-modal-title]');
  var imgEl = root.querySelector('[data-wpc-gallery-modal-image]');
  var counterEl = root.querySelector('[data-wpc-gallery-modal-counter]');
  var panel = root.querySelector('[data-wpc-gallery-modal-panel]');
  var current = null;
  var index = 0;

  function render() {
    if (!current || !current.images || !current.images.length) return;
    if (titleEl) titleEl.textContent = current.title || '';
    if (imgEl) {
      imgEl.src = current.images[index];
      imgEl.alt = (current.title || 'Gallery') + ' ' + (index + 1);
    }
    if (counterEl) counterEl.textContent = (index + 1) + ' / ' + current.images.length;
  }

  // EC-GALLERY-002d: other injectors (the universal carousel especially) adopt any
  // prev/next arrow pair they find and disable it when they decide there is nothing to
  // cycle. A disabled <button> dispatches no click event at all, so reclaim ours.
  function enableControls() {
    var controls = root.querySelectorAll(
      '[data-wpc-gallery-modal-prev],[data-wpc-gallery-modal-next],[data-wpc-gallery-modal-close]'
    );
    for (var ci = 0; ci < controls.length; ci++) {
      controls[ci].disabled = false;
      controls[ci].removeAttribute('disabled');
      controls[ci].style.opacity = '';
    }
  }

  function open(id) {
    current = byId[id];
    if (!current) return;
    index = 0;
    enableControls();
    render();
    // EC-GALLERY-002d: inline display — .hidden/.flex may be absent or may lose the
    // cascade in the converted site's compiled CSS.
    root.style.display = 'flex';
    root.classList.remove('hidden');
    root.setAttribute('aria-hidden', 'false');
    document.body.style.overflow = 'hidden';
  }

  function close() {
    root.style.display = 'none';
    root.setAttribute('aria-hidden', 'true');
    document.body.style.overflow = '';
    current = null;
  }

  function next() {
    if (!current || !current.images.length) return;
    index = (index + 1) % current.images.length;
    render();
  }

  function prev() {
    if (!current || !current.images.length) return;
    index = (index - 1 + current.images.length) % current.images.length;
    render();
  }

  document.querySelectorAll('[data-wpc-gallery-trigger]').forEach(function(btn) {
    btn.style.cursor = 'pointer';
    btn.addEventListener('click', function(e) {
      if (e && e.preventDefault) e.preventDefault();
      open(btn.getAttribute('data-wpc-gallery-trigger'));
    });
  });

  var closeBtn = root.querySelector('[data-wpc-gallery-modal-close]');
  if (closeBtn) closeBtn.addEventListener('click', close);
  var prevBtn = root.querySelector('[data-wpc-gallery-modal-prev]');
  if (prevBtn) prevBtn.addEventListener('click', prev);
  var nextBtn = root.querySelector('[data-wpc-gallery-modal-next]');
  if (nextBtn) nextBtn.addEventListener('click', next);

  root.addEventListener('click', function(e) {
    if (e.target === root) close();
  });
  if (panel) {
    panel.addEventListener('click', function(e) { e.stopPropagation(); });
  }
  document.addEventListener('keydown', function(e) {
    if (root.style.display === 'none') return;
    if (e.key === 'Escape') close();
    else if (e.key === 'ArrowRight') next();
    else if (e.key === 'ArrowLeft') prev();
  });
})();
            } catch(e) { console.warn("[WPConvert] Gallery modal error:", e); }

            try { // EC-CASE-OVERLAY-001: click-to-expand case-study overlays
            (function(){
  if (window.__wpcCaseOverlayInit) return;
  window.__wpcCaseOverlayInit = true;
  document.addEventListener('click', function(e) {
    var closeBtn = e.target.closest && e.target.closest('[data-wpc-case-close]');
    if (closeBtn) {
      var closeCard = closeBtn.closest('[data-wpc-case-card]');
      if (closeCard) closeCard.classList.remove('wpc-case-open');
      e.stopPropagation();
      e.preventDefault();
      return;
    }
    var card = e.target.closest && e.target.closest('[data-wpc-case-card]');
    if (!card || !card.querySelector('[data-wpc-case-overlay]')) return;
    var open = document.querySelectorAll('.wpc-case-open');
    for (var i = 0; i < open.length; i++) {
      if (open[i] !== card) open[i].classList.remove('wpc-case-open');
    }
    card.classList.toggle('wpc-case-open');
  });
  document.addEventListener('keydown', function(e) {
    if (e.key !== 'Escape') return;
    var open = document.querySelectorAll('.wpc-case-open');
    for (var i = 0; i < open.length; i++) open[i].classList.remove('wpc-case-open');
  });
})();
            } catch(e) { console.warn("[WPConvert] Case overlay error:", e); }

            try { // EC-GALLERY-003 / EC-CAROUSEL-016i: GalleryCarousel photo stacks
            (function(){
  /* EC-GALLERY-003 / EC-CAROUSEL-016i: GalleryCarousel photo stacks */
  function setup(box){
    if (!box || box.getAttribute('data-wpc-gallery-carousel-bound')) return;
    var imgs = Array.prototype.slice.call(box.children).filter(function(n){
      return n.tagName === 'IMG';
    });
    if (imgs.length < 2) {
      imgs = Array.prototype.slice.call(box.querySelectorAll('img')).filter(function(img){
        var c = img.getAttribute('class') || '';
        return /\babsolute\b/.test(c);
      });
    }
    if (imgs.length < 2) return;
    box.setAttribute('data-wpc-gallery-carousel-bound', 'true');

    var card = box.closest('.bg-card, [class*="rounded-2xl"]') || box.parentElement;
    var allBtns = Array.prototype.slice.call(box.querySelectorAll('button'));
    var dots = allBtns.filter(function(b){
      return /^go to (photo|image|picture)\s+\d+/i.test(b.getAttribute('aria-label') || '');
    });
    var prevOverlay = allBtns.find(function(b){
      var a = (b.getAttribute('aria-label') || '').toLowerCase();
      return /\b(previous|prev)\b/.test(a) && /\b(photo|image|picture|gallery)\b/.test(a);
    }) || null;
    var nextOverlay = allBtns.find(function(b){
      var a = (b.getAttribute('aria-label') || '').toLowerCase();
      return /\bnext\b/.test(a) && /\b(photo|image|picture|gallery)\b/.test(a);
    }) || null;
    var counter = null;
    var prevFooter = null;
    var nextFooter = null;
    if (card) {
      var spans = card.querySelectorAll('span');
      for (var s = 0; s < spans.length; s++) {
        if (/^\s*\d+\s*\/\s*\d+\s*$/.test(spans[s].textContent || '')) { counter = spans[s]; break; }
      }
      var cardBtns = card.querySelectorAll('button');
      for (var bi = 0; bi < cardBtns.length; bi++) {
        if (cardBtns[bi] === prevOverlay || cardBtns[bi] === nextOverlay) continue;
        if (dots.indexOf(cardBtns[bi]) >= 0) continue;
        var t = (cardBtns[bi].textContent || '').replace(/\s+/g, ' ').trim();
        if (/^(prev|previous)$/i.test(t)) prevFooter = cardBtns[bi];
        if (/^next$/i.test(t)) nextFooter = cardBtns[bi];
      }
    }

    var idx = 0;
    var timer = null;
    function show(n){
      idx = ((n % imgs.length) + imgs.length) % imgs.length;
      imgs.forEach(function(img, i){
        img.style.transition = 'opacity 0.5s ease';
        img.style.opacity = i === idx ? '1' : '0';
      });
      dots.forEach(function(d, i){
        d.style.cursor = 'pointer';
        if (i === idx) { d.style.width = '1.5rem'; }
        else { d.style.width = '0.375rem'; }
      });
      if (counter) counter.textContent = (idx + 1) + ' / ' + imgs.length;
    }
    function start(){ stop(); timer = setInterval(function(){ show(idx + 1); }, 5000); }
    function stop(){ if (timer) { clearInterval(timer); timer = null; } }
    function bind(el, delta){
      if (!el) return;
      el.addEventListener('click', function(e){
        if (e && e.preventDefault) e.preventDefault();
        if (e && e.stopPropagation) e.stopPropagation();
        stop(); show(idx + delta); start();
      });
    }
    bind(prevOverlay, -1);
    bind(nextOverlay, 1);
    bind(prevFooter, -1);
    bind(nextFooter, 1);
    dots.forEach(function(d, i){
      d.addEventListener('click', function(e){
        if (e && e.preventDefault) e.preventDefault();
        if (e && e.stopPropagation) e.stopPropagation();
        stop(); show(i); start();
      });
    });
    box.addEventListener('mouseenter', stop);
    box.addEventListener('mouseleave', start);
    show(0);
    start();
    box.__wpcGalleryStop = stop;
  }
  function boot(){
    document.querySelectorAll('[data-wpc-gallery-carousel="true"]').forEach(setup);
  }
  function stopAll(){
    document.querySelectorAll('[data-wpc-gallery-carousel="true"]').forEach(function(box){
      if (typeof box.__wpcGalleryStop === 'function') box.__wpcGalleryStop();
    });
  }
  window.__wpcStopGalleryCarousels = stopAll;
  // Always boot immediately. JSDOM (and some WP inline-script timings) can leave
  // readyState at "loading" without ever firing DOMContentLoaded for outside-only evals.
  boot();
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', function(){ boot(); });
  }
})();
            } catch(e) { console.warn("[WPConvert] Gallery carousel error:", e); }

            try { // EC-CAROUSEL-023: translate3d flex testimonial sliders
            (function() {
  'use strict';
  function findRoot(el) {
    var p = el;
    while (p && p !== document.body) {
      if (p.querySelector('[data-wpconvert-translate3d-slider="viewport"]') &&
          p.querySelector('[data-wpconvert-translate3d-slider="controls"]')) return p;
      p = p.parentElement;
    }
    return el;
  }
  document.querySelectorAll('[data-wpconvert-translate3d-slider="viewport"]').forEach(function(viewport) {
    var root = findRoot(viewport);
    var track = viewport.querySelector('[data-wpconvert-translate3d-slider="track"]');
    var controls = root.querySelector('[data-wpconvert-translate3d-slider="controls"]');
    if (!track || !controls) return;
    var slides = track.querySelectorAll('[data-wpconvert-translate3d-slider="slide"]');
    var prev = controls.querySelector('[data-wpconvert-translate3d-slider="prev"]');
    var next = controls.querySelector('[data-wpconvert-translate3d-slider="next"]');
    var dots = controls.querySelectorAll('[data-wpconvert-translate3d-slider="dot"]');
    if (slides.length < 2) return;
    var idx = 0;
    function updateDots() {
      dots.forEach(function(dot, i) {
        if (i === idx) {
          dot.classList.add('bg-primary', 'w-4');
          dot.classList.remove('bg-stone-300');
        } else {
          dot.classList.remove('bg-primary', 'w-4');
          dot.classList.add('bg-stone-300');
        }
      });
    }
    function go(n) {
      idx = ((n % slides.length) + slides.length) % slides.length;
      track.style.transform = 'translate3d(-' + (idx * 100) + '%, 0px, 0px)';
      updateDots();
    }
    if (prev) prev.addEventListener('click', function(e) { e.preventDefault(); go(idx - 1); });
    if (next) next.addEventListener('click', function(e) { e.preventDefault(); go(idx + 1); });
    dots.forEach(function(dot) {
      dot.addEventListener('click', function(e) {
        e.preventDefault();
        go(parseInt(dot.getAttribute('data-wpconvert-translate3d-index'), 10) || 0);
      });
    });
    go(0);
  });
})();
            } catch(e) { console.warn("[WPConvert] Translate3d slider error:", e); }

            try { // EC-CAROUSEL-032: auto-advance flex carousels without prev/next buttons
            (function() {
  'use strict';
  function perViewForWidth(w, maxPerView) {
    var lg = maxPerView > 0 ? maxPerView : 3;
    if (w >= 1024) return lg;
    if (w >= 640) return Math.min(2, lg);
    return 1;
  }
  function recordedPerView(viewport) {
    var raw = parseInt(viewport.getAttribute('data-wpconvert-flex-carousel-per-view') || '', 10);
    return raw > 0 ? raw : 0;
  }
  function sectionHasArrowButtons(section) {
    if (!section) return false;
    var buttons = section.querySelectorAll('button');
    for (var i = 0; i < buttons.length; i++) {
      var al = (buttons[i].getAttribute('aria-label') || '').toLowerCase();
      var cls = buttons[i].className || '';
      if (/prev|previous/.test(al) || al === 'next' || /\bprev\b|\bnext\b/i.test(cls)) return true;
    }
    return false;
  }
  function logicalTotal(section, slideCount) {
    var enc = section && section.getAttribute('data-wpconvert-testimonials');
    if (enc) {
      try {
        var json = JSON.parse(decodeURIComponent(escape(atob(enc))));
        if (Array.isArray(json) && json.length > 0) return json.length;
      } catch (e) {
        try {
          var json2 = JSON.parse(atob(enc));
          if (Array.isArray(json2) && json2.length > 0) return json2.length;
        } catch (e2) { /* fall through */ }
      }
    }
    return slideCount;
  }
  document.querySelectorAll('[data-wpconvert-flex-carousel="viewport"]').forEach(function(viewport) {
    if (viewport.dataset.wpcFlexAutoInit) return;
    var section = viewport.closest('section');
    if (sectionHasArrowButtons(section)) return;
    var track = viewport.querySelector('[data-wpconvert-flex-carousel="track"]');
    if (!track) return;
    var slides = track.children;
    if (slides.length < 2) return;
    viewport.dataset.wpcFlexAutoInit = '1';
    if (section) section.dataset.wpcFlexAutoInit = '1';
    console.log('[EC-CAROUSEL-032] Auto-advance flex carousel: ' + slides.length + ' slides');
    var index = 0;
    var animate = true;
    var total = logicalTotal(section, slides.length);
    var maxPerView = recordedPerView(viewport);
    function applyLayout() {
      var pv = perViewForWidth(window.innerWidth, maxPerView);
      for (var i = 0; i < slides.length; i++) {
        slides[i].style.width = (100 / pv) + '%';
        slides[i].style.flexShrink = '0';
        slides[i].style.display = '';
      }
      track.style.display = 'flex';
      track.style.flexWrap = 'nowrap';
      if (viewport.style.overflow !== 'hidden') viewport.style.overflow = 'hidden';
      return pv;
    }
    function go(pv) {
      track.style.transition = animate ? 'transform 0.7s ease' : 'none';
      track.style.transform = 'translateX(-' + (index * (100 / pv)) + '%)';
    }
    var pv = applyLayout();
    go(pv);
    window.addEventListener('resize', function() {
      pv = applyLayout();
      go(pv);
    });
    setInterval(function() {
      index += 1;
      animate = true;
      pv = perViewForWidth(window.innerWidth, maxPerView);
      go(pv);
      if (index >= total) {
        setTimeout(function() {
          animate = false;
          index = 0;
          go(pv);
          setTimeout(function() { animate = true; }, 50);
        }, 700);
      }
    }, 4000);
  });
})();
            } catch(e) { console.warn("[WPConvert] Flex carousel auto-advance error:", e); }

            try { // EC-POPUP-016: site overlays trapped in the content stacking context
            (function () {
  var CHROME_Z = 1000;
  var Z_BASE = 1000000;
  var MAX_SRC_Z = 9999;
  var HANDLED = 'data-wpc-overlay-portal';
  var MOVED = 'data-wpc-overlay-portaled';

  function isZero(v) { return v === '0px' || v === '0%' || v === '0'; }

  // A modal covers the viewport: all four insets pinned, or pinned at the origin
  // and sized to 100%. Read from computed style, which resolves even while the
  // element is display:none.
  function coversViewport(cs) {
    if (isZero(cs.top) && isZero(cs.left) && isZero(cs.right) && isZero(cs.bottom)) return true;
    if (!isZero(cs.top) || !isZero(cs.left)) return false;
    var w = cs.width, h = cs.height;
    var wideEnough = w === '100%' || w === '100vw' || parseFloat(w) >= window.innerWidth - 1;
    var tallEnough = h === '100%' || h === '100vh' || parseFloat(h) >= window.innerHeight - 1;
    return !!(wideEnough && tallEnough);
  }

  function isHidden(el, cs) {
    if (el.hasAttribute('hidden')) return true;
    if (el.getAttribute('aria-hidden') === 'true') return true;
    if (cs.display === 'none') return true;
    if (cs.visibility === 'hidden' || cs.visibility === 'collapse') return true;
    if (parseFloat(cs.opacity) === 0) return true;
    return false;
  }

  // The nearest ancestor that either creates a stacking context or becomes the
  // containing block for position:fixed. Either one traps the overlay.
  function trappingAncestor(el) {
    var p = el.parentElement;
    while (p && p !== document.body && p !== document.documentElement) {
      var cs = window.getComputedStyle(p);
      if (cs.transform !== 'none') return p;
      if (cs.perspective && cs.perspective !== 'none') return p;
      if (cs.filter && cs.filter !== 'none') return p;
      if (cs.backdropFilter && cs.backdropFilter !== 'none') return p;
      if (cs.isolation === 'isolate') return p;
      if (cs.contain && /paint|layout|strict|content/.test(cs.contain)) return p;
      if (cs.willChange && /transform|filter|perspective|opacity|z-index/.test(cs.willChange)) return p;
      if (parseFloat(cs.opacity) < 1) return p;
      if (cs.position !== 'static' && cs.zIndex !== 'auto') return p;
      p = p.parentElement;
    }
    return null;
  }

  var NON_RENDERED = /^(SCRIPT|STYLE|TEMPLATE|NOSCRIPT|LINK|META)$/;

  function rendersOnly(parent, child) {
    for (var n = parent.firstChild; n; n = n.nextSibling) {
      if (n === child) continue;
      if (n.nodeType === 3 && /\S/.test(n.nodeValue)) return false;
      if (n.nodeType === 1 && !NON_RENDERED.test(n.tagName)) return false;
    }
    return true;
  }

  // EC-POPUP-035: the wrappers that render nothing but the overlay belong to it.
  // Scripts find their popup through them (block.querySelector('.popup')), so the
  // outermost one moves, never stopping at or above the trap.
  function portalUnit(el, trap) {
    var unit = el;
    var p = el.parentElement;
    while (p && p !== trap && p !== document.body && !p.contains(trap) && rendersOnly(p, unit)) {
      unit = p;
      p = p.parentElement;
    }
    return unit;
  }

  // Candidate selectors come from the page's own CSS: any rule that positions
  // something fixed and either pins it to the viewport or gives it a real layer.
  // Cheaper and far more precise than walking every element in the document.
  function ruleIsCandidate(style) {
    if (!style || style.position !== 'fixed') return false;
    if (isZero(style.top) && isZero(style.left) && isZero(style.right) && isZero(style.bottom)) return true;
    return parseInt(style.zIndex, 10) > 0;
  }

  function collectSelectors(rules, out) {
    for (var i = 0; i < rules.length; i++) {
      var r = rules[i];
      if (r.cssRules && r.cssRules.length) collectSelectors(r.cssRules, out);
      if (!r.selectorText) continue;
      if (ruleIsCandidate(r.style)) out[r.selectorText] = true;
    }
  }

  function candidateElements() {
    var selectors = {};
    var sheets = document.styleSheets;
    for (var i = 0; i < sheets.length; i++) {
      var rules = null;
      try { rules = sheets[i].cssRules; } catch (e) { continue; } // cross-origin
      if (rules) { try { collectSelectors(rules, selectors); } catch (e) {} }
    }
    var found = [];
    var seen = [];
    function add(el) {
      if (!el || seen.indexOf(el) !== -1) return;
      seen.push(el);
      found.push(el);
    }
    for (var sel in selectors) {
      if (!Object.prototype.hasOwnProperty.call(selectors, sel)) continue;
      var matches = null;
      try { matches = document.querySelectorAll(sel); } catch (e) { continue; }
      for (var m = 0; m < matches.length; m++) add(matches[m]);
    }
    // Overlays styled with an inline style attribute never appear in a stylesheet.
    var inline = document.querySelectorAll('[style*="fixed"]');
    for (var n = 0; n < inline.length; n++) add(inline[n]);
    return found;
  }

  // Sites that inject their modal with JS leave two elements with the same id.
  // getElementById returns the first in document order, which is the baked copy
  // the script wired up, so the safe one to drop is a hidden clone sitting at
  // body level.
  function dropDuplicateIds(keep) {
    if (!keep.id) return;
    var clones;
    try { clones = document.querySelectorAll('[id="' + keep.id.replace(/["\\]/g, '\\$&') + '"]'); }
    catch (e) { return; }
    for (var i = 0; i < clones.length; i++) {
      var other = clones[i];
      if (other === keep) continue;
      if (other.parentElement !== document.body) continue;
      if (other.contains(keep) || keep.contains(other)) continue;
      if (!isHidden(other, window.getComputedStyle(other))) continue;
      other.parentNode.removeChild(other);
    }
  }

  function run() {
    var els = candidateElements();
    for (var i = 0; i < els.length; i++) {
      var el = els[i];
      if (!el || el === document.body || !el.parentElement) continue;
      // WPConvert's own overlays (popup form, editor chrome) manage their own layers.
      if (el.id && el.id.indexOf('wpconvert-') === 0) continue;

      if (el.hasAttribute(HANDLED)) { dropDuplicateIds(el); continue; }

      var cs = window.getComputedStyle(el);
      if (cs.position !== 'fixed') continue;
      var z = parseInt(cs.zIndex, 10);
      if (!(z > 0)) continue;
      if (!coversViewport(cs)) continue;
      // Visible at load means it is part of the design, not a modal.
      if (!isHidden(el, cs)) continue;

      var trap = trappingAncestor(el);
      if (trap) {
        el.setAttribute(MOVED, '');
        document.body.appendChild(portalUnit(el, trap));
        if (trappingAncestor(el)) document.body.appendChild(el);
      }
      if (z < CHROME_Z) {
        el.style.zIndex = String(Z_BASE + Math.min(z, MAX_SRC_Z));
      }
      el.setAttribute(HANDLED, '');
      dropDuplicateIds(el);
    }
  }

  function boot() {
    run();
    // The source script usually builds its copy in its own DOMContentLoaded
    // handler, which may run after this one.
    setTimeout(run, 0);
    window.addEventListener('load', run);
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', boot);
  } else {
    boot();
  }
})();
            } catch(e) { console.warn("[WPConvert] Overlay portal error:", e); }

            try { // [WPConvert: Tabs Component]
            // WPConvert Tabs Component
            // Handles tabbed content sections converted from React components
            document.querySelectorAll('.wpconvert-tabs').forEach(function(container) {
                var tabCount = parseInt(container.dataset.tabCount) || 0;
                var currentTab = 0;
                
                var buttons = container.querySelectorAll('.wpconvert-tab-btn');
                var panels = container.querySelectorAll('.wpconvert-tab-panel');
                var dots = container.querySelectorAll('.wpconvert-tab-dot');
                var prevBtn = container.querySelector('.wpconvert-tab-prev');
                var nextBtn = container.querySelector('.wpconvert-tab-next');
                
                function showTab(index) {
                    if (index < 0) index = tabCount - 1;
                    if (index >= tabCount) index = 0;
                    currentTab = index;
                    
                    buttons.forEach(function(btn, i) {
                        btn.classList.toggle('active', i === index);
                        btn.setAttribute('aria-selected', i === index ? 'true' : 'false');
                    });
                    
                    panels.forEach(function(panel, i) {
                        panel.classList.toggle('active', i === index);
                        panel.hidden = i !== index;
                    });
                    
                    dots.forEach(function(dot, i) {
                        dot.classList.toggle('active', i === index);
                    });
                }
                
                buttons.forEach(function(btn, i) {
                    btn.addEventListener('click', function() { showTab(i); });
                });
                
                dots.forEach(function(dot, i) {
                    dot.addEventListener('click', function() { showTab(i); });
                });
                
                if (prevBtn) {
                    prevBtn.addEventListener('click', function() { showTab(currentTab - 1); });
                }
                
                if (nextBtn) {
                    nextBtn.addEventListener('click', function() { showTab(currentTab + 1); });
                }
                
                // Auto-rotate every 5 seconds
                var autoPlay = setInterval(function() {
                    showTab(currentTab + 1);
                }, 5000);
                
                // Pause on hover
                container.addEventListener('mouseenter', function() {
                    clearInterval(autoPlay);
                });
                
                container.addEventListener('mouseleave', function() {
                    autoPlay = setInterval(function() {
                        showTab(currentTab + 1);
                    }, 5000);
                });
            });
            } catch(e) { console.warn("[WPConvert] Tabs component error:", e); }

            try { // [WPConvert: Multi-Step Form]
            
/* EC-MSTEP-002f: Multi-step form — preserve original design.
   Wires up the original Continue/Back buttons and adds selection toggle. */
(function() {
  var MSTEP_NEXT_LABEL = new RegExp("^(continue|next|next step|proceed|get started|seuraava|jatka|nästa|naesta|weiter|suivant|siguiente)$", 'i');
  var MSTEP_PREV_LABEL = new RegExp("^\\s*(?:[←⟵◀◄‹«<]\\s*)?(previous|back|prev|go back|edellinen|takaisin|tillbaka|föregående|zurück|précédent|anterior)(?:\\s+(question|step|page|slide|section|kysymys|vaihe|steg|fråga|schritt|frage|étape|paso|pregunta))?\\s*$", 'i');
  /* Wording that finishes a form rather than moving through it. It advances
     only while there is a step left to advance to — see wireAdvance. */
  var MSTEP_SEND_LABEL = /^(submit|send|send\s+.*request|finish|done)/i;

  /* EC-MSTEP-011: a wired control must not keep rendering as disabled. Tailwind
     spells that a dozen ways (disabled:opacity-40, disabled:opacity-50,
     disabled:cursor-not-allowed), so drop the variant rather than a guess. */
  function mstepEnable(btn) {
    btn.removeAttribute('disabled');
    btn.style.opacity = '1';
    btn.style.pointerEvents = 'auto';
    Array.prototype.slice.call(btn.classList).forEach(function(cls) {
      if (cls.indexOf('disabled:') === 0) btn.classList.remove(cls);
    });
  }

  /* EC-MSTEP-026: a chosen option must reach the inbox, not just the eye. */
  var WPC_STEP_COUNTER = new RegExp("(?:step|question|part|stage|screen|vaihe|kysymys|steg|fr\\u00e5ga|fraga|frage|schritt|\\u00e9tape|etape|pregunta|paso|domanda|passo|vraag|stap)\\s*(\\d+)\\s*(?:of|\\/|von|av|sur|de|di|van|\\u2044)\\s*(\\d+)", 'i');

  /* An element's text as a person reads it: a space where the markup breaks, so
     a two-line card reads "Umzugsreinigung Mit Abnahmegarantie" and not
     "UmzugsreinigungMit Abnahmegarantie". */
  function wpcAnswerText(el) {
    var out = '';
    (function walk(node) {
      for (var c = node.firstChild; c; c = c.nextSibling) {
        if (c.nodeType === 3) out += c.nodeValue;
        else if (c.nodeType === 1) { walk(c); out += ' '; }
      }
    })(el);
    return out.replace(/\s+/g, ' ').trim();
  }

  function wpcAnswerSlug(s) {
    var fold = { 'ä': 'ae', 'ö': 'oe', 'ü': 'ue', 'ß': 'ss', 'é': 'e', 'è': 'e', 'à': 'a', 'á': 'a', 'ó': 'o', 'ú': 'u', 'ñ': 'n', 'ç': 'c', '²': '2', '³': '3' };
    return String(s || '').toLowerCase()
      .replace(/[äöüßéèàáóúñç²³]/g, function(c) { return fold[c] || c; })
      .replace(/[^a-z0-9]+/g, '_').replace(/^_+|_+$/g, '').slice(0, 40).replace(/_+$/, '');
  }

  /* The question a group of options answers: the nearest caption above it. A
     step counter is not a caption — it describes the wizard, not the question —
     so it is skipped by the same vocabulary the capture uses to find one. */
  function wpcAnswerLabel(group) {
    /* Never outside the form: the chrome above it — a step indicator, a heading
       for the whole card — describes the wizard, not this one question. */
    var bound = group.closest ? group.closest('form') : null;
    var node = group;
    for (var up = 0; node && node !== bound && up < 3; up++) {
      for (var sib = node.previousElementSibling; sib; sib = sib.previousElementSibling) {
        if (sib.querySelector('input, select, textarea, button')) continue;
        var t = wpcAnswerText(sib);
        if (!t || t.length > 60) continue;
        if (WPC_STEP_COUNTER.test(t)) continue;
        return t;
      }
      node = node.parentElement;
    }
    return '';
  }

  /* The hidden field behind a group, made on first use and reused after that.
     The hint is what the step indicator calls this step — "Leistung", "Termin" —
     used when the question itself has no caption because the source put it
     somewhere the form cannot see, such as a mascot's speech bubble. */
  function wpcAnswerField(group, btns, hint) {
    if (group._wpcAnswerField) return group._wpcAnswerField;
    var form = group.closest ? group.closest('form') : null;
    if (!form) return null;  /* nowhere to submit to */
    var taken = {};
    Array.prototype.forEach.call(form.querySelectorAll('[name]'), function(el) {
      taken[el.getAttribute('name')] = true;
    });
    form._wpcAnswerCount = (form._wpcAnswerCount || 0) + 1;
    var caption = wpcAnswerLabel(group) || hint || '';
    var base = wpcAnswerSlug(wpcAnswerLabel(group)) ||
      wpcAnswerSlug(hint) ||
      ('answer_' + form._wpcAnswerCount);
    var name = base;
    for (var n = 2; taken[name]; n++) name = base + '_' + n;
    var field = document.createElement('input');
    field.type = 'hidden';
    field.setAttribute('name', name);
    /* EC-FORMS-012: the question this answers, kept where a reader can find it.
       Nothing in the browser uses it — a hidden input submits its name and its
       value and nothing else — but the build-time probe that tells forms.json
       about these fields would otherwise have to work the caption out a second
       time, and a second derivation is how the names drift apart. */
    field.setAttribute('data-wpc-answer', caption);
    form.appendChild(field);
    group._wpcAnswerField = field;
    return field;
  }

  /* Write the current selection. Chosen-and-then-unchosen is an empty string,
     which is a different fact from never having been asked. */
  function wpcRecordAnswer(group, btns, hint) {
    var field = wpcAnswerField(group, btns, hint);
    if (!field) return;
    var chosen = [];
    btns.forEach(function(b) {
      if (b.hasAttribute('data-selected')) chosen.push(wpcAnswerText(b));
    });
    field.value = chosen.join(', ');
  }


  function initMultiStepForms() {
  document.querySelectorAll('.wpconvert-multistep-form').forEach(function(form) {
    var steps = Array.from(form.querySelectorAll('[data-wpc-form-step]'));
    if (steps.length < 2) return;
    var current = 0;

    /* EC-QUIZ-001: a scored quiz's result panel, and the band table the injector
       sent with it. Null for every other wizard, which is what makes all of the
       quiz code below a no-op everywhere else. */
    var quizPanel = form.querySelector('[data-wpc-quiz-outcome]');
    var quizData = null;
    var quizAnswers = [];
    if (quizPanel) {
      var quizHolder = quizPanel.querySelector('script[data-wpc-quiz-data]');
      try { quizData = quizHolder ? JSON.parse(quizHolder.textContent) : null; } catch (e) { quizData = null; }
    }

    /* EC-MSTEP-025: the row of step pills above the form — Leistung · Grösse ·
       Extras · … — is a sibling of the form, not part of it, so swapping panels
       cannot reach it and it shipped frozen on whichever step the capture caught.
       Found once, moved on every showStep.

       A row qualifies only if it is outside the form but inside the card, has
       exactly one child per step, contains no links (a navigation bar is not a
       progress strip), and has its FIRST child wearing a class the others do not
       share. That last one is the real test: a row of identical children is a
       list, a row where exactly one differs is showing state — and a page
       captured at step 1 can only be showing state on its first item.

       The design's own two class strings are reused verbatim. The original also
       gives ANSWERED steps a third look, but that state is not in a step-1
       capture, so it is not knowable here and is not guessed at. */
    var stepMarks = (function() {
      var card = form.parentElement;
      for (var hops = 0; card && hops < 4; hops++, card = card.parentElement) {
        /* Never past the card into the page at large. A few hops from a shallow
           form reach BODY, and from there a six-item stats band or footer
           column set could match every test below and start rearranging itself
           whenever somebody answered a question. */
        var stop = card.tagName;
        if (stop === 'BODY' || stop === 'HTML' || stop === 'MAIN') break;
        var rows = card.querySelectorAll('*');
        for (var i = 0; i < rows.length; i++) {
          var row = rows[i];
          if (form.contains(row) || row.contains(form)) continue;
          var kids = Array.prototype.slice.call(row.children);
          if (kids.length !== steps.length) continue;
          if (row.querySelector('a[href]')) continue;
          /* A step pill is a label, not a card and not a control: nothing to
             click, and a word or two of text. Content rows fail both. */
          if (row.querySelector('input, select, textarea, button')) continue;
          var pillish = kids.every(function(k) {
            return typeof k.className === 'string' &&
              (k.textContent || '').trim().length <= 40;
          });
          if (!pillish) continue;
          var activeCls = kids[0].className;
          var idleCls = kids[1].className;
          if (!activeCls || activeCls === idleCls) continue;
          var restAgree = kids.slice(1).every(function(k) { return k.className === idleCls; });
          if (!restAgree) continue;
          return { kids: kids, active: activeCls, idle: idleCls };
        }
      }
      return null;
    })();

    function markStep(n) {
      if (!stepMarks) return;
      stepMarks.kids.forEach(function(kid, i) {
        kid.className = i === n ? stepMarks.active : stepMarks.idle;
      });
    }

    function showStep(n) {
      if (n < 0 || n >= steps.length) return;
      current = n;
      steps.forEach(function(s, i) { s.style.display = i === current ? '' : 'none'; });
      markStep(current);  /* EC-MSTEP-025 */
      /* EC-ASSESS-001: hide any validation chrome left in captured step HTML */
      steps.forEach(function(s) {
        s.querySelectorAll('[role="alert"], [id$="-error"]').forEach(function(el) { el.remove(); });
        s.querySelectorAll('[aria-invalid="true"]').forEach(function(el) { el.setAttribute('aria-invalid', 'false'); });
      });
      /* EC-MSTEP-009: the review screen summarises the visitor's answers, so it
         is filled on every visit — an answer changed after an edit must show. */
      if (steps[current].hasAttribute('data-wpc-review')) fillReview(steps[current]);
      /* EC-QUIZ-001: the result is computed on arrival, every time — a visitor
         who goes back and changes an answer must get the new score. */
      if (quizData && steps[current] === quizPanel) renderQuizOutcome();
      wireButtons();
    }

    /* ---- EC-QUIZ-001: the scored result ------------------------------- */

    function quizFieldValue(band, key) {
      if (!band || !band.fields) return null;
      for (var i = 0; i < band.fields.length; i++) {
        if (band.fields[i].key === key) return band.fields[i].value;
      }
      return null;
    }

    /* The band a total falls into, by the source's own thresholds. */
    function quizBandIndex(total) {
      var bands = quizData.bands || [];
      for (var i = 0; i < bands.length; i++) {
        if (bands[i].min === null || bands[i].min === undefined) return i;
        if (bands[i].op === '>' ? total > bands[i].min : total >= bands[i].min) return i;
      }
      return bands.length - 1;
    }

    function renderQuizOutcome() {
      var total = 0;
      quizAnswers.forEach(function(score) { total += (score || 0); });
      total = Math.round(total * 1000) / 1000;
      var index = quizBandIndex(total);
      var band = (quizData.bands || [])[index];
      if (!band) return;

      quizPanel.querySelectorAll('[data-wpc-quiz-total]').forEach(function(node) {
        var template = node.getAttribute('data-wpc-quiz-total') || '{score}';
        node.textContent = template.split('{score}').join(String(total)).split('{max}').join(String(quizData.max));
      });
      quizPanel.querySelectorAll('[data-wpc-quiz-field]').forEach(function(node) {
        var value = quizFieldValue(band, node.getAttribute('data-wpc-quiz-field'));
        if (value !== null) node.textContent = value;
      });

      /* The tokens to take off are the ones the element is WEARING: the captured
         band's on the first render, and whatever the last render left after that.
         Without this a second, better result would keep the first one's red. */
      var wearing = quizPanel._wpcQuizBand;
      if (wearing === undefined || wearing === null) wearing = quizData.capturedBandIndex;
      quizPanel.querySelectorAll('[data-wpc-quiz-class]').forEach(function(node) {
        var key = node.getAttribute('data-wpc-quiz-class');
        var off = quizFieldValue((quizData.bands || [])[wearing], key);
        var on = quizFieldValue(band, key);
        if (off) off.split(/\s+/).forEach(function(token) { if (token) node.classList.remove(token); });
        if (on) on.split(/\s+/).forEach(function(token) { if (token) node.classList.add(token); });
      });
      quizPanel._wpcQuizBand = index;
    }

    /* The quiz's own "Retake" control: back to question 1 with the answers
       forgotten, which is what the React component's reset did. */
    function wireQuizRetake() {
      if (!quizPanel) return;
      quizPanel.querySelectorAll('[data-wpc-quiz-retake]').forEach(function(btn) {
        if (btn._wpcQuizRetakeBound) return;
        btn._wpcQuizRetakeBound = true;
        btn.addEventListener('click', function(e) {
          e.preventDefault();
          quizAnswers = [];
          showStep(0);
        });
        mstepEnable(btn);
      });
    }

    /* ---- EC-MSTEP-009: the review screen ------------------------------ */

    var REVIEW_UNWIRED_NOTICE = {
      en: 'This form is not connected yet, so nothing was sent. Please contact us directly.',
      fi: 'Lomaketta ei ole vielä kytketty, joten mitään ei lähetetty. Ota yhteyttä suoraan.',
      sv: 'Formuläret är inte anslutet än, så inget skickades. Kontakta oss direkt.',
      de: 'Dieses Formular ist noch nicht verbunden, es wurde nichts gesendet. Bitte kontaktieren Sie uns direkt.',
      nl: 'Dit formulier is nog niet verbonden, er is niets verzonden. Neem direct contact met ons op.',
      fr: 'Ce formulaire n\'est pas encore connecté, rien n\'a été envoyé. Contactez-nous directement.',
      es: 'Este formulario aún no está conectado, no se envió nada. Contáctenos directamente.'
    };

    function reviewNoticeText() {
      var lang = (document.documentElement.getAttribute('lang') || 'en').slice(0, 2).toLowerCase();
      return REVIEW_UNWIRED_NOTICE[lang] || REVIEW_UNWIRED_NOTICE.en;
    }

    function cssEscape(value) {
      if (window.CSS && CSS.escape) return CSS.escape(value);
      return String(value).replace(/["\\]/g, '\\$&');
    }

    function controlsNamed(field) {
      if (!field) return [];
      try {
        return Array.prototype.slice.call(form.querySelectorAll('[name="' + cssEscape(field) + '"]'));
      } catch (e) { return []; }
    }

    /* The words the visitor read next to a control, not its stored value. */
    function visibleLabel(el) {
      var texts = [];
      var nodes = [];
      if (el.id) {
        var forLabel = document.querySelector('label[for="' + cssEscape(el.id) + '"]');
        if (forLabel) nodes.push(forLabel);
      }
      var own = el.closest('label');
      if (own && nodes.indexOf(own) === -1) nodes.push(own);
      nodes.forEach(function(node) {
        var text = (node.textContent || '').replace(/\s+/g, ' ').trim();
        if (text && texts.indexOf(text) === -1) texts.push(text);
      });
      if (!texts.length && el.getAttribute('aria-label')) texts.push(el.getAttribute('aria-label'));
      return texts.join(' ').trim();
    }

    function answerFor(field) {
      var controls = controlsNamed(field);
      if (!controls.length) return '';
      var first = controls[0];
      var type = (first.getAttribute('type') || '').toLowerCase();
      if (type === 'radio' || type === 'checkbox') {
        return controls.filter(function(c) { return c.checked; })
          .map(function(c) { return visibleLabel(c) || c.value; })
          .filter(Boolean).join(', ');
      }
      if (first.tagName === 'SELECT') {
        var option = first.options[first.selectedIndex];
        if (!option || !option.value) return '';
        return (option.textContent || '').replace(/\s+/g, ' ').trim();
      }
      return (first.value || '').replace(/\s+/g, ' ').trim();
    }

    /* The block that holds one summary row: the smallest ancestor carrying both
       the value and its edit control, so hiding it hides the whole row. */
    function rowOf(slot) {
      var field = slot.getAttribute('data-wpc-review-value');
      for (var node = slot.parentElement; node && node !== form; node = node.parentElement) {
        if (field && node.querySelector('[data-wpc-review-edit="' + cssEscape(field) + '"]')) return node;
      }
      return slot.parentElement || slot;
    }

    function stepOwning(field) {
      for (var i = 0; i < steps.length; i++) {
        try {
          if (steps[i].querySelector('[name="' + cssEscape(field) + '"]')) return i;
        } catch (e) { /* keep looking */ }
      }
      return 0;
    }

    function fillReview(panel) {
      panel.querySelectorAll('[data-wpc-review-value]').forEach(function(slot) {
        var field = slot.getAttribute('data-wpc-review-value');
        var answer = field ? answerFor(field) : '';
        slot.textContent = answer;
        /* An empty row reads as a broken summary; the visitor left it blank. */
        var row = rowOf(slot);
        if (row) row.style.display = answer ? '' : 'none';
      });
      panel.querySelectorAll('[data-wpc-review-edit]').forEach(function(btn) {
        if (btn.getAttribute('data-wpc-mstep-nav') === '1') return;
        btn.setAttribute('data-wpc-mstep-nav', '1');
        btn.addEventListener('click', function(e) {
          e.preventDefault();
          showStep(stepOwning(btn.getAttribute('data-wpc-review-edit')));
        });
      });
      var submit = panel.querySelector('[data-wpc-review-submit]');
      if (submit && submit.getAttribute('data-wpc-review-bound') !== '1') {
        submit.setAttribute('data-wpc-review-bound', '1');
        submit.addEventListener('click', function(e) {
          e.preventDefault();
          var owner = submit.closest('form');
          if (owner) {
            /* A wired form is carried by the plugin's bridge, which listens for
               exactly this event. An unwired one is stopped by the EC-FORM-003
               safety net — silently, which is the dead end the visitor felt. */
            owner.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
            if (owner.getAttribute('data-wpconvert-form') !== 'needs-wiring') return;
          }
          var status = panel.querySelector('[data-wpc-review-status]');
          if (!status) {
            status = document.createElement('p');
            status.setAttribute('data-wpc-review-status', '1');
            status.setAttribute('role', 'status');
            status.style.cssText = 'margin-top:12px;font-size:14px;';
            submit.parentNode.insertBefore(status, submit.nextSibling);
          }
          status.textContent = reviewNoticeText();
          if (window.console && console.warn) {
            console.warn('[WPConvert] Review submit: this form still needs wiring (install the wpconvert-forms plugin).');
          }
        });
      }
    }

    function wireButtons() {
      var step = steps[current];
      var allBtns = Array.from(step.querySelectorAll('button'));
      allBtns.forEach(function(btn) {
        var t = (btn.textContent || '').trim().toLowerCase();
        /* EC-MSTEP-002g: Scope grid check to step element only.
           .closest() traverses the entire DOM — if the form sits inside a
           CSS-grid page layout (e.g. "grid lg:grid-cols-3"), Continue/Back
           buttons incorrectly appear "in a grid" and never get wired. */
        var gridAnc = btn.closest('[class*="grid"]');
        var inGrid = gridAnc && step.contains(gridAnc);
        /* Wire Continue/Next buttons (not in selection grids). A label that
           finishes the form is only navigation while a step remains: on the
           last step it belongs to the form, and EC-MSTEP-011 leaves it there. */
        var advances = MSTEP_NEXT_LABEL.test(t) || (MSTEP_SEND_LABEL.test(t) && current < steps.length - 1);
        if (!inGrid && advances && !MSTEP_PREV_LABEL.test(t) && t.length < 50) {
          btn.onclick = function(e) {
            if (current >= steps.length - 1) return;
            e.preventDefault();
            showStep(current + 1);
          };
          /* EC-EDIT-005b: mark the button as wizard navigation so the WPConvert
             editor's click intercept lets it through in edit mode. Only buttons
             we actually wired are stamped, so no editable label is lost. */
          btn.setAttribute('data-wpc-mstep-nav', '1');
          /* EC-MSTEP-013e: and say which DIRECTION it goes, because "does this
             step already have a control that moves it on?" is a different
             question from "is this button wizard navigation?". */
          btn.setAttribute('data-wpc-mstep-advance', '1');
          mstepEnable(btn);
        }
        /* Wire Back/Previous buttons */
        if (!inGrid && MSTEP_PREV_LABEL.test(t)) {
          btn.onclick = function(e) {
            e.preventDefault();
            if (current > 0) showStep(current - 1);
          };
          btn.setAttribute('data-wpc-mstep-nav', '1');
        }
      });
      /* EC-MSTEP-022: the control the whole form exists for. React rendered the
         last step's submit disabled — nothing was filled in at capture time —
         and the state that used to enable it is gone, so it stays grey forever
         and the visitor reaches the end of six steps to find a dead button.
         The loop above deliberately does not treat it as navigation, which is
         right, but it meant mstepEnable never reached it. Only the last step,
         only a control that arrived disabled; the browser's own validation
         still guards the submit, because the stepped form restores each
         field's required attribute as its step becomes active. */
      if (current === steps.length - 1) {
        allBtns.forEach(function(btn) {
          if (!btn.disabled) return;
          var t = (btn.textContent || '').trim().toLowerCase();
          if (btn.type !== 'submit' && !MSTEP_SEND_LABEL.test(t)) return;
          if (MSTEP_PREV_LABEL.test(t)) return;
          mstepEnable(btn);
        });
      }
      wireAdvanceByPosition(step);
      wireSelections(step);
      wireAnswerAdvance(step);
    }

    /* EC-MSTEP-013: a quiz has no Next button — choosing an ANSWER advances it.
       The customer's "1-Minute Business IT Health Check" is four questions of
       four answers with no navigation at all, and its answers live in a
       space-y list rather than a grid, so neither wireAdvanceByPosition (which
       skips grid/flex-wrap children and caps the label at 60 chars) nor
       wireSelections (which only walks grids, and only marks a selection) ever
       gave them a handler. The visitor clicked an answer and nothing happened.

       Gated on the step having NO navigation control of its own, so any wizard
       whose Continue button was wired above is untouched. */
    /* The answers to ONE question, as a group, or null when the step has no such
       row. Shared by wireAdvanceByPosition and wireAnswerAdvance so the two
       cannot disagree about what an answer is: without this, the positional
       guess below claimed the LAST answer as the advance control, and only that
       one answer moved the wizard on. */
    function findAnswerGroup(step) {
      if (step.hasAttribute('data-wpc-review')) return null;
      /* EC-QUIZ-001: nor is a result screen's "Claim your audit"/"Retake" pair a
         question's answers. */
      if (step.hasAttribute('data-wpc-quiz-outcome')) return null;

      var buttons = Array.prototype.slice.call(step.querySelectorAll('button'));
      var answers = buttons.filter(function(b) {
        var t = (b.textContent || '').replace(/\s+/g, ' ').trim();
        if (!t || t.length > 240) return false;
        if (MSTEP_PREV_LABEL.test(t) || MSTEP_NEXT_LABEL.test(t) || MSTEP_SEND_LABEL.test(t)) return false;
        if (/^\d+$/.test(t)) return false;
        /* The ATTRIBUTE, not the property: button.type reads "submit" for every
           typeless <button>, which is how the captured answers are marked up, so
           testing the property rejected all of them and wired nothing. */
        var typeAttr = (b.getAttribute('type') || '').toLowerCase();
        if (typeAttr === 'submit' || typeAttr === 'reset') return false;
        return true;
      });
      if (answers.length < 2) return null;

      /* All the answers to ONE question share a container, so a stray CTA
         elsewhere in the card cannot join the group. Answers sit either directly
         in the list or each wrapped in an <li>, hence both depths. */
      var group = null;
      for (var depth = 1; depth <= 2; depth++) {
        var byContainer = new Map();
        answers.forEach(function(b) {
          var p = b;
          for (var i = 0; i < depth && p; i++) p = p.parentElement;
          if (!p) return;
          if (!byContainer.has(p)) byContainer.set(p, []);
          byContainer.get(p).push(b);
        });
        byContainer.forEach(function(list) {
          if (list.length >= 2 && (!group || list.length > group.length)) group = list;
        });
      }
      return group;
    }

    function wireAnswerAdvance(step) {
      if (current >= steps.length - 1) return;
      /* A wizard with its own Continue/Review control keeps it: that button was
         wired above and marked, so the answers stay inert selections.

         EC-MSTEP-013e: the test is for a control that ADVANCES. It used to be for
         any wizard navigation at all, and a Back button is wizard navigation — so
         once "← Previous Question" was recognised, every question after the first
         had a marker in it and its answers were left inert. The reported health
         check moved from question 1 to question 2 and died there. */
      if (step.querySelector('[data-wpc-mstep-advance]')) return;

      var group = findAnswerGroup(step);
      if (!group) return;

      group.forEach(function(btn) {
        if (btn._wpcAnswerBound) return;
        btn._wpcAnswerBound = true;
        btn.style.cursor = 'pointer';
        /* EC-EDIT-005b: same contract as the other wizard controls, so the
           editor's click intercept lets these through in edit mode. */
        btn.setAttribute('data-wpc-mstep-nav', '1');
        btn.setAttribute('data-wpc-mstep-advance', '1');
        btn.addEventListener('click', function(e) {
          e.preventDefault();
          /* EC-QUIZ-001: remember what this answer was worth before moving on.
             Keyed by step, so going back and choosing again REPLACES the score
             rather than adding a second one. */
          if (btn.hasAttribute('data-wpc-quiz-answer')) {
            quizAnswers[current] = parseFloat(btn.getAttribute('data-wpc-quiz-answer')) || 0;
          }
          if (current < steps.length - 1) showStep(current + 1);
        });
        mstepEnable(btn);
      });
    }

    /* EC-MSTEP-009: the advance control is not always called "Next".
       The last step of the customer's assessment says "Review details"
       ("Tarkista tiedot" / "Granska uppgifterna"), matched no label pattern, and
       so was left with no handler at all: the visitor filled in four steps and
       the final button did nothing. Position identifies it regardless of
       wording — the control beside Previous in the same action row, exactly as
       the crawler finds it (lib/render/mstep-capture.js). */
    function wireAdvanceByPosition(step) {
      if (step.hasAttribute('data-wpc-review')) return;
      var buttons = Array.prototype.slice.call(step.querySelectorAll('button'));
      if (current >= steps.length - 1) return;
      /* EC-MSTEP-013: an answer is never the advance control. Where the answers
         ARE the advance (no Continue at all) wireAnswerAdvance binds every one of
         them; picking the last one here would have left A, B and C dead. */
      var answerGroup = findAnswerGroup(step) || [];
      var eligible = buttons.filter(function(b) {
        if (answerGroup.indexOf(b) !== -1) return false;
        if (b.getAttribute('data-wpc-mstep-nav') === '1') return false;
        if (b.hasAttribute('data-wpc-review-submit') || b.hasAttribute('data-wpc-review-edit')) return false;
        var gridAnc = b.closest('[class*="grid"], [class*="flex-wrap"]');
        if (gridAnc && step.contains(gridAnc)) return false;
        var label = (b.textContent || '').trim();
        /* EC-MSTEP-011: the retreat control is never the advance control, in
           any language — a positional guess got this wrong on "Zurück". */
        if (MSTEP_PREV_LABEL.test(label)) return false;
        if (b.type === 'submit') return false;
        return label.length > 0 && label.length < 60;
      });
      var back = buttons.filter(function(b) {
        return MSTEP_PREV_LABEL.test((b.textContent || '').trim());
      })[0];
      var candidate = null;
      if (back && back.parentElement) {
        var row = Array.prototype.slice.call(back.parentElement.querySelectorAll('button'))
          .filter(function(b) { return b !== back && eligible.indexOf(b) !== -1; });
        candidate = row[row.length - 1] || null;
      }
      if (!candidate) candidate = eligible[eligible.length - 1] || null;
      if (!candidate) return;
      candidate.onclick = function(e) {
        e.preventDefault();
        if (current < steps.length - 1) showStep(current + 1);
      };
      candidate.setAttribute('data-wpc-mstep-nav', '1');
      candidate.setAttribute('data-wpc-mstep-advance', '1');
      mstepEnable(candidate);
    }

    /* Selection toggle for card-style buttons (services, budget, timeline) */
    function wireSelections(step) {
      /* EC-MSTEP-020: a flex-wrap row counts too. The "Anzahl Zimmer" step on
         garantiert-sauber.ch lays its chips out with "flex flex-wrap gap-2" and
         got no handler here, so clicking a room chip left it looking untouched
         while the grid-laid steps either side of it worked. answerStep and
         wireAdvanceByPosition both already read both selectors; this was the
         only one in the family that did not. */
      var grids = step.querySelectorAll('[class*="grid"], [class*="flex-wrap"]');
      grids.forEach(function(grid) {
        var btns = Array.from(grid.querySelectorAll('button')).filter(function(b) {
          if (b.closest('[class*="grid"], [class*="flex-wrap"]') !== grid) return false;
          /* EC-MSTEP-020: which makes the wizard's own action row a candidate,
             and every option bound here calls preventDefault — so without this
             guard, widening the selector would swallow the click that advances
             the step. wireAdvanceByPosition runs first and stamps the real
             navigation, and the label test is the shared multilingual one,
             because the English list this replaces did not know "Weiter". */
          if (b.getAttribute('data-wpc-mstep-nav') === '1') return false;
          if (b.type === 'submit') return false;
          var label = (b.textContent || '').trim();
          if (MSTEP_NEXT_LABEL.test(label) || MSTEP_PREV_LABEL.test(label)) return false;
          var t = label.toLowerCase();
          return !/^(continue|next|previous|back|prev|submit|get started|send)/i.test(t) && t.length > 1 && t.length < 60;
        });
        if (btns.length < 2) return;
        var isMulti = btns.length > 4;
        /* Detect accent color from Continue button's inline style */
        var accentColor = '', accentBg = '';
        var continueBtn = Array.from(step.querySelectorAll('button')).find(function(b) {
          var t = (b.textContent || '').trim().toLowerCase();
          var gAnc = b.closest('[class*="grid"]');
          var bInGrid = gAnc && step.contains(gAnc);
          return /continue|next|send|submit/i.test(t) && !bInGrid && b.style.backgroundColor;
        });
        if (continueBtn) {
          accentColor = continueBtn.style.backgroundColor;
          accentBg = accentColor.replace('rgb(', 'rgba(').replace(')', ', 0.1)');
        }
        if (!accentColor) { accentColor = '#3b82f6'; accentBg = 'rgba(59,130,246,0.1)'; }
        /* Capture default styles from first button */
        var defBorder = btns[0] && btns[0].style.borderColor || '';
        var defBg = btns[0] && btns[0].style.backgroundColor || '';
        btns.forEach(function(btn) {
          if (btn._wpcBound) return;
          btn._wpcBound = true;
          btn.style.cursor = 'pointer';
          btn.addEventListener('click', function(e) {
            e.preventDefault();
            if (isMulti) {
              btn.toggleAttribute('data-selected');
            } else {
              btns.forEach(function(b) { b.removeAttribute('data-selected'); });
              btn.setAttribute('data-selected', '');
            }
            /* EC-MSTEP-026: the step indicator found for EC-MSTEP-025 knows what
               this step is called, which beats "answer_3" in a lead notification. */
            wpcRecordAnswer(grid, btns, stepMarks && stepMarks.kids[current]
              ? wpcAnswerText(stepMarks.kids[current]) : '');
            btns.forEach(function(b) {
              var sel = b.hasAttribute('data-selected');
              b.style.borderColor = sel ? accentColor : defBorder;
              b.style.backgroundColor = sel ? accentBg : defBg;
              /* EC-MSTEP-024: and NOT the text colour. accentBg is the accent at
                 ten percent, so a chosen chip is a soft tint over whatever the
                 card already was — white text on that is white on white, which
                 is how garantiert-sauber.ch's visitors lost sight of the answer
                 they had just picked. The design's own colour was readable on
                 that surface before the click and still is. injectSelectionToggleJS,
                 which does this same job when the wizard does not fire, never
                 touched the text colour either. */
            });
          });
        });
      });
    }

    wireQuizRetake();
    showStep(0);
  });
  }
  /* EC-MSTEP-002h: Run immediately if DOM is already loaded (e.g. inside jQuery.ready),
     otherwise wait for DOMContentLoaded. jQuery.ready fires after DOMContentLoaded,
     so adding a DOMContentLoaded listener inside it would silently never execute. */
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', initMultiStepForms);
  } else {
    initMultiStepForms();
  }
})();

            } catch(e) { console.warn("[WPConvert] Multi-step form error:", e); }

            try { // [WPConvert: Signature Canvas]
            
/* EC-CANVAS-002: Activate canvas drawing pads only with a strong positive signal.
   See generate.js > generateSignatureCanvasInitJS for the full rationale. */
(function(){
  var DECORATIVE_TOKEN = /(^|[-_\s])(hero|particle|particles|background|bg|webgl|three|chart|graph|noise|ripple|aurora|stars|matrix|fluid|wave|globe|sphere|mesh|shader|fbo|gl|canvas-bg|main-canvas)([-_\s]|$)/;
  function hasStrongPositiveSignal(canvas) {
    var id = (canvas.id || '').toLowerCase();
    var rawCls = canvas.className;
    var cls = (rawCls && typeof rawCls === 'string' ? rawCls : (rawCls && rawCls.baseVal) || '').toLowerCase();
    /* 1. explicit attribute */
    if (canvas.hasAttribute('data-signature') || canvas.hasAttribute('data-sig-pad')) return true;
    /* 2. id/class spells "signature", "sigpad", "sig-pad" */
    if (/sig(?:nature|pad|-pad)/.test(id) || /sig(?:nature|pad|-pad)/.test(cls)) return true;
    /* 3. <label for="canvasId"> with "signature" text */
    if (canvas.id) {
      try {
        var safeId = canvas.id.replace(/(["\\])/g, '\\$1');
        var lbl = canvas.ownerDocument.querySelector('label[for="' + safeId + '"]');
        if (lbl && /signature/i.test(lbl.textContent || '')) return true;
      } catch (e) { /* invalid selector — fall through */ }
    }
    /* 4. canvas inside form/multistep panel AND a label/legend/heading in that
          scope mentions "signature". We deliberately scope to the form so we
          do not match unrelated text elsewhere on the page (e.g. a footer
          newsletter "Sign up" or a pricing line "60% on signature"). */
    var formScope = canvas.closest('form, .wpconvert-step-panel, .wpconvert-multistep-form');
    if (formScope) {
      var labels = formScope.querySelectorAll('label, legend, h1, h2, h3, h4, h5, h6');
      for (var i = 0; i < labels.length; i++) {
        if (/signature/i.test(labels[i].textContent || '')) return true;
      }
    }
    return false;
  }

  document.querySelectorAll('canvas').forEach(function(canvas) {
    if (canvas.dataset.wpcSigInit) return;
    /* Strong negative: well-known decorative canvas ids/classes.
       Checked BEFORE positive signals — even inside a <form> a canvas
       named "hero-canvas" or "particle-canvas" must never become a
       signature pad. */
    var id = (canvas.id || '').toLowerCase();
    var rawCls = canvas.className;
    var cls = (rawCls && typeof rawCls === 'string' ? rawCls : (rawCls && rawCls.baseVal) || '').toLowerCase();
    if (DECORATIVE_TOKEN.test(id) || DECORATIVE_TOKEN.test(cls)) return;

    if (!hasStrongPositiveSignal(canvas)) return;

    canvas.dataset.wpcSigInit = 'true';
    canvas.width = canvas.offsetWidth || 600;
    canvas.height = canvas.offsetHeight || 150;
    canvas.style.touchAction = 'none';
    canvas.style.cursor = 'crosshair';
    var ctx = canvas.getContext && canvas.getContext('2d');
    if (!ctx) return;
    ctx.strokeStyle = '#1a1a1a';
    ctx.lineWidth = 2;
    ctx.lineCap = 'round';
    ctx.lineJoin = 'round';
    var drawing = false;
    function getPos(e) {
      var rect = canvas.getBoundingClientRect();
      var x = (e.touches ? e.touches[0].clientX : e.clientX) - rect.left;
      var y = (e.touches ? e.touches[0].clientY : e.clientY) - rect.top;
      return { x: x, y: y };
    }
    canvas.addEventListener('mousedown', function(e) { drawing = true; ctx.beginPath(); var p = getPos(e); ctx.moveTo(p.x, p.y); });
    canvas.addEventListener('mousemove', function(e) { if (!drawing) return; var p = getPos(e); ctx.lineTo(p.x, p.y); ctx.stroke(); });
    canvas.addEventListener('mouseup', function() { drawing = false; });
    canvas.addEventListener('mouseleave', function() { drawing = false; });
    canvas.addEventListener('touchstart', function(e) { e.preventDefault(); drawing = true; ctx.beginPath(); var p = getPos(e); ctx.moveTo(p.x, p.y); }, { passive: false });
    canvas.addEventListener('touchmove', function(e) { e.preventDefault(); if (!drawing) return; var p = getPos(e); ctx.lineTo(p.x, p.y); ctx.stroke(); }, { passive: false });
    canvas.addEventListener('touchend', function() { drawing = false; });
    /* Wire a "Clear" button next to the canvas if present. */
    var container = canvas.closest('div');
    if (container) {
      var clearBtn = container.querySelector('button');
      if (!clearBtn) clearBtn = container.parentElement ? container.parentElement.querySelector('button') : null;
      if (clearBtn && /clear/i.test(clearBtn.textContent || '')) {
        clearBtn.addEventListener('click', function(e) {
          e.preventDefault();
          ctx.clearRect(0, 0, canvas.width, canvas.height);
        });
      }
    }
    /* Persist signature data into a hidden input so the form submission
       includes the drawn image. */
    var hiddenInput = canvas.ownerDocument.createElement('input');
    hiddenInput.type = 'hidden';
    hiddenInput.name = 'signature_data';
    if (canvas.parentElement) canvas.parentElement.appendChild(hiddenInput);
    canvas.addEventListener('mouseup', function() { hiddenInput.value = canvas.toDataURL ? canvas.toDataURL() : ''; });
    canvas.addEventListener('touchend', function() { hiddenInput.value = canvas.toDataURL ? canvas.toDataURL() : ''; });
  });
})();

            } catch(e) { console.warn("[WPConvert] Signature canvas error:", e); }

            try { // [WPConvert: Calculator]
            
/* EC-CALC-001 / EC-CALC-002: Interactive calculator (native range + Radix role=slider) */
(function() {
  function formatValue(val, fmt) {
    if (typeof val === 'string') return val;
    var n = parseFloat(val);
    if (isNaN(n)) return String(val);
    switch (fmt) {
      case 'currency':
        return '$' + n.toLocaleString('en-US', {minimumFractionDigits: 0, maximumFractionDigits: 0});
      case 'decimal2':
        return n.toFixed(2);
      case 'percent':
        return n + '%';
      case 'months':
        return n + ' months';
      default:
        return n.toLocaleString('en-US');
    }
  }

  function wireNativeSlider(s, calcEl, config, state, recalc) {
    var sVar = s.getAttribute('data-wpc-calc-var');
    var inputKey = null;
    for (var k in config.inputs) {
      if (config.inputs[k].sliderVar === sVar) { inputKey = k; break; }
    }
    if (!inputKey) return;
    state[inputKey] = parseFloat(s.value) || 0;
    s.addEventListener('input', function() {
      state[inputKey] = parseFloat(s.value) || 0;
      var display = calcEl.querySelector('[data-wpc-calc-display="' + sVar + '"]');
      if (display && config.inputs[inputKey]) {
        var mult = config.inputs[inputKey].displayMultiplier || 1;
        display.textContent = formatValue(parseFloat(s.value) * mult, config.inputs[inputKey].displayFormat || config.inputs[inputKey].format);
      }
      recalc();
    });
  }

  function wireRadixSlider(sliderEl, calcEl, config, state, recalc) {
    var sVar = sliderEl.getAttribute('data-wpc-calc-var');
    var inputKey = null;
    for (var k in config.inputs) {
      if (config.inputs[k].sliderVar === sVar) { inputKey = k; break; }
    }
    if (!inputKey) return;
    var min = parseFloat(sliderEl.getAttribute('aria-valuemin')) || 0;
    var max = parseFloat(sliderEl.getAttribute('aria-valuemax')) || 100;
    var step = parseFloat(sliderEl.getAttribute('step')) || 1;
    // EC-CALC-002f: role="slider" also has data-orientation — closest() must not
    // stop on the thumb. The outer [dir=ltr] wrapper spans the full track width.
    var root = sliderEl.closest('[dir="ltr"]');
    if (!root && sliderEl.parentElement) root = sliderEl.parentElement.parentElement;
    var trackEl = root ? (root.querySelector('span.grow') || root.firstElementChild) : null;
    var rangeBar = trackEl ? trackEl.querySelector('span.absolute.h-full') : null;
    var thumbWrap = sliderEl.parentElement;

    function setVal(val) {
      val = Math.max(min, Math.min(max, val));
      if (step > 0) val = Math.round(val / step) * step;
      state[inputKey] = val;
      sliderEl.setAttribute('aria-valuenow', String(val));
      var pct = max > min ? ((val - min) / (max - min)) * 100 : 0;
      if (rangeBar) {
        rangeBar.style.left = '0%';
        rangeBar.style.right = (100 - pct) + '%';
      }
      if (thumbWrap) {
        thumbWrap.style.left = pct + '%';
        thumbWrap.style.transform = 'translateX(-50%)';
      }
      var display = calcEl.querySelector('[data-wpc-calc-display="' + sVar + '"]');
      if (display && config.inputs[inputKey]) {
        var mult = config.inputs[inputKey].displayMultiplier || 1;
        display.textContent = formatValue(val * mult, config.inputs[inputKey].displayFormat || config.inputs[inputKey].format);
      }
      recalc();
    }

    setVal(parseFloat(sliderEl.getAttribute('aria-valuenow')) || min);
    sliderEl.style.cursor = 'grab';
    sliderEl.style.touchAction = 'none';
    if (root) {
      root.style.cursor = 'pointer';
      root.style.touchAction = 'none';
    }
    var dragging = false;
    function onTrackPointer(e) {
      var measure = trackEl || root;
      if (!measure) return;
      var rect = measure.getBoundingClientRect();
      if (rect.width <= 0) return;
      var ratio = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
      setVal(min + ratio * (max - min));
    }
    sliderEl.addEventListener('pointerdown', function(e) {
      e.preventDefault();
      dragging = true;
      sliderEl.setPointerCapture(e.pointerId);
      sliderEl.style.cursor = 'grabbing';
      onTrackPointer(e);
    });
    if (root) {
      root.addEventListener('pointerdown', function(e) {
        if (e.target === sliderEl || sliderEl.contains(e.target)) return;
        e.preventDefault();
        dragging = true;
        root.setPointerCapture(e.pointerId);
        onTrackPointer(e);
      });
    }
    sliderEl.addEventListener('pointermove', function(e) {
      if (!dragging) return;
      onTrackPointer(e);
    });
    if (root) {
      root.addEventListener('pointermove', function(e) {
        if (!dragging) return;
        onTrackPointer(e);
      });
    }
    function endDrag() {
      dragging = false;
      sliderEl.style.cursor = 'grab';
    }
    sliderEl.addEventListener('pointerup', endDrag);
    if (root) root.addEventListener('pointerup', endDrag);
    sliderEl.addEventListener('pointercancel', endDrag);
    if (root) root.addEventListener('pointercancel', endDrag);
    sliderEl.addEventListener('keydown', function(e) {
      var val = state[inputKey];
      if (e.key === 'ArrowRight' || e.key === 'ArrowUp') setVal(val + step);
      if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') setVal(val - step);
    });
  }

  function wpcCalcInit() {
    document.querySelectorAll('[data-wpc-calc]').forEach(function(calcEl) {
      var configStr = calcEl.getAttribute('data-wpc-calc-formula');
      if (!configStr) return;
      var config;
      try { config = JSON.parse(configStr); } catch(e) { return; }

      var state = {};
      var nativeSliders = calcEl.querySelectorAll('input[type="range"][data-wpc-calc-var]');
      var radixSliders = calcEl.querySelectorAll('[role="slider"][data-wpc-calc-var]');

      function recalc() {
        var computed = {};
        for (var k in state) computed[k] = state[k];
        if (config.formulas) {
          for (var i = 0; i < config.formulas.length; i++) {
            var f = config.formulas[i];
            try {
              var fn = new Function(f.deps.join(','), 'return (' + f.expr + ')');
              var args = f.deps.map(function(d) { return computed[d]; });
              computed[f['var']] = fn.apply(null, args);
            } catch(e) { /* skip broken formula */ }
          }
        }
        nativeSliders.forEach(function(s) {
          var sVar = s.getAttribute('data-wpc-calc-var');
          var display = calcEl.querySelector('[data-wpc-calc-display="' + sVar + '"]');
          if (!display) return;
          var inputKey = null;
          for (var k in config.inputs) {
            if (config.inputs[k].sliderVar === sVar) { inputKey = k; break; }
          }
          if (inputKey && config.inputs[inputKey]) {
            var mult = config.inputs[inputKey].displayMultiplier || 1;
            display.textContent = formatValue(parseFloat(s.value) * mult, config.inputs[inputKey].displayFormat || config.inputs[inputKey].format);
          }
        });
        radixSliders.forEach(function(sliderEl) {
          var sVar = sliderEl.getAttribute('data-wpc-calc-var');
          var display = calcEl.querySelector('[data-wpc-calc-display="' + sVar + '"]');
          if (!display) return;
          var inputKey = null;
          for (var k in config.inputs) {
            if (config.inputs[k].sliderVar === sVar) { inputKey = k; break; }
          }
          if (inputKey && config.inputs[inputKey]) {
            var mult = config.inputs[inputKey].displayMultiplier || 1;
            var val = parseFloat(sliderEl.getAttribute('aria-valuenow')) || 0;
            display.textContent = formatValue(val * mult, config.inputs[inputKey].displayFormat || config.inputs[inputKey].format);
          }
        });
        var outputEls = calcEl.querySelectorAll('[data-wpc-calc-output]');
        outputEls.forEach(function(el) {
          var oVar = el.getAttribute('data-wpc-calc-output');
          var outCfg = config.outputs[oVar];
          if (!outCfg) return;
          var val = computed[outCfg.formulaVar];
          if (val !== undefined && val !== null) {
            var formatted = formatValue(val, outCfg.format);
            var unitSpan = el.querySelector(':scope > span');
            if (outCfg.unitSuffix && unitSpan) {
              var textNode = Array.from(el.childNodes).find(function(n) { return n.nodeType === 3; });
              if (textNode) textNode.textContent = formatted;
              else el.insertBefore(document.createTextNode(formatted), unitSpan);
            } else {
              el.textContent = formatted;
            }
          }
        });
      }

      nativeSliders.forEach(function(s) { wireNativeSlider(s, calcEl, config, state, recalc); });
      radixSliders.forEach(function(sliderEl) { wireRadixSlider(sliderEl, calcEl, config, state, recalc); });

      var toggleBtns = calcEl.querySelectorAll('[data-wpc-calc-toggle]');
      toggleBtns.forEach(function(btn) {
        var tVar = btn.getAttribute('data-wpc-calc-toggle');
        var idx = parseInt(btn.getAttribute('data-wpc-calc-toggle-idx'), 10) || 0;
        var inputKey = null;
        for (var k in config.inputs) {
          if (config.inputs[k].toggleVar === tVar) { inputKey = k; break; }
        }
        if (!inputKey) return;
        if (!state[inputKey]) {
          state[inputKey] = config.inputs[inputKey]['default'] || config.inputs[inputKey].options[0];
        }
        btn.addEventListener('click', function() {
          var opts = config.inputs[inputKey].options;
          state[inputKey] = opts[idx] || opts[0];
          calcEl.querySelectorAll('[data-wpc-calc-toggle="' + tVar + '"]').forEach(function(b, bi) {
            if (bi === idx) b.classList.add('wpc-calc-toggle-active');
            else b.classList.remove('wpc-calc-toggle-active');
          });
          recalc();
        });
      });

      recalc();
    });
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', wpcCalcInit);
  } else {
    wpcCalcInit();
  }
})();

            } catch(e) { console.warn("[WPConvert] Calculator error:", e); }

            try { // [WPConvert: Count Up]
            
/* EC-COUNT-001: Scroll-triggered stat counter animation */
(function() {
  function easeOutCubic(t) { return 1 - Math.pow(1 - t, 3); }

  function animateCount(el, cfg, duration) {
    duration = duration || 1400;
    var target = cfg.value;
    var prefix = cfg.prefix || '';
    var suffix = cfg.suffix || '';
    var decimals = typeof cfg.decimals === 'number' ? cfg.decimals : (target % 1 === 0 ? 0 : 1);
    function format(n) {
      /* EC-COUNT-004: the locale the original formats with; '' = the browser's */
      if (typeof cfg.locale === 'string') {
        try {
          return n.toLocaleString(cfg.locale || undefined, { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
        } catch (e) {}
      }
      return decimals === 0 ? Math.round(n).toString() : n.toFixed(decimals);
    }
    if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
      el.textContent = prefix + format(target) + suffix;
      return;
    }
    var start = performance.now();
    function tick(now) {
      var p = Math.min(1, (now - start) / duration);
      var eased = easeOutCubic(p);
      var current = target * eased;
      el.textContent = prefix + format(decimals === 0 ? Math.round(current) : current) + suffix;
      if (p < 1) requestAnimationFrame(tick);
    }
    requestAnimationFrame(tick);
  }

  function runCounters(container) {
    if (container.getAttribute('data-wpc-count-done') === 'true') return;
    container.setAttribute('data-wpc-count-done', 'true');
    container.querySelectorAll('[data-wpc-count-target]').forEach(function(el) {
      var cfg;
      try { cfg = JSON.parse(el.getAttribute('data-wpc-count-target')); } catch(e) { return; }
      animateCount(el, cfg);
    });
  }

  function initCountUp() {
    document.querySelectorAll('[data-wpc-count]').forEach(function(container) {
      if (typeof IntersectionObserver === 'undefined') {
        runCounters(container);
        return;
      }
      var io = new IntersectionObserver(function(entries) {
        entries.forEach(function(entry) {
          if (entry.isIntersecting) {
            runCounters(entry.target);
            io.unobserve(entry.target);
          }
        });
      }, { threshold: 0.2 });
      io.observe(container);
    });
  }

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', initCountUp);
  } else {
    initCountUp();
  }
})();

            } catch(e) { console.warn("[WPConvert] Count-up error:", e); }
        });
        (function() {
            var selectors = '.scroll-fade-up, .scroll-fade-left, .scroll-fade-right, .scroll-scale-in';
            function initScrollReveal() {
                var els = document.querySelectorAll(selectors);
                if (!els.length || typeof IntersectionObserver === 'undefined') return;
                var io = new IntersectionObserver(function(entries) {
                    entries.forEach(function(entry) {
                        if (entry.isIntersecting) {
                            entry.target.classList.add('visible');
                            io.unobserve(entry.target);
                        }
                    });
                }, { threshold: 0.15 });
                els.forEach(function(el) {
                    if (el.closest('[aria-roledescription="carousel"]')) {
                        el.classList.add('visible');
                    } else {
                        io.observe(el);
                    }
                });
            }
            // EC-ANIM-020: captured reveal pairs. What is on screen at load stays as
            // it is; what is below the fold loses its revealing class until it
            // scrolls into view.
            function initCapturedReveal() {
                var els = document.querySelectorAll('[data-wpc-reveal]');
                if (!els.length || typeof IntersectionObserver === 'undefined') return;
                if (window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
                var fold = window.innerHeight || document.documentElement.clientHeight;
                var io = new IntersectionObserver(function(entries) {
                    entries.forEach(function(entry) {
                        if (!entry.isIntersecting) return;
                        entry.target.classList.add(entry.target.getAttribute('data-wpc-reveal'));
                        io.unobserve(entry.target);
                    });
                }, { rootMargin: '0px 0px -8%', threshold: 0.08 });
                els.forEach(function(el) {
                    var cls = el.getAttribute('data-wpc-reveal');
                    if (!cls || el.closest('[data-wpc-toggle-store], [aria-roledescription="carousel"], header, nav')) return;
                    var r = el.getBoundingClientRect();
                    if (!r.width && !r.height) return;
                    if (r.top < fold && r.bottom > 0) return;
                    el.classList.remove(cls);
                    io.observe(el);
                });
            }
            function initAll() {
                initScrollReveal();
                initCapturedReveal();
            }
            if (document.readyState === 'loading') {
                document.addEventListener('DOMContentLoaded', initAll);
            } else {
                initAll();
            }
        })();
//# sourceURL=jquery-js-after
</script>
<link rel="https://api.w.org/" href="https://studydoor.de/wp-json/" /><link rel="alternate" title="JSON" type="application/json" href="https://studydoor.de/wp-json/wp/v2/posts/85" /><link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://studydoor.de/xmlrpc.php?rsd" />
<meta name="generator" content="WordPress 7.1.5" />
<link rel='shortlink' href='https://studydoor.de/?p=85' />
<link rel="icon" href="https://studydoor.de/wp-content/uploads/2026/10/cropped-public-favicon-32x32.png" sizes="32x32" />
<link rel="icon" href="https://studydoor.de/wp-content/uploads/2026/10/cropped-public-favicon-192x192.png" sizes="192x192" />
<link rel="apple-touch-icon" href="https://studydoor.de/wp-content/uploads/2026/10/cropped-public-favicon-180x180.png" />
<meta name="msapplication-TileImage" content="https://studydoor.de/wp-content/uploads/2026/10/cropped-public-favicon-270x270.png" />
    <!-- EC-PLAYGROUND-001: Head-after-wp_head — scroll-reveal + duplicated Vite CSS can keep .scroll-fade-up at opacity:0
         (IntersectionObserver never runs in static WP; Playground/theme preview also reorder stylesheets).
         This block is in the HTML after wp_head() so it wins over bundled assets for culture/Embla carousels. -->
    <style id="wpconvert-scroll-carousel-critical">
      .scroll-fade-up:has([aria-roledescription="carousel"]),
      .scroll-fade-up:has([data-wpconvert-carousel]),
      .scroll-fade-up:has([data-wpc-carousel="true"]),
      /* EC-BLOG-146: Blog category strip uses horizontal scroll + chevrons, not a carousel — IO scroll-reveal
       * still hid the bar at opacity:0 (looks like a “carousel flash”). */
      .scroll-fade-up:has([data-wpconvert-blog-filter-bar]) {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
      }
      [role="region"][aria-roledescription="carousel"],
      [data-wpconvert-carousel="aria"],
      [data-wpc-carousel="true"] {
        opacity: 1 !important;
        visibility: visible !important;
      }
      /* EC-CAROUSEL-028: Carousel tracks must never wrap — generic site .flex flex-wrap:wrap
         in bundled style.css breaks multi-slide carousels into a stacked grid. */
      [data-wpconvert-flex-carousel="track"],
      [role="region"][aria-roledescription="carousel"] .overflow-hidden > div,
      .wpc-carousel-track {
        flex-wrap: nowrap !important;
      }
      /* EC-CAROUSEL-035: slide widths were computed by JS from the capture viewport and
         baked inline, so a 3-up desktop carousel stayed 3-up (squashed) on phones.
         Restore the mobile-first ladder the React component had: 1 up, 2 up, N up. */
      [data-wpconvert-flex-carousel-per-view] > [data-wpconvert-flex-carousel="track"] > * {
        width: 100% !important;
        flex-shrink: 0 !important;
      }
      @media (min-width: 640px) {
        [data-wpconvert-flex-carousel-per-view="2"] > [data-wpconvert-flex-carousel="track"] > *,
        [data-wpconvert-flex-carousel-per-view="3"] > [data-wpconvert-flex-carousel="track"] > *,
        [data-wpconvert-flex-carousel-per-view="4"] > [data-wpconvert-flex-carousel="track"] > *,
        [data-wpconvert-flex-carousel-per-view="5"] > [data-wpconvert-flex-carousel="track"] > *,
        [data-wpconvert-flex-carousel-per-view="6"] > [data-wpconvert-flex-carousel="track"] > * {
          width: 50% !important;
        }
      }
      @media (min-width: 1024px) {
        [data-wpconvert-flex-carousel-per-view="2"] > [data-wpconvert-flex-carousel="track"] > * { width: 50% !important; }
        [data-wpconvert-flex-carousel-per-view="3"] > [data-wpconvert-flex-carousel="track"] > * { width: 33.3333% !important; }
        [data-wpconvert-flex-carousel-per-view="4"] > [data-wpconvert-flex-carousel="track"] > * { width: 25% !important; }
        [data-wpconvert-flex-carousel-per-view="5"] > [data-wpconvert-flex-carousel="track"] > * { width: 20% !important; }
        [data-wpconvert-flex-carousel-per-view="6"] > [data-wpconvert-flex-carousel="track"] > * { width: 16.6667% !important; }
      }
    </style>

    <!-- EC-NAV-097: Mobile sticky bottom CTA — mobile-first: hidden by default, show only max-width 1023px.
         Desktop-only @media (min-width:1024px) hide can lose to later rules; base display:none wins on large screens. -->
    <style id="wpconvert-mobile-sticky-cta-critical">
      #wpconvert-mobile-sticky-cta {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
      }
      @media (max-width: 1023px) {
        #wpconvert-mobile-sticky-cta {
          display: block !important;
          visibility: visible !important;
          pointer-events: auto !important;
          position: fixed !important;
          left: 0 !important;
          right: 0 !important;
          bottom: 0 !important;
          z-index: 50 !important;
        }
      }
    </style>
    <!-- EC-NAV-100: --wpconvert-header-bar-height from captured header (row vs logo Tailwind classes). -->
    <style id="wpconvert-header-metrics-critical">
      :root {
        --wpconvert-header-bar-height: 4rem;
      }
    </style>
    <!-- EC-NAV-473: sizing for the spacer EC-NAV-472 leaves where a page's own
         in-flow header bar used to be. The bar removed there is a different
         element than the one this file renders, so only this file can size it. -->
    <style id="wpconvert-header-spacer-critical">
      [data-wpc-header-spacer] {
        height: var(--wpc-fixed-header-height, var(--wpconvert-header-bar-height, 4rem));
        flex: none;
      }
    </style>
    <script id="wpconvert-header-spacer-measure">
      (function () {
        // EC-NAV-473: the EC-NAV-100 metric is read off Tailwind height classes
        // and misses padding, a wrapped logo and a promo strip above the row —
        // Sylani's bar measures 91px against a 64px metric. It is the right
        // pre-paint value (it avoids a jump on load); this corrects it once the
        // bar has actually rendered.
        // The lookup lives inside apply(), not out here. header.php puts this
        // script in the document head, so at parse time the body element does
        // not exist yet and there is no spacer to find — returning here would
        // skip the listener registration below and every subpage would silently
        // keep the 4rem guess.
        function topBarHeight(spacer) {
          var tallest = 0;
          var nodes = document.body ? document.body.children : [];
          for (var i = 0; i < nodes.length; i++) {
            var el = nodes[i];
            if (el === spacer || el.contains(spacer)) continue;
            var cs = window.getComputedStyle(el);
            if (cs.position !== 'fixed') continue;
            var r = el.getBoundingClientRect();
            // Pinned across the top: at the top edge and spanning the viewport.
            if (r.top > 1 || r.width < window.innerWidth * 0.9) continue;
            if (r.height > tallest) tallest = r.height;
          }
          return tallest;
        }

        function apply() {
          var spacer = document.querySelector('[data-wpc-header-spacer]');
          if (!spacer) return; // no spacer means nothing to size
          var h = topBarHeight(spacer);
          if (h > 0) document.documentElement.style.setProperty('--wpc-fixed-header-height', h + 'px');
        }

        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', apply);
        } else {
          apply();
        }
        window.addEventListener('load', apply);
        window.addEventListener('resize', apply);
      })();
    </script>
    
    
    <!-- EC-NAV-098: Tall logo in short row + flex-wrap CTA stacking — min-height uses EC-NAV-100 variable -->
    <style id="wpconvert-header-nowrap-critical">
      header .container.flex.items-center.justify-between,
      header .container.flex {
        flex-wrap: nowrap !important;
        flex-direction: row !important;
      }
      header .container.flex.h-16,
      header .container.flex.min-h-16 {
        min-height: var(--wpconvert-header-bar-height) !important;
      }
    </style>
    <!-- EC-NAV-099e: Nav cluster wrapper uses display:contents so nav+CTA stay direct flex children of
         .container (three-way justify-between). Bundled Tailwind may purge .lg:contents — this matches bp. -->
    <style id="wpconvert-header-nav-cluster-contents-critical">
      [data-wpconvert-merge-nav-cluster] {
        display: none !important;
      }
      @media (min-width: 640px) {
        [data-wpconvert-merge-nav-cluster="sm"] {
          display: contents !important;
        }
      }
      @media (min-width: 768px) {
        [data-wpconvert-merge-nav-cluster="md"] {
          display: contents !important;
        }
      }
      @media (min-width: 1024px) {
        [data-wpconvert-merge-nav-cluster="lg"] {
          display: contents !important;
        }
      }
      @media (min-width: 1280px) {
        [data-wpconvert-merge-nav-cluster="xl"] {
          display: contents !important;
        }
      }
    </style>
    
    <!-- EC-NAV-179: Flat nav anchors must not wrap inside a min-content flex row.
         Framer NoCodeExport (and similar static exporters) give the nav container
         width:min-content and rely on RichTextContainer wrapper divs to keep each link
         on one line. The flat menu walker emits bare anchor elements so WordPress
         owns the links — which means "Chi siamo" collapses to two lines without
         this rule. Scoped to #wpconvert-flat-nav / [data-wpconvert-merge-nav-cluster]
         so Radix, Tailwind group-hover, Elementor mega, and dropdown submenus are
         untouched. -->
    <style id="wpconvert-flat-nav-nowrap-critical">
      /* EC-NAV-179b: target BOTH the menu_id span (when items_wrap preserves it)
         AND the stable .wpconvert-flat-nav-items marker class, so the rule keeps
         matching even if a future consumer overrides menu_id. Using > a picks up
         the walker-emitted bare anchors regardless of whether the span is
         display:contents or a real box. */
      #wpconvert-flat-nav > a,
      .wpconvert-flat-nav-items > a,
      [data-wpconvert-merge-nav-cluster] #wpconvert-flat-nav > a,
      [data-wpconvert-merge-nav-cluster] .wpconvert-flat-nav-items > a {
        white-space: nowrap;
        flex: 0 0 auto;
        width: auto;
      }
    </style>
    
    
    
    <script id="wpconvert-parallax-scroll">
      // EC-ANIM-012: Scroll-driven parallax translateX handler.
      // Replaces Framer Motion useScroll+useTransform for horizontal parallax text sections.
      (function() {
        function initParallax() {
          var els = document.querySelectorAll('[data-wpconvert-parallax-x]');
          if (!els.length) return;
          var entries = [];
          els.forEach(function(el) {
            var parts = el.getAttribute('data-wpconvert-parallax-x').split(',');
            entries.push({ el: el, start: parseFloat(parts[0]), end: parseFloat(parts[1]) });
          });
          var ticking = false;
          function update() {
            var vh = window.innerHeight;
            entries.forEach(function(e) {
              var parent = e.el.closest('section') || e.el.parentElement;
              var rect = parent.getBoundingClientRect();
              var progress = Math.max(0, Math.min(1, (vh - rect.top) / (vh + rect.height)));
              var x = e.start + (e.end - e.start) * progress;
              e.el.style.transform = 'translateX(' + x + '%)';
            });
            ticking = false;
          }
          window.addEventListener('scroll', function() {
            if (!ticking) { ticking = true; requestAnimationFrame(update); }
          }, { passive: true });
          update();
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', initParallax);
        } else {
          initParallax();
        }
      })();
      // EC-ANIM-011c: Overlap fix handled at build time by demoting z-10 on centered pulse cards.
    </script>
    
    <!-- CRITICAL: Super-aggressive popup hiding for WordPress admin previews -->
    <style id="wpconvert-popup-hide-critical">
      [data-wpconvert-popup-disabled="true"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -99999px !important;
        top: -99999px !important;
        width: 0 !important;
        height: 0 !important;
        max-width: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        clip: rect(0,0,0,0) !important;
        z-index: -99999 !important;
        transform: scale(0) !important;
        margin: 0 !important;
        padding: 0 !important;
      }
      [data-wpconvert-popup-disabled="true"] * {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
      }
      /* Block any JavaScript from showing popups */
      [data-wpconvert-popup-disabled="true"][style*="display: block"],
      [data-wpconvert-popup-disabled="true"][style*="display:block"],
      [data-wpconvert-popup-disabled="true"][class*="open"],
      [data-wpconvert-popup-disabled="true"][class*="show"],
      [data-wpconvert-popup-disabled="true"][class*="active"] {
        display: none !important;
      }

      /* EC-NAV-479: everything above styles #wpconvert-mobile-nav and its backdrop,
         which are only emitted when this conversion had to inject a drawer. When the
         source shipped its own (mobileMenuPreserved), EC-NAV-333/465 suppress both
         elements — so the rules match nothing and were pure render-blocking weight
         in every <head>. Same gate as the markup, so they cannot disagree. */
      /* Universal Search Modal - works for any site with search icon */
      #wpconvert-search-modal {
        display: none;
        position: fixed !important;
        inset: 0;
        z-index: 100000;
        padding: 1rem;
        padding-top: 15vh;
      }
      #wpconvert-search-modal.open {
        display: flex;
        flex-direction: column;
        align-items: center;
      }
      #wpconvert-search-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
      }
      #wpconvert-search-container {
        position: relative;
        width: 100%;
        max-width: 32rem;
        /* EC-NAV-DROPDOWN-005: format-aware surface — hsl(var(--background)) is invalid
           on complete-color (oklch) themes, which left the Ctrl+K search modal panel
           transparent (unreadable results over the dimmed page). */
        background: var(--background, white);
        border-radius: 0.75rem;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        overflow: hidden;
        animation: wpconvert-search-slide-down 0.2s ease-out;
      }
      @keyframes wpconvert-search-slide-down {
        from { opacity: 0; transform: translateY(-10px) scale(0.98); }
        to { opacity: 1; transform: translateY(0) scale(1); }
      }
      .dark #wpconvert-search-container {
        background: var(--background, white);
      }
      #wpconvert-search-header {
        display: flex;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid hsl(var(--border, 0 0% 80%) / 0.3);
      }
      #wpconvert-search-icon {
        flex-shrink: 0;
        margin-right: 0.75rem;
        color: hsl(var(--muted-foreground, 0 0% 45%));
      }
      #wpconvert-search-input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        font-size: 1rem;
        color: var(--foreground, white);
      }
      #wpconvert-search-input::placeholder {
        color: hsl(var(--muted-foreground, 0 0% 45%));
      }
      .dark #wpconvert-search-input {
        color: var(--foreground, white);
      }
      #wpconvert-search-close {
        flex-shrink: 0;
        padding: 0.5rem;
        margin-left: 0.5rem;
        background: none;
        border: none;
        cursor: pointer;
        color: hsl(var(--muted-foreground, 0 0% 45%));
        border-radius: 0.375rem;
        transition: background-color 0.2s;
      }
      #wpconvert-search-close:hover {
        background: hsl(var(--accent, 0 0% 95%) / 0.5);
      }
      #wpconvert-search-results {
        max-height: 50vh;
        overflow-y: auto;
        padding: 0.5rem;
      }
      #wpconvert-search-results:empty::after {
        content: "Type to search...";
        display: block;
        padding: 1rem;
        text-align: center;
        color: hsl(var(--muted-foreground, 0 0% 45%));
        font-size: 0.875rem;
      }
      .wpconvert-search-result {
        display: block;
        padding: 0.75rem 1rem;
        text-decoration: none;
        color: var(--foreground, white);
        border-radius: 0.375rem;
        transition: background-color 0.2s;
      }
      .wpconvert-search-result:hover {
        background: hsl(var(--accent, 0 0% 95%) / 0.5);
      }
      .wpconvert-search-result-title {
        font-weight: 500;
        margin-bottom: 0.25rem;
      }
      .wpconvert-search-result-url {
        font-size: 0.75rem;
        color: hsl(var(--muted-foreground, 0 0% 45%));
      }
      .dark .wpconvert-search-result {
        color: var(--foreground, white);
      }
      #wpconvert-search-hint {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
        color: hsl(var(--muted-foreground, 0 0% 45%));
        border-top: 1px solid hsl(var(--border, 0 0% 80%) / 0.3);
      }
      #wpconvert-search-hint kbd {
        display: inline-block;
        padding: 0.125rem 0.375rem;
        margin: 0 0.125rem;
        font-size: 0.7rem;
        font-family: inherit;
        background: hsl(var(--muted, 0 0% 95%));
        border-radius: 0.25rem;
        border: 1px solid hsl(var(--border, 0 0% 80%) / 0.5);
      }
      /* Gradient text fix - ensures background-clip works correctly */
      [style*="background"][style*="text-fill-color"] {
        -webkit-background-clip: text !important;
        background-clip: text !important;
      }
      /* CSS-only dropdown menus for converted React SPAs */
      /* Works with Tailwind's group/group-hover pattern */
      /* EC-NAV-072: Exclude .wpconvert-dropdown-panel — those have their own rules
         and transform: scaleY(1) would clobber -translate-x-1/2 centering on mega menus */
      /* EC-HERO-CAROUSEL-016: Exclude [data-wpc-slide] carousel slides. The stacked-opacity
         hero lives in a ".relative ... group" container and its hidden slides are DIRECT
         children carrying opacity-0 (and sometimes invisible). Without this exclusion,
         hovering the hero matched ".relative.group:hover > div[class*=opacity-0]" and forced
         EVERY slide to opacity:1 !important, stacking all 5 — the last slide in the DOM
         (the snapshot captured-active slide) then painted on top, so the carousel froze
         on that one frame for as long as the pointer stayed over it. The carousel runtime
         owns slide visibility, so this nav-dropdown reveal must never touch its slides. */
      .group:hover > div[class*="scale-y-0"]:not(.wpconvert-dropdown-panel):not([data-wpc-slide]),
      .group:focus-within > div[class*="scale-y-0"]:not(.wpconvert-dropdown-panel):not([data-wpc-slide]),
      .relative.group:hover > div[class*="invisible"]:not(.wpconvert-dropdown-panel):not([data-wpc-slide]),
      .relative.group:focus-within > div[class*="invisible"]:not(.wpconvert-dropdown-panel):not([data-wpc-slide]),
      .relative.group:hover > div[class*="opacity-0"]:not(.wpconvert-dropdown-panel):not([data-wpc-slide]),
      .relative.group:focus-within > div[class*="opacity-0"]:not(.wpconvert-dropdown-panel):not([data-wpc-slide]) {
        opacity: 1 !important;
        transform: scaleY(1) !important;
        visibility: visible !important;
      }
      /* Dropdown triggers */
      .group > button,
      .relative.group > button {
        cursor: pointer;
      }
      /* Keep dropdown visible while hovering on dropdown content */
      .group > div:hover:not(.wpconvert-dropdown-panel):not(.wpconvert-dropdown-wrapper),
      .relative.group > div:hover:not(.wpconvert-dropdown-panel):not(.wpconvert-dropdown-wrapper) {
        opacity: 1 !important;
        transform: scaleY(1) !important;
        visibility: visible !important;
      }
      /* WPConvert injected dropdown panels.
         EC-NAV-DROPDOWN-002: the outer .wpconvert-dropdown-wrapper now
         owns position + opacity + transition + the hoverable pt-2 gap
         between trigger and panel. The inner .wpconvert-dropdown-panel
         only carries visible surface styling. Hovering the parent
         .group keeps the wrapper visible, and the wrapper's bottom
         padding stays inside the hover box — so traversing the gap
         from trigger to panel never drops :hover. */
      .wpconvert-dropdown-wrapper {
        position: absolute;
        left: 0;
        top: 100%;
        padding-top: 0.5rem;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
        z-index: 50;
      }
      .group:hover > .wpconvert-dropdown-wrapper,
      .group:focus-within > .wpconvert-dropdown-wrapper,
      .wpconvert-dropdown-wrapper:hover {
        opacity: 1 !important;
        visibility: visible !important;
      }
      .wpconvert-dropdown-panel {
        min-width: 12rem;
        border-radius: 0.375rem;
        /* EC-NAV-DROPDOWN-004: emit the panel surface format-aware (EC-NAV-199).
           On Tailwind v4 / Lovable / new-shadcn projects --background / --border are
           COMPLETE colors (oklch/hex/rgb/var-chain); hsl(var(--background)) → hsl(oklch(…))
           is invalid-at-computed-value-time, so the panel background resets to transparent
           and (being later in the cascade than .bg-background) wins → see-through mega
           dropdown over the hero. cssVarColorExpr keeps hsl() for legacy HSL-triplet themes. */
        background: var(--background, white);
        border: 1px solid var(--border, white);
        /* shadow-card equivalent: 1px ring + soft shadow defines edge
           against hero photos / colored backgrounds. */
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
      }
      /* EC-NAV-470: a third-level submenu revealed from inside an open dropdown.
         The source opened it from React state, which does not survive conversion,
         so the flyout was inlined into its own positioned wrapper at capture time
         and the two were marked. These rules are what re-arm it: the wrapper is
         the hover box, and the flyout stays hidden until the pointer is in it.
         The panel keeps the geometry it was authored with (left-full, top-0 and
         its own surface) — only visibility is taken over here. */
      .wpc-nested-parent {
        position: relative;
      }
      .wpc-nested-panel {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.15s, visibility 0.15s;
      }
      /* :focus-within carries the same reveal to the keyboard, and hovering the
         flyout itself holds it open while the pointer travels across it. */
      .wpc-nested-parent:hover > .wpc-nested-panel,
      .wpc-nested-parent:focus-within > .wpc-nested-panel,
      .wpc-nested-panel:hover {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
      }
      /* EC-NAV-072: Mega menu centering is now handled by Tailwind
         utilities on the wrapper itself (left-1/2 + -translate-x-1/2).
         The defensive rule here just documents the contract for the
         inner panel class — visible styling is unchanged. */
      /* EC-NAV-496: .wpconvert-dropdown-wrapper { left: 0 } pins a mega panel
         to its trigger, and the old scaleY(1) !important hover rule wiped
         translateX(-50%). A right-side trigger then runs the panel off the
         viewport. Anchor the panel to the trigger's right edge so it grows
         leftward and stays on screen. The clamp script may still set left. */
      .wpconvert-dropdown-wrapper:has(.wpconvert-mega-menu) {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
        max-width: min(52rem, calc(100vw - 2rem));
      }
      .wpconvert-mega-menu {
        /* outer .wpconvert-dropdown-wrapper provides the on-screen anchor */
      }
      /* EC-NAV-141: Flat dropdown with many links (no category grandchildren) — 2-column flow */
      .wpconvert-dropdown-panel.wpconvert-dropdown-panel--flat-mega {
        min-width: min(520px, 92vw);
        max-width: 92vw;
      }
      .wpconvert-dropdown-flat-mega-inner {
        column-count: 2;
        column-gap: 2.5rem;
      }
      .wpconvert-dropdown-flat-mega-inner > a {
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
      }
      .wpconvert-dropdown-panel a {
        display: block;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        color: var(--foreground, white);
        text-decoration: none;
        transition: background-color 0.2s;
      }
      .wpconvert-dropdown-panel a:hover {
        background: color-mix(in oklab, var(--accent, white) 50%, transparent);
      }
      .dark .wpconvert-dropdown-panel {
        background: var(--card, white);
      }
      .dark .wpconvert-dropdown-panel a {
        color: var(--foreground, white);
      }
      .dark .wpconvert-dropdown-panel a:hover {
        background: color-mix(in oklab, var(--accent, white) 50%, transparent);
      }
      /* EC-NAV-DROPDOWN-001: Ensure Tailwind group-hover utilities are always available.
         Bundled CSS from JIT-compiled Tailwind may not include these if they weren't used
         in the original source — but our dropdown walker/fallback menus rely on them.
         NOTE: this whole style block is emitted inside a JavaScript template literal, so
         a single colon escape would be silently dropped during interpolation. We write
         a double backslash to preserve the literal backslash that CSS requires to
         escape the colon in compound class names like .group-hover:opacity-100. */
      .group:hover .group-hover\:opacity-100 { opacity: 1; }
      .group:hover .group-hover\:visible { visibility: visible; }
      .group:hover .group-hover\:scale-y-100 { transform: scaleY(1); }
      /* EC-NAV-DROPDOWN-006: the reveal fallbacks above are only half the
         contract — the HIDE side (.opacity-0 / .invisible) is equally
         bundle-dependent. Ship the base utilities too so a panel that opted
         into .invisible is actually hidden. */
      .invisible { visibility: hidden; }
      .visible { visibility: visible; }
      /* EC-NAV-475: space a rebuilt decorative mark off the label. The source
         spaced it with the anchor's own layout classes - Sylani's link is
         inline-flex items-center gap-2 - and those are filtered out of
         menus.json, so without this the mark renders on top of the label.
         em rather than a fixed length so it tracks the nav's own font size,
         and scoped to an attribute this feature is the only writer of, so no
         existing markup can be affected. */
      [data-wpc-nav-deco] { vertical-align: middle; }
      [data-wpc-nav-deco="before"] { margin-inline-end: 0.5em; }
      [data-wpc-nav-deco="after"] { margin-inline-start: 0.5em; }
      /* WPC Mobile Menu Panel States (for preserved mobile menus) */
      [data-wpc-menu-panel] {
        /* Original styling preserved via classes */
      }
      /* EC-NAV-474: none, not translateX(0). Both undo a source
         -translate-x-full equally, but any transform other than none makes
         this wrapper a containing block for its absolutely positioned
         descendants - and a preserved panel is often positioned against an
         ancestor further up. Sylani's mobile nav is written "absolute
         inset-x-0 top-full" against the navbar row; trapped in this wrapper,
         which is a zero-width flex item of that row, it resolved to width 0
         and the menu opened as a 32px sliver.
         NOTE: no backticks in this comment - it lives inside a JS template
         literal, where a backtick silently ends the string. */
      [data-wpc-menu-panel].is-open {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
      }
      /* EC-NAV-454: an in-place panel is held shut by Tailwind's max-h-0, which
         the rule above cannot release - it only undoes a transform. Give back
         the same 80vh the source component opens to, and let the panel scroll
         internally on short viewports. The element keeps its own
         transition-[max-height,opacity], so this still animates.
         NOTE: no backticks in this comment - it lives inside a JS template
         literal, where a backtick silently ends the string. */
      [data-wpc-menu-panel="inline-collapse"].is-open {
        max-height: 80vh !important;
        overflow-y: auto !important;
      }
      /* EC-NAV-462: this panel is viewport-fixed at an offset measured against the
         header (top-[60px] = the header's height). EC-NAV-089 drops the header by
         the admin bar height; nothing moved the panel, so it rode up over the
         header's lower edge and covered the hamburger inside it - the menu opened
         and could never be closed. Hand the panel the same shift.
         margin-top rather than an overriding top, so the authored offset survives
         whatever it is - a bracket value, a scale step, or one that varies by
         breakpoint - without the generator having to resolve it.
         Logged out there is no body.admin-bar, so none of this applies. */
      body.admin-bar [data-wpc-panel-header-anchored] {
        margin-top: var(--wp-admin--admin-bar--height, 32px) !important;
      }
      [data-wpc-menu-overlay] {
        display: none;
        position: fixed !important;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99998;
      }
      [data-wpc-menu-overlay].is-open {
        display: block;
      }
      body.wpc-menu-open {
        overflow: hidden;
      }
      .wpc-mobile-menu {
        list-style: none;
        padding: 0;
        margin: 0;
      }
      .wpc-mobile-menu li {
        margin: 0;
      }
      .wpc-mobile-menu a {
        display: block;
        text-decoration: none;
      }
      /* EC-NAV-518: links that brought their own padding (wpc-panel-pad) keep it.
         :where() keeps this rule at the specificity it always had. */
      .wpc-mobile-menu a:where(:not(.wpc-panel-pad)) {
        padding: 0.75rem 1rem;
      }
    </style>
    <script id="wpc-mega-panel-clamp">
    (function(){
      /* EC-NAV-496: a built mega panel centred on a right-side trigger overflows
         the viewport. EC-NAV-503: a captured panel has lost its authored anchor
         to the neutraliser, and the wrapper that replaced it holds the anchor
         instead. Measure on hover and keep both edges 8px inside the window.
         Flat dropdowns carry neither hook and are left alone. */
      var clampLeft = function clampMegaPanelLeft(box) {
        const margin = box.margin == null ? 8 : box.margin;
        const triggerLeft = box.triggerLeft;
        let ideal;
        if (box.anchor === 'left') {
          ideal = triggerLeft;
        } else if (box.anchor === 'right') {
          ideal = triggerLeft + box.triggerWidth - box.panelWidth;
        } else {
          ideal = triggerLeft + box.triggerWidth / 2 - box.panelWidth / 2;
        }
        const maxLeft = Math.max(margin, box.viewportWidth - box.panelWidth - margin);
        const clamped = Math.max(margin, Math.min(maxLeft, ideal));
        return clamped - triggerLeft;
      };
      /* The element whose width decides the placement, or null when this wrapper
         is not ours to place. */
      function panelIn(wrap){
        var mega=wrap.querySelector('.wpconvert-mega-menu');
        if(mega)return mega;
        var cl=wrap.classList;
        if(!cl.contains('wpconvert-rich-panel-content'))return null;
        /* EC-NAV-MEGA-003 hands a full-bleed panel viewport-wide geometry of its
           own, and EC-NAV-185b.6 positions the panels it injects into static
           header markup. Only the walker's own host is ours. */
        if(cl.contains('wpconvert-rich-panel-content--fullbleed'))return null;
        var host=wrap.parentElement;
        if(!host||!host.classList.contains('wpconvert-nav-rich-panel'))return null;
        return wrap.firstElementChild;
      }
      function override(wrap){
        wrap.style.setProperty('transform','none','important');
        wrap.style.setProperty('right','auto','important');
        wrap.style.setProperty('left','0px','important');
      }
      function place(wrap){
        var mega=!!wrap.querySelector('.wpconvert-mega-menu');
        var panel=panelIn(wrap);
        if(!panel)return;
        var trig=wrap.parentElement;
        if(!trig||!trig.getBoundingClientRect)return;
        /* clientWidth, not innerWidth: the latter counts the scrollbar gutter, so
           a panel clamped against it still sits partly under the scrollbar. */
        var vw=document.documentElement.clientWidth||window.innerWidth;
        var margin=8;
        if(mega){
          override(wrap);
        }else{
          /* EC-NAV-503: the stylesheet anchor is the one the source authored, so
             drop any earlier override and keep it whenever it fits. Re-anchoring
             a panel that is already on screen would animate left and transform
             through the wrapper's own transition-all. */
          wrap.style.removeProperty('left');
          wrap.style.removeProperty('right');
          wrap.style.removeProperty('transform');
          var at=panel.getBoundingClientRect();
          if(at.left>=margin-1&&at.right<=vw-margin+1)return;
          override(wrap);
        }
        var tr=trig.getBoundingClientRect();
        wrap.style.setProperty('left',clampLeft({
          anchor:wrap.getAttribute('data-wpc-panel-anchor')||'center',
          triggerLeft:tr.left,
          triggerWidth:tr.width,
          panelWidth:panel.getBoundingClientRect().width,
          viewportWidth:vw,
          margin:margin
        })+'px','important');
      }
      document.addEventListener('mouseover',function(e){
        var t=e.target;
        var g=t&&t.closest?t.closest('.group'):null;
        if(!g)return;
        var w=g.querySelector(':scope > .wpconvert-dropdown-wrapper, :scope > .wpconvert-rich-panel-content');
        if(w)place(w);
      });
      window.addEventListener('resize',function(){
        var open=document.querySelectorAll('.group:hover > .wpconvert-dropdown-wrapper, .wpconvert-nav-rich-panel:hover > .wpconvert-rich-panel-content');
        for(var i=0;i<open.length;i++)place(open[i]);
      });
    })();
    </script>
<style id="wpc-inline-link-css">a.wpc-inline-link{color:#2563eb!important;text-decoration:underline!important;cursor:pointer}a.wpc-inline-link:hover{color:#1d4ed8!important}</style></head>
<body class="wp-singular post-template-default single single-post postid-85 single-format-standard wp-theme-studydoor-updated-08102026-theme">
        
    
    <!-- Universal Search Modal -->
    <div id="wpconvert-search-modal" role="dialog" aria-modal="true" aria-label="Search">
        <div id="wpconvert-search-backdrop"></div>
        <div id="wpconvert-search-container">
            <div id="wpconvert-search-header">
                <svg id="wpconvert-search-icon" xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg>
                <input type="text" id="wpconvert-search-input" placeholder="Search pages..." autocomplete="off" />
                <button id="wpconvert-search-close" type="button" aria-label="Close search">
                    <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" x2="6" y1="6" y2="18"></line><line x1="6" x2="18" y1="6" y2="18"></line></svg>
                </button>
            </div>
            <div id="wpconvert-search-results"></div>
            <div id="wpconvert-search-hint">Press <kbd>Esc</kbd> to close &bull; <kbd>Ctrl</kbd>+<kbd>K</kbd> to open</div>
        </div>
    </div>
    
    <!-- Original mobile menu preserved with wp_nav_menu() integration -->
    
    
    
    <header class="sticky top-0 z-50 border-b border-border/70 bg-background/85 backdrop-blur-md" data-tsd-source="/src/components/site/SiteHeader.tsx:20:5"><div class="mx-auto flex h-16 max-w-6xl items-center justify-between px-5 lg:px-8" data-tsd-source="/src/components/site/SiteHeader.tsx:21:7"><a class="group inline-flex items-center" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/" data-status="active" aria-current="page"><img src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/images/logo-studydoor-color.png" alt="Studydoor" class="h-5 max-w-[134px] shrink-0 object-contain transition-transform group-hover:-translate-y-0.5 sm:h-6 sm:max-w-[161px]" style="max-height: 48px; width: auto;" data-wpc-id="wpc_2d631735f9" data-wpc-editable="image" /></a><nav class="hidden items-center gap-1 md:flex" data-tsd-source="/src/components/site/SiteHeader.tsx:24:9"><span id="wpconvert-flat-nav" class="wpconvert-flat-nav-items" style="display:contents"><a href="https://studydoor.de/" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary">Home</a><a href="https://studydoor.de/services" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary">Services</a><a href="https://studydoor.de/learn" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary">Learn</a><a href="https://studydoor.de/about" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary">About</a></span></nav><div class="hidden md:block" data-tsd-source="/src/components/site/SiteHeader.tsx:37:9"><a class="inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 bg-primary text-primary-foreground shadow hover:bg-primary/90 h-8 rounded-md px-3 text-xs" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="/contact" data-wpc-id="wpc_6778c81414" data-wpc-editable="button">Contact us</a></div><button type="button" class="inline-flex size-10 items-center justify-center rounded-md border border-border md:hidden" aria-label="Open menu" aria-expanded="false" data-tsd-source="/src/components/site/SiteHeader.tsx:44:9" data-state="closed" data-wpc-open-icon="PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXggc2l6ZS01IiBhcmlhLWhpZGRlbj0idHJ1ZSIgZGF0YS10c2Qtc291cmNlPSIvc3JjL2NvbXBvbmVudHMvc2l0ZS9TaXRlSGVhZGVyLnRzeDo1MToxOSI+PHBhdGggZD0iTTE4IDYgNiAxOCI+PC9wYXRoPjxwYXRoIGQ9Im02IDYgMTIgMTIiPjwvcGF0aD48L3N2Zz4=" data-wpc-open-label="Close menu" data-wpc-menu-toggle="true"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-menu size-5" aria-hidden="true" data-tsd-source="/src/components/site/SiteHeader.tsx:51:46"><path d="M4 5h16"></path><path d="M4 12h16"></path><path d="M4 19h16"></path></svg></button></div><div class="hidden md:hidden" data-wpc-revealed-mobile-panel="1" data-wpc-menu-panel="display-toggle"><div class="border-t border-border bg-background md:hidden" data-tsd-source="/src/components/site/SiteHeader.tsx:56:9"><nav class="mx-auto flex max-w-6xl flex-col px-5 py-3" data-tsd-source="/src/components/site/SiteHeader.tsx:57:11"><ul id="menu-primary-menu" class="wpc-mobile-menu"><li id="menu-item-21" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-21"><a href="https://studydoor.de/" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary wpc-panel-ink wpc-panel-pad rounded-md px-2 py-3 text-sm font-medium text-foreground/80 data-[status=active]:text-primary active">Home</a></li>
<li id="menu-item-22" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-22"><a href="https://studydoor.de/services" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary wpc-panel-ink wpc-panel-pad rounded-md px-2 py-3 text-sm font-medium text-foreground/80 data-[status=active]:text-primary active">Services</a></li>
<li id="menu-item-23" class="menu-item menu-item-type-post_type menu-item-object-page current_page_parent menu-item-23"><a href="https://studydoor.de/learn" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary wpc-panel-ink wpc-panel-pad rounded-md px-2 py-3 text-sm font-medium text-foreground/80 data-[status=active]:text-primary active">Learn</a></li>
<li id="menu-item-24" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-24"><a href="https://studydoor.de/about" class="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground data-[status=active]:text-primary wpc-panel-ink wpc-panel-pad rounded-md px-2 py-3 text-sm font-medium text-foreground/80 data-[status=active]:text-primary active">About</a></li>
</ul><a class="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&amp;_svg]:pointer-events-none [&amp;_svg]:size-4 [&amp;_svg]:shrink-0 bg-primary text-primary-foreground shadow hover:bg-primary/90 h-9 px-4 py-2 mt-2" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="/contact" data-wpc-id="wpc_1522fe6482" data-wpc-editable="button">Contact us</a></nav></div></div></header>
    
    
    <main class="site-main">
            <style>
                .studydoor-post {
                    background: #fcfcfa;
                }

                .studydoor-post-hero {
                    background: linear-gradient(135deg, #173e33 0%, #285a48 100%);
                    color: #fff;
                    padding: 5.5rem 1.5rem 5rem;
                }

                .studydoor-post-hero-inner {
                    width: min(100%, 900px);
                    margin: 0 auto;
                }

                .studydoor-post-category {
                    display: inline-block;
                    margin: 0 0 1.25rem;
                    padding: .45rem .8rem;
                    border: 1px solid rgba(255,255,255,.35);
                    border-radius: 999px;
                    color: rgba(255,255,255,.9);
                    font-size: .75rem;
                    font-weight: 700;
                    letter-spacing: .08em;
                    text-transform: uppercase;
                }

                .studydoor-post-title {
                    max-width: 850px;
                    margin: 0;
                    color: #fff;
                    font-size: clamp(2.4rem, 6vw, 4.75rem);
                    font-weight: 700;
                    line-height: 1.08;
                    letter-spacing: -.035em;
                }

                .studydoor-post-intro {
                    max-width: 700px;
                    margin: 1.75rem 0 0;
                    color: rgba(255,255,255,.82);
                    font-size: clamp(1.1rem, 2vw, 1.3rem);
                    line-height: 1.65;
                }

                .studydoor-post-main {
                    width: min(100%, 900px);
                    margin: 0 auto;
                    padding: 3.5rem 1.5rem 5.5rem;
                }

                .studydoor-featured-image {
                    width: min(100%, 820px);
                    height: clamp(240px, 45vw, 430px);
                    margin: 0 auto 3.5rem;
                    overflow: hidden;
                    border-radius: 1.25rem;
                    box-shadow: 0 18px 45px rgba(20, 48, 39, .16);
                }

                .studydoor-featured-image img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }

                .studydoor-post-content {
                    max-width: 720px;
                    margin: 0 auto;
                    color: #4b5563;
                    font-size: 1.12rem;
                    line-height: 1.9;
                }

                .studydoor-post-content p {
                    margin: 0 0 1.7rem;
                }

                .studydoor-post-content > p:first-child {
                    color: #27342f;
                    font-size: 1.28rem;
                    line-height: 1.75;
                }

                .studydoor-post-content h2,
                .studydoor-post-content h3,
                .studydoor-post-content h4 {
                    color: #173e33;
                    font-weight: 700;
                    line-height: 1.2;
                    letter-spacing: -.02em;
                }

                .studydoor-post-content h2 {
                    margin: 3.6rem 0 1.15rem;
                    font-size: clamp(1.8rem, 4vw, 2.4rem);
                }

                .studydoor-post-content h3 {
                    margin: 2.6rem 0 1rem;
                    font-size: clamp(1.35rem, 3vw, 1.7rem);
                }

                .studydoor-post-content ul,
                .studydoor-post-content ol {
                    margin: 0 0 1.8rem;
                    padding-left: 1.5rem;
                }

                .studydoor-post-content li {
                    margin-bottom: .65rem;
                    padding-left: .3rem;
                }

                .studydoor-post-content a {
                    color: #176b52;
                    font-weight: 600;
                    text-decoration: underline;
                    text-underline-offset: 3px;
                }

                .studydoor-post-content blockquote {
                    margin: 2.5rem 0;
                    padding: 1.5rem 1.75rem;
                    border-left: 4px solid #d1a640;
                    background: #f3f6f1;
                    color: #274438;
                    font-size: 1.2rem;
                    font-style: italic;
                    line-height: 1.65;
                }

                .studydoor-post-content img {
                    max-width: 100%;
                    height: auto;
                    margin: 2.5rem auto;
                    border-radius: 1rem;
                }

                .studydoor-back-link {
                    display: inline-flex;
                    align-items: center;
                    gap: .6rem;
                    margin-top: 4rem;
                    padding-top: 2rem;
                    border-top: 1px solid #dfe6df;
                    color: #176b52;
                    font-size: .95rem;
                    font-weight: 700;
                    text-decoration: none;
                }

                .studydoor-back-link:hover {
                    color: #0d4d39;
                }

                @media (max-width: 640px) {
                    .studydoor-post-hero {
                        padding: 4rem 1.25rem 3.75rem;
                    }

                    .studydoor-post-main {
                        padding: 2.5rem 1.25rem 4rem;
                    }

                    .studydoor-post-content {
                        font-size: 1.05rem;
                        line-height: 1.8;
                    }
                }
            </style>

            <article id="post-85" class="studydoor-post post-85 post type-post status-publish format-standard has-post-thumbnail hentry category-knowledge tag-alemania tag-estudiar tag-germany tag-que-es-studienkolleg tag-studienkolleg tag-studieren tag-what-is-studienkolleg">

                <header class="studydoor-post-hero">
                    <div class="studydoor-post-hero-inner">

                                                    <p class="studydoor-post-category">
                                Knowledge                            </p>
                        
                        <h1 class="studydoor-post-title">What Is a Studienkolleg? Your Pathway to Studying in Germany</h1>

                                                    <p class="studydoor-post-intro">
                                Discover how Studienkolleg prepares international students for university in Germany, bridges educational gaps and opens the door to a Bachelor’s degree.                            </p>
                        
                    </div>
                </header>

                <main class="studydoor-post-main">

                                            <div class="studydoor-featured-image">
                            <img width="1024" height="576" src="https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-1024x576.jpg" class="attachment-large size-large wp-post-image" alt="" loading="eager" decoding="async" fetchpriority="high" srcset="https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-1024x576.jpg 1024w, https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-300x169.jpg 300w, https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-768x432.jpg 768w, https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-1536x864.jpg 1536w, https://studydoor.de/wp-content/uploads/2026/11/vitaly-gariev-vyuiyIyboc0-unsplash-2048x1152.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" />                        </div>
                    
                    <div class="studydoor-post-content">
                        
<p class="wp-block-paragraph">Many international students dream of studying in Germany. However, depending on your school qualification, you may not yet meet the admission requirements for a German university.</p>



<p class="wp-block-paragraph">But don’t worry! If your qualification is not considered equivalent to the German university entrance qualification (<em>Abitur</em>), there is still a clear pathway to your degree: the <a href="https://www.daad.de/de/in-deutschland-studieren/voraussetzungen/studienkollegs/" target="_blank" rel="noreferrer noopener">Studienkolleg</a>.</p>



<p class="wp-block-paragraph"><strong>How Does it Work?</strong></p>



<p class="wp-block-paragraph">A Studienkolleg is a preparatory program designed specifically for international students. It helps bridge the gap between different education systems and prepares students for successful university studies in Germany.</p>



<p class="wp-block-paragraph">The program typically lasts two semesters (around one year). During this time, you attend classes, complete assignments, and prepare for the final assessment known as the <em>Feststellungsprüfung</em> (Assessment Examination).</p>



<p class="wp-block-paragraph">Successfully passing this examination qualifies you to apply for Bachelor programs at German universities. Start studying in Germany right away!</p>



<p class="wp-block-paragraph"><strong>Different Courses for Different Study Fields</strong></p>



<p class="wp-block-paragraph">Not all students have the same academic goals. That is why Studienkollegs offer different specialized courses depending on the Bachelor program you plan to apply for.</p>



<p class="wp-block-paragraph">Some of the most common course types include:</p>



<ul class="wp-block-list">
<li><strong>M-Course</strong>: For future students of medicine, biology, pharmacy, and related fields</li>



<li><strong>T-Course</strong>: For engineering, mathematics, computer science, and natural sciences</li>



<li><strong>W-Course</strong>: For business, economics, management, and social sciences</li>



<li><strong>G-Course</strong>: For humanities, German studies, history, and similar subjects</li>



<li><strong>S-Course</strong>: For language-related studies</li>
</ul>



<p class="wp-block-paragraph"><strong>What Will You Learn?</strong></p>



<p class="wp-block-paragraph">The curriculum at a Studienkolleg focuses on both academic preparation and language development.</p>



<p class="wp-block-paragraph">Depending on your chosen course, subjects may include:</p>



<ul class="wp-block-list">
<li>Mathematics </li>



<li>Natural Sciences</li>



<li>Economics </li>



<li>Social Sciences </li>



<li>German Language </li>



<li>Academic Writing and Communication </li>
</ul>



<p class="wp-block-paragraph">A strong emphasis is placed on developing the skills needed for success at a German university. Students learn how to work independently, participate in academic discussions, improve their German skills, and prepare for university-level examinations.&nbsp;</p>



<p class="wp-block-paragraph"><strong>Why a Studienkolleg Can Be a Great Opportunity</strong></p>



<p class="wp-block-paragraph">Some students initially view the Studienkolleg as an extra step on the way to university. In reality, it often provides a valuable advantage.</p>



<p class="wp-block-paragraph">The additional year allows students to:</p>



<ul class="wp-block-list">
<li>Improve their German language skills </li>



<li>Strengthen their academic foundation</li>



<li>Adapt to a country  </li>



<li>Meet other international students and create a network</li>
</ul>



<p class="wp-block-paragraph">Many graduates report that the Studienkolleg made the transition to university much smoother and increased their chances of academic success.</p>



<p class="wp-block-paragraph">Interested in studying in Germany but unsure whether you need a Studienkolleg? <a href="https://studydoor.de/contact/" target="_blank" data-type="link" data-id="https://studydoor.de/contact/" rel="noreferrer noopener">Contact us</a> or explore our <a href="https://studydoor.de/services/" target="_blank" rel="noreferrer noopener">services</a>—we are happy to help you find the right path to your studies in Germany!</p>



<p class="wp-block-paragraph"><em>Foto</em>:<em> <a href="https://unsplash.com/de/@silverkblack?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" target="_blank" rel="noopener">Vitaly Gariev</a> / <a href="https://unsplash.com/de/fotos/professor-der-vor-studenten-in-einem-klassenzimmer-referiert-vyuiyIyboc0?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText" target="_blank" rel="noopener">Unsplash</a></em></p>



<p class="wp-block-paragraph"></p>
                    </div>

                    <a
                        class="studydoor-back-link"
                        href="https://studydoor.de/learn/"
                    >
                        <span aria-hidden="true">←</span>
                        Back to all articles
                    </a>

                </main>

            </article>

            <!--WPFC_FOOTER_START-->    </main>
    
    
    <footer class="bg-forest text-forest-foreground bg-forest" data-tsd-source="/src/components/site/SiteFooter.tsx:36:5"><div class="mx-auto grid max-w-6xl gap-12 px-5 py-16 lg:grid-cols-[1.2fr_1fr_1fr] lg:px-8" data-tsd-source="/src/components/site/SiteFooter.tsx:37:7"><div data-tsd-source="/src/components/site/SiteFooter.tsx:38:9"><a class="group inline-flex items-center" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/" data-status="active" aria-current="page"><img src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/images/logo-studydoor-white.png" alt="Studydoor" class="h-5 max-w-[134px] shrink-0 object-contain transition-transform group-hover:-translate-y-0.5 sm:h-6 sm:max-w-[161px]" style="max-height: 64px; width: auto;" data-wpc-id="wpc_64a2e61c42" data-wpc-editable="image" /></a><p class="mt-4 max-w-sm whitespace-pre-line text-sm text-forest-foreground/70" data-tsd-source="/src/components/site/SiteFooter.tsx:40:11" data-wpc-id="wpc_00343b97d7" data-wpc-editable="text">From the first idea to the first semester.
We guide you every step of the way.</p></div><div data-tsd-source="/src/components/site/SiteFooter.tsx:45:9"><h3 class="text-sm font-semibold tracking-wide text-forest-foreground" data-tsd-source="/src/components/site/SiteFooter.tsx:46:11" data-wpc-id="wpc_ae27600b69" data-wpc-editable="heading">Pages</h3><ul class="mt-4 space-y-2.5 text-sm text-forest-foreground/70" data-tsd-source="/src/components/site/SiteFooter.tsx:47:11"><li data-tsd-source="/src/components/site/SiteFooter.tsx:48:34"><a class="transition-colors hover:text-forest-foreground" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/" data-status="active" aria-current="page" data-wpc-id="wpc_4f69f7ea95" data-wpc-editable="link">Home</a></li><li data-tsd-source="/src/components/site/SiteFooter.tsx:48:34"><a class="transition-colors hover:text-forest-foreground" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/services/" data-wpc-id="wpc_63d3d36c16" data-wpc-editable="link">Services</a></li><li data-tsd-source="/src/components/site/SiteFooter.tsx:48:34"><a class="transition-colors hover:text-forest-foreground" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/learn/" data-wpc-id="wpc_192b73354c" data-wpc-editable="link">Learn</a></li><li data-tsd-source="/src/components/site/SiteFooter.tsx:48:34"><a class="transition-colors hover:text-forest-foreground" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/about/" data-wpc-id="wpc_4ab9a0ea07" data-wpc-editable="link">About</a></li><li data-tsd-source="/src/components/site/SiteFooter.tsx:48:34"><a class="transition-colors hover:text-forest-foreground" data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/contact/" data-wpc-id="wpc_1c462ae8e3" data-wpc-editable="link">Contact us</a></li></ul></div><div data-tsd-source="/src/components/site/SiteFooter.tsx:52:9"><h3 class="text-sm font-semibold tracking-wide text-forest-foreground" data-tsd-source="/src/components/site/SiteFooter.tsx:53:11" data-wpc-id="wpc_607e29e12e" data-wpc-editable="heading">Contact information</h3><ul class="mt-4 space-y-4 text-sm" data-tsd-source="/src/components/site/SiteFooter.tsx:56:11" data-wpc-id="wpc_e0e790290a" data-wpc-editable="list"><li class="flex gap-3" data-tsd-source="/src/components/site/SiteFooter.tsx:58:15"><span class="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-forest-foreground/10" data-tsd-source="/src/components/site/SiteFooter.tsx:59:17"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-phone size-4" aria-hidden="true" data-tsd-source="/src/components/site/SiteFooter.tsx:60:19"><path d="M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"></path></svg></span><span data-tsd-source="/src/components/site/SiteFooter.tsx:62:17" data-wpc-id="wpc_f5830ad42d" data-wpc-editable="text"><span class="block font-medium text-forest-foreground" data-tsd-source="/src/components/site/SiteFooter.tsx:63:19">WhatsApp</span><span class="text-forest-foreground/70" data-tsd-source="/src/components/site/SiteFooter.tsx:64:19">+49 000 000 000</span></span></li><li class="flex gap-3" data-tsd-source="/src/components/site/SiteFooter.tsx:58:15"><span class="mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-forest-foreground/10" data-tsd-source="/src/components/site/SiteFooter.tsx:59:17"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-circle size-4" aria-hidden="true" data-tsd-source="/src/components/site/SiteFooter.tsx:60:19"><path d="M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"></path></svg></span><span data-tsd-source="/src/components/site/SiteFooter.tsx:62:17" data-wpc-id="wpc_43d8d3f0ad" data-wpc-editable="text"><span class="block font-medium text-forest-foreground" data-tsd-source="/src/components/site/SiteFooter.tsx:63:19">WeChat</span><span class="text-forest-foreground/70" data-tsd-source="/src/components/site/SiteFooter.tsx:64:19">@StudyDoor</span></span></li></ul></div></div><div class="border-t border-forest-foreground/10" data-tsd-source="/src/components/site/SiteFooter.tsx:72:7"><div class="mx-auto flex max-w-6xl flex-col gap-2 px-5 py-6 text-xs text-forest-foreground/60 sm:flex-row sm:items-center sm:justify-between lg:px-8" data-tsd-source="/src/components/site/SiteFooter.tsx:73:9"><p data-tsd-source="/src/components/site/SiteFooter.tsx:74:11" data-wpc-id="wpc_acbb6794f4" data-wpc-editable="text">Copyright © 2026 — Studydoor</p><div class="flex items-center gap-3" data-tsd-source="/src/components/site/SiteFooter.tsx:75:11"><a aria-label="Instagram" aria-disabled="true" class="flex items-center justify-center text-forest-foreground/80 transition-colors hover:text-forest-foreground" data-tsd-source="/src/components/site/SiteFooter.tsx:77:15"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" class="size-7" aria-hidden="true" data-tsd-source="/src/components/site/SiteFooter.tsx:17:11"><rect x="2.5" y="2.5" width="19" height="19" rx="5.5" data-tsd-source="/src/components/site/SiteFooter.tsx:17:171"></rect><circle cx="12" cy="12" r="4.3" data-tsd-source="/src/components/site/SiteFooter.tsx:17:227"></circle><circle cx="17.6" cy="6.4" r="0.8" fill="currentColor" data-tsd-source="/src/components/site/SiteFooter.tsx:17:261"></circle></svg></a><a href="https://www.xiaohongshu.com/user/profile/65084cd10000000012006e04?xsec_token=YBYtdsHfClEV5g5jTdSRr_LaX6a4DA6qefpb9RMQF4fGM%3D&xsec_source=app_share&xhsshare=CopyLink&shareRedId=ODsyODdISDo2NzUyOTgwNjc1OTc6SjY9&apptime=1792072203&share_id=25b8c8bcb9d34b98a99640c81edd155b&share_channel=copy_link&track_code=12Vs6zKIyoU" target="_blank" rel="noopener noreferrer" aria-label="小红书 (Xiaohongshu)" class="flex items-center justify-center text-forest-foreground/80 transition-colors hover:text-forest-foreground" data-tsd-source="/src/components/site/SiteFooter.tsx:77:15"><svg viewBox="0 0 24 24" class="size-7" aria-hidden="true" data-tsd-source="/src/components/site/SiteFooter.tsx:21:11"><rect x="1.5" y="1.5" width="21" height="21" rx="5.5" fill="currentColor" data-tsd-source="/src/components/site/SiteFooter.tsx:21:74"></rect><text x="12" y="14.8" text-anchor="middle" font-size="6.3" font-weight="700" letter-spacing="-0.2" fill="var(--forest)" font-family="'PingFang SC','Microsoft YaHei','Noto Sans SC',sans-serif" data-tsd-source="/src/components/site/SiteFooter.tsx:21:150">小红书</text></svg></a></div><nav class="flex flex-wrap gap-x-4 gap-y-2" data-tsd-source="/src/components/site/SiteFooter.tsx:82:11"><a data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/legal-notice/" data-wpc-id="wpc_a537532792" data-wpc-editable="link">Legal Notice</a><a data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/privacy-policy/" data-wpc-id="wpc_c1ea650900" data-wpc-editable="link">Privacy Policy</a><a data-tsd-source="/src/components/site/LocalizedLink.tsx:12:10" href="https://studydoor.de/terms/" data-wpc-id="wpc_7ce15f09a4" data-wpc-editable="link">General Terms &amp; Conditions</a></nav></div></div></footer>
    
    
    
    <script type="speculationrules">
{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/studydoor-updated-08102026-theme/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]}
</script>
<script id="wpconvert-hero-carousel-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-hero-carousel.js?ver=2.0.0"></script>
<script id="wpconvert-static-grid-carousel-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-static-grid-carousel.js?ver=2.0.0"></script>
<script id="wpconvert-aria-tab-stack-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-aria-tab-stack.js?ver=2.0.0"></script>
<script id="wpconvert-testimonial-slider-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-testimonial-slider.js?ver=2.0.0"></script>
<script id="wpconvert-product-gallery-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-product-gallery.js?ver=2.0.0"></script>
<script id="wpconvert-product-options-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-product-options.js?ver=1.0.0"></script>
<script id="wpconvert-swiper-init-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-swiper-init.js?ver=2.0.0"></script>
<script id="wpconvert-scroll-scrub-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-scroll-scrub.js?ver=2.0.0"></script>
<script id="wpconvert-scroll-story-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-scroll-story.js?ver=1.0.0"></script>
<script id="wpconvert-parallax-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-parallax.js?ver=2.0.0"></script>
<script id="wpconvert-webgl-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-webgl.js?ver=2.0.0"></script>
<script id="wpconvert-asset-wpconvert-product-options-js-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-product-options.js?ver=2.0.0"></script>
<script id="wpconvert-asset-wpconvert-scroll-story-js-js" src="https://studydoor.de/wp-content/themes/studydoor-updated-08102026-theme/assets/js/wpconvert-scroll-story.js?ver=2.0.0"></script>
<script id="wp-emoji-settings" type="application/json">
{"baseUrl":"https://s.w.org/images/core/emoji/17.0.2/72x72/","ext":".png","svgUrl":"https://s.w.org/images/core/emoji/17.0.2/svg/","svgExt":".svg","source":{"concatemoji":"https://studydoor.de/wp-includes/js/wp-emoji-release.min.js?ver=7.1.5"}}
</script>
<script type="module">
/*! This file is auto-generated */
var e="script#wp-emoji-settings",t=document.querySelector(e);if(!(t instanceof HTMLScriptElement))throw new Error("Element missing: "+e);const r=JSON.parse(t.text),s=(window._wpemojiSettings=r,"wpEmojiSettingsSupports"),o=["flag","emoji"];function i(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(s,JSON.stringify(t))}catch(e){}}function c(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0);const r=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);return t.every((e,t)=>e===r[t])}function p(e,t){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var n=e.getImageData(16,16,1,1);for(let e=0;e<n.data.length;e++)if(0!==n.data[e])return!1;return!0}function u(e,t,n,r){switch(t){case"flag":return n(e,"\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!n(e,"\ud83c\udde8\ud83c\uddf6","\ud83c\udde8\u200b\ud83c\uddf6")&&!n(e,"\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!r(e,"\ud83e\u1fac8")}return!1}function f(e,t,n,r){let a;const s=(a="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?new OffscreenCanvas(300,150):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0}),o=(s.textBaseline="top",s.font="600 32px Arial",{});return e.forEach(e=>{o[e]=t(s,e,n,r)}),o}function a(e){var t=document.createElement("script");t.src=e,t.defer=!0,document.head.appendChild(t)}r.supports={everything:!0,everythingExceptFlag:!0},new Promise(t=>{let n=function(){try{var e=JSON.parse(sessionStorage.getItem(s));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf()<e.timestamp+604800&&"object"==typeof e.supportTests)return e.supportTests}catch(e){}return null}();if(!n){if("undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof URL&&URL.createObjectURL&&"undefined"!=typeof Blob)try{var e="postMessage("+f.toString()+"("+[JSON.stringify(o),u.toString(),c.toString(),p.toString()].join(",")+"));",r=new Blob([e],{type:"text/javascript"});const a=new Worker(URL.createObjectURL(r),{name:"wpTestEmojiSupports"});return void(a.onmessage=e=>{i(n=e.data),a.terminate(),t(n)})}catch(e){}i(n=f(o,u,c,p))}t(n)}).then(e=>{for(const n in e)r.supports[n]=e[n],r.supports.everything=r.supports.everything&&r.supports[n],"flag"!==n&&(r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&r.supports[n]);var t;r.supports.everythingExceptFlag=r.supports.everythingExceptFlag&&!r.supports.flag,r.supports.everything||((t=r.source||{}).concatemoji?a(t.concatemoji):t.wpemoji&&t.twemoji&&(a(t.twemoji),a(t.wpemoji)))});
//# sourceURL=https://studydoor.de/wp-includes/js/wp-emoji-loader.min.js
</script>
<!-- WPConvert Forms: wpforms footer bridge for /contact-form-0 -->
<script>
(function(){
  var formId     = "\/contact-form-0";
  var successUrl = "";
  var ajaxUrl    = "https:\/\/studydoor.de\/wp-admin\/admin-ajax.php";

  var orig = document.querySelector('[data-wpconvert-form-id="' + formId + '"]');
  if (!orig) return;

  // EC-FORMS-I18N-002: auto-heal stale template bridges (see render_cf7_footer_bridge
  // for full rationale). Symmetric handling so users on Gravity / WPForms also
  // recover from a pre-1.4.0 wire without manually re-wiring.
  var CURRENT_BRIDGE_VERSION = '2';
  if (orig.dataset.wpconvertBridgeVersion === CURRENT_BRIDGE_VERSION) return;
  // HTML forbids nested <form> elements. WPForms outputs its own form; if it sits inside the theme wrapper, the browser may break the DOM (fields vanish on input). Let WPForms handle submission — do not attach this bridge.
  if (orig.querySelector && orig.querySelector('form.wpforms-form')) {
    console.warn('[WPConvert Forms] Skipping AJAX bridge for ' + formId + ': nested WPForms markup detected. Use a <div> wrapper with only [wpforms id="…"] (no outer <form>), or re-wire from Tools → WPConvert Forms.');
    return;
  }
  if (orig.dataset.wpconvertBridgeActive) {
    var clone = orig.cloneNode(true);
    orig.parentNode.replaceChild(clone, orig);
    orig = clone;
  }
  orig.dataset.wpconvertBridgeActive = '1';
  orig.dataset.wpconvertBridgeVersion = CURRENT_BRIDGE_VERSION;
  orig.removeAttribute('action');
  orig.setAttribute('method', 'post');
  orig.setAttribute('data-wpconvert-form', 'wired');

  // Honeypot — invisible field that bots auto-fill but humans never see
  var hp = document.createElement('input');
  hp.type = 'text'; hp.name = 'wpconvert_hp';
  hp.setAttribute('autocomplete','off'); hp.setAttribute('tabindex','-1');
  hp.style.cssText = 'position:absolute;left:-9999px;height:0;width:0;overflow:hidden;opacity:0;';
  orig.appendChild(hp);

  var msgBox = document.createElement('div');
  msgBox.className = 'wpconvert-form-status';
  msgBox.style.cssText = 'display:none;padding:12px 16px;margin-top:12px;border-radius:8px;font-size:14px;';
  orig.appendChild(msgBox);

  var btn = orig.querySelector('[type=submit]');
  if (!btn) {
    btn = orig.querySelector('button:last-of-type') || orig.querySelector('a:last-child');
    if (btn) btn.addEventListener('click', function(ev){ ev.preventDefault(); orig.dispatchEvent(new Event('submit',{bubbles:true,cancelable:true})); });
  }

  // Detect reCAPTCHA site key for token generation
  var rcSiteKey = '';
  var rcScript = document.querySelector('script[src*="recaptcha"][src*="render="]');
  if (rcScript) { var m = rcScript.src.match(/render=([^&]+)/); if (m) rcSiteKey = m[1]; }
  if (!rcSiteKey && window.wpcf7 && wpcf7.recaptcha) rcSiteKey = wpcf7.recaptcha.sitekey || '';

  function doAjaxFetch(fd) {
    fetch(ajaxUrl, { method:'POST', body:fd })
      .then(function(r){ return r.json(); })
      .then(function(resp){
        if (btn) { btn.disabled = false; btn.textContent = btn.dataset.origText; }
        var ok  = resp.success;
        var msg = (resp.data && resp.data.message) ? resp.data.message : '';
        if (ok) {
          if (successUrl) { window.location.href = successUrl; return; }
          msgBox.style.display = 'block'; msgBox.style.background = '#d4edda'; msgBox.style.color = '#155724'; msgBox.style.border = '1px solid #c3e6cb';
          msgBox.textContent = msg || 'Your message has been sent successfully.';
          orig.reset();
        } else {
          msgBox.style.display = 'block'; msgBox.style.background = '#f8d7da'; msgBox.style.color = '#721c24'; msgBox.style.border = '1px solid #f5c6cb';
          msgBox.textContent = msg || 'There was an error. Please try again.';
        }
      })
      .catch(function(err){
        console.error('[WPConvert Forms] AJAX fetch failed:', err);
        if (btn) { btn.disabled = false; btn.textContent = btn.dataset.origText; }
        msgBox.style.display = 'block'; msgBox.style.background = '#f8d7da'; msgBox.style.color = '#721c24'; msgBox.style.border = '1px solid #f5c6cb';
        msgBox.textContent = 'There was an error sending your message. Please try again.';
      });
  }

  orig.addEventListener('submit', function(e){
    e.preventDefault();
    var fd = new FormData(orig);
    fd.set('action', 'wpconvert_form_submit');
    fd.set('wpconvert_form_id', formId);
    fd.set('wpconvert_ts', String(Math.floor(Date.now()/1000)));
    if (btn) { btn.disabled = true; btn.dataset.origText = btn.textContent; btn.textContent = 'Sending\u2026'; }

    if (rcSiteKey && window.grecaptcha) {
      grecaptcha.ready(function(){
        grecaptcha.execute(rcSiteKey, {action:'submit'}).then(function(token){
          fd.set('wpconvert_recaptcha', token);
          doAjaxFetch(fd);
        }).catch(function(){ doAjaxFetch(fd); });
      });
    } else {
      doAjaxFetch(fd);
    }
  });
})();
</script>
            <script id="wpconvert-video-lightbox">
    (function() {
        'use strict';
        
        function getEmbedUrl(rawUrl) {
            var url = (rawUrl || '').trim();
            if (!url || /\bexample\d*\b/i.test(url)) return '';
            
            if (url.indexOf('vimeo.com') !== -1) {
                var vm = url.match(/vimeo\.com\/(?:video\/)?(\d+)/);
                return vm ? 'https://player.vimeo.com/video/' + vm[1] + '?autoplay=1&title=0&byline=0&portrait=0&dnt=1' : '';
            }
            if (url.indexOf('youtube.com') !== -1 || url.indexOf('youtu.be') !== -1) {
                var yt = url.match(/youtu\.be\/([^?&\/]+)/) ||
                         url.match(/[?&]v=([^?&\/]+)/) ||
                         url.match(/youtube\.com\/embed\/([^?&\/]+)/);
                return yt ? 'https://www.youtube-nocookie.com/embed/' + yt[1] + '?autoplay=1&rel=0&modestbranding=1' : '';
            }
            return url;
        }
        
        function createModal() {
            if (document.getElementById('wpconvert-video-modal')) return;
            var overlay = document.createElement('div');
            overlay.id = 'wpconvert-video-modal';
            overlay.style.cssText = 'display:none;position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,0.85);backdrop-filter:blur(4px);align-items:center;justify-content:center;padding:2rem;';
            overlay.innerHTML = '<div style="position:relative;width:100%;max-width:960px;"><button id="wpconvert-video-close" style="position:absolute;top:-40px;right:0;background:none;border:none;color:#fff;font-size:28px;cursor:pointer;padding:4px 8px;z-index:1;" aria-label="Close video">&times;</button><div style="position:relative;width:100%;padding-top:56.25%;background:#000;border-radius:8px;overflow:hidden;"><iframe id="wpconvert-video-frame" style="position:absolute;top:0;left:0;width:100%;height:100%;border:none;" allow="accelerometer;autoplay;clipboard-write;encrypted-media;gyroscope;picture-in-picture;fullscreen" allowfullscreen></iframe></div></div>';
            document.body.appendChild(overlay);
            
            var closeBtn = document.getElementById('wpconvert-video-close');
            closeBtn.addEventListener('click', closeModal);
            overlay.addEventListener('click', function(e) {
                if (e.target === overlay) closeModal();
            });
            document.addEventListener('keydown', function(e) {
                if (e.key === 'Escape') closeModal();
            });
        }
        
        function openModal(videoUrl) {
            var modal = document.getElementById('wpconvert-video-modal');
            var iframe = document.getElementById('wpconvert-video-frame');
            if (!modal || !iframe) return;
            var embedUrl = getEmbedUrl(videoUrl);
            if (!embedUrl) return;
            iframe.src = embedUrl;
            modal.style.display = 'flex';
            document.body.style.overflow = 'hidden';
        }
        
        function closeModal() {
            var modal = document.getElementById('wpconvert-video-modal');
            var iframe = document.getElementById('wpconvert-video-frame');
            if (!modal) return;
            modal.style.display = 'none';
            if (iframe) iframe.src = '';
            document.body.style.overflow = '';
        }
        
        function init() {
            if (window.location.search.indexOf('wpc_edit=1') !== -1) return;
            var cardsFound = 0;
            
            // Strategy 1: Cards with data-video-url (set during snapshot extraction)
            document.querySelectorAll('[data-video-url]').forEach(function(card) {
                var videoUrl = card.getAttribute('data-video-url');
                if (!videoUrl) return;
                card.style.cursor = 'pointer';
                card.addEventListener('click', function(e) {
                    e.preventDefault();
                    e.stopPropagation();
                    openModal(videoUrl);
                });
                cardsFound++;
            });
            
            // Strategy 2: Cards with play button SVGs but no data-video-url
            // Auto-detect video URLs from thumbnail image sources
            var playIcons = document.querySelectorAll('.lucide-play, [class*="lucide-play"]');
            playIcons.forEach(function(icon) {
                var card = icon.closest('[class*="cursor-pointer"]') ||
                           icon.closest('[class*="card"]') ||
                           icon.closest('[class*="group"]');
                if (!card || card.hasAttribute('data-video-url') || card.hasAttribute('data-wpconvert-video-bound')) return;
                
                var img = card.querySelector('img');
                if (!img) return;
                var src = img.getAttribute('src') || '';
                
                var videoUrl = '';
                // YouTube thumbnail -> YouTube embed
                var ytMatch = src.match(/img\.youtube\.com\/vi\/([a-zA-Z0-9_-]+)\//);
                if (ytMatch) {
                    videoUrl = 'https://www.youtube.com/watch?v=' + ytMatch[1];
                }
                // Vimeo CDN thumbnail — can't derive URL, skip
                
                if (videoUrl) {
                    card.setAttribute('data-wpconvert-video-bound', 'true');
                    card.addEventListener('click', function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        openModal(videoUrl);
                    });
                    cardsFound++;
                }
            });
            
            if (cardsFound > 0) {
                createModal();
                console.log('[WPConvert] Video lightbox initialized for ' + cardsFound + ' card(s)');
            }
        }
        
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', init);
        } else {
            init();
        }
    })();
    </script>
        <script>
    (function() {
        'use strict';
        
        function init() {
            // Find button groups that look like tab selectors
            // Pattern: multiple sibling buttons in a flex container with gap
            var containers = document.querySelectorAll('div[class*="flex"][class*="gap"]');
            var tabGroupsInitialized = 0;
            
            containers.forEach(function(container, containerIndex) {
                var buttons = container.querySelectorAll(':scope > button');
                
                // Need at least 2 buttons to be a tab selector
                if (buttons.length < 2) return;
                
                // Check if buttons have similar structure (tab selector pattern)
                // Only compare SIZE classes (w-, h-), ignore color/styling differences
                var hasSimilarButtons = true;
                var firstButtonSizeClasses = buttons[0].className.split(' ').filter(function(c) {
                    // Only check size classes - ignore border colors, bg colors, hover states
                    return /^(w-[0-9]+|h-[0-9]+)$/.test(c);
                }).sort().join(' ');
                
                buttons.forEach(function(btn) {
                    var btnSizeClasses = btn.className.split(' ').filter(function(c) {
                        return /^(w-[0-9]+|h-[0-9]+)$/.test(c);
                    }).sort().join(' ');
                    if (btnSizeClasses !== firstButtonSizeClasses) {
                        hasSimilarButtons = false;
                    }
                });
                
                // Also require that buttons have size classes (not just any flex container)
                if (!firstButtonSizeClasses || !hasSimilarButtons) return;
                
                // Skip if already handled (navigation buttons with < > arrows)
                var hasNavArrows = container.querySelector('svg[class*="chevron-left"], svg[class*="chevron-right"]');
                var isNavContainer = container.querySelectorAll(':scope > button').length === 2 && hasNavArrows;
                if (isNavContainer) return;
                
                // Find the active button (has gold/primary styling)
                var activeButton = null;
                var activeIndex = 0;
                buttons.forEach(function(btn, index) {
                    if (/border-gold|bg-gold|border-primary|bg-primary/.test(btn.className)) {
                        activeButton = btn;
                        activeIndex = index;
                    }
                });
                
                // Find associated content area
                // Look for text that shows selected item info
                // It could be: sibling of container, sibling of parent, or in ancestor section
                var infoText = null;
                var searchContext = container.parentElement;
                
                // Try parent's siblings first (common pattern)
                if (searchContext && searchContext.parentElement) {
                    var grandparent = searchContext.parentElement;
                    infoText = grandparent.querySelector('div[class*="text-center"] p[class*="text-gold"], div[class*="text-center"] p[class*="font-serif"]');
                }
                
                // If not found, try the whole section
                if (!infoText) {
                    var section = container.closest('section');
                    if (section) {
                        infoText = section.querySelector('div[class*="text-center"][class*="mt-"] p[class*="text-gold"], div[class*="text-center"][class*="mt-"] p[class*="font-serif"]');
                    }
                }
                
                // Mark as initialized
                container.setAttribute('data-wpconvert-tabs', 'true');
                
                // Store button labels for updating info text
                var buttonLabels = [];
                buttons.forEach(function(btn) {
                    buttonLabels.push(btn.textContent.trim());
                });
                
                // Add click handlers to each button
                buttons.forEach(function(btn, index) {
                    btn.addEventListener('click', function(e) {
                        e.preventDefault();
                        e.stopPropagation();
                        
                        // Update active styling on all buttons
                        buttons.forEach(function(b, i) {
                            if (i === index) {
                                // Make this button active - use RegExp constructor to avoid escape issues
                                b.className = b.className
                                    .replace(new RegExp('border-white/[0-9]+', 'g'), 'border-gold')
                                    .replace(new RegExp('hover:border-white/[0-9]+', 'g'), '');
                                if (b.className.indexOf('bg-gold') === -1) {
                                    b.className = b.className.replace('border-gold', 'border-gold bg-gold/20');
                                }
                            } else {
                                // Make this button inactive
                                b.className = b.className
                                    .replace(/border-gold/g, 'border-white/20')
                                    .replace(new RegExp('bg-gold/[0-9]+', 'g'), '')
                                    .replace(new RegExp(' +', 'g'), ' ')
                                    .trim();
                                if (b.className.indexOf('hover:border') === -1) {
                                    b.className += ' hover:border-white/40';
                                }
                            }
                        });
                        
                        // Update info text if found
                        if (infoText && buttonLabels[index]) {
                            infoText.textContent = buttonLabels[index];
                        }
                        
                        // Store active index
                        container.setAttribute('data-active-index', index);
                    });
                });
                
                tabGroupsInitialized++;
            });
            
            if (tabGroupsInitialized > 0) {
                console.log('WPConvert Tab Selector: Initialized ' + tabGroupsInitialized + ' tab group(s)');
            }
        }
        
        // Initialize when DOM is ready
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', init);
        } else {
            init();
        }
        
    })();
    </script>
        <script>
    (function() {
        'use strict';
        
        function init() {
            // Find all range inputs that might be comparison sliders
            var rangeInputs = document.querySelectorAll('input[type="range"]');
            var slidersInitialized = 0;
            
            rangeInputs.forEach(function(input) {
                // Look for comparison slider pattern:
                // - Range input inside a container with overlapping elements
                // - Sibling or nearby element with clip-path styling
                var container = input.closest('div[class*="relative"], div[class*="overflow"]');
                if (!container) return;
                
                // Find elements that use clip-path (the "after" reveal layer)
                var clipPathElements = container.querySelectorAll('[style*="clip-path"], [style*="clipPath"]');
                if (clipPathElements.length === 0) return;
                
                // Find the divider line (vertical bar that moves with slider)
                var dividerLine = container.querySelector('[class*="bg-gold"], [class*="bg-primary"], div[style*="left:"]');
                
                // Mark as initialized
                input.setAttribute('data-wpconvert-comparison', 'true');
                
                // Make input visible and interactive
                input.style.opacity = '0';
                input.style.cursor = 'ew-resize';
                input.style.zIndex = '20';
                
                // Add input handler
                input.addEventListener('input', function(e) {
                    var value = e.target.value;
                    
                    // Update clip-path on reveal elements
                    clipPathElements.forEach(function(el) {
                        // clip-path: inset(0 RIGHT% 0 0) - RIGHT is 100 - value
                        el.style.clipPath = 'inset(0 ' + (100 - value) + '% 0 0)';
                    });
                    
                    // Update divider line position
                    if (dividerLine) {
                        dividerLine.style.left = value + '%';
                    }
                });
                
                // Trigger initial positioning based on current value
                input.dispatchEvent(new Event('input'));
                
                slidersInitialized++;
            });

            // ============================================================
            // EC-SLIDER-002: Pointer-drag comparison sliders (NO range input).
            // React before/after components (e.g. Vertex Services) render a
            // container marked cursor-ew-resize with a clip-path reveal layer and
            // a draggable divider handle, wiring mouse/touch handlers in JS that do
            // NOT survive static conversion — so the handle sits frozen at 50% and
            // "does not drag". Re-attach pointer + touch dragging here.
            // ============================================================
            var clipEls = document.querySelectorAll('[style*="clip-path"], [style*="clipPath"]');
            clipEls.forEach(function(clip) {
                var container = clip.closest('[class*="cursor-ew-resize"]');
                if (!container) {
                    // Fallback: nearest positioned ancestor that also holds a handle
                    // (an element positioned via an inline left:% style).
                    var anc = clip.parentElement;
                    while (anc && anc !== document.body) {
                        if (anc.querySelector('[style*="left:"]') &&
                            /relative|overflow/.test(anc.className || '')) { container = anc; break; }
                        anc = anc.parentElement;
                    }
                }
                if (!container) return;
                if (container.querySelector('input[type="range"]')) return; // Strategy 1 owns it
                if (container.hasAttribute('data-wpconvert-comparison-drag')) return;
                container.setAttribute('data-wpconvert-comparison-drag', 'true');
                container.style.cursor = 'ew-resize';
                container.style.userSelect = 'none';

                var revealEls = container.querySelectorAll('[style*="clip-path"], [style*="clipPath"]');
                var handle = container.querySelector('[style*="left:"]');
                var dragging = false;

                function setPos(clientX) {
                    var rect = container.getBoundingClientRect();
                    if (!rect.width) return;
                    var pct = ((clientX - rect.left) / rect.width) * 100;
                    pct = Math.max(2, Math.min(98, pct));
                    revealEls.forEach(function(el) {
                        el.style.clipPath = 'inset(0 ' + (100 - pct) + '% 0 0)';
                        el.style.webkitClipPath = 'inset(0 ' + (100 - pct) + '% 0 0)';
                    });
                    if (handle) handle.style.left = pct + '%';
                }

                container.addEventListener('mousedown', function(e) { dragging = true; setPos(e.clientX); e.preventDefault(); });
                window.addEventListener('mousemove', function(e) { if (dragging) setPos(e.clientX); });
                window.addEventListener('mouseup', function() { dragging = false; });
                container.addEventListener('touchstart', function(e) { if (e.touches && e.touches[0]) setPos(e.touches[0].clientX); }, { passive: true });
                container.addEventListener('touchmove', function(e) { if (e.touches && e.touches[0]) setPos(e.touches[0].clientX); }, { passive: true });

                slidersInitialized++;
            });

            // ============================================================
            // EC-SLIDER-003: Width-window before/after sliders (NO clip-path).
            // Some React BeforeAfter components reveal the "before" photo by
            // setting a wrapper's width to N% and the photo's width to
            // (100/N)*100% so it stays full-bleed. There is no clip-path and
            // no range input, so the two strategies above never attach and
            // the grip stays frozen at 50%.
            // ============================================================
            // No regex escapes here. This script is emitted from a template
            // literal, and a single backslash would be stripped before it
            // reached the browser (the first build of this check did exactly
            // that, so the handle never moved).
            function isPctStyle(style, prop) {
                var parts = (style || '').split(';');
                for (var pi = 0; pi < parts.length; pi++) {
                    var part = parts[pi].trim();
                    var c = part.indexOf(':');
                    if (c < 0) continue;
                    var key = part.slice(0, c).trim().toLowerCase();
                    var val = part.slice(c + 1).trim();
                    if (key === prop && val.length > 1 && val.charAt(val.length - 1) === '%') {
                        var n = parseFloat(val);
                        if (n === n) return true;
                    }
                }
                return false;
            }
            var widthContainers = document.querySelectorAll('[class*="cursor-ew-resize"]');
            widthContainers.forEach(function(container) {
                if (container.querySelector('input[type="range"]')) return;
                if (container.hasAttribute('data-wpconvert-comparison-drag')) return;
                if (container.querySelector('[style*="clip-path"], [style*="clipPath"]')) return;
                var reveal = null;
                var widthNodes = container.querySelectorAll('[style*="width"]');
                for (var wi = 0; wi < widthNodes.length; wi++) {
                    var wst = widthNodes[wi].getAttribute('style') || '';
                    if (!isPctStyle(wst, 'width')) continue;
                    if (widthNodes[wi].querySelector('img')) { reveal = widthNodes[wi]; break; }
                }
                if (!reveal) return;
                var handle = null;
                var leftNodes = container.querySelectorAll('[style*="left"]');
                for (var li = 0; li < leftNodes.length; li++) {
                    if (isPctStyle(leftNodes[li].getAttribute('style') || '', 'left')) {
                        handle = leftNodes[li];
                        break;
                    }
                }
                if (!handle) return;
                container.setAttribute('data-wpconvert-comparison-drag', 'true');
                container.style.cursor = 'ew-resize';
                container.style.userSelect = 'none';
                var draggingW = false;

                function setWidthPos(clientX) {
                    var rect = container.getBoundingClientRect();
                    if (!rect.width) return;
                    var pct = ((clientX - rect.left) / rect.width) * 100;
                    pct = Math.max(0, Math.min(100, pct));
                    reveal.style.width = pct + '%';
                    var beforeImg = reveal.querySelector('img');
                    if (beforeImg) {
                        beforeImg.style.width = (pct > 0 ? (10000 / pct) : 100) + '%';
                        beforeImg.style.maxWidth = 'none';
                    }
                    handle.style.left = pct + '%';
                }

                container.addEventListener('mousedown', function(e) { draggingW = true; setWidthPos(e.clientX); e.preventDefault(); });
                window.addEventListener('mousemove', function(e) { if (draggingW) setWidthPos(e.clientX); });
                window.addEventListener('mouseup', function() { draggingW = false; });
                container.addEventListener('touchstart', function(e) { if (e.touches && e.touches[0]) setWidthPos(e.touches[0].clientX); }, { passive: true });
                container.addEventListener('touchmove', function(e) { if (e.touches && e.touches[0]) setWidthPos(e.touches[0].clientX); }, { passive: true });

                slidersInitialized++;
            });

            if (slidersInitialized > 0) {
                console.log('WPConvert Comparison Slider: Initialized ' + slidersInitialized + ' slider(s)');
            }
        }
        
        // Initialize when DOM is ready
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', init);
        } else {
            init();
        }
        
    })();
    </script>
        <script id="wpconvert-back-to-top">
    (function(){
  'use strict';
  var THRESHOLD = 300;
  function findButtons(){
    return Array.prototype.slice.call(
      document.querySelectorAll('[data-wpconvert-back-to-top]')
    );
  }
  function setVisible(btn, visible){
    if(!btn) return;
    btn.classList.toggle('opacity-0', !visible);
    btn.classList.toggle('pointer-events-none', !visible);
    if(visible) btn.removeAttribute('aria-hidden');
    else btn.setAttribute('aria-hidden','true');
  }
  function wire(){
    var buttons = findButtons();
    if(!buttons.length) return;
    buttons.forEach(function(btn){
      if(btn.getAttribute('data-wpconvert-btt-wired') === '1') return;
      btn.setAttribute('data-wpconvert-btt-wired','1');
      btn.setAttribute('type','button');
      if(!btn.getAttribute('onclick')){
        btn.addEventListener('click', function(e){
          e.preventDefault();
          window.scrollTo({ top: 0, behavior: 'smooth' });
        });
      }
    });
    function sync(){
      var show = window.scrollY > THRESHOLD;
      buttons.forEach(function(btn){ setVisible(btn, show); });
    }
    sync();
    window.addEventListener('scroll', sync, { passive: true });
  }
  if(document.readyState === 'loading'){
    document.addEventListener('DOMContentLoaded', wire);
  } else {
    wire();
  }
})();
    </script>
        <script>
    (function() {
        'use strict';
        
        // EC-ACCORDION-003: Find the content panel for an accordion button.
        // Handles two DOM patterns:
        // 1. Direct sibling: <button/> <div class="overflow-hidden">  (custom accordions)
        // 2. Header-wrapped: <h3><button/></h3> <div role="region">   (Radix UI / shadcn)
        //
        // EC-ACCORDION-012: An accordion content panel always comes AFTER its
        // trigger and is real content (not an img/picture/video-only wrapper).
        // Otherwise we mis-detect image-card layouts where the CTA button is
        // the LAST child of the card (MenuCard "+ Tilfoj"): the old
        // third-branch loop returned the image wrapper at the TOP of the
        // card and the init collapsed it to height:0.
        function isImageOnlyPanel(el) {
            if (!el || !el.children) return false;
            var hasText = (el.textContent || '').replace(/\s+/g, '').length > 0;
            if (hasText) return false;
            var kids = el.children;
            if (!kids.length) return false;
            for (var i = 0; i < kids.length; i++) {
                var tag = kids[i].tagName;
                if (tag !== 'IMG' && tag !== 'PICTURE' && tag !== 'VIDEO' && tag !== 'SOURCE') {
                    return false;
                }
            }
            return true;
        }
        function findContentPanel(btn) {
            // EC-ACCORDION-024: the author's explicit aria-controls link wins over
            // sibling heuristics — but only for NON-Radix targets (Radix content
            // has role="region"/data-state and is owned by the jQuery handler).
            var ac = btn.getAttribute && btn.getAttribute('aria-controls');
            if (ac) {
                var acTarget = document.getElementById(ac);
                if (acTarget && acTarget.tagName === 'DIV' &&
                    acTarget.getAttribute('role') !== 'region' &&
                    !acTarget.hasAttribute('data-state') &&
                    !isImageOnlyPanel(acTarget)) {
                    return acTarget;
                }
            }

            var sibling = btn.nextElementSibling;
            if (sibling && sibling.tagName === 'DIV') {
                if (isImageOnlyPanel(sibling)) return null;
                return sibling;
            }
            
            var parent = btn.parentElement;
            if (parent && /^H[1-6]$/.test(parent.tagName)) {
                var parentSibling = parent.nextElementSibling;
                if (parentSibling && parentSibling.tagName === 'DIV') {
                    if (isImageOnlyPanel(parentSibling)) return null;
                    return parentSibling;
                }
            }
            // EC-ACCORDION-012: third branch -- button has no nextElementSibling.
            // The original intent (button is first child of wrapper, wrapper
            // contains a hidden div) is enforced by ONLY returning DIVs that
            // come AFTER the button in DOM order. Image-only DIVs are skipped.
            if (parent && !sibling) {
                var kids = parent.children;
                var btnIdx = -1;
                for (var k = 0; k < kids.length; k++) {
                    if (kids[k] === btn) { btnIdx = k; break; }
                }
                if (btnIdx >= 0) {
                    for (var j = btnIdx + 1; j < kids.length; j++) {
                        if (kids[j].tagName === 'DIV' && !isImageOnlyPanel(kids[j])) {
                            return kids[j];
                        }
                    }
                }
            }
            return null;
        }

        // EC-ACCORDION-013: Morph a single lucide plus/minus icon to match the
        // accordion's expanded state. Custom React useState FAQs (Galaxy
        // Construction) render ONE icon at a time via isOpen ? <Minus/> : <Plus/>,
        // so the display-swap path (which needs both icons) never fires. We rewrite
        // the icon's class token and its inner <path>s in place. No-op when both
        // icons are present (handled by display-swap) or when no lucide plus/minus
        // icon exists (e.g. chevron-only accordions), keeping other patterns intact.
        function setLucidePlusMinusState(btn, expanded) {
            if (btn.querySelector('.lucide-plus') && btn.querySelector('.lucide-minus')) return false;
            var icon = btn.querySelector('.lucide-plus, .lucide-minus');
            if (!icon) return false;
            var cls = icon.getAttribute('class') || '';
            if (expanded) {
                icon.setAttribute('class', cls.replace(/lucide-plus/g, 'lucide-minus'));
                icon.innerHTML = '<path d="M5 12h14"></path>';
            } else {
                icon.setAttribute('class', cls.replace(/lucide-minus/g, 'lucide-plus'));
                icon.innerHTML = '<path d="M5 12h14"></path><path d="M12 5v14"></path>';
            }
            return true;
        }

        // EC-ACCORDION-015: CSS-drawn plus icons (two perpendicular bars inside a span
        // that rotates 45deg to form an X — Adco FAQ pattern). No lucide SVG involved.
        function setCssPlusRotateState(btn, expanded) {
            var icon = btn.querySelector('span[aria-hidden="true"]');
            if (!icon || !icon.querySelector('span')) {
                var spans = btn.querySelectorAll('span');
                icon = spans.length ? spans[spans.length - 1] : null;
            }
            if (!icon || !icon.querySelector('span')) return false;
            if (expanded) {
                icon.classList.remove('rotate-0');
                icon.classList.add('rotate-45');
            } else {
                icon.classList.remove('rotate-45');
                icon.classList.add('rotate-0');
            }
            return true;
        }

        // EC-ACCORDION-019: Text "+/−" toggle indicator. A React useState FAQ that renders
        // {isOpen ? "—" : "+"} inside a <span> (The Hollywood Effect) has NO lucide SVG, NO
        // chevron, and NO CSS-rotate span — so none of the icon handlers above can see it,
        // and the glyph never changed on toggle. Swap the glyph's text directly. The exact
        // plus/minus characters the site uses (e.g. "+" and an em dash "—") are resolved once
        // from the live DOM so we reuse them verbatim instead of guessing.
        var __wpcFaqPlusGlyph = '+';
        var __wpcFaqMinusGlyph = '−';
        var __wpcFaqGlyphsResolved = false;
        function isFaqPlusGlyph(t) { return t === '+'; }
        function isFaqMinusGlyph(t) {
            return t === '−' || t === '—' || t === '–' || t === '-';
        }
        function findTextToggleIndicator(btn) {
            if (!btn || !btn.querySelectorAll) return null;
            var els = btn.querySelectorAll('span, i, em, b, strong, div');
            for (var k = els.length - 1; k >= 0; k--) {
                var e = els[k];
                if (e.children && e.children.length) continue; // leaf only
                var t = (e.textContent || '').trim();
                if (t.length === 1 && (isFaqPlusGlyph(t) || isFaqMinusGlyph(t))) return e;
            }
            return null;
        }
        function resolveFaqToggleGlyphs() {
            if (__wpcFaqGlyphsResolved) return;
            __wpcFaqGlyphsResolved = true;
            try {
                var btns = document.querySelectorAll(
                    'section[id="faq"] button, [id="faq"] button, button[data-wpconvert-accordion]'
                );
                for (var i = 0; i < btns.length; i++) {
                    var ind = findTextToggleIndicator(btns[i]);
                    if (!ind) continue;
                    var t = (ind.textContent || '').trim();
                    if (isFaqPlusGlyph(t)) __wpcFaqPlusGlyph = t;
                    else if (isFaqMinusGlyph(t)) __wpcFaqMinusGlyph = t;
                }
            } catch (e) {}
        }
        function setTextPlusMinusState(btn, expanded) {
            var ind = findTextToggleIndicator(btn);
            if (!ind) return false;
            resolveFaqToggleGlyphs();
            ind.textContent = expanded ? __wpcFaqMinusGlyph : __wpcFaqPlusGlyph;
            return true;
        }

        // EC-ACCORDION-014: The sibling group container for an accordion item.
        // React single-open FAQs (useState<number|null>) render items as siblings
        // inside one <ul>/<ol>/<dl> or a shared wrapper. Grouping by the nearest
        // such container keeps "open one closes the others" scoped to ONE
        // accordion — never unrelated accordions elsewhere on the page.
        function findAccordionGroup(el) {
            if (!el) return null;
            var group = el.closest('ul, ol, dl, [role="list"]');
            if (group) return group;
            if (el.parentElement && el.parentElement.parentElement) return el.parentElement.parentElement;
            return el.parentElement || null;
        }

        // EC-ACCORDION-014: Collapse a grid-rows accordion item — used to close
        // sibling items in single-open groups. Mirrors the manual "close" path.
        // EC-ACCORDION-027: also collapse height/opacity panels, and swap the
        // captured open/closed class tokens on the item wrapper + marker box
        // (Synergi: border-l-4 / dark chevron square follow isOpen).
        function classTokens(el) {
            return ((el && el.getAttribute && el.getAttribute('class')) || '').split(/\s+/).filter(Boolean);
        }
        // EC-ACCORDION-027b: a row wears some classes because of WHERE IT SITS in
        // the list, not because it is open. The initially-open row is row 1, so its
        // first-row corner rounding and seam borders looked exactly like open-state
        // chrome — moving them rounded the middle of the list and left row 1
        // permanently square. No token family below can express "this row is open".
        function isPositionalToken(t) {
            if (!t) return true;
            if (/^(?:first|last|odd|even|only):/.test(t)) return true;
            var bare = t.replace(/^(?:[a-z-]+:)+/, '');
            if (/^rounded-(?:t|b|l|r|tl|tr|bl|br|s|e|ss|se|es|ee)(?:-|$)/.test(bare)) return true;
            if (/^-?m[trblxyse]?-/.test(bare)) return true;
            if (/^border-(?:t|b|l|r|x|y)-0$/.test(bare)) return true;
            if (/^(?:order|col-start|col-end|row-start|row-end)-/.test(bare)) return true;
            return false;
        }
        // Tokens the open row has that NO closed row has — the open state, with the
        // positional families removed.
        function stateTokensOnlyOnOpen(openEl, closedEls) {
            var out = [];
            var mine = classTokens(openEl);
            for (var i = 0; i < mine.length; i++) {
                var t = mine[i];
                if (isPositionalToken(t)) continue;
                var seen = false;
                for (var j = 0; j < closedEls.length; j++) {
                    if (classTokens(closedEls[j]).indexOf(t) !== -1) { seen = true; break; }
                }
                if (!seen) out.push(t);
            }
            return out;
        }
        // The resting baseline is what EVERY closed row agrees on. Reading a single
        // arbitrary sibling let that row's own positional tokens (the last row's
        // bottom rounding) get pushed onto whichever row closes.
        function stateTokensSharedByClosed(closedEls, openEl) {
            if (!closedEls.length) return [];
            var out = [];
            var first = classTokens(closedEls[0]);
            var openTokens = classTokens(openEl);
            for (var i = 0; i < first.length; i++) {
                var t = first[i];
                if (isPositionalToken(t)) continue;
                if (openTokens.indexOf(t) !== -1) continue;
                var all = true;
                for (var j = 1; j < closedEls.length; j++) {
                    if (classTokens(closedEls[j]).indexOf(t) === -1) { all = false; break; }
                }
                if (all) out.push(t);
            }
            return out;
        }
        function findMarkerBox(btn) {
            var chev = btn.querySelector('.lucide-chevron-down, .lucide-chevron-up, [class*="chevron"]');
            if (chev && chev.parentElement && chev.parentElement !== btn) return chev.parentElement;
            return null;
        }
        function applyTokenSwap(el, onTokens, offTokens, expanded) {
            if (!el) return;
            var add = expanded ? onTokens : offTokens;
            var remove = expanded ? offTokens : onTokens;
            for (var i = 0; i < remove.length; i++) { try { el.classList.remove(remove[i]); } catch (e) {} }
            for (var j = 0; j < add.length; j++) { try { el.classList.add(add[j]); } catch (e) {} }
        }
        function applyItemChrome(btn, expanded) {
            var grp = findAccordionGroup(btn);
            if (!grp) return;
            var wrapOn = (grp.getAttribute('data-wpc-acc-wrap-on') || '').split(/\s+/).filter(Boolean);
            var wrapOff = (grp.getAttribute('data-wpc-acc-wrap-off') || '').split(/\s+/).filter(Boolean);
            if (wrapOn.length || wrapOff.length) applyTokenSwap(btn.parentElement, wrapOn, wrapOff, expanded);
            var markOn = (grp.getAttribute('data-wpc-acc-mark-on') || '').split(/\s+/).filter(Boolean);
            var markOff = (grp.getAttribute('data-wpc-acc-mark-off') || '').split(/\s+/).filter(Boolean);
            if (markOn.length || markOff.length) applyTokenSwap(findMarkerBox(btn), markOn, markOff, expanded);
        }
        function captureItemChrome(grp, openBtn, closedBtns) {
            if (!grp || !openBtn || !closedBtns || !closedBtns.length) return;
            var ow = openBtn.parentElement;
            var closedWraps = [];
            for (var i = 0; i < closedBtns.length; i++) {
                var w = closedBtns[i].parentElement;
                if (w && w !== ow) closedWraps.push(w);
            }
            if (ow && closedWraps.length) {
                var wrapOn = stateTokensOnlyOnOpen(ow, closedWraps);
                var wrapOff = stateTokensSharedByClosed(closedWraps, ow);
                if (wrapOn.length) grp.setAttribute('data-wpc-acc-wrap-on', wrapOn.join(' '));
                if (wrapOff.length) grp.setAttribute('data-wpc-acc-wrap-off', wrapOff.join(' '));
            }
            var om = findMarkerBox(openBtn);
            var closedMarks = [];
            for (var k = 0; k < closedBtns.length; k++) {
                var cm = findMarkerBox(closedBtns[k]);
                if (cm && cm !== om) closedMarks.push(cm);
            }
            if (om && closedMarks.length) {
                var markOn = stateTokensOnlyOnOpen(om, closedMarks);
                var markOff = stateTokensSharedByClosed(closedMarks, om);
                if (markOn.length) grp.setAttribute('data-wpc-acc-mark-on', markOn.join(' '));
                if (markOff.length) grp.setAttribute('data-wpc-acc-mark-off', markOff.join(' '));
            }
        }
        function collapseAccordionItem(otherBtn) {
            var oc = findContentPanel(otherBtn);
            if (oc && oc.hasAttribute('data-wpconvert-grid-accordion')) {
                oc.style.gridTemplateRows = '0fr';
                oc.style.opacity = '0';
                oc.classList.remove('opacity-100');
                oc.classList.add('opacity-0');
            } else if (oc) {
                var currentHeight = oc.scrollHeight || oc.offsetHeight;
                oc.style.height = currentHeight + 'px';
                oc.offsetHeight;
                oc.style.height = '0px';
                oc.style.opacity = '0';
            }
            otherBtn.setAttribute('data-expanded', 'false');
            otherBtn.setAttribute('aria-expanded', 'false');
            setLucidePlusMinusState(otherBtn, false);
            setCssPlusRotateState(otherBtn, false);
            setTextPlusMinusState(otherBtn, false); // EC-ACCORDION-019: text +/− indicator
            var chev = otherBtn.querySelector('.lucide-chevron-down, .lucide-chevron-up, [class*="chevron"]');
            if (chev) chev.style.transform = 'rotate(0deg)';
            applyItemChrome(otherBtn, false);
        }
        function collapseGridAccordionItem(otherBtn) {
            collapseAccordionItem(otherBtn);
        }
        function closeSiblingAccordions(btn) {
            var grp = findAccordionGroup(btn);
            if (!grp || grp.getAttribute('data-wpc-accordion-single') !== '1') return;
            grp.querySelectorAll('button[data-wpconvert-accordion]').forEach(function(ob) {
                if (ob !== btn && ob.getAttribute('data-expanded') === 'true') {
                    collapseAccordionItem(ob);
                }
            });
        }

        function init() {
            var buttons = document.querySelectorAll('button');
            var accordionsInitialized = 0;
            
            buttons.forEach(function(btn) {
                // EC-ACCORDION-012: Image-card CTA buttons (e.g. MenuCard
                // + Tilfoj) are explicitly stamped at build time as
                // non-accordion triggers. Honour the marker here so the
                // accordion init can never wire them up regardless of
                // what findContentPanel would otherwise return.
                if (btn.getAttribute('data-wpc-no-accordion-trigger') === '1') return;

                // EC-ACCORDION-007: Skip buttons with aria-controls pointing to existing
                // Radix content. The jQuery accordion handler already manages these via
                // aria-controls → role="region". Attaching a second handler on the
                // injected data-wpc-faq-answer div would show duplicate answers.
                // EC-ACCORDION-024: only skip when the target is genuinely Radix-managed
                // (role="region" or its own data-state). Non-Radix grid-rows panels
                // (Nexora audit trail) also carry aria-controls but NEED the vanilla
                // wiring — the blanket skip left them frozen open with no handler.
                var ariaCtrl = btn.getAttribute('aria-controls');
                var ctrlTarget = ariaCtrl ? document.getElementById(ariaCtrl) : null;
                if (ctrlTarget && (ctrlTarget.getAttribute('role') === 'region' || ctrlTarget.hasAttribute('data-state'))) return;

                var sibling = findContentPanel(btn);
                if (!sibling) return;

                // EC-NAV-283: Never treat a Bootstrap/Mobirise responsive navbar as an
                // accordion. The .navbar-collapse menu carries the collapse class
                // (matched by the /overflow-hidden|collapse/i sniff below) and its
                // .navbar-toggler (data-toggle/data-bs-toggle="collapse") is its own
                // collapse trigger, handled by Bootstrap + navbar-dropdown.js. Wiring the
                // accordion handler onto it force-collapses the DESKTOP menu to
                // height:0/opacity:0 (items "appear then disappear" on load) AND adds a
                // SECOND click handler that fights the native toggle (hamburger needs two
                // taps and shows the wrong open/closed icon). Leave the native navbar to
                // its own JS.
                if ((btn.matches && btn.matches('.navbar-toggler, [data-toggle="collapse"], [data-bs-toggle="collapse"]')) ||
                    (sibling.classList && sibling.classList.contains('navbar-collapse'))) {
                    return;
                }

                var siblingClasses = sibling.className || '';
                var siblingStyle = sibling.getAttribute('style') || '';
                var hasHidden = sibling.hasAttribute('hidden');
                var hasRoleRegion = sibling.getAttribute('role') === 'region';
                
                // EC-ACCORDION-005: Also check first child for overflow-hidden (grid-rows pattern)
                var firstChild = sibling.firstElementChild;
                var childClasses = firstChild ? (firstChild.className || '') : '';
                
                // Detect accordion pattern:
                // 1. Sibling has overflow-hidden class (common accordion pattern)
                // 2. Sibling has height: 0 or height: auto in inline style
                // 3. Sibling has opacity: 0 or opacity: 1 in inline style
                // EC-ACCORDION-003: Also detect Radix UI pattern (role="region" + hidden + data-state)
                // EC-ACCORDION-005: Tailwind grid-rows-[0fr] pattern (sibling is grid, child has overflow-hidden)
                var isGridRowsAccordion = /grid-rows-\[0fr\]|grid-rows-\[1fr\]/.test(siblingClasses) || /grid-template-rows:\s*[01]fr/i.test(siblingStyle); // EC-ACCORDION-020: also inline grid-template-rows
                var hasChildOverflowHidden = /overflow-hidden/.test(childClasses);
                
                var isFaqAnswer = sibling.hasAttribute('data-wpc-faq-answer');
                var isAccordion = /overflow-hidden|collapse/i.test(siblingClasses) ||
                                  /height:[ ]*(0|auto)|opacity:[ ]*(0|1)/i.test(siblingStyle) ||
                                  (hasRoleRegion && (hasHidden || sibling.hasAttribute('data-state'))) ||
                                  (isGridRowsAccordion && hasChildOverflowHidden) ||
                                  isFaqAnswer;
                
                if (!isAccordion) return;
                
                // Check current state
                var isExpanded = false;
                if (isGridRowsAccordion) {
                    isExpanded = /grid-rows-\[1fr\]/.test(siblingClasses) || /grid-template-rows:\s*1fr/i.test(siblingStyle); // EC-ACCORDION-020
                    // EC-ACCORDION-024: the snapshot close pass stamps the BUTTON
                    // aria-expanded="false" but could not always re-collapse a
                    // grid-rows panel captured open. The button attribute is the
                    // source of truth (mirrors EC-ACCORDION-022) — honouring it
                    // here collapses frozen-open panels at init.
                    var btnExpandedAttr = btn.getAttribute('aria-expanded');
                    if (btnExpandedAttr === 'false') isExpanded = false;
                    else if (btnExpandedAttr === 'true') isExpanded = true;
                } else if (hasHidden || /display:[ ]*none/i.test(siblingStyle)) {
                    isExpanded = false;
                } else if (/height:[ ]*auto|opacity:[ ]*1/i.test(siblingStyle) && 
                           !/height:[ ]*0|opacity:[ ]*0/i.test(siblingStyle)) {
                    isExpanded = true;
                }
                
                btn.setAttribute('data-wpconvert-accordion', 'true');
                btn.setAttribute('data-expanded', isExpanded ? 'true' : 'false');
                sibling.setAttribute('data-wpconvert-accordion-content', 'true');
                
                // EC-ACCORDION-005: Grid-rows accordion uses grid-template-rows for animation
                if (isGridRowsAccordion) {
                    sibling.setAttribute('data-wpconvert-grid-accordion', 'true');
                    sibling.style.transition = 'grid-template-rows 0.3s ease, opacity 0.3s ease';
                    // EC-ACCORDION-014: drive opacity inline so the captured
                    // opacity-0 / opacity-100 classes can't leave an opened panel
                    // invisible, and keep aria-expanded in sync (source of truth
                    // for the jQuery handler, which we also guard against below).
                    if (!isExpanded) {
                        sibling.style.gridTemplateRows = '0fr';
                        sibling.style.opacity = '0';
                    } else {
                        sibling.style.gridTemplateRows = '1fr';
                        sibling.style.opacity = '1';
                    }
                    btn.setAttribute('aria-expanded', isExpanded ? 'true' : 'false');
                    setCssPlusRotateState(btn, isExpanded);
                } else {
                    // EC-ACCORDION-003: Remove hidden attribute and display:none so CSS can control visibility.
                    // The accordion starts collapsed via height:0 + opacity:0 instead.
                    sibling.removeAttribute('hidden');
                    sibling.style.display = '';
                    
                    sibling.style.overflow = 'hidden';
                    sibling.style.transition = 'height 0.3s ease, opacity 0.3s ease';
                    
                    // EC-ACCORDION-004: Tailwind max-h-0 class sets max-height:0px which
                    // blocks expansion regardless of inline height. Override with a
                    // large value instead of 'none' — some browsers treat 'none' (the
                    // initial value) as removing the inline declaration, letting the
                    // class rule win.
                    if (/max-h-/.test(siblingClasses)) {
                        sibling.style.maxHeight = '9999px';
                    }
                    
                    if (!isExpanded) {
                        sibling.style.height = '0px';
                        sibling.style.opacity = '0';
                    } else {
                        sibling.style.height = 'auto';
                        sibling.style.opacity = '1';
                    }
                }
                
                btn.addEventListener('click', function(e) {
                    e.preventDefault();
                    
                    var currentlyExpanded = btn.getAttribute('data-expanded') === 'true';
                    var content = findContentPanel(btn);
                    if (!content) return;

                    // EC-ACCORDION-014 / EC-ACCORDION-027: exclusive-open for
                    // both grid-rows and height/opacity groups.
                    if (!currentlyExpanded) closeSiblingAccordions(btn);
                    
                    // EC-ACCORDION-005: Grid-rows toggle
                    if (content.hasAttribute('data-wpconvert-grid-accordion')) {
                        if (currentlyExpanded) {
                            content.style.gridTemplateRows = '0fr';
                            content.style.opacity = '0';
                            content.classList.remove('opacity-100');
                            content.classList.add('opacity-0');
                            btn.setAttribute('data-expanded', 'false');
                            btn.setAttribute('aria-expanded', 'false');
                            setCssPlusRotateState(btn, false);
                        } else {
                            content.style.gridTemplateRows = '1fr';
                            content.style.opacity = '1';
                            content.classList.remove('opacity-0');
                            content.classList.add('opacity-100');
                            btn.setAttribute('data-expanded', 'true');
                            btn.setAttribute('aria-expanded', 'true');
                            setCssPlusRotateState(btn, true);
                        }
                    } else if (currentlyExpanded) {
                        var currentHeight = content.scrollHeight || content.offsetHeight;
                        content.style.height = currentHeight + 'px';
                        content.offsetHeight;
                        content.style.height = '0px';
                        content.style.opacity = '0';
                        btn.setAttribute('data-expanded', 'false');
                    } else {
                        // EC-ACCORDION-004: Robust height measurement.
                        // Some browsers return scrollHeight=0 when height:0+overflow:hidden.
                        // Temporarily reveal to measure, then animate from 0.
                        var targetHeight = content.scrollHeight;
                        if (!targetHeight) {
                            content.style.transition = 'none';
                            content.style.height = 'auto';
                            content.style.maxHeight = '9999px';
                            content.style.opacity = '0';
                            targetHeight = content.scrollHeight || content.offsetHeight;
                            content.style.height = '0px';
                            content.offsetHeight; // force reflow
                            content.style.transition = 'height 0.3s ease, opacity 0.3s ease';
                        }
                        if (targetHeight > 0) {
                            content.style.height = targetHeight + 'px';
                        } else {
                            content.style.height = 'auto';
                        }
                        content.style.opacity = '1';
                        btn.setAttribute('data-expanded', 'true');
                        
                        setTimeout(function() {
                            if (btn.getAttribute('data-expanded') === 'true') {
                                content.style.height = 'auto';
                            }
                        }, 300);
                    }
                    
                    var plusIcon = btn.querySelector('.lucide-plus, [class*="plus"]');
                    var minusIcon = btn.querySelector('.lucide-minus, [class*="minus"]');
                    
                    if (plusIcon && minusIcon) {
                        if (currentlyExpanded) {
                            plusIcon.style.display = '';
                            minusIcon.style.display = 'none';
                        } else {
                            plusIcon.style.display = 'none';
                            minusIcon.style.display = '';
                        }
                    } else {
                        // EC-ACCORDION-013: single-icon useState pattern
                        // (isOpen ? <Minus/> : <Plus/>) — only ONE lucide icon
                        // exists, so morph it between plus and minus.
                        setLucidePlusMinusState(btn, !currentlyExpanded);
                    }
                    
                    var chevron = btn.querySelector('.lucide-chevron-down, .lucide-chevron-up, [class*="chevron"]');
                    if (chevron) {
                        chevron.style.transition = 'transform 0.3s ease';
                        chevron.style.transform = currentlyExpanded ? 'rotate(0deg)' : 'rotate(180deg)';
                    }

                    // EC-ACCORDION-019: swap a text "+/−" indicator (no-op if none present).
                    setTextPlusMinusState(btn, !currentlyExpanded);

                    // EC-ACCORDION-027: move wrapper/marker chrome with the open row.
                    applyItemChrome(btn, !currentlyExpanded);
                });
                
                var plusIcon = btn.querySelector('.lucide-plus, [class*="plus"]');
                var minusIcon = btn.querySelector('.lucide-minus, [class*="minus"]');
                if (plusIcon && minusIcon) {
                    if (isExpanded) {
                        plusIcon.style.display = 'none';
                        minusIcon.style.display = '';
                    } else {
                        plusIcon.style.display = '';
                        minusIcon.style.display = 'none';
                    }
                } else {
                    // EC-ACCORDION-013: single-icon pattern — sync the lone
                    // lucide plus/minus icon to the initial expanded state.
                    setLucidePlusMinusState(btn, isExpanded);
                }

                // EC-ACCORDION-019: sync a text "+/−" indicator to the initial state
                // (no-op if the button has no such glyph).
                setTextPlusMinusState(btn, isExpanded);
                
                accordionsInitialized++;
            });

            // EC-ACCORDION-014 + EC-ACCORDION-027: Detect single-open accordion
            // groups. React FAQs built with useState<number|null>(0) keep exactly
            // ONE panel open at a time. Mirror that when the captured DOM proves
            // the intent: a group of >=2 data-wpconvert-accordion buttons with
            // EXACTLY ONE initially expanded. Zero or many open stay multi-open
            // (014 contract). 014 only scanned grid-rows groups; 027 extends the
            // same fingerprint to height/opacity FAQs and captures wrapper/marker
            // class-token diffs so the baked-open chrome moves with the open row.
            try {
                var accBtns = document.querySelectorAll('button[data-wpconvert-accordion]');
                var seenGroups = [];
                accBtns.forEach(function(b) {
                    var grp = findAccordionGroup(b);
                    if (!grp || seenGroups.indexOf(grp) !== -1) return;
                    seenGroups.push(grp);
                    var groupBtns = grp.querySelectorAll('button[data-wpconvert-accordion]');
                    if (groupBtns.length < 2) return;
                    var openCount = 0;
                    var openBtn = null;
                    // EC-ACCORDION-027b: every closed row, not the first one. The
                    // resting chrome is what they all agree on.
                    var closedBtns = [];
                    groupBtns.forEach(function(gb) {
                        if (gb.getAttribute('data-expanded') === 'true') {
                            openCount++;
                            if (!openBtn) openBtn = gb;
                        } else {
                            closedBtns.push(gb);
                        }
                    });
                    if (openCount === 1) {
                        grp.setAttribute('data-wpc-accordion-single', '1');
                        captureItemChrome(grp, openBtn, closedBtns);
                    }
                });
            } catch (e) {}

            if (accordionsInitialized > 0) {
                console.log('WPConvert Accordion: Initialized ' + accordionsInitialized + ' accordion(s)');
            }
            
            // EC-ACCORDION-007: Enhance <details>/<summary> elements for consistent FAQ styling
            // Sub-pages may have FAQ sections converted to native <details>/<summary>.
            // Add animated +/- icon toggle and smooth open/close transitions.
            var detailsEnhanced = 0;
            document.querySelectorAll('details').forEach(function(det) {
                if (det.hasAttribute('data-wpc-enhanced')) return;
                det.setAttribute('data-wpc-enhanced', 'true');
                var summary = det.querySelector('summary');
                if (!summary) return;
                // EC-ACCORDION-017: If the source CSS already renders a toggle
                // marker via a ::before/::after pseudo-element (e.g. a
                // summary::after content of "+" plus a details[open] rotate),
                // injecting our own span icon would DOUBLE the marker — the user
                // sees two "+" (and a "+" beside a rotated half-"x") on every FAQ
                // row (KaliHub user report). Detect the CSS-generated marker and
                // leave the toggle entirely to the source CSS, which already
                // animates the open/closed state.
                //
                // EC-ACCORDION-017b: the marker is NOT always on the <summary>
                // itself. Editorial/serif templates (e.g. the Idle "Fresh New"
                // site) draw the +/- on a dedicated decorative CHILD span
                //   <summary>Question<span class="pm"></span></summary>
                // whose ::before/::after paint two positioned background bars
                // (a "+") with an EMPTY-STRING content value, not a "+" glyph.
                // The original guard only looked at summary::before/::after AND
                // only matched a text glyph, so it missed this shape and appended
                // a second toggle → two "+" per FAQ row again. Detect a marker on
                // the summary OR on any decorative (text-empty) child, and treat
                // an empty-string pseudo content value as a geometric marker too.
                function wpcSummaryPseudoIsMarker(el, pe) {
                    try {
                        var c = window.getComputedStyle(el, pe).getPropertyValue('content');
                        if (!c || c === 'none' || c === 'normal') return false;
                        // Text-glyph marker: +, −, ×, ✕, ✖, x, -
                        if (/[+−×✕✖x-]/i.test(c)) return true;
                        // Geometric marker: an empty-string content ("") that a
                        // decorative element paints as bars/shape via background
                        // or border (the "+"/"−" is drawn, not typed).
                        var stripped = c.replace(/^s*["']|["']s*$/g, '');
                        return stripped === '';
                    } catch (e) { return false; }
                }
                var hasCssToggleMarker =
                    wpcSummaryPseudoIsMarker(summary, '::before') ||
                    wpcSummaryPseudoIsMarker(summary, '::after');
                if (!hasCssToggleMarker) {
                    // A dedicated marker lives on a text-empty child (e.g. .pm).
                    var wpcMarkerKids = summary.querySelectorAll('*');
                    for (var wpcMk = 0; wpcMk < wpcMarkerKids.length; wpcMk++) {
                        var wpcKid = wpcMarkerKids[wpcMk];
                        if (wpcKid.textContent && wpcKid.textContent.trim() !== '') continue;
                        if (wpcSummaryPseudoIsMarker(wpcKid, '::before') ||
                            wpcSummaryPseudoIsMarker(wpcKid, '::after')) {
                            hasCssToggleMarker = true;
                            break;
                        }
                    }
                }
                // EC-ACCORDION-026: the marker is not always drawn in CSS. Tailwind/
                // lucide FAQs ship it as a real <svg> chevron after the question text,
                // rotated by the source's own group-open:rotate-180 class:
                //   <summary>Question<svg class="lucide-chevron-down"></svg></summary>
                // Both CSS guards above miss it (an <svg> is text-empty, so 017b
                // inspects it, but its ::before/::after report "none"), so every row got
                // a chevron AND an injected "+" (aileadit.com user report). A graphic
                // that TRAILS the question text is the row's toggle affordance; one that
                // precedes it is a category icon, and the row still needs a marker.
                if (!hasCssToggleMarker) {
                    try {
                        var wpcGraphics = summary.querySelectorAll('svg, img');
                        if (wpcGraphics.length) {
                            var wpcWalk = document.createTreeWalker(summary, NodeFilter.SHOW_TEXT, null);
                            var wpcLastText = null, wpcNode;
                            while ((wpcNode = wpcWalk.nextNode())) {
                                if (wpcNode.nodeValue && wpcNode.nodeValue.trim() !== '') wpcLastText = wpcNode;
                            }
                            if (wpcLastText) {
                                for (var wpcGi = 0; wpcGi < wpcGraphics.length; wpcGi++) {
                                    var wpcPos = wpcLastText.compareDocumentPosition(wpcGraphics[wpcGi]);
                                    if (wpcPos & Node.DOCUMENT_POSITION_FOLLOWING) {
                                        hasCssToggleMarker = true;
                                        break;
                                    }
                                }
                            }
                        }
                    } catch (e) { /* fall through and inject as before */ }
                }
                // EC-ACCORDION-028: the marker is not always a pseudo-element, a
                // CSS-painted child, or a graphic. Editorial templates ship it as a real
                // element holding a real glyph, animated by the source's own CSS:
                //   <summary><time>00:00</time><strong>Chapter</strong><b>+</b></summary>
                //   .ed-accordion details[open] summary b { transform: rotate(45deg) }
                // 017 finds no pseudo-element, 017b skips the <b> because it HAS text, and
                // 026 only looks for <svg>/<img> — so every row rendered the source "+" AND
                // an injected one, and an open row showed "+" beside "−" (N0BS Podcasts user
                // report). The enhancer's adopt-an-existing-icon path below is no help: it
                // only recognises a span:last-child, and adopting would be wrong anyway
                // because it rewrites the glyph to "−" while the source CSS rotates it to "×".
                // A leaf whose whole text is a toggle glyph and which TRAILS the question
                // text is the row's affordance, whatever tag carries it; one that precedes
                // the text is a bullet, and the row still needs a marker.
                if (!hasCssToggleMarker) {
                    try {
                        var wpcGlyphKids = summary.querySelectorAll('*');
                        for (var wpcGk = 0; wpcGk < wpcGlyphKids.length; wpcGk++) {
                            var wpcCand = wpcGlyphKids[wpcGk];
                            if (wpcCand.children && wpcCand.children.length) continue;
                            if (!/^[-+×–—−✕✖]$/.test((wpcCand.textContent || '').trim())) continue;
                            var wpcGw = document.createTreeWalker(summary, NodeFilter.SHOW_TEXT, null);
                            var wpcGn, wpcTextBefore = null;
                            while ((wpcGn = wpcGw.nextNode())) {
                                if (!wpcGn.nodeValue || wpcGn.nodeValue.trim() === '') continue;
                                if (wpcCand.contains(wpcGn)) continue;
                                if (wpcGn.compareDocumentPosition(wpcCand) & Node.DOCUMENT_POSITION_FOLLOWING) {
                                    wpcTextBefore = wpcGn;
                                }
                            }
                            if (wpcTextBefore) { hasCssToggleMarker = true; break; }
                        }
                    } catch (e) { /* fall through and inject as before */ }
                }
                if (hasCssToggleMarker) {
                    detailsEnhanced++;
                    return;
                }
                // Add toggle icon if not already present
                var toggleSpan = summary.querySelector('.wpc-toggle-icon');
                if (!toggleSpan) {
                    var existingIcon = summary.querySelector('span:last-child');
                    // The hyphen leads the class deliberately: written as "[+-×]" this is a
                    // RANGE spanning U+002B–U+00D7, which matches every digit and letter.
                    if (existingIcon && /^[-+×]$/.test(existingIcon.textContent.trim())) {
                        toggleSpan = existingIcon;
                        toggleSpan.classList.add('wpc-toggle-icon');
                    } else {
                        toggleSpan = document.createElement('span');
                        toggleSpan.className = 'wpc-toggle-icon';
                        toggleSpan.textContent = '+';
                        toggleSpan.style.cssText = 'margin-left:auto;transition:transform 0.3s ease;font-size:1.25em;';
                        summary.appendChild(toggleSpan);
                    }
                }
                function updateIcon() {
                    if (det.open) {
                        toggleSpan.textContent = toggleSpan.textContent === '+' ? '−' : toggleSpan.textContent;
                        toggleSpan.style.transform = 'rotate(45deg)';
                    } else {
                        toggleSpan.textContent = toggleSpan.textContent === '−' ? '+' : toggleSpan.textContent;
                        toggleSpan.style.transform = 'rotate(0deg)';
                    }
                }
                det.addEventListener('toggle', updateIcon);
                updateIcon();
                detailsEnhanced++;
            });
            if (detailsEnhanced > 0) {
                console.log('WPConvert Accordion: Enhanced ' + detailsEnhanced + ' <details> element(s)');
            }
        }
        
        // Initialize when DOM is ready
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', init);
        } else {
            init();
        }
        
    })();
    </script>
        <script id="wpconvert-smooth-scroll">
    (function() {
        'use strict';
        
        // Configuration
        const CONFIG = {
            offset: 80,              // Offset from top (accounts for sticky headers)
            duration: 800,           // Scroll duration in ms
            easing: 'easeInOutCubic' // Easing function
        };
        
        // Easing functions
        const easings = {
            linear: function(t) { return t; },
            easeInOutCubic: function(t) { 
                return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; 
            },
            easeInOutQuad: function(t) {
                return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
            }
        };
        
        /**
         * Smooth scroll to target element
         */
        function smoothScrollTo(target, duration, offset, easing) {
            const targetPosition = target.getBoundingClientRect().top + window.pageYOffset - offset;
            const startPosition = window.pageYOffset;
            const distance = targetPosition - startPosition;
            const easingFunction = easings[easing] || easings.easeInOutCubic;
            let startTime = null;
            
            function animation(currentTime) {
                if (startTime === null) startTime = currentTime;
                const timeElapsed = currentTime - startTime;
                const progress = Math.min(timeElapsed / duration, 1);
                const ease = easingFunction(progress);
                
                window.scrollTo(0, startPosition + distance * ease);
                
                if (timeElapsed < duration) {
                    requestAnimationFrame(animation);
                } else {
                    // Update URL hash without jumping
                    if (target.id && window.history && window.history.pushState) {
                        window.history.pushState(null, null, '#' + target.id);
                    }
                }
            }
            
            requestAnimationFrame(animation);
        }
        
        /**
         * Calculate header offset dynamically
         * Accounts for sticky/fixed headers
         */
        function getHeaderOffset() {
            const fixedElements = document.querySelectorAll('header, nav, [class*="sticky"], [class*="fixed"]');
            let maxHeight = CONFIG.offset;
            
            fixedElements.forEach(function(el) {
                const styles = window.getComputedStyle(el);
                const position = styles.position;
                
                if (position === 'fixed' || position === 'sticky') {
                    const rect = el.getBoundingClientRect();
                    // Only consider elements at top of page
                    if (rect.top < 100) {
                        maxHeight = Math.max(maxHeight, rect.height + 20);
                    }
                }
            });
            
            return maxHeight;
        }
        
        /**
         * Find target element by ID or data attribute
         * Handles cases where IDs were modified during conversion
         */
        function findTarget(hash) {
            // Remove # from hash
            const id = hash.replace('#', '');
            if (!id) return null;
            
            // Try direct ID match
            let target = document.getElementById(id);
            if (target) return target;
            
            // Try case-insensitive match (IDs might have been lowercased)
            const elements = document.querySelectorAll('[id]');
            for (let i = 0; i < elements.length; i++) {
                if (elements[i].id.toLowerCase() === id.toLowerCase()) {
                    return elements[i];
                }
            }
            
            // Try data-section attribute (common in converted SPAs)
            target = document.querySelector('[data-section="' + id + '"]');
            if (target) return target;
            
            // Try finding by heading text content (last resort)
            const headings = document.querySelectorAll('h1, h2, h3');
            const searchText = id.replace(/-/g, ' ').toLowerCase();
            for (let i = 0; i < headings.length; i++) {
                const headingText = headings[i].textContent.toLowerCase();
                if (headingText.includes(searchText)) {
                    return headings[i];
                }
            }
            
            return null;
        }
        
        /**
         * Handle anchor link clicks
         */
        function handleAnchorClick(e) {
            // EC-EDITOR-005: Skip when WPConvert editor is active to avoid scroll conflict
            if (window.location.search.indexOf('wpc_edit=1') !== -1) return;

            const href = this.getAttribute('href');
            
            // Only handle anchor links (starting with #)
            if (!href || !href.startsWith('#')) return;
            
            // Skip empty hashes
            if (href === '#' || href === '#!') return;

            // EC-NAV-285: Never hijack Bootstrap/Mobirise interactive controls that
            // happen to use an in-page href. Carousel/lightbox prev-next controls are
            // <a class="carousel-control-next" data-bs-slide="next" href="#lb-xxxx">, and
            // collapse/modal/tab/dropdown togglers are <a data-bs-toggle="..." href="#id">.
            // The universal handler would preventDefault + smooth-scroll the page to that
            // target, so any control click — including a gallery that auto-advances every
            // few seconds via a synthetic click — yanks the page away ("auto-scrolls to
            // the top"). Let Bootstrap own these; only real in-page nav links scroll.
            if (this.matches && this.matches(
                '.carousel-control, .carousel-control-next, .carousel-control-prev, ' +
                '[data-bs-slide], [data-slide], [data-bs-slide-to], [data-slide-to], ' +
                '[data-bs-toggle], [data-toggle], [data-bs-dismiss], [data-dismiss], ' +
                '.dropdown-toggle, .navbar-toggler'
            )) {
                return;
            }

            const target = findTarget(href);
            
            if (target) {
                e.preventDefault();
                
                // Get dynamic header offset
                const offset = getHeaderOffset();
                
                // Smooth scroll to target
                smoothScrollTo(target, CONFIG.duration, offset, CONFIG.easing);
                
                // Update focus for accessibility
                target.setAttribute('tabindex', '-1');
                target.focus();
            } else if (/^#top$/i.test(href)) {
                // EC-NAV-444: no element answers to this, and none has to. The
                // HTML standard resolves the fragment "top" to the top of the
                // document itself, which is what a one-page nav's Home link means
                // and what EC-NAV-444 rewrites a dead home anchor to. Without
                // this the click fell through to the warning below and did
                // nothing at all.
                e.preventDefault();
                window.scrollTo({ top: 0, behavior: 'smooth' });
            } else {
                // Target not found - log warning but don't break
                console.warn('WPConvert Smooth Scroll: Target not found for', href);
            }
        }
        
        /**
         * Initialize smooth scroll on page load
         */
        function init() {
            // Handle all anchor links
            const anchorLinks = document.querySelectorAll('a[href^="#"]');
            anchorLinks.forEach(function(link) {
                link.addEventListener('click', handleAnchorClick);
            });
            
            // CONSERVATIVE FALLBACK: Handle buttons with explicit data attributes
            // Only activates if button has data-scroll-to or similar attributes
            const scrollButtons = document.querySelectorAll('button[data-scroll-to], button[data-anchor]');
            scrollButtons.forEach(function(btn) {
                const scrollTarget = btn.getAttribute('data-scroll-to') || btn.getAttribute('data-anchor');
                if (scrollTarget) {
                    btn.addEventListener('click', function(e) {
                        const targetId = scrollTarget.replace('#', '');
                        const target = document.getElementById(targetId);
                        if (target) {
                            e.preventDefault();
                            const offset = getHeaderOffset();
                            smoothScrollTo(target, CONFIG.duration, offset, CONFIG.easing);
                            console.log('WPConvert Smooth Scroll: Button scrolled to #' + targetId);
                        }
                    });
                }
            });
            
            // Handle hash in URL on page load
            if (window.location.hash) {
                // Small delay to ensure page is fully loaded
                setTimeout(function() {
                    const target = findTarget(window.location.hash);
                    if (target) {
                        const offset = getHeaderOffset();
                        smoothScrollTo(target, CONFIG.duration, offset, CONFIG.easing);
                    }
                }, 100);
            }
        }
        
        // Initialize when DOM is ready
        if (document.readyState === 'loading') {
            document.addEventListener('DOMContentLoaded', init);
        } else {
            init();
        }
        
    })();
    </script>
        <style id="wpconvert-carousel-visibility-footer">
    .scroll-fade-up:has([aria-roledescription="carousel"]),
    .scroll-fade-up:has([data-wpconvert-carousel]),
    .scroll-fade-up:has([data-wpconvert-blog-filter-bar]) {
      opacity: 1 !important;
      transform: none !important;
      visibility: visible !important;
    }
    [role="region"][aria-roledescription="carousel"],
    [data-wpconvert-carousel="aria"] {
      opacity: 1 !important;
      visibility: visible !important;
    }
    </style>
        </body>
</html>