/**
 * HostOffers Homepage — hero, category bar, listing header, loading state.
 *
 * @package HostOffers
 * @since   1.3.0
 */

/* ==========================================================================
   Hero Section — light background matching prototype
   ========================================================================== */

/* Override REHub fullgutenberg max-width for homepage sections */
.fullgutenberg .post > .ho-homepage-hero {
	max-width: 100vw !important;
}

.fullgutenberg .post > .ho-homepage-below-hero {
	max-width: 1280px !important;
	width: 100%;
	box-sizing: border-box;
	overflow: hidden;
}

.ho-homepage-hero {
	background: #ffffff;
	padding: 80px 24px 40px;
	text-align: center;
	position: relative;
}

/* Dot pattern overlay matching prototype */
.ho-homepage-hero::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
	background-size: 16px 16px;
	opacity: 0.4;
	mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%);
	-webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%);
	pointer-events: none;
}

/* Constrain inner content width — z-index layers above dot pattern */
.ho-hero-inner {
	max-width: 1280px;
	margin: 0 auto;
	position: relative;
	z-index: 10;
}

/* "EXPERT HOSTING ADVICE" tag — green pill */
.ho-hero-tag {
	display: inline-block;
	background: rgba(0, 168, 89, 0.1);
	color: #00A859;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 4px 12px;
	border-radius: 999px;
	margin-bottom: 16px !important;
}

/* Main heading */
.ho-hero-heading {
	font-size: 60px;
	font-weight: 800;
	color: #003366 !important;
	line-height: 1.25;
	margin: 0 0 24px !important;
	font-family: 'Montserrat', sans-serif;
}

.ho-hero-heading em {
	font-style: italic;
	color: #94a3b8;
}

/* Subtitle */
.ho-hero-subtitle {
	font-size: 18px;
	line-height: 1.6;
	color: #475569 !important;
	margin: 0 0 32px !important;
	max-width: 672px;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* ==========================================================================
   Hero Search Bar
   ========================================================================== */

.ho-hero-search-row {
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 576px;
	margin: 0 auto 28px;
}

.ho-hero-search-wrap {
	position: relative;
	flex: 1;
	min-width: 0;
}

.ho-hero-search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	color: #94a3b8;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	width: 24px;
	height: 24px;
	z-index: 1;
}

.ho-hero-search-input {
	width: 100%;
	padding: 16px 16px 16px 52px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 12px !important;
	font-size: 16px !important;
	font-family: inherit !important;
	color: #1e293b;
	background: #ffffff !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	outline: none;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
	box-sizing: border-box;
	height: auto !important;
}

.ho-hero-search-input:focus {
	border-color: transparent;
	box-shadow: 0 0 0 2px #003366;
}

.ho-hero-search-input::placeholder {
	color: #94a3b8;
}

/* ==========================================================================
   Hero Search Dropdown
   ========================================================================== */

.ho-hero-search-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 4px;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
	max-height: 320px;
	overflow-y: auto;
	z-index: 100;
}

.ho-search-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	text-decoration: none;
	color: #1e293b;
	border-bottom: 1px solid #f1f5f9;
	transition: background 0.15s ease;
}

.ho-search-item:last-child {
	border-bottom: none;
}

.ho-search-item:first-child {
	border-radius: 12px 12px 0 0;
}

.ho-search-item:last-child {
	border-radius: 0 0 12px 12px;
}

.ho-search-item:only-child {
	border-radius: 12px;
}

.ho-search-item:hover,
.ho-search-item--active {
	background: #f0f4f8;
}

.ho-search-item__logo {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
}

.ho-search-item__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ho-search-item__name {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
}

.ho-search-item__price {
	font-size: 12px;
	color: #00A859;
	font-weight: 600;
}

.ho-search-empty {
	padding: 20px;
	text-align: center;
	color: #94a3b8;
	font-size: 14px;
}

/* Quiz CTA button — inline with search bar */
.ho-hero-quiz-btn-link {
	display: inline-flex;
	align-items: center;
	background: #00A859;
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
	padding: 16px 32px;
	border-radius: 12px;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
	gap: 8px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.ho-hero-quiz-btn-link svg {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

.ho-hero-quiz-btn-link:hover {
	background: #008a47;
	color: #ffffff;
	transform: scale(1.05);
	box-shadow: 0 6px 20px rgba(0, 168, 89, 0.4);
}

/* ==========================================================================
   Category Filter Bar — card-style container matching prototype
   ========================================================================== */

.ho-homepage-listing {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 16px;
	box-sizing: border-box;
}

.ho-category-bar {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 16px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	position: sticky;
	top: 64px;
	z-index: 40;
	margin-bottom: 8px;
	margin-top: 16px ;
}

.ho-category-bar__label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #003366;
	white-space: nowrap;
}

.ho-category-bar__icon {
	color: #00A859;
	font-size: 14px;
	display: flex;
	align-items: center;
}

.ho-category-pills {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 12px;
	flex: 1;
}

.ho-pill {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: 2px solid #f1f5f9;
	background: #ffffff;
	color: #64748b;
	font-size: 12px;
	font-weight: 700;
	padding: 12px 16px;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
	font-family: inherit;
	text-align: center;
}

.ho-pill__icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

/* Hover tooltip */
.ho-pill__tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #003366;
	color: #ffffff;
	font-size: 12px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 8px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
	z-index: 10;
}

.ho-pill__tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #003366;
}

.ho-pill:hover .ho-pill__tooltip {
	opacity: 1;
}

.ho-pill:hover {
	border-color: #00A859;
	color: #00A859;
	transform: scale(1.05);
	box-shadow: 0 0 20px rgba(0, 168, 89, 0.3);
}

.ho-pill--active {
	background: #003366;
	color: #ffffff;
	border-color: #003366;
	box-shadow: 0 0 20px rgba(0, 168, 89, 0.4);
}

.ho-pill--active:hover {
	background: #003366;
	color: #ffffff;
	border-color: #003366;
}

.ho-category-bar__sort {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

.ho-sort-select {
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 8px 32px 8px 12px;
	font-size: 12px;
	font-weight: 700;
	color: #475569;
	background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
	appearance: none;
	cursor: pointer;
	font-family: inherit;
}

.ho-sort-select:focus {
	outline: none;
	border-color: #00A859;
	box-shadow: 0 0 0 2px rgba(0, 168, 89, 0.15);
}

/* Visible "SORT:" label */
.ho-sort-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #94a3b8;
	white-space: nowrap;
}

/* Advanced filter button */
.ho-advanced-btn {
/*	display: inline-flex; */
	display: none;
	align-items: center;
	gap: 6px;
	border: none;
	border-radius: 12px;
	padding: 12px 16px;
	font-size: 13px;
	font-weight: 700;
	color: #334155;
	background: #ffffff;
	cursor: pointer;
	font-family: inherit;
	white-space: nowrap;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.ho-advanced-btn:hover {
	border-color: #003366;
	color: #003366;
}

.ho-advanced-chevron {
	flex-shrink: 0;
}

/* ==========================================================================
   Listing Header
   ========================================================================== */

.ho-listing-header {
	padding: 40px 0 48px;
}

.ho-listing-title {
	font-size: 36px;
	font-weight: 800;
	color: #003366;
	margin: 0 0 12px;
	font-family: 'Montserrat', sans-serif;
}

.ho-listing-subtitle {
	font-size: 16px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.ho-cards-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 0;
	color: #94a3b8;
	gap: 16px;
}

.ho-cards-loading p {
	font-size: 14px;
	margin: 0;
	color: #94a3b8;
}

.ho-loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e2e8f0;
	border-top-color: #003366;
	border-radius: 50%;
	animation: ho-spin 0.8s linear infinite;
}

@keyframes ho-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   Cards container transition
   ========================================================================== */

#ho-homepage-cards {
	transition: opacity 0.2s ease;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 781px) {

	.ho-homepage-hero {
		padding: 48px 20px 40px;
	}

	.ho-hero-heading {
		font-size: 36px;
	}

	.ho-hero-subtitle {
		font-size: 15px;
	}

	.ho-hero-search-input {
		font-size: 14px !important;
		padding: 14px 16px 14px 48px !important;
	}

	.ho-hero-search-row {
		flex-direction: column;
		gap: 12px;
	}

	.ho-hero-quiz-btn-link {
		width: 100%;
		justify-content: center;
		padding: 14px 16px;
		font-size: 14px;
		border-radius: 12px;
		box-sizing: border-box;
	}

	.ho-hero-search-dropdown {
		max-height: 240px;
	}

	/* Stack category bar vertically on tablet */
	.ho-category-bar {
		flex-direction: column;
		gap: 12px;
		padding: 12px;
		overflow: hidden;
	}

	.ho-category-bar__label {
		align-self: flex-start;
	}

	/* Horizontal scroll pills instead of wrapping grid */
	.ho-category-pills {
		display: flex;
		overflow-x: auto;
		gap: 8px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 4px;
		width: 100%;
	}

	.ho-category-pills::-webkit-scrollbar {
		display: none;
	}

	.ho-pill {
		flex-shrink: 0;
	}

	.ho-category-bar__sort {
		width: 100%;
	}

	.ho-sort-select {
		width: 100%;
	}

	.ho-listing-title {
		font-size: 24px;
	}

	.ho-listing-subtitle {
		font-size: 14px;
	}
}

@media (max-width: 480px) {

	.ho-homepage-hero {
		padding: 36px 16px 32px;
	}

	.ho-hero-heading {
		font-size: 28px;
	}

	.ho-hero-subtitle {
		font-size: 14px;
		margin-bottom: 24px !important;
	}

	.ho-hero-quiz-btn-link {
		padding: 14px 24px;
		font-size: 14px;
		box-sizing: border-box;
	}

	/* Tighter gap between pills on small screens */
	.ho-category-pills {
		gap: 6px;
	}

	.ho-pill {
		padding: 10px 14px;
		font-size: 11px;
		white-space: nowrap;
	}

	.ho-category-bar {
		padding: 10px;
	}

	.ho-homepage-listing {
		padding: 0 12px;
	}

	.ho-listing-header {
		padding: 28px 0 16px;
	}

	.ho-listing-title {
		font-size: 22px;
	}
}

/* ==========================================================================
   Quiz Personalization Banner
   ========================================================================== */

.ho-quiz-banner {
	position: relative;
	background-color: #003366;
	color: #fff;
	overflow: hidden;
	margin: 12px 0 0;
	border-radius: 16px;
}

.ho-quiz-banner__dots {
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgb(0, 168, 89) 1px, transparent 1px);
	background-size: 24px 24px;
	opacity: 0.1;
	pointer-events: none;
}

.ho-quiz-banner__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 1280px;
	margin: 0 auto;
	padding: 16px 24px;
	gap: 16px;
}

.ho-quiz-banner__content {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ho-quiz-banner__icon {
	flex-shrink: 0;
	color: #00A859;
}

.ho-quiz-banner__text {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	font-size: 14px;
	line-height: 1.5;
}

.ho-quiz-banner__text strong {
	font-weight: 600;
}

.ho-quiz-banner__text span {
	opacity: 0.85;
}

.ho-quiz-banner__reset {
	display: flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
	color: #fff;
	padding: 8px 14px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.03em;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.2s ease;
}

.ho-quiz-banner__reset:hover {
	background: rgba(255, 255, 255, 0.25);
}

.ho-quiz-banner__reset svg {
	flex-shrink: 0;
	opacity: 0.7;
}

@media (max-width: 600px) {
	.ho-quiz-banner__inner {
		flex-direction: column;
		align-items: flex-start;
		padding: 14px 16px;
	}

	.ho-quiz-banner__reset {
		align-self: flex-end;
	}
}
