/* ============================================================
   ATTAI — Page Builder Sections CSS
   Loaded on: is_page() + is_front_page() (any page using builder)

   Design-lock rules:
     • All values come from tokens.css variables.
     • No hardcoded colors, radii, shadows, or font names.
     • No spacing inputs exposed to the admin — layout is fixed.

   Section classes:
     .attai-section-hero        — Hero panel
     .attai-section-testimonials — Testimonials grid (via .attai-pb-test-*)
     .attai-section-cta          — Call-to-action strip

   Product sections reuse .home-product-grid / .home-product-card
   from home-redesign.css (already loaded on the front page).
   On standalone pages the --home-* aliases below make those classes work.
   ============================================================ */

/* ── Re-alias home tokens so product cards work on every page ─ */
:root {
	--home-color-primary: var(--color-navy);
	--home-color-accent: var(--color-indigo);
	--home-color-bg: var(--color-pale);
	--home-color-card: var(--color-white);
	--home-color-text: var(--text-primary);
	--home-color-muted: var(--text-secondary);
	--home-shadow-soft: var(--s-md);
	--home-shadow-hover: var(--s-lg);
	--home-radius-lg: var(--r-lg);
	--home-radius-md: var(--r-md);
	--home-transition: var(--t-fast);
}

/* ============================================================
   SHARED SECTION SPACING
   Inherits .home-section rhythm from home-redesign.css on the
   front page; defines it independently on other pages.
   ============================================================ */
.attai-section-hero,
.attai-section-testimonials,
.attai-section-cta {
	padding: clamp(2.75rem, 4vw, 4.5rem) 0;
}

/* ============================================================
   HERO SECTION  .attai-section-hero
   ============================================================ */
.attai-section-hero {
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	/* height driven by --hero-height CSS variable (set by Customizer via attai_dynamic_layout_vars) */
	min-height: var(--hero-height, clamp(400px, 50vw, 680px));
	display: block;
	background-color: var(--color-pale);
	overflow: hidden;
	padding: 0;
	/* override shared spacing — inner content has its own */
}

.attai-section-hero__slides {
	position: relative;
	min-height: inherit;
}

.attai-section-hero__slide {
	position: relative;
	min-height: inherit;
	display: flex;
	align-items: center;
}

.attai-section-hero--slider .attai-section-hero__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity var(--t-base), visibility var(--t-base);
}

.attai-section-hero--slider .attai-section-hero__slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 1;
}

.attai-section-hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.attai-section-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: var(--hero-fit, cover);
	display: block;
}

.attai-section-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg,
			rgba(57, 57, 104, 0.88) 0%,
			rgba(57, 57, 104, 0.50) 55%,
			rgba(57, 57, 104, 0.22) 100%);
	z-index: 1;
}

.attai-section-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	padding-top: clamp(3rem, 6vw, 5rem);
	padding-bottom: clamp(3rem, 6vw, 5rem);
}

.attai-section-hero__content {
	max-width: min(37.5rem, 90%);
}

.attai-section-hero__title {
	font-size: clamp(1.9rem, 4.5vw, 3.6rem);
	line-height: 1.05;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--color-white);
	margin: 0 0 0.85rem;
}

.attai-section-hero__subtitle {
	font-size: clamp(1rem, 2vw, 1.15rem);
	color: rgba(255, 255, 255, 0.88);
	margin: 0 0 1.5rem;
	line-height: 1.6;
}

.attai-section-hero__cta {
	display: inline-flex;
	align-items: center;
	background: var(--color-white);
	color: var(--color-navy);
	border-radius: var(--r-full);
	padding: 0.85rem 1.6rem;
	font-weight: 700;
	font-size: 0.95rem;
	border: 0;
	min-height: 44px;
	transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
	text-decoration: none;
}

.attai-section-hero__cta:hover,
.attai-section-hero__cta:focus-visible {
	background: var(--color-indigo);
	color: var(--color-white);
	transform: translateY(-2px);
	box-shadow: var(--s-md);
}

.attai-section-hero__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: clamp(0.9rem, 2.2vw, 1.4rem);
	z-index: 3;
	display: flex;
	justify-content: center;
	pointer-events: none;
}

.attai-section-hero__dots {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: var(--r-full);
	background: color-mix(in srgb, var(--color-navy) 68%, transparent);
	backdrop-filter: blur(6px);
	pointer-events: auto;
}

.attai-section-hero__dot {
	width: 0.625rem;
	height: 0.625rem;
	border: 0;
	border-radius: var(--r-full);
	background: color-mix(in srgb, var(--color-white) 45%, transparent);
	transition: transform var(--t-fast), background-color var(--t-fast);
}

.attai-section-hero__dot.is-active {
	background: var(--color-white);
	transform: scale(1.2);
}

.attai-section-hero__dot:focus-visible {
	outline: 2px solid var(--color-white);
	outline-offset: 2px;
}

/* ── Mobile: full-width hero with centered text ─────────────── */
@media (max-width: 767px) {
	.attai-section-hero {
		min-height: min(var(--hero-height, 50vh), 70vh);
	}

	.attai-section-hero__overlay {
		background: rgba(57, 57, 104, 0.7);
	}

	.attai-section-hero__content {
		max-width: 100%;
	}

	.attai-section-hero__title {
		font-size: clamp(1.6rem, 7vw, 2.2rem);
	}

	.attai-section-hero__controls {
		bottom: 0.75rem;
	}
}

/* ============================================================
   PRODUCT SECTION — Slider layout variant
   Grid layout uses the existing .home-product-grid styles.
   Slider overrides the display to horizontal scroll-snap.
   ============================================================ */
.home-product-grid[data-product-layout="slider"] {
	display: flex;
	grid-template-columns: none;
	/* reset grid */
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	gap: 1rem;
	padding-bottom: 0.75rem;
	/* room for scrollbar */
	/* Hide scrollbar visually but keep it functional */
	scrollbar-width: thin;
	scrollbar-color: var(--color-pale) transparent;
}

.home-product-grid[data-product-layout="slider"]::-webkit-scrollbar {
	height: 4px;
}

.home-product-grid[data-product-layout="slider"]::-webkit-scrollbar-track {
	background: transparent;
}

.home-product-grid[data-product-layout="slider"]::-webkit-scrollbar-thumb {
	background: var(--color-pale);
	border-radius: var(--r-full);
}

.home-product-grid[data-product-layout="slider"] .home-product-card {
	flex: 0 0 260px;
	scroll-snap-align: start;
	/* Override hover lift that looks odd in a slider */
	transition: box-shadow var(--t-fast);
}

.home-product-grid[data-product-layout="slider"] .home-product-card:hover {
	transform: none;
	box-shadow: var(--s-lg);
}

@media (max-width: 767px) {
	.home-product-grid[data-product-layout="slider"] .home-product-card {
		flex: 0 0 220px;
	}
}

.attai-products-footer-link-wrap {
	display: flex;
	justify-content: center;
	margin-top: clamp(1rem, 2.6vw, 1.5rem);
}

.attai-view-all-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.75rem 1.5rem;
	border-radius: var(--r-full);
	border: 1px solid var(--color-indigo);
	background: var(--color-indigo);
	color: var(--color-white);
	font-weight: 700;
	text-decoration: none;
	transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.attai-view-all-btn:hover,
.attai-view-all-btn:focus-visible {
	background: var(--color-navy);
	border-color: var(--color-navy);
	color: var(--color-white);
	transform: translateY(-1px);
	box-shadow: var(--s-md);
}

.attai-hero-slider:focus-visible,
.attai-section-hero__dot:focus-visible,
.attai-section-hero__cta:focus-visible,
.attai-view-all-btn:focus-visible,
.home-link-cta:focus-visible {
	outline: 2px solid var(--color-gold);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.attai-section-hero--slider .attai-section-hero__slide {
		transition: none;
	}

	.attai-section-hero__dot,
	.attai-view-all-btn {
		transition: none;
	}
}

/* ============================================================
   TESTIMONIALS SECTION  .attai-section-testimonials
   ============================================================ */
.attai-pb-test-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.15rem;
}

.attai-pb-test-card {
	background: var(--color-white);
	border-radius: var(--r-md);
	box-shadow: var(--s-md);
	padding: 1.4rem 1.25rem;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	border: 1px solid var(--color-pale);
	transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.attai-pb-test-card:hover {
	box-shadow: var(--s-lg);
	transform: translateY(-3px);
}

.attai-pb-test-card__photo {
	width: 52px;
	height: 52px;
	border-radius: var(--r-full);
	overflow: hidden;
	border: 2px solid var(--color-pale);
	flex-shrink: 0;
}

.attai-pb-test-card__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.attai-pb-test-card__photo--placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--color-pale);
	color: var(--color-navy);
	font-weight: 700;
	font-size: 0.95rem;
}

.attai-pb-test-card__text {
	font-size: 0.97rem;
	line-height: 1.65;
	color: var(--text-primary);
	margin: 0;
	flex: 1;
}

.attai-pb-test-card__author {
	font-size: 0.88rem;
	font-weight: 700;
	color: var(--color-indigo);
	font-style: normal;
	margin-top: auto;
}

.attai-pb-test-card__author::before {
	content: "— ";
}

/* ── Tablet: 2 columns ──────────────────────────────────────── */
@media (max-width: 1080px) {
	.attai-pb-test-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ── Mobile: 1 column ───────────────────────────────────────── */
@media (max-width: 767px) {
	.attai-pb-test-grid {
		grid-template-columns: 1fr;
	}
}

/* ============================================================
   CTA SECTION  .attai-section-cta
   ============================================================ */
.attai-section-cta__panel {
	border-radius: var(--r-lg);
	padding: clamp(1.6rem, 5vw, 2.8rem) clamp(1.4rem, 5vw, 3rem);
	background: linear-gradient(118deg,
			var(--color-navy) 0%,
			var(--color-navy) 55%,
			var(--color-purple) 100%);
	color: var(--color-white);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.attai-section-cta__title {
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.15;
	color: var(--color-white);
	margin: 0;
}

.attai-section-cta__desc {
	font-size: clamp(0.95rem, 1.6vw, 1.05rem);
	color: rgba(255, 255, 255, 0.82);
	max-width: 560px;
	line-height: 1.6;
	margin: 0;
}

.attai-section-cta__btn {
	display: inline-flex;
	align-items: center;
	background: var(--color-white);
	color: var(--color-navy);
	border-radius: var(--r-full);
	padding: 0.85rem 1.8rem;
	font-weight: 700;
	font-size: 0.95rem;
	min-height: 44px;
	border: 0;
	text-decoration: none;
	transition: background-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}

.attai-section-cta__btn:hover,
.attai-section-cta__btn:focus-visible {
	background: var(--color-indigo);
	color: var(--color-white);
	transform: translateY(-2px);
	box-shadow: var(--s-lg);
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
	.attai-section-cta__panel {
		border-radius: var(--r-md);
	}
}

/* ============================================================
   PAGE BUILDER WRAPPER
   When a page uses the builder, wrap in home-redesign styles.
   ============================================================ */
.attai-pb-wrap {
	padding-top: 0;
	/* hero starts flush with navbar — no page-wrapper gap */
	background: radial-gradient(circle at 8% 10%,
			rgba(68, 71, 148, 0.06),
			transparent 36%),
		linear-gradient(180deg, var(--color-white) 0%, var(--color-pale) 80%);
	padding-bottom: 5rem;
}

.attai-pb-wrap .home-container {
	width: min(1240px, calc(100% - 2.5rem));
	margin-inline: auto;
}

.attai-pb-wrap .home-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.attai-pb-wrap .home-section-title {
	font-size: clamp(1.7rem, 3vw, 2.45rem);
	line-height: 1.12;
	color: var(--text-primary);
	margin: 0;
	letter-spacing: -0.03em;
}

/* ── Product grid base (for pages without home-redesign.css) ── */
.attai-pb-wrap .home-product-grid {
	display: grid;
	gap: 1.15rem;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attai-pb-wrap .home-link-cta {
	color: var(--color-indigo);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--t-fast);
}

.attai-pb-wrap .home-link-cta:hover {
	color: var(--color-navy);
}

/* ── Responsive product grid ────────────────────────────────── */
@media (max-width: 1080px) {
	.attai-pb-wrap .home-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.attai-pb-wrap .home-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.65rem;
	}
}
