/**
 * StockWP — Home hero + Magnific-style spotlight
 */

.swp-hero {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
	padding: 3.25rem 1rem 2rem;
	text-align: center;
}

.swp-hero__title {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	font-family: var(--swp-font-display);
	font-size: clamp(1.55rem, 3.2vw, 2.15rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.2;
	color: var(--swp-text);
	animation: swp-hero-title-enter 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.swp-hero__sub {
	font-weight: 500;
	color: var(--swp-text-muted);
	font-size: 0.92em;
}

@keyframes swp-hero-title-enter {
	from {
		opacity: 0;
		transform: translateY(36px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Spotlight trigger bar */
.swp-spotlight-trigger {
	width: min(100%, 40rem);
	padding: 0;
	border: none;
	background: transparent;
	cursor: text;
	text-align: left;
	animation: swp-spotlight-enter 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes swp-spotlight-enter {
	from {
		opacity: 0;
		filter: blur(5px);
		transform: scale(0.96);
	}
	to {
		opacity: 1;
		filter: blur(0);
		transform: scale(1);
	}
}

.swp-spotlight-trigger__inner {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-height: 48px;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--swp-border);
	border-radius: 999px;
	background: var(--swp-bg);
	color: var(--swp-text-muted);
	transition: background 0.2s ease, border-color 0.2s ease;
}

.swp-spotlight-trigger:hover .swp-spotlight-trigger__inner {
	background: var(--swp-bg-muted);
	border-color: var(--swp-border-strong);
}

.swp-spotlight-trigger__icon {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

.swp-spotlight-trigger__icon svg {
	stroke: currentColor;
	fill: none;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.swp-spotlight-trigger__text {
	flex: 1;
	min-width: 0;
	font-size: 0.95rem;
	font-weight: 400;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.swp-spotlight-trigger__kbd {
	display: none;
	flex: 0 0 auto;
	padding: 0.15rem 0.45rem;
	border-radius: 6px;
	background: transparent;
	color: var(--swp-text-muted);
	font-family: var(--swp-font);
	font-size: 0.7rem;
	font-weight: 500;
	line-height: 1.2;
}

@media (min-width: 640px) {
	.swp-spotlight-trigger__kbd {
		display: inline-block;
	}
}

/* Category cards */
.swp-hero-cards {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem 1.35rem;
	margin-top: 0.5rem;
}

.swp-hero-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.55rem;
	min-width: 5.5rem;
	color: var(--swp-text);
	text-decoration: none;
	animation: swp-card-enter 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes swp-card-enter {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.swp-hero-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 14px;
	background: var(--swp-bg-muted);
	border: 1px solid var(--swp-border);
	color: var(--swp-text);
	transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.swp-hero-card__icon svg {
	width: 22px;
	height: 22px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.swp-hero-card:hover .swp-hero-card__icon {
	background: var(--swp-bg);
	border-color: var(--swp-border-strong);
	transform: translateY(-2px);
}

.swp-hero-card__label {
	font-size: 0.78rem;
	font-weight: 500;
	color: var(--swp-text-muted);
}

.swp-hero-card:hover .swp-hero-card__label {
	color: var(--swp-text);
}

/* Spotlight overlay */
.swp-spotlight[hidden] {
	display: none !important;
}

.swp-spotlight {
	position: fixed;
	inset: 0;
	z-index: 200000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 10vh 1rem 2rem;
}

.swp-spotlight__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 12, 0.55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.swp-spotlight__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(100%, 36rem);
	max-height: min(72vh, 560px);
	overflow: hidden;
	border: 1px solid var(--swp-border);
	border-radius: 16px;
	background: var(--swp-bg-elevated);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	animation: swp-spotlight-panel-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes swp-spotlight-panel-in {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.swp-spotlight__search {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid var(--swp-border);
}

.swp-spotlight__search-icon {
	display: inline-flex;
	color: var(--swp-text-muted);
}

.swp-spotlight__search-icon svg {
	stroke: currentColor;
	fill: none;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.swp-spotlight__input {
	flex: 1;
	min-width: 0;
	height: 36px;
	border: none;
	background: transparent;
	color: var(--swp-text);
	font-family: var(--swp-font);
	font-size: 1rem;
	outline: none;
}

.swp-spotlight__input::placeholder {
	color: var(--swp-text-muted);
}

.swp-spotlight__kbd {
	display: none;
	padding: 0.15rem 0.4rem;
	color: var(--swp-text-muted);
	font-size: 0.7rem;
	font-weight: 500;
}

@media (min-width: 640px) {
	.swp-spotlight__kbd {
		display: inline-block;
	}
}

.swp-spotlight__body {
	flex: 1;
	overflow: auto;
	padding: 0.65rem 0.5rem;
}

.swp-spotlight__heading {
	margin: 0.35rem 0.65rem 0.45rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--swp-text-muted);
}

.swp-spotlight__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.swp-spotlight__item {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	width: 100%;
	min-height: 42px;
	padding: 0.45rem 0.65rem;
	border: none;
	border-radius: 10px;
	background: transparent;
	color: var(--swp-text);
	font-family: var(--swp-font);
	font-size: 0.875rem;
	font-weight: 500;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.swp-spotlight__item:hover,
.swp-spotlight__item.is-active {
	background: var(--swp-bg-muted);
	color: var(--swp-text);
}

.swp-spotlight__item-icon {
	display: inline-flex;
	flex: 0 0 32px;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: var(--swp-bg);
	border: 1px solid var(--swp-border);
	color: var(--swp-text-muted);
}

.swp-spotlight__item-icon img {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	object-fit: cover;
}

.swp-spotlight__item-icon svg {
	width: 15px;
	height: 15px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.swp-spotlight__item-label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.swp-spotlight__item-meta {
	flex: 0 0 auto;
	color: var(--swp-text-muted);
	font-size: 0.75rem;
	font-weight: 500;
}

.swp-spotlight__empty {
	margin: 0.75rem 0.65rem;
	color: var(--swp-text-muted);
	font-size: 0.85rem;
}

.swp-spotlight__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.1rem;
	padding: 0.55rem 1rem;
	border-top: 1px solid var(--swp-border);
	color: var(--swp-text-muted);
	font-size: 0.7rem;
}

.swp-spotlight__footer kbd {
	display: inline-block;
	margin-right: 0.15rem;
	padding: 0.05rem 0.3rem;
	border-radius: 4px;
	border: 1px solid var(--swp-border);
	background: var(--swp-bg);
	font-family: var(--swp-font);
	font-size: 0.65rem;
}

body.swp-spotlight-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.swp-hero__title,
	.swp-spotlight-trigger,
	.swp-hero-card,
	.swp-spotlight__panel {
		animation: none;
	}
}

@media (max-width: 640px) {
	.swp-hero {
		padding: 2rem 0.5rem 1.25rem;
		gap: 1.15rem;
	}

	.swp-spotlight {
		padding: 12vh 0.65rem 1rem;
	}
}
