/**
 * ZuuzEatsWell — Animation & Effect Styles
 * Implements CSS-only and vanilla-JS-targeted effects from the UI component library.
 */

/* ==========================================================================
   1. TUBELIGHT NAVBAR — Active item glow indicator
   ========================================================================== */

.site-nav .wp-block-navigation__container > .wp-block-navigation-item > a,
.site-nav a {
	position: relative;
	transition: color 0.2s ease;
}

.site-nav .wp-block-navigation__container > .wp-block-navigation-item > a::after,
.site-nav a::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: 50%;
	transform: translateX(-50%) scaleX(0);
	width: 70%;
	height: 3px;
	border-radius: 100px;
	background: #10b981;
	box-shadow:
		0 0 8px 2px rgba(16, 185, 129, 0.7),
		0 0 20px 6px rgba(16, 185, 129, 0.35);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.site-nav .wp-block-navigation__container > .wp-block-navigation-item > a.is-active::after,
.site-nav a.is-active::after {
	transform: translateX(-50%) scaleX(1);
}

/* Hover preview (non-active links) */
.site-nav .wp-block-navigation__container > .wp-block-navigation-item > a:hover::after,
.site-nav a:not(.is-active):hover::after {
	transform: translateX(-50%) scaleX(0.5);
	box-shadow:
		0 0 6px 2px rgba(16, 185, 129, 0.4),
		0 0 12px 4px rgba(16, 185, 129, 0.2);
}


/* ==========================================================================
   2. TYPING ANIMATION — Character-by-character text reveal with cursor
   ========================================================================== */

.typing-text::after {
	content: '|';
	color: #059669;
	font-weight: 300;
	animation: blink-cursor 0.7s step-end infinite;
}

/* Remove cursor once typing is done (JS adds .typing-done class) */
.typing-text.typing-done::after {
	display: none;
}

@keyframes blink-cursor {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0; }
}


/* ==========================================================================
   3. GRADIENT ANIMATED TEXT — Animated green gradient on headings
   ========================================================================== */

.text-gradient-animated {
	background: linear-gradient(
		135deg,
		#059669 0%,
		#34d399 30%,
		#10b981 60%,
		#047857 100%
	);
	background-size: 300% 300%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
	0%   { background-position: 0%   50%; }
	50%  { background-position: 100% 50%; }
	100% { background-position: 0%   50%; }
}


/* ==========================================================================
   4. MARQUEE — Infinite horizontal scroll (testimonials, logos, etc.)
   ========================================================================== */

.marquee-wrapper {
	overflow: hidden;
	/* Side gradient masks */
	-webkit-mask-image: linear-gradient(
		to right,
		transparent 0%,
		black 10%,
		black 90%,
		transparent 100%
	);
	mask-image: linear-gradient(
		to right,
		transparent 0%,
		black 10%,
		black 90%,
		transparent 100%
	);
}

.marquee-track {
	display: flex;
	flex-wrap: nowrap;
	gap: 2rem;
	width: max-content;
	/* Animation starts only after JS clones children and adds .is-animated */
}

.marquee-track.is-animated {
	animation: marquee-scroll 35s linear infinite;
}

.marquee-track.is-animated:hover {
	animation-play-state: paused;
}

@keyframes marquee-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* Testimonial card — fixed width, no shrink */
.marquee-card {
	min-width: 320px;
	max-width: 340px;
	flex-shrink: 0;
	box-sizing: border-box;
}

/* Reverse direction variant */
.marquee-track--reverse {
	animation-direction: reverse;
}


/* ==========================================================================
   5. HOVER BUTTON OVERLAY — Expanding light overlay on hover
   ========================================================================== */

.wp-block-button__link.btn-hover-overlay,
a.btn-hover-overlay {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.wp-block-button__link.btn-hover-overlay::before,
a.btn-hover-overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.18);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: inherit;
	pointer-events: none;
}

.wp-block-button__link.btn-hover-overlay:hover::before,
a.btn-hover-overlay:hover::before {
	transform: scaleX(1);
}


/* ==========================================================================
   6. SCROLL REVEAL — Fade + slide up on scroll into view
   ========================================================================== */

.reveal-on-scroll {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-on-scroll.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Stagger variants (add data-delay="1|2|3" attribute) */
.reveal-on-scroll[data-delay="1"] { transition-delay: 0.1s; }
.reveal-on-scroll[data-delay="2"] { transition-delay: 0.2s; }
.reveal-on-scroll[data-delay="3"] { transition-delay: 0.3s; }
.reveal-on-scroll[data-delay="4"] { transition-delay: 0.4s; }


/* ==========================================================================
   7. IMAGE AUTO SLIDER — Infinite horizontal carousel (JS-driven cloning)
   ========================================================================== */

.image-slider-wrapper {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(
		to right,
		transparent 0%,
		black 8%,
		black 92%,
		transparent 100%
	);
	mask-image: linear-gradient(
		to right,
		transparent 0%,
		black 8%,
		black 92%,
		transparent 100%
	);
}

.image-slider-track {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.5rem;
	width: max-content;
	/* Animation starts only after JS clones children and adds .is-animated */
}

.image-slider-track.is-animated {
	animation: image-slide 28s linear infinite;
}

.image-slider-track.is-animated:hover {
	animation-play-state: paused;
}

@keyframes image-slide {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* Cover block used as slider item */
.wp-block-cover.image-slider-item {
	min-width: 280px;
	max-width: 280px;
	flex-shrink: 0;
	border-radius: 16px !important;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
}

.wp-block-cover.image-slider-item:hover {
	transform: scale(1.04);
	box-shadow: 0 8px 32px rgba(6, 78, 59, 0.2);
}

.wp-block-cover.image-slider-item video,
.wp-block-cover.image-slider-item .wp-block-cover__image-background {
	object-fit: cover;
	border-radius: 16px;
}


/* ==========================================================================
   8. RAINBOW / GLOW BUTTON — Optional animated border on featured CTA
   ========================================================================== */

.btn-rainbow {
	position: relative;
	z-index: 0;
	border: none !important;
}

.btn-rainbow::before {
	content: '';
	position: absolute;
	inset: -2px;
	border-radius: inherit;
	background: linear-gradient(90deg, #10b981, #34d399, #059669, #047857, #10b981);
	background-size: 200% 100%;
	z-index: -1;
	animation: rainbow-border 3s linear infinite;
}

@keyframes rainbow-border {
	from { background-position: 0% 50%; }
	to   { background-position: 200% 50%; }
}


/* ==========================================================================
   9. TEXT LOGO — ZuuzEatsWell split-colour brand mark
   ========================================================================== */

.zuuz-logo {
	text-decoration: none;
	font-family: 'Playfair Display', serif;
	font-weight: 800;
	font-size: 1.75rem;
	letter-spacing: -0.02em;
	display: inline-flex;
	align-items: baseline;
	line-height: 1;
}

.zuuz-logo__zuuz {
	color: #ffffff;
	transition: color 0.25s ease;
}

.zuuz-logo__eatswell {
	color: #10b981;
}

.zuuz-logo:hover .zuuz-logo__zuuz {
	color: #6ee7b7;
}


/* ==========================================================================
   10. HEADER WOOCOMMERCE ICONS — White icons on dark green header
   ========================================================================== */

.header-icons .wc-block-mini-cart__button,
.header-icons .wc-block-mini-cart__button svg,
.header-icons .wc-block-mini-cart__badge-wrapper {
	color: #ffffff;
	fill: #ffffff;
}

.header-icons .wc-block-customer-account a,
.header-icons .wc-block-customer-account svg {
	color: #ffffff;
	fill: #ffffff;
}

.header-icons .wc-block-customer-account a:hover,
.header-icons .wc-block-mini-cart__button:hover {
	color: #6ee7b7;
}

/* Mini-cart count badge */
.header-icons .wc-block-mini-cart__quantity-badge {
	background-color: #10b981;
	color: #064e3b;
}


/* ==========================================================================
   11. HERO COVER — Full-width image/video background below nav bar
   ========================================================================== */

.hero-cover {
	width: 100%;
}

.hero-cover video.wp-block-cover__video-background {
	object-fit: cover;
	width: 100%;
	height: 100%;
}

.hero-cover .wp-block-cover__image-background {
	object-fit: cover;
}


/* ==========================================================================
   12. FOOTER COVER — Full-width image/video above footer content
   ========================================================================== */

.footer-cover {
	width: 100%;
}

.footer-cover video.wp-block-cover__video-background {
	object-fit: cover;
	width: 100%;
	height: 100%;
}

.footer-cover .wp-block-cover__image-background {
	object-fit: cover;
}


/* ==========================================================================
   13. PAYMENT ICONS — GoPay contractual logo row
   ========================================================================== */

.payment-icons {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.payment-icons img {
	height: 28px;
	width: auto;
	opacity: 0.85;
	border-radius: 4px;
	transition: opacity 0.2s ease;
}

.payment-icons img:hover {
	opacity: 1;
}


/* ==========================================================================
   14. STICKY HEADER — Cover-based header fixed to top on scroll
   ========================================================================== */

/* Header — Cover block sticks to top */
.site-header {
	position: sticky;
	top: 0;
	z-index: 999;
	transition: backdrop-filter 0.35s ease;
}

/* When the page is scrolled: frosted-glass effect */
.site-header.is-scrolled {
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.site-header.is-scrolled .wp-block-cover__background {
	opacity: 0.85 !important;
}

/* Stat number styling for wp:html blocks */
.stat-number {
	text-align: center;
	font-family: 'Playfair Display', serif;
	font-weight: 800;
	color: #ffffff;
}


/* ==========================================================================
   15. CONTENT BREAKER — Large transparent text + scrolling pills overlay
   ========================================================================== */

.content-breaker {
	position: relative;
	overflow: hidden;
}

.breaker-text {
	font-size: clamp(6rem, 12vw, 12rem) !important;
	opacity: 0.06;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1 !important;
	margin: 0 !important;
}

.breaker-pills-wrapper {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
	mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.breaker-pills-track {
	display: flex;
	gap: 1rem;
	width: max-content;
}

.breaker-pills-track.is-animated {
	animation: breaker-scroll 25s linear infinite;
}

@keyframes breaker-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-33.333%); }
}

.breaker-pills-track.is-animated:hover {
	animation-play-state: paused;
}

.breaker-pill {
	border-radius: 100px !important;
	white-space: nowrap;
	flex-shrink: 0;
}


/* ==========================================================================
   16. SPLIT-COLOR HEADINGS — Green highlight for part of heading text
   ========================================================================== */

mark.has-inline-color {
	background: none;
}

.text-green {
	color: #10b981 !important;
}


/* ==========================================================================
   17. STATS COUNTER — Animated number counter section
   ========================================================================== */

.stats-counter {
	text-align: center;
}

.stat-number {
	font-size: clamp(2.5rem, 5vw, 3.5rem) !important;
	line-height: 1.1 !important;
	margin-bottom: 8px !important;
}

.stat-label {
	font-size: 0.95rem !important;
}


/* ==========================================================================
   18. FAQ ACCORDION — Expandable Q&A with smooth animation
   ========================================================================== */

.faq-item {
	border-bottom: 1px solid #e7e5e4;
	overflow: hidden;
}

.faq-question {
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	background: none;
	border: none;
	padding: 24px 0;
	text-align: left;
	font-family: 'DM Sans', sans-serif;
	font-size: 1.1rem;
	font-weight: 600;
	color: #1a1a18;
	transition: color 0.2s ease;
}

.faq-question:hover {
	color: #059669;
}

.faq-question::after {
	content: '+';
	font-size: 1.5rem;
	font-weight: 400;
	color: #a8a29e;
	transition: transform 0.3s ease;
	flex-shrink: 0;
	margin-left: 16px;
}

.faq-item.is-open .faq-question::after {
	content: '-';
	transform: rotate(180deg);
}

.faq-answer {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.35s ease, padding 0.35s ease;
	padding: 0 0;
}

.faq-item.is-open .faq-answer {
	max-height: 500px;
	padding-bottom: 24px;
}

.faq-answer p {
	color: #57534e;
	font-size: 0.95rem;
	line-height: 1.7;
	margin: 0;
}


/* ==========================================================================
   19. NEWSLETTER CTA — Email signup section
   ========================================================================== */

.newsletter-form {
	display: flex;
	gap: 12px;
	max-width: 480px;
	margin: 0 auto;
}

.newsletter-form input[type="email"] {
	flex: 1;
	padding: 14px 24px;
	border: 2px solid #e7e5e4;
	border-radius: 100px;
	font-family: 'DM Sans', sans-serif;
	font-size: 0.95rem;
	outline: none;
	transition: border-color 0.2s ease;
}

.newsletter-form input[type="email"]:focus {
	border-color: #10b981;
}

.newsletter-form button {
	padding: 14px 32px;
	background: #064e3b;
	color: #ffffff;
	border: none;
	border-radius: 100px;
	font-family: 'DM Sans', sans-serif;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background-color 0.2s ease;
	white-space: nowrap;
}

.newsletter-form button:hover {
	background: #047857;
}

@media (max-width: 480px) {
	.newsletter-form {
		flex-direction: column;
	}
}


/* ==========================================================================
   20. REVEAL FADE ONLY — Opacity-only scroll reveal variant
   ========================================================================== */

.reveal-fade-only {
	opacity: 0;
	transition: opacity 0.65s ease;
}

.reveal-fade-only.is-visible {
	opacity: 1;
}
