/* ================================================================
   Archive, Category & Search Pages — How to Repel
   Premium redesign: hero banners, card grids, search results.
   Loads on: archive, category, search, blog, author pages.
   ================================================================ */

/* ── shared tokens (mirrors homepage.css) ── */
.htr-unified-chrome {
	--htr-primary:       #0f6463;
	--htr-primary-dark:  #0a4a49;
	--htr-primary-light: #19807f;
	--htr-accent:        #1a7f7e;
	--htr-text:          #1d1a16;
	--htr-text-muted:    #4a5568;
	--htr-bg:            #f5f2eb;
	--htr-surface:       #fcfbf8;
	--htr-border:        rgba(15,100,99,.12);
	--htr-text-light:    #8a7960;
	--htr-shadow-soft:   0 8px 28px rgba(15,100,99,.08);
	--htr-shadow-hover:  0 16px 40px rgba(15,100,99,.16);
	--htr-radius-lg:     18px;
	--htr-radius-md:     12px;
	--htr-radius-pill:   999px;
	--htr-container:     1200px;
}

/* ================================================================
   CATEGORY / ARCHIVE HERO BANNER
   ================================================================ */
.htr-archive-hero {
	position: relative;
	background: linear-gradient(150deg, #0a4a49 0%, #0f6463 45%, #1a7f7e 100%);
	color: #fff;
	padding: 3.5rem 0 4.5rem;
	margin-bottom: 2.5rem;
	overflow: hidden;
}

/* wave bottom — matches homepage */
.htr-archive-hero::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 100%;
	height: 70px;
	background: var(--htr-bg);
	-webkit-clip-path: ellipse(55% 100% at 50% 100%);
	clip-path: ellipse(55% 100% at 50% 100%);
	pointer-events: none;
}

/* decorative circle */
.htr-archive-hero::before {
	content: '';
	position: absolute;
	top: -80px;
	right: -60px;
	width: 380px;
	height: 380px;
	border-radius: 50%;
	background: rgba(255,255,255,.04);
	pointer-events: none;
}

.htr-archive-hero-inner {
	position: relative;
	z-index: 1;
	width: min(var(--htr-container), calc(100% - 2rem));
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 1.5rem;
}

.htr-archive-hero-icon {
	font-size: 3.5rem;
	line-height: 1;
	flex-shrink: 0;
	filter: drop-shadow(0 4px 12px rgba(0,0,0,.2));
}

.htr-archive-hero-text {
	flex: 1;
}

.htr-archive-hero-text h1 {
	margin: 0 0 0.4rem;
	font-size: clamp(1.8rem, 4vw, 3rem);
	font-weight: 800;
	line-height: 1.1;
	color: #fff;
	letter-spacing: -0.02em;
	text-shadow: 0 2px 16px rgba(0,0,0,.15);
}

.htr-archive-hero-text p {
	margin: 0;
	font-size: 1.05rem;
	color: rgba(255,255,255,.82);
	max-width: 600px;
	line-height: 1.6;
}

.htr-archive-hero-badges {
	display: flex;
	gap: 0.65rem;
	flex-wrap: wrap;
	margin-top: 1rem;
}

.htr-archive-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	background: rgba(255,255,255,.14);
	border: 1px solid rgba(255,255,255,.22);
	padding: 0.3rem 0.85rem;
	border-radius: var(--htr-radius-pill);
	font-size: 0.82rem;
	font-weight: 600;
	color: rgba(255,255,255,.9);
	backdrop-filter: blur(6px);
}

/* ================================================================
   SEARCH HERO / RESULTS HEADER
   ================================================================ */
.htr-search-hero {
	background: linear-gradient(150deg, #0a4a49 0%, #0f6463 60%, #1a7f7e 100%);
	color: #fff;
	padding: 2.5rem 0 4rem;
	margin-bottom: 2rem;
	position: relative;
	overflow: hidden;
}

.htr-search-hero::after {
	content: '';
	position: absolute;
	bottom: -1px;
	left: 0;
	width: 100%;
	height: 60px;
	background: var(--htr-bg);
	-webkit-clip-path: ellipse(55% 100% at 50% 100%);
	clip-path: ellipse(55% 100% at 50% 100%);
	pointer-events: none;
}

.htr-search-hero-inner {
	position: relative;
	z-index: 1;
	width: min(var(--htr-container), calc(100% - 2rem));
	margin: 0 auto;
}

.htr-search-hero-title {
	font-size: clamp(1.4rem, 3vw, 2.2rem);
	font-weight: 800;
	color: #fff;
	margin: 0 0 0.35rem;
	letter-spacing: -0.02em;
}

.htr-search-hero-title em {
	style: normal;
	color: #8ef0ef;
	font-style: normal;
}

.htr-search-count {
	display: inline-flex;
	align-items: center;
	background: rgba(255,255,255,.14);
	border: 1px solid rgba(255,255,255,.22);
	padding: 0.25rem 0.75rem;
	border-radius: var(--htr-radius-pill);
	font-size: 0.82rem;
	font-weight: 600;
	color: rgba(255,255,255,.9);
	margin-bottom: 1.25rem;
}

/* Re-search form inside search hero */
.htr-search-refine {
	display: flex;
	gap: 0.65rem;
	max-width: 560px;
}

.htr-search-refine input[type="search"] {
	flex: 1;
	height: 50px;
	padding: 0 1.1rem;
	border-radius: var(--htr-radius-pill);
	border: 2px solid rgba(255,255,255,.3);
	background: rgba(255,255,255,.12);
	color: #fff;
	font-family: 'Poppins', sans-serif;
	font-size: 0.95rem;
	backdrop-filter: blur(6px);
	transition: border-color .2s, background .2s;
}

.htr-search-refine input[type="search"]::placeholder {
	color: rgba(255,255,255,.5);
}

.htr-search-refine input[type="search"]:focus {
	outline: none;
	border-color: rgba(255,255,255,.7);
	background: rgba(255,255,255,.18);
}

.htr-search-refine button {
	height: 50px;
	padding: 0 1.3rem;
	border: none;
	border-radius: var(--htr-radius-pill);
	background: #fff;
	color: var(--htr-primary);
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s, transform .15s;
}

.htr-search-refine button:hover {
	background: #e8f4f3;
	transform: translateY(-1px);
}

/* ================================================================
   OVERRIDE: Replace boring Astra archive description
   ================================================================ */
body.htr-unified-chrome .ast-archive-description {
	display: none !important;
}

/* ================================================================
   POST CARD GRID — Premium redesign
   ================================================================ */
body.htr-unified-chrome.archive #primary .ast-row,
body.htr-unified-chrome.author #primary .ast-row,
body.htr-unified-chrome.category #primary .ast-row,
body.htr-unified-chrome.blog #primary .ast-row,
body.htr-unified-chrome.search #primary .ast-row {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 1.5rem !important;
	align-items: start !important;
}

/* Search: 2-col for better readability */
body.htr-unified-chrome.search #primary .ast-row {
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.htr-unified-chrome.archive .ast-article-post,
body.htr-unified-chrome.author .ast-article-post,
body.htr-unified-chrome.category .ast-article-post,
body.htr-unified-chrome.blog .ast-article-post,
body.htr-unified-chrome.search .ast-article-post {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	background: #fff !important;
	border: 1px solid var(--htr-border) !important;
	border-top: 3px solid var(--htr-primary) !important;
	border-radius: var(--htr-radius-md) !important;
	overflow: hidden !important;
	box-shadow: var(--htr-shadow-soft) !important;
	transition: transform .22s, box-shadow .25s, border-top-color .2s !important;
	display: flex !important;
	flex-direction: column !important;
	margin: 0 !important;
}

body.htr-unified-chrome.archive .ast-article-post:hover,
body.htr-unified-chrome.author .ast-article-post:hover,
body.htr-unified-chrome.category .ast-article-post:hover,
body.htr-unified-chrome.blog .ast-article-post:hover,
body.htr-unified-chrome.search .ast-article-post:hover {
	transform: translateY(-5px) !important;
	box-shadow: var(--htr-shadow-hover) !important;
	border-top-color: var(--htr-accent) !important;
}

/* Featured image — full-bleed with zoom-on-hover */
body.htr-unified-chrome .ast-blog-featured-section {
	margin: 0 !important;
	order: -1;
	overflow: hidden;
	aspect-ratio: 16 / 9;
}

body.htr-unified-chrome .ast-blog-featured-section a {
	display: block;
	width: 100%;
	height: 100%;
}

body.htr-unified-chrome .ast-blog-featured-section img {
	aspect-ratio: 16 / 9 !important;
	object-fit: cover !important;
	width: 100% !important;
	height: 100% !important;
	display: block !important;
	transition: transform .4s ease !important;
}

body.htr-unified-chrome .ast-article-post:hover .ast-blog-featured-section img {
	transform: scale(1.06) !important;
}

/* Card inner: post content area */
body.htr-unified-chrome .ast-article-inner {
	display: flex !important;
	flex-direction: column !important;
	height: 100% !important;
}

body.htr-unified-chrome .ast-article-post .post-content {
	padding: 1rem 1.1rem 1.2rem !important;
	display: flex !important;
	flex-direction: column !important;
	flex: 1 !important;
}

/* Title */
body.htr-unified-chrome .ast-article-post .entry-title {
	margin: 0 0 0.4rem !important;
	font-size: 0.95rem !important;
	line-height: 1.42 !important;
	font-weight: 700 !important;
}

body.htr-unified-chrome .ast-article-post .entry-title a {
	color: var(--htr-text) !important;
	text-decoration: none !important;
	transition: color .2s !important;
}

body.htr-unified-chrome .ast-article-post .entry-title a:hover {
	color: var(--htr-primary) !important;
}

/* Excerpt */
body.htr-unified-chrome .ast-excerpt {
	font-size: 0.83rem !important;
	color: var(--htr-text-light) !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 2 !important;
	-webkit-box-orient: vertical !important;
	overflow: hidden !important;
	margin-bottom: 0.65rem !important;
	line-height: 1.6 !important;
}

/* Card footer meta */
body.htr-unified-chrome .htr-archive-meta {
	margin-top: auto !important;
	padding-top: 0.65rem !important;
	border-top: 1px solid rgba(15,100,99,.08) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 0.5rem !important;
	flex-wrap: wrap !important;
}

/* Category pill */
body.htr-unified-chrome .htr-archive-cat {
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.2rem !important;
	background: rgba(15,100,99,.08) !important;
	color: var(--htr-primary) !important;
	font-weight: 600 !important;
	font-size: 0.72rem !important;
	padding: 0.2rem 0.65rem !important;
	border-radius: var(--htr-radius-pill) !important;
	text-decoration: none !important;
	transition: background .2s !important;
}

body.htr-unified-chrome .htr-archive-cat:hover {
	background: rgba(15,100,99,.16) !important;
}

/* Reading time chip */
.htr-reading-time {
	font-size: 0.72rem;
	color: var(--htr-text-light);
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

/* Read guide CTA link */
.htr-card-read-btn {
	display: inline-block !important;
	background: var(--htr-primary) !important;
	color: #fff !important;
	font-size: 0.75rem !important;
	font-weight: 700 !important;
	padding: 0.3rem 0.85rem !important;
	border-radius: var(--htr-radius-pill) !important;
	text-decoration: none !important;
	transition: background .2s, transform .15s !important;
	white-space: nowrap !important;
}

.htr-card-read-btn:hover {
	background: var(--htr-primary-dark) !important;
	transform: translateY(-1px) !important;
}

/* Hide the default Astra meta / taxonomies (replaced by our meta row) */
body.htr-unified-chrome .entry-header.ast-blog-meta-container,
body.htr-unified-chrome .ast-taxonomy-container.cat-links,
body.htr-unified-chrome.archive .entry-header,
body.htr-unified-chrome.category .entry-header,
body.htr-unified-chrome.blog .entry-header,
body.htr-unified-chrome.search .entry-header {
	display: none !important;
}

/* ================================================================
   RELATED CATEGORIES STRIP
   ================================================================ */
.htr-related-cats {
	margin: 3rem 0 1rem;
	padding: 2rem 0;
	background: linear-gradient(180deg, var(--htr-bg) 0%, #fff 100%);
	border-top: 1px solid var(--htr-border);
}

.htr-related-cats-inner {
	width: min(var(--htr-container), calc(100% - 2rem));
	margin: 0 auto;
}

.htr-related-cats h3 {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--htr-text-light);
	margin: 0 0 1rem;
	font-weight: 600;
}

.htr-related-cats-row {
	display: flex;
	gap: 0.65rem;
	flex-wrap: wrap;
}

.htr-related-cat-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1rem;
	border-radius: var(--htr-radius-pill);
	background: #fff;
	border: 1px solid var(--htr-border);
	text-decoration: none !important;
	color: var(--htr-text) !important;
	font-size: 0.85rem;
	font-weight: 600;
	transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
	box-shadow: var(--htr-shadow-soft);
}

.htr-related-cat-pill:hover {
	background: var(--htr-primary);
	color: #fff !important;
	border-color: var(--htr-primary);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(15,100,99,.2);
}

.htr-related-cat-pill .htr-rcat-icon {
	font-size: 1rem;
}

.htr-related-cat-pill .htr-rcat-count {
	color: var(--htr-text-light);
	font-size: 0.75rem;
	font-weight: 400;
	transition: color .2s;
}

.htr-related-cat-pill:hover .htr-rcat-count {
	color: rgba(255,255,255,.75);
}

/* ================================================================
   PAGINATION — Premium pills
   ================================================================ */
body.htr-unified-chrome .ast-pagination,
body.htr-unified-chrome .navigation.pagination {
	display: flex !important;
	justify-content: center !important;
	gap: 0.4rem !important;
	padding: 2rem 0 !important;
	margin-top: 1rem !important;
}

body.htr-unified-chrome .page-numbers {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 40px !important;
	height: 40px !important;
	border-radius: 50% !important;
	text-decoration: none !important;
	font-weight: 600 !important;
	font-size: 0.9rem !important;
	background: #fff !important;
	border: 1px solid var(--htr-border) !important;
	color: var(--htr-text) !important;
	transition: background .2s, color .2s, border-color .2s, transform .15s !important;
}

body.htr-unified-chrome .page-numbers:hover {
	background: var(--htr-primary) !important;
	color: #fff !important;
	border-color: var(--htr-primary) !important;
	transform: translateY(-1px) !important;
}

body.htr-unified-chrome .page-numbers.current {
	background: var(--htr-primary) !important;
	color: #fff !important;
	border-color: var(--htr-primary) !important;
}

body.htr-unified-chrome .page-numbers.dots {
	background: transparent !important;
	border-color: transparent !important;
	width: auto !important;
}

/* ================================================================
   NO-RESULTS STATE
   ================================================================ */
.htr-no-results {
	text-align: center;
	padding: 4rem 1rem;
	max-width: 540px;
	margin: 0 auto;
}

.htr-no-results-icon {
	font-size: 4rem;
	margin-bottom: 1rem;
	line-height: 1;
}

.htr-no-results h2 {
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--htr-primary);
	margin: 0 0 0.65rem;
}

.htr-no-results p {
	color: var(--htr-text-muted);
	font-size: 1rem;
	margin-bottom: 2rem;
	line-height: 1.65;
}

.htr-no-results-cats {
	display: flex;
	gap: 0.65rem;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 1.5rem;
}

/* ================================================================
   SCROLL FADE-IN
   ================================================================ */
.htr-arc-animate {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity .5s ease, transform .5s ease;
}

.htr-arc-animate.htr-arc-visible {
	opacity: 1;
	transform: translateY(0);
}

.htr-arc-delay-1 { transition-delay: .08s; }
.htr-arc-delay-2 { transition-delay: .16s; }
.htr-arc-delay-3 { transition-delay: .24s; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 980px) {
	body.htr-unified-chrome.archive #primary .ast-row,
	body.htr-unified-chrome.author #primary .ast-row,
	body.htr-unified-chrome.category #primary .ast-row,
	body.htr-unified-chrome.blog #primary .ast-row {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	body.htr-unified-chrome.search #primary .ast-row {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.htr-archive-hero-inner {
		flex-direction: column;
		gap: 0.75rem;
		text-align: center;
	}

	.htr-archive-hero-badges {
		justify-content: center;
	}
}

@media (max-width: 767px) {
	.htr-archive-hero {
		padding: 2.5rem 0 3.5rem;
	}

	.htr-archive-hero-text h1 {
		font-size: clamp(1.5rem, 7vw, 2rem);
	}

	body.htr-unified-chrome.archive #primary .ast-row,
	body.htr-unified-chrome.author #primary .ast-row,
	body.htr-unified-chrome.category #primary .ast-row,
	body.htr-unified-chrome.blog #primary .ast-row,
	body.htr-unified-chrome.search #primary .ast-row {
		grid-template-columns: 1fr !important;
	}

	.htr-search-refine {
		flex-direction: column;
		max-width: 100%;
	}

	.htr-search-refine input[type="search"],
	.htr-search-refine button {
		width: 100%;
	}

	.htr-related-cats-row {
		gap: 0.5rem;
	}
}
