/**
 * Thủy Bích Vĩnh Long — Blog Category Archive CSS
 *
 * Path:
 * wp-content/themes/flatsome-child/css/tb-blog-archive.css
 *
 * Owner:
 * - WordPress post category archive pages.
 * - Archive header, toolbar, sort, grid, empty state, responsive layout.
 *
 * Uses shared components:
 * - css/tb-blog-card.css for common blog card primitives.
 * - css/tb-pagination.css for pagination.
 *
 * Not owner:
 * - Blog Hub page template.
 * - Single Blog post layout.
 * - WooCommerce product categories.
 * - Shared blog-card primitive rules.
 */

.tb-blog-archive {
	--tb-archive-text: #111513;
	--tb-archive-muted: #646b65;
	--tb-archive-line: rgba(30, 35, 32, .065);
	--tb-archive-line-soft: rgba(30, 35, 32, .04);
	--tb-archive-brass: #a98a5e;
	--tb-archive-surface: #f4f5f2;
	--tb-archive-wide: 1540px;
	--tb-archive-gutter: 32px;

	/* Shared blog-card aliases scoped to archive cards. */
	--tb-blog-card-bg: #fff;
	--tb-blog-card-text: #1d211d;
	--tb-blog-card-muted: #656d67;
	--tb-blog-card-accent: var(--tb-archive-brass);
	--tb-blog-card-line-strong: rgba(30, 35, 32, .14);

	padding: 58px 0 104px;
	background: #fff;
	color: var(--tb-archive-text);
	font-family: var(--tb-font, "Be Vietnam Pro", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.tb-blog-archive *,
.tb-blog-archive *::before,
.tb-blog-archive *::after {
	box-sizing: border-box;
}

.tb-blog-archive a {
	color: inherit;
	text-decoration: none;
}

.tb-blog-archive__wrap {
	width: min(var(--tb-archive-wide), calc(100vw - 2 * var(--tb-archive-gutter)));
	margin-inline: auto;
}

.tb-blog-archive__breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	margin: 0 0 50px;
	color: #6f7670;
	font-size: 13px;
	line-height: 1.2;
	font-weight: 500;
}

.tb-blog-archive__breadcrumb a:hover,
.tb-blog-archive__breadcrumb span:last-child {
	color: #111513;
}

.tb-blog-archive__header {
	max-width: 820px;
	margin: 0;
}

.tb-blog-archive__eyebrow {
	margin: 0 0 20px;
	color: var(--tb-archive-brass);
	font-size: 12px;
	line-height: 1;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.tb-blog-archive__title {
	max-width: 760px;
	margin: 0;
	color: #1d211d;
	font-size: clamp(28px, 2.6vw, 42px);
	line-height: 1.14;
	font-weight: 700;
	letter-spacing: -.026em;
}

.tb-blog-archive__description {
	max-width: 680px;
	margin-top: 16px;
	color: var(--tb-archive-muted);
	font-size: 15px;
	line-height: 1.7;
}

.tb-blog-archive__description p {
	margin: 0;
}

.tb-blog-archive__divider {
	width: 100%;
	height: 1px;
	margin: 40px 0 22px;
	background: var(--tb-archive-line);
}

.tb-blog-archive__toolbar {
	margin: 0 0 28px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}

.tb-blog-archive__toolbar:not(.has-sort) {
	justify-content: flex-start;
}

.tb-blog-archive__sort {
	position: relative;
	z-index: 5;
	flex: 0 0 auto;
	width: 220px;
	margin: 0;
}

.tb-blog-archive__sort summary {
	list-style: none;
}

.tb-blog-archive__sort summary::-webkit-details-marker {
	display: none;
}

.tb-blog-archive__sort-trigger {
	height: 38px;
	padding: 0 36px 0 14px;
	display: flex;
	align-items: center;
	position: relative;
	border: 1px solid rgba(30, 35, 32, .14);
	border-radius: 2px;
	background: #fff;
	box-shadow: none;
	color: #2f3732;
	font-size: 13px;
	line-height: 38px;
	font-weight: 600;
	cursor: pointer;
	user-select: none;
}

.tb-blog-archive__sort-trigger::after {
	content: "";
	position: absolute;
	right: 14px;
	top: 50%;
	width: 7px;
	height: 7px;
	border-right: 1.25px solid #7a817b;
	border-bottom: 1.25px solid #7a817b;
	transform: translateY(-64%) rotate(45deg);
	transition: transform .16s ease;
}

.tb-blog-archive__sort[open] .tb-blog-archive__sort-trigger::after {
	transform: translateY(-36%) rotate(-135deg);
}

.tb-blog-archive__sort-trigger:hover,
.tb-blog-archive__sort[open] .tb-blog-archive__sort-trigger,
.tb-blog-archive__sort-trigger:focus-visible {
	border-color: rgba(30, 35, 32, .26);
	outline: 0;
}

.tb-blog-archive__sort-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	display: grid;
	padding: 0;
	background: #fff;
	border: 1px solid rgba(30, 35, 32, .12);
	border-radius: 2px;
	box-shadow: none;
	overflow: hidden;
}

.tb-blog-archive__sort-option {
	min-height: 38px;
	padding: 0 14px;
	display: flex;
	align-items: center;
	background: #fff;
	color: #424a45;
	font-size: 13px;
	line-height: 1.35;
	font-weight: 500;
	text-decoration: none;
}

.tb-blog-archive__sort-option:hover,
.tb-blog-archive__sort-option:focus-visible {
	background: #f4f5f2;
	color: #111513;
	outline: 0;
}

.tb-blog-archive__sort-option.is-active {
	background: #f1f2ef;
	color: #111513;
	font-weight: 700;
}

.tb-blog-archive__count {
	margin: 0;
	color: var(--tb-archive-muted);
	font-size: 13px;
	line-height: 1.5;
	font-weight: 500;
}

.tb-blog-archive__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 34px 28px;
}

.tb-archive-card {
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--tb-archive-line-soft);
	border-radius: 3px;
	box-shadow: none;
}

.tb-archive-card:hover {
	border-color: rgba(30, 35, 32, .075);
}

.tb-archive-card__link {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.tb-archive-card__image {
	transition: transform .55s ease;
}

.tb-archive-card:hover .tb-archive-card__image {
	transform: scale(1.014);
}

.tb-archive-card__fallback {
	height: 100%;
	min-height: 160px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #798179;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	background: linear-gradient(135deg, #f2f5ef, #e7ede6);
}

.tb-archive-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 14px 18px 15px;
}

.tb-archive-card__meta {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 14px;
	margin: 0 0 10px;
}

.tb-archive-card__cat {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tb-archive-card__date {
	white-space: nowrap;
}

.tb-archive-card__title {
	margin: 0 0 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tb-archive-card__excerpt {
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tb-archive-card__foot {
	margin-top: auto;
	padding-top: 11px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.tb-blog-archive__empty {
	padding: 42px 24px;
	background: var(--tb-archive-surface);
	border: 1px solid var(--tb-archive-line);
	color: var(--tb-archive-muted);
	font-size: 15px;
	line-height: 1.6;
	text-align: center;
}

.tb-blog-archive__empty p {
	margin: 0;
}

@media (max-width: 1100px) {
	.tb-blog-archive {
		--tb-archive-gutter: 24px;
	}

	.tb-blog-archive__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 849px) {
	.tb-blog-archive {
		--tb-archive-gutter: 16px;
		padding: 38px 0 78px;
	}

	.tb-blog-archive__breadcrumb {
		margin-bottom: 30px;
		font-size: 12.5px;
	}

	.tb-blog-archive__divider {
		margin: 32px 0 18px;
	}

	.tb-blog-archive__toolbar {
		margin-bottom: 22px;
		align-items: flex-start;
	}

	.tb-blog-archive__toolbar.has-sort {
		flex-direction: column;
		align-items: stretch;
	}

	.tb-blog-archive__sort {
		width: 100%;
	}

	.tb-blog-archive__title {
		font-size: 30px;
	}

	.tb-blog-archive__grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	.tb-archive-card__body {
		padding: 13px 15px 14px;
	}

	.tb-archive-card__title {
		font-size: 15.5px;
	}

	.tb-archive-card__title::before {
		margin-bottom: 9px;
	}
}
