/**
 * MommyHana - My First Book: effects layer.
 *
 * Everything here reproduces visual details that core Gutenberg blocks + theme.json
 * cannot express on their own: keyframe animations, auto-scroll marquees, absolutely
 * positioned floating badges, card hover-lift, twinkle starfields, the sticky blurred
 * header and the countdown timer styling. Tokens (colours/fonts/spacing) live in theme.json.
 *
 * Applied to blocks via the "Additional CSS class(es)" field or registered block styles.
 */

/* ---------------------------------------------------------------------------
 * Keyframes (from the original design)
 * ------------------------------------------------------------------------- */
@keyframes mfb-floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes mfb-glow {
	0%, 100% { box-shadow: 0 0 0 0 rgba(245,165,36,0), 0 18px 44px rgba(245,165,36,0.34); }
	50%      { box-shadow: 0 0 34px 4px rgba(255,201,92,0.5), 0 22px 54px rgba(245,165,36,0.46); }
}
@keyframes mfb-twinkle { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes mfb-marq { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
	.mfb-float img, img.mfb-float,
	.wp-block-button.is-style-mfb-glow .wp-block-button__link,
	.mfb-marquee__track, .mfb-stars::before, .mfb-stars::after { animation: none !important; }
}

/* ---------------------------------------------------------------------------
 * Hero / product floating image
 * ------------------------------------------------------------------------- */
.mfb-float img, img.mfb-float { animation: mfb-floaty 6s ease-in-out infinite; }

/* Soft golden glow blob behind hero product */
.mfb-glow-blob {
	position: absolute; inset: -6% 6%; z-index: 0; pointer-events: none;
	background: radial-gradient(circle, rgba(255,201,92,0.4), transparent 66%);
	filter: blur(8px);
}

/* Media wrapper so the price / save badges can float over the image */
.mfb-hero-media { position: relative; }
.mfb-hero-media > .wp-block-image { position: relative; z-index: 1; margin: 0; }

.mfb-badge-price, .mfb-badge-save { position: absolute; z-index: 3; }
.mfb-badge-price {
	bottom: 7%; left: -3%;
	background: #fff; border-radius: 18px; padding: 12px 18px;
	box-shadow: 0 16px 34px rgba(0,0,0,0.28); transform: rotate(-5deg);
}
.mfb-badge-save {
	top: 5%; right: -3%;
	width: 84px; height: 84px; border-radius: 100px;
	background: var(--wp--preset--color--purple-accent, #6C3F9E); color: #fff;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	transform: rotate(9deg); box-shadow: 0 12px 26px rgba(0,0,0,.3);
}
.mfb-badge-price *, .mfb-badge-save * { margin: 0; }

/* ---------------------------------------------------------------------------
 * Twinkle starfield overlay (decorative, no markup children needed)
 * ------------------------------------------------------------------------- */
.mfb-stars { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.mfb-stars::before, .mfb-stars::after {
	content: ""; position: absolute; inset: 0;
	background-repeat: no-repeat;
	background-image:
		radial-gradient(2px 2px at 12% 18%, rgba(255,215,138,.9), transparent),
		radial-gradient(2px 2px at 32% 62%, rgba(255,215,138,.7), transparent),
		radial-gradient(3px 3px at 52% 12%, rgba(255,215,138,.8), transparent),
		radial-gradient(2px 2px at 68% 48%, rgba(255,215,138,.7), transparent),
		radial-gradient(2px 2px at 84% 22%, rgba(255,215,138,.9), transparent),
		radial-gradient(2px 2px at 92% 70%, rgba(255,215,138,.6), transparent),
		radial-gradient(2px 2px at 22% 82%, rgba(255,215,138,.8), transparent);
	animation: mfb-twinkle 4s ease-in-out infinite;
}
.mfb-stars::after {
	background-image:
		radial-gradient(2px 2px at 8% 52%, rgba(255,215,138,.7), transparent),
		radial-gradient(2px 2px at 44% 34%, rgba(255,215,138,.8), transparent),
		radial-gradient(3px 3px at 60% 78%, rgba(255,215,138,.7), transparent),
		radial-gradient(2px 2px at 76% 8%, rgba(255,215,138,.9), transparent),
		radial-gradient(2px 2px at 96% 40%, rgba(255,215,138,.7), transparent),
		radial-gradient(2px 2px at 28% 8%, rgba(255,215,138,.6), transparent);
	animation-duration: 6s; animation-delay: 1s;
}
/* Keep content above the stars */
.mfb-stars ~ * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------------
 * Marquees: trust bar + testimonials
 * ------------------------------------------------------------------------- */
.mfb-marquee { overflow: hidden; }
.mfb-marquee .mfb-marquee__track {
	display: inline-flex; flex-wrap: nowrap; align-items: center; width: max-content;
	gap: 38px; animation: mfb-marq 26s linear infinite; will-change: transform;
}
.mfb-marquee__track > * { flex: none; }

/* Testimonials variant: slower, edge fade mask, pause on hover */
.mfb-marquee--reviews {
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
	        mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.mfb-marquee--reviews .mfb-marquee__track { gap: 18px; animation-duration: 46s; }
.mfb-marquee--reviews:hover .mfb-marquee__track { animation-play-state: paused; }

/* ---------------------------------------------------------------------------
 * Card hover lift (registered block style: "Kad MFB")
 * ------------------------------------------------------------------------- */
.wp-block-group.is-style-mfb-card,
.is-style-mfb-card {
	transition: transform .3s ease, box-shadow .3s ease;
}
.wp-block-group.is-style-mfb-card:hover,
.is-style-mfb-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 40px rgba(46,29,76,0.12);
}

/* ---------------------------------------------------------------------------
 * Glow CTA (registered block style: "Butang Berseri")
 * ------------------------------------------------------------------------- */
.wp-block-button.is-style-mfb-glow .wp-block-button__link {
	animation: mfb-glow 2.6s ease-in-out infinite;
}

/* ---------------------------------------------------------------------------
 * Dark (purple) sections: default heading colour becomes white.
 * Accent text that carries a colour class keeps its colour (WP uses !important).
 * ------------------------------------------------------------------------- */
.mfb-on-dark h1, .mfb-on-dark h2, .mfb-on-dark h3, .mfb-on-dark h4 { color: #fff; }

/* ---------------------------------------------------------------------------
 * Sticky blurred header
 * ------------------------------------------------------------------------- */
.mfb-header {
	position: sticky; top: 0; z-index: 60;
	background: rgba(251,243,228,0.92);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-bottom: 1px solid #EEDFC4;
}

/* ---------------------------------------------------------------------------
 * Countdown timer boxes
 * ------------------------------------------------------------------------- */
.mfb-countdown { display: flex; gap: 8px; flex-wrap: wrap; }
.mfb-countdown__box {
	background: var(--wp--preset--color--surface, #F6EAD6);
	border-radius: 11px; padding: 8px 12px; text-align: center; min-width: 58px;
}
.mfb-countdown__num {
	font-family: var(--wp--preset--font-family--baloo-2, sans-serif);
	font-weight: 800; font-size: 22px; line-height: 1.1;
	color: var(--wp--preset--color--heading, #2E1D4C);
}
.mfb-countdown__label { font-size: 9.5px; letter-spacing: 1px; color: var(--wp--preset--color--muted-2, #8A7E6E); }

/* ---------------------------------------------------------------------------
 * Small helpers used across patterns
 * ------------------------------------------------------------------------- */
.mfb-eyebrow { display: inline-block; font-weight: 800; letter-spacing: 1px; font-size: 13px; text-transform: uppercase; }
.mfb-chip {
	display: inline-flex; align-items: center; gap: 8px;
	border-radius: 100px; padding: 7px 15px; font-size: 13px; font-weight: 700;
}
.mfb-pill {
	display: inline-block; border-radius: 100px; padding: 7px 16px;
	font-weight: 800; font-size: 12.5px; letter-spacing: .5px;
}
.mfb-strike { text-decoration: line-through; }

/* Featured product card: absolute "limited edition" tag */
.mfb-featured-media { position: relative; }
.mfb-tag-abs {
	position: absolute; top: 18px; left: 18px; z-index: 2; margin: 0;
	letter-spacing: .5px; padding: 6px 14px; border-radius: 100px;
}

/* Shop-by-age card: age range pill over the image */
.mfb-age-media { position: relative; }
.mfb-age-pill {
	position: absolute; top: 14px; left: 14px; z-index: 2; margin: 0;
	padding: 5px 14px; border-radius: 100px; line-height: 1.2;
}

/* Testimonial avatar circle */
.mfb-avatar {
	flex: none; width: 42px; height: 42px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* How-it-works step icon tile with number badge */
.mfb-step-ico {
	position: relative; width: 74px; height: 74px; margin: 0 auto;
	border-radius: 22px; background: #fff; border: 1px solid #EEDFC4;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 10px 24px rgba(46,29,76,0.08);
}
.mfb-step-num, .mfb-aff-num {
	position: absolute; top: -10px; right: -10px;
	width: 30px; height: 30px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* Affiliate step icon tile (on dark) */
.mfb-aff-ico {
	position: relative; width: 62px; height: 62px; margin: 0 auto;
	border-radius: 18px; background: rgba(255,201,92,0.16);
	display: flex; align-items: center; justify-content: center;
}
.mfb-aff-num { width: 28px; height: 28px; top: -9px; right: -9px; }

/* FAQ (core Details block) styled to match the design */
.mfb-faq summary {
	font-family: var(--wp--preset--font-family--baloo-2, sans-serif);
	font-weight: 700; font-size: 16.5px; color: var(--wp--preset--color--heading, #2E1D4C);
	list-style: none; cursor: pointer; padding: 13px 0;
	display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.mfb-faq summary::-webkit-details-marker { display: none; }
.mfb-faq summary::after {
	content: "+"; color: #E8951C; font-size: 24px; line-height: 1;
	font-family: var(--wp--preset--font-family--baloo-2, sans-serif); flex: none;
}
.mfb-faq[open] summary::after { content: "\2212"; } /* minus */
.mfb-faq > *:not(summary) { padding-bottom: 8px; }

/* Footer logo rendered in white */
.mfb-logo-white img { filter: brightness(0) invert(1); }

/* Icon tiles inside feature/benefit cards */
.mfb-icon-tile {
	display: flex; align-items: center; justify-content: center;
	border-radius: 16px; line-height: 1;
}

/* Ensure images inside rounded figures clip nicely */
.mfb-round img { border-radius: 20px; display: block; }

/* ---------------------------------------------------------------------------
 * Responsive nudges (mirrors the original max-width:520px tweaks)
 * ------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.mfb-hero-cta .wp-block-button { flex: 1 1 0; }
	.mfb-hero-cta .wp-block-button__link { width: 100%; text-align: center; padding-left: 14px; padding-right: 14px; }
	.mfb-badge-price { padding: 9px 13px; }
	.mfb-badge-save { width: 68px; height: 68px; }
}
