/**
 * Tree Insurance Agency — motion and hover states from the approved homepage
 * draft, applied to native Elementor widgets.
 *
 * Each rule keys off a CSS class set in an element's Advanced > CSS Classes
 * field. Content and styling stay in Elementor; delete a class and that
 * element falls back to plain Elementor behaviour.
 *
 *   ti-hero            hero section: leaf canopy drifts
 *   ti-rise ti-d-NN    entrance: rises in after NN hundredths of a second
 *   hl                 <span class="hl"> inside a heading: green marker bar
 *   ti-film / ti-play  video frame sheen / pulsing ring on the play button
 *   ti-door            lift on hover (hero doors)
 *   ti-panels/ti-panel/ti-panel__desc   photo panels that widen on hover
 *   ti-marquee         carrier carousel glides at a constant speed
 *   ti-arrow           button arrow nudges right on hover
 *   ti-scale / ti-scale-band            $5M–$20M band grows in
 *   ti-qa / ti-more    accordion icon from the draft / "show more" link toggle
 *   ti-guide           Resources card hover
 *   ti-office          office address underline
 *   ti-lift            interior page cards: lift, shadow and icon nudge on hover
 *
 * Bizopia.
 */

:root {
	--ti-ease: cubic-bezier(.22, 1, .36, 1);
}

/* Hero ------------------------------------------------------------------- */
.ti-hero { overflow: hidden; }
.ti-hero .hl { position: relative; white-space: nowrap; z-index: 0; }
.ti-hero .hl::after {
	content: ""; position: absolute; left: -.08em; right: -.08em; bottom: .04em; height: .38em;
	background: #8FB73C; border-radius: 2px; z-index: -1;
}
.ti-film { position: relative; isolation: isolate; overflow: hidden; }
.ti-film::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
	background: linear-gradient(104deg, transparent 40%, rgba(204,225,163,.13) 48%, transparent 57%);
	background-size: 240% 100%; background-position: 130% 0;
}
.ti-play .elementor-icon { position: relative; transition: transform .3s var(--ti-ease), background-color .3s var(--ti-ease); }
.ti-play .elementor-icon:hover { transform: scale(1.06); background-color: #B2D264; }
.ti-play .elementor-icon svg { margin-left: 4px; }
.ti-play .elementor-icon::after {
	content: ""; position: absolute; inset: -10px; border-radius: 50%;
	border: 2px solid #8FB73C; animation: ti-ring 2.8s var(--ti-ease) infinite;
}
@keyframes ti-ring {
	0% { transform: scale(.9); opacity: .6; }
	70% { transform: scale(1.3); opacity: 0; }
	100% { opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
	.ti-rise { animation: ti-rise .9s var(--ti-ease) var(--d, 0s) both; }
	.ti-hero .hl::after { transform: scaleX(0); transform-origin: left center; animation: ti-hl-sweep .8s var(--ti-ease) .5s both; }
	.ti-hero::before {
		top: -160px !important; right: -160px !important; bottom: -160px !important; left: -160px !important;
		width: auto !important; height: auto !important;
		animation: ti-canopy 44s ease-in-out infinite alternate;
	}
	.ti-film::after { animation: ti-sheen 9s ease-in-out 2.4s infinite; }
}
.ti-d-05 { --d: .05s; } .ti-d-12 { --d: .12s; } .ti-d-26 { --d: .26s; } .ti-d-28 { --d: .28s; } .ti-d-36 { --d: .36s; }
.ti-d-44 { --d: .44s; } .ti-d-50 { --d: .5s; } .ti-d-56 { --d: .56s; } .ti-d-63 { --d: .63s; } .ti-d-70 { --d: .7s; }
@keyframes ti-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ti-hl-sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ti-canopy { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-52px, -34px, 0); } }
@keyframes ti-sheen { 0%, 74% { background-position: 130% 0; } 100% { background-position: -40% 0; } }

/* Doors ------------------------------------------------------------------- */
.ti-door { transition: transform .35s var(--ti-ease), box-shadow .35s var(--ti-ease) !important; }
.ti-door:hover { transform: translateY(-4px); }
.ti-door img { transition: transform .7s var(--ti-ease); }
.ti-door:hover img { transform: scale(1.045); }
.ti-door .elementor-widget-icon svg, .ti-guide .elementor-widget-icon svg { transition: transform .35s var(--ti-ease); }
.ti-door:hover .elementor-widget-icon svg, .ti-guide:hover .elementor-widget-icon svg { transform: translateX(4px); }

/* Buttons with an arrow --------------------------------------------------- */
.ti-arrow .elementor-button-icon { transition: transform .35s var(--ti-ease); }
.ti-arrow .elementor-button:hover .elementor-button-icon { transform: translateX(3px); }

/* Photo panels: the hovered one opens, the first one is open at rest ------ */
/* Elementor sizes containers through --height, so set the variable, not height */
.e-con.ti-panels { --open-grow: 2.2; --height: clamp(290px, 25vw, 340px); }
.e-con.ti-panels > .e-con.ti-panel {
	--open: 0; flex: 1 1 0 !important; min-width: 0; --height: 100%; min-height: 0 !important;
	transition: flex-grow .65s var(--ti-ease);
}
.e-con.ti-panels > .e-con.ti-panel:first-child { --open: 1; flex-grow: var(--open-grow) !important; }
.e-con.ti-panels:has(> .ti-panel:hover, > .ti-panel:focus-within) > .e-con.ti-panel { --open: 0; flex-grow: 1 !important; }
.e-con.ti-panels:has(> .ti-panel:hover, > .ti-panel:focus-within) > .e-con.ti-panel:is(:hover, :focus-within) { --open: 1; flex-grow: var(--open-grow) !important; }
.ti-panel h3 { white-space: nowrap; }
.ti-panel .ti-panel__desc {
	width: 28ch; max-width: 100%; min-height: 2.9em; opacity: var(--open); translate: 0 calc((1 - var(--open)) * 6px);
	transition: opacity .35s var(--ti-ease) calc(var(--open) * .18s), translate .35s var(--ti-ease) calc(var(--open) * .18s);
}
@media (max-width: 1040px), (hover: none) {
	/* Narrow and touch screens: a row to swipe through, every description showing */
	.e-con.ti-panels {
		--height: auto; width: calc(100% + 80px) !important; max-width: none !important; flex-wrap: nowrap !important; overflow-x: auto; scroll-snap-type: x mandatory;
		margin: 0 -40px; padding: 0 40px !important; scroll-padding-inline: 40px; scrollbar-width: none;
	}
	.ti-panels::-webkit-scrollbar { display: none; }
	.e-con.ti-panels > .e-con.ti-panel, .e-con.ti-panels > .e-con.ti-panel:first-child { flex: 0 0 min(76%, 300px) !important; --height: auto; aspect-ratio: 4 / 5; scroll-snap-align: start; }
	.ti-panel .ti-panel__desc { opacity: 1; translate: none; width: auto; }
}
@media (max-width: 720px) {
	.e-con.ti-panels { width: calc(100% + 40px) !important; margin: 0 -20px; padding: 0 20px !important; scroll-padding-inline: 20px; }
}

/* Carrier marquee --------------------------------------------------------- */
.ti-marquee .swiper-wrapper { transition-timing-function: linear !important; }
.ti-marquee img { opacity: .88; transition: opacity .25s; }
.ti-marquee img:hover { opacity: 1; }

/* Property scale ---------------------------------------------------------- */
.ti-scale-band { transform-origin: left center; overflow: visible !important; }
.ti-scale-band::before, .ti-scale-band::after {
	content: "" !important; display: block !important; position: absolute !important;
	top: -6px !important; bottom: -6px !important; width: 2px !important; height: auto !important;
	background: #8FB73C !important; mix-blend-mode: normal !important; opacity: 1 !important; border-radius: 0 !important; z-index: 1;
}
.ti-scale-band::before { left: 0 !important; right: auto !important; }
.ti-scale-band::after { right: 0 !important; left: auto !important; }
@media (prefers-reduced-motion: no-preference) {
	.ti-scale.in-view .ti-scale-band { animation: ti-grow 1.2s var(--ti-ease) both; }
}
@keyframes ti-grow { from { transform: scaleX(.2); } to { transform: none; } }

/* Accordion icon from the draft: a ring with a plus that turns into a minus */
.elementor-widget-n-accordion.ti-qa .e-n-accordion-item-title-icon {
	position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #7E766D;
	transition: background-color .3s var(--ti-ease), border-color .3s var(--ti-ease), transform .45s var(--ti-ease);
}
.ti-qa .e-n-accordion-item-title-icon > span { display: none !important; }
.ti-qa .e-n-accordion-item-title-icon::before, .ti-qa .e-n-accordion-item-title-icon::after {
	content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 1.5px; margin: -.75px 0 0 -6px;
	border-radius: 1px; background: #1D3617; transition: transform .45s var(--ti-ease), background-color .3s var(--ti-ease);
}
.ti-qa .e-n-accordion-item-title-icon::after { transform: rotate(90deg); }
.ti-qa .e-n-accordion-item-title:hover .e-n-accordion-item-title-icon { border-color: #1D3617; }
.ti-qa details[open] > summary .e-n-accordion-item-title-icon { background: #1D3617; border-color: #1D3617; transform: rotate(180deg); }
.ti-qa details[open] > summary .e-n-accordion-item-title-icon::before,
.ti-qa details[open] > summary .e-n-accordion-item-title-icon::after { background: #FBF8F4; }
.ti-qa details[open] > summary .e-n-accordion-item-title-icon::after { transform: rotate(0deg); }
.ti-qa .e-n-accordion > details:last-child { border-bottom: 1px solid #D7C9B7; }

/* "Show home & auto carriers": a text link under the logos, not a bar ---- */
.ti-more .e-n-accordion-item-title { margin-left: 260px; }
.ti-more .e-n-accordion-item-title-icon { display: none !important; }
.ti-more .e-n-accordion-item-title-text { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
@media (max-width: 1040px) { .ti-more .e-n-accordion-item-title { margin-left: 0; } }
/* Open content renders above the toggle, so "Hide all" ends up under the last logo */
.ti-more details.e-n-accordion-item { display: flex; flex-direction: column-reverse; }
.ti-more details[open] > summary { margin-top: 14px; }
/* ti-more--flush: no label-column indent (carriers page) */
.ti-more--flush .e-n-accordion-item-title { margin-left: 0; }

/* Resources cards --------------------------------------------------------- */
.ti-guide:hover .elementor-widget-theme-post-title .elementor-heading-title { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* Offices: leaf-green underline under the address ------------------------- */
.ti-office .elementor-heading-title, .ti-office .elementor-heading-title a { text-decoration-color: #8FB73C; text-underline-offset: 3px; }
.ti-office .elementor-heading-title a:hover { text-decoration-color: currentColor; }

/* Footer closing line: the bold phrase is medium, not bold ------------------ */
.ti-roots h2 b, .ti-roots h2 strong { font-weight: 500; }

/* Shop board: the caption under the chosen quote is editable in the widget */
.ti-w .board__quote.is-pick::after { content: var(--pick-label, "Your pick"); }

/* Interior page cards: lift and shadow on hover, the icon badge nudges up -- */
.ti-lift { transition: transform .35s var(--ti-ease), box-shadow .35s var(--ti-ease), border-color .35s var(--ti-ease) !important; }
.ti-lift:hover { transform: translateY(-5px); box-shadow: 0 22px 44px -26px rgba(29, 54, 23, .45); border-color: #CFE0C2 !important; }
.ti-lift .elementor-widget-icon .elementor-icon { transition: transform .35s var(--ti-ease), background-color .35s var(--ti-ease); }
.ti-lift:hover .elementor-widget-icon .elementor-icon { transform: translateY(-3px) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) { .ti-lift, .ti-lift:hover, .ti-lift:hover .elementor-widget-icon .elementor-icon { transform: none; transition: none; } }
