/* ==========================================================================
   HAPPYPIP — Knowledge Hub + Deck Cards
   ========================================================================== */

/* ── Knowledge Grid Page ── */
.hp-knowledge {
	padding-top: var(--space-xl);
	padding-bottom: var(--space-3xl);
	max-width: 1200px;
	margin: 0 auto;
	padding-left: var(--space-lg);
	padding-right: var(--space-lg);
}

.hp-knowledge .hp-hero-tile {
	max-width: 900px;
	margin: 0 auto 48px;
}

/* ── Category Filter Pills ── */
.hp-knowledge__filters {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	justify-content: center;
	margin-bottom: var(--space-xl);
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
}

.hp-knowledge__filter-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	border-radius: var(--radius-full);
	border: 1.5px solid var(--border-default);
	background: var(--bg-card);
	font-family: var(--font-heading);
	font-size: var(--text-small);
	font-weight: 600;
	color: var(--text-secondary);
	cursor: pointer;
	transition: all 0.2s ease;
}

.hp-knowledge__filter-pill:hover {
	border-color: var(--sunset-mid);
	color: var(--sunset-text);
}

.hp-knowledge__filter-pill.is-active {
	background: var(--gradient-sunset);
	border-color: transparent;
	color: #fff;
}

.hp-knowledge__filter-pill.is-active .hp-knowledge__filter-count {
	background: rgba(255,255,255,0.25);
	color: #fff;
}

.hp-knowledge__filter-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: var(--radius-full);
	background: var(--bg-surface);
	font-size: var(--text-badge);
	font-weight: 700;
	color: var(--text-muted);
}

.hp-knowledge__filter-empty {
	text-align: center;
	padding: var(--space-2xl) var(--space-lg);
	max-width: 900px;
	margin: 0 auto;
}

.hp-knowledge__filter-empty p {
	font-family: var(--font-body);
	font-size: var(--text-sub);
	color: var(--text-muted);
}

.hp-knowledge__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-lg);
	max-width: 900px;
	margin: 0 auto;
	padding: 0 var(--space-lg);
}

.hp-knowledge__deck {
	background: var(--bg-card);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	padding: var(--space-xl) var(--space-lg);
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	position: relative;
	overflow: hidden;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hp-knowledge__deck:hover {
	border-color: var(--sunset-light);
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(200, 165, 100, 0.12);
}

.hp-knowledge__deck--coming {
	opacity: 0.6;
	pointer-events: none;
}

.hp-knowledge__deck-accent {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
}

.hp-knowledge__deck-thumb {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--radius-lg);
	overflow: hidden;
	margin-bottom: var(--space-md);
}

.hp-knowledge__deck-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hp-knowledge__deck-icon {
	width: 44px;
	height: 44px;
	border-radius: var(--radius-lg);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--space-md);
}

.hp-knowledge__deck-icon .hp-ico {
	width: 22px;
	height: 22px;
}

.hp-knowledge__deck-cat {
	font-family: var(--font-heading);
	font-size: var(--text-badge);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: var(--sunset-text);
	margin-bottom: var(--space-xs);
}

.hp-knowledge__deck-title {
	font-family: var(--font-heading);
	font-size: var(--text-h3);
	font-weight: 700;
	color: var(--green-dark);
	margin: 0 0 var(--space-xs);
	line-height: 1.3;
}

.hp-knowledge__deck-desc {
	font-family: var(--font-body);
	font-size: var(--text-sub);
	color: var(--text-body);
	line-height: 1.5;
	margin: 0 0 var(--space-md);
	flex: 1;
}

.hp-knowledge__deck-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: var(--space-sm);
	border-top: 1px solid var(--border-default);
}

.hp-knowledge__deck-cards {
	font-family: var(--font-heading);
	font-size: var(--text-small);
	font-weight: 500;
	color: var(--text-muted);
}

.hp-knowledge__deck-arrow {
	font-size: 18px;
	color: var(--sunset-mid);
	transition: transform 0.2s ease;
}

.hp-knowledge__deck:hover .hp-knowledge__deck-arrow {
	transform: translateX(4px);
}

.hp-knowledge__deck-badge {
	font-family: var(--font-heading);
	font-size: var(--text-badge);
	font-weight: 600;
	color: var(--text-muted);
	background: var(--bg-surface);
	padding: 3px 10px;
	border-radius: var(--radius-full);
}

.hp-knowledge__empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: var(--space-3xl) var(--space-lg);
}

.hp-knowledge__empty .hp-ico {
	width: 40px;
	height: 40px;
	opacity: 0.3;
	margin-bottom: var(--space-md);
}

.hp-knowledge__empty h3 {
	font-family: var(--font-heading);
	font-size: var(--text-h3);
	color: var(--green-dark);
	margin: 0 0 var(--space-xs);
}

.hp-knowledge__empty p {
	font-family: var(--font-body);
	font-size: var(--text-base);
	color: var(--text-muted);
	margin: 0;
}

@media (max-width: 600px) {
	.hp-knowledge__filters {
		gap: 6px;
		margin-bottom: var(--space-lg);
	}

	.hp-knowledge__filter-pill {
		padding: 6px 14px;
		font-size: var(--text-badge);
	}

	.hp-knowledge__filter-count {
		min-width: 18px;
		height: 18px;
		font-size: 8px;
	}

	.hp-knowledge__grid {
		grid-template-columns: 1fr;
		padding: 0 var(--space-md);
	}
}

/* ==========================================================================
   DECK — Swipeable Card Experience
   ========================================================================== */

.hp-deck {
	min-height: 100vh;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	padding: var(--space-xl) var(--space-lg);
	position: relative;
	max-width: 100% !important;
	margin: 0 auto !important;
	width: 100% !important;
}

/* Kill Astra content wrapper constraints */
.single-knowledge_deck .ast-container,
.single-knowledge_deck .site-content > .ast-container {
	max-width: 100% !important;
	padding: 0 !important;
}

.single-knowledge_deck #primary {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

/* Also fix archive */
.post-type-archive-knowledge_deck .ast-container,
.post-type-archive-knowledge_deck .site-content > .ast-container {
	max-width: 100% !important;
	padding: 0 !important;
}

.post-type-archive-knowledge_deck #primary {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin: 0 !important;
}

/* Breadcrumbs */
.hp-deck__breadcrumbs {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	margin-bottom: var(--space-lg);
	width: 100%;
	max-width: 540px;
}

.hp-deck__breadcrumbs a {
	font-family: var(--font-heading);
	font-size: var(--text-small);
	font-weight: 500;
	color: var(--text-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.hp-deck__breadcrumbs a:hover {
	color: var(--sunset-text);
}

.hp-deck__breadcrumbs span {
	font-family: var(--font-heading);
	font-size: var(--text-small);
	color: var(--border-default);
}

.hp-deck__breadcrumbs .hp-deck__breadcrumbs-current {
	font-weight: 600;
	color: var(--green-dark);
}

/* Card Stack + Arrows wrapper */
.hp-deck__stage {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	width: 100%;
	max-width: 580px;
}

/* Navigation Arrows */
.hp-deck__arrow {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1.5px solid var(--border-default);
	background: var(--bg-card);
	color: var(--text-muted);
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: all 0.2s ease;
	padding: 0;
}

.hp-deck__arrow:hover {
	border-color: var(--sunset-light);
	color: var(--sunset-text);
}

.hp-deck__arrow:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* Card Stack */
.hp-deck__cards {
	width: 100%;
	max-width: 480px;
	position: relative;
	flex: 1;
}

.hp-deck__card {
	display: none;
	width: 100%;
}

.hp-deck__card.is-active {
	display: block;
}

.hp-deck__card-inner {
	border-radius: var(--radius-lg);
	padding: var(--space-2xl) var(--space-xl);
	height: 500px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
	overflow-y: auto;
	position: relative;
}

/* Custom scrollbar inside cards */
.hp-deck__card-inner::-webkit-scrollbar {
	width: 4px;
}

.hp-deck__card-inner::-webkit-scrollbar-track {
	background: transparent;
}

.hp-deck__card-inner::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 2px;
}

/* Hide arrows on mobile */
@media (max-width: 540px) {
	.hp-deck__arrow {
		display: none;
	}

	.hp-deck__card-inner {
		height: calc(100vh - 220px);
		max-height: 420px;
		padding: var(--space-xl) var(--space-lg);
	}
}

/* Corner Bleed Image — floats right, text wraps around it */
.hp-deck__card-corner {
	float: right;
	width: 140px;
	height: auto;
	margin: -16px -12px 8px 16px;
	border-radius: var(--radius-sm);
	object-fit: contain;
	shape-outside: margin-box;
}

@media (max-width: 540px) {
	.hp-deck__card-corner {
		width: 100px;
		margin: -12px -8px 6px 12px;
	}
}

/* Card Type Badge */
.hp-deck__card-type {
	display: inline-block;
	font-family: var(--font-heading);
	font-size: var(--text-badge);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: rgba(255, 255, 255, 0.6);
	margin-bottom: var(--space-lg);
}

.hp-deck__card-type--dark {
	color: var(--sunset-text);
}

/* Card Icon */
.hp-deck__card-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: var(--space-lg);
}

.hp-deck__card-icon .hp-ico {
	width: 28px;
	height: 28px;
	filter: brightness(0) invert(1);
}

/* Card Title */
.hp-deck__card-title {
	font-family: var(--font-heading);
	font-size: var(--text-h2);
	font-weight: 700;
	margin: 0 0 var(--space-md);
	line-height: 1.2;
}

.hp-deck__card-subtitle {
	font-family: var(--font-heading);
	font-size: var(--text-h3);
	font-weight: 700;
	color: var(--green-dark);
	margin: 0 0 var(--space-lg);
}

/* Card Text */
.hp-deck__card-text {
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: 1.7;
	margin: 0 0 var(--space-md);
}

/* Swipe Hint */
.hp-deck__card-swipe {
	font-family: var(--font-heading);
	font-size: var(--text-small);
	color: rgba(255, 255, 255, 0.35);
	margin-top: auto;
	padding-top: var(--space-lg);
	animation: hpDeckSwipeHint 2s ease-in-out infinite;
}

@keyframes hpDeckSwipeHint {
	0%, 100% { transform: translateX(0); opacity: 0.35; }
	50% { transform: translateX(6px); opacity: 0.6; }
}

/* ── Myth Buster Card ── */
.hp-deck__card-myth {
	background: rgba(192, 57, 43, 0.06);
	border: 1px solid rgba(192, 57, 43, 0.15);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	margin-bottom: var(--space-lg);
	display: flex;
	gap: var(--space-md);
	align-items: flex-start;
}

.hp-deck__card-myth-x {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #C0392B;
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 28px;
	text-align: center;
}

.hp-deck__card-myth-claim {
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-style: italic;
	color: #C0392B;
	margin: 0;
	line-height: 1.5;
}

.hp-deck__card-truth {
	background: rgba(88, 173, 114, 0.06);
	border: 1px solid rgba(88, 173, 114, 0.15);
	border-radius: var(--radius-lg);
	padding: var(--space-lg);
	display: flex;
	gap: var(--space-md);
	align-items: flex-start;
}

.hp-deck__card-truth-check {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--color-success);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 28px;
	text-align: center;
}

.hp-deck__card-truth-text {
	font-family: var(--font-body);
	font-size: var(--text-base);
	color: var(--text-body);
	margin: 0;
	line-height: 1.6;
}

/* ── Compare Card ── */
.hp-deck__card-compare {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-sm);
}

.hp-deck__card-compare-col {
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	overflow: hidden;
}

.hp-deck__card-compare-header {
	font-family: var(--font-heading);
	font-size: var(--text-sub);
	font-weight: 700;
	padding: var(--space-sm) var(--space-md);
	text-align: center;
}

.hp-deck__card-compare-col ul {
	list-style: none;
	margin: 0;
	padding: var(--space-sm) var(--space-md) var(--space-md);
}

.hp-deck__card-compare-col li {
	font-family: var(--font-body);
	font-size: var(--text-small);
	color: var(--text-body);
	padding: 5px 0;
	border-bottom: 1px solid var(--border-default);
	line-height: 1.4;
}

.hp-deck__card-compare-col li:last-child {
	border-bottom: none;
}

/* ── Stat Card ── */
.hp-deck__card-stat {
	text-align: center;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.hp-deck__card-stat-num {
	font-family: var(--font-heading);
	font-size: clamp(56px, 12vw, 80px);
	font-weight: 700;
	color: inherit;
	line-height: 1;
	margin-bottom: var(--space-md);
}

.hp-deck__card-stat-text {
	font-family: var(--font-body);
	font-size: var(--text-base);
	color: inherit;
	opacity: 0.85;
	line-height: 1.6;
	max-width: 340px;
}

/* ── CTA Card ── */
.hp-deck__card-ctas {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	margin-top: var(--space-xl);
}

.hp-deck__card-back-link {
	display: block;
	text-align: center;
	margin-top: var(--space-lg);
	font-family: var(--font-heading);
	font-size: var(--text-small);
	color: rgba(250, 246, 239, 0.4);
	text-decoration: none;
}

.hp-deck__card-back-link:hover {
	color: rgba(250, 246, 239, 0.7);
}

/* ── Dots Navigation ── */
.hp-deck__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: var(--space-xl);
}

.hp-deck__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	background: var(--border-default);
	cursor: pointer;
	padding: 0;
	transition: all 0.3s ease;
}

.hp-deck__dot.is-active {
	background: var(--sunset-mid);
	width: 24px;
	border-radius: var(--radius-full);
}

.hp-deck__home {
	text-align: center;
	margin-top: var(--space-xl);
}

/* ── Responsive ── */
@media (max-width: 540px) {
	.hp-deck {
		padding: var(--space-lg) var(--space-md);
		min-height: auto;
		padding-top: 60px;
	}

	.hp-deck__back {
		top: var(--space-md);
		left: var(--space-md);
	}

	.hp-deck__card-inner {
		padding: var(--space-xl) var(--space-lg);
		min-height: auto;
	}

	.hp-deck__card-compare {
		grid-template-columns: 1fr;
	}
}
