/* ==========================================================
   Dotthemes – Blog page (home.php)
   Upload to: /wp-content/themes/YOUR-CHILD-THEME/blog-archive.css
   Needs category-archive.css too (hero, pagination, variables).
   ========================================================== */

.dt-blog {
	--dt-cols: 2;          /* change to 3 for a 3-column grid */
	--dt-sticky-top: 110px; /* distance from top when sidebar sticks (match your sticky header height) */
	--dt-side-w: 280px;
}

/* ---------- Layout ---------- */
.dt-blog__layout {
	display: grid;
	grid-template-columns: var(--dt-side-w) minmax(0, 1fr);
	gap: 48px;
	align-items: start; /* required for sticky */
}

.dt-blog__side {
	position: sticky;
	top: var(--dt-sticky-top);
	align-self: start;
}

/* ---------- Sidebar ---------- */
.dt-side-box {
	padding: 22px;
	border-radius: var(--dt-radius-md);
	background: var(--dt-surface);
	border: 1px solid var(--dt-line);
}

.dt-search {
	position: relative;
	margin-bottom: 26px;
}

.dt-search input[type="search"] {
	width: 100%;
	height: 46px;
	padding: 0 46px 0 16px;
	border-radius: 12px;
	border: 1px solid var(--dt-line);
	background: rgba(14, 19, 48, 0.035);
	font-size: 15px;
	color: var(--dt-text);
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.dt-search input[type="search"]:focus {
	outline: none;
	background: #fff;
	border-color: var(--dt-ink-2);
	box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25);
}

.dt-search button {
	position: absolute;
	top: 0;
	right: 0;
	width: 46px;
	height: 46px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--dt-muted);
	cursor: pointer;
}

.dt-search button:hover {
	color: var(--dt-ink);
}

.dt-side-box__title {
	margin: 0 0 12px;
	font-size: 17px;
	font-weight: 700;
	color: var(--dt-text);
}

.dt-topics {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 2px;
}

.dt-topics a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	color: var(--dt-text);
	transition: background 0.18s, color 0.18s;
}

.dt-topics a em {
	font-style: normal;
	font-size: 13px;
	color: var(--dt-muted);
}

.dt-topics a:hover {
	background: rgba(14, 19, 48, 0.06);
}

.dt-topics a.is-active {
	background: var(--dt-ink);
	color: #fff;
	font-weight: 600;
}

.dt-topics a.is-active em {
	color: rgba(255, 255, 255, 0.7);
}

/* ---------- Posts grid ---------- */
.dt-posts {
	display: grid;
	grid-template-columns: repeat(var(--dt-cols), minmax(0, 1fr));
	gap: var(--dt-gap);
}

.dt-post a {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--dt-radius-md);
	overflow: hidden;
	background: var(--dt-surface);
	border: 1px solid var(--dt-line);
	transition: transform 0.25s, box-shadow 0.3s, border-color 0.2s;
}

.dt-post a:hover {
	transform: translateY(-4px);
	border-color: transparent;
	box-shadow: 0 22px 44px -22px rgba(14, 19, 48, 0.35);
}

.dt-post__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.dt-post a:hover .dt-thumb-img {
	transform: scale(1.05);
}

.dt-post__body {
	display: block;
	padding: 22px 22px 26px;
}

.dt-post__title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.32;
	letter-spacing: -0.01em;
	font-weight: 650;
	color: var(--dt-text);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.dt-post__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 15px;
	line-height: 1.65;
	color: var(--dt-muted);
}

/* ==========================================================
   GUEST POST CTA
   ========================================================== */
.dt-cta {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px;
	margin-top: 88px;
	padding: clamp(32px, 5vw, 64px);
	border-radius: var(--dt-radius-lg);
	color: #fff;
	background:
		radial-gradient(520px 320px at 100% 0%, rgba(45, 212, 191, 0.38), transparent 70%),
		radial-gradient(480px 320px at 0% 100%, rgba(99, 102, 241, 0.45), transparent 70%),
		linear-gradient(150deg, var(--dt-ink-2), var(--dt-ink));
}

/* dotted texture */
.dt-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.4px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(100deg, transparent 20%, #000 100%);
	mask-image: linear-gradient(100deg, transparent 20%, #000 100%);
}

.dt-cta__text {
	max-width: 620px;
}

.dt-cta__title {
	margin: 0 0 12px;
	color: #fff;
	font-size: clamp(26px, 3.4vw, 40px);
	line-height: 1.15;
	letter-spacing: -0.02em;
	font-weight: 700;
}

.dt-cta__desc {
	margin: 0;
	font-size: 17px;
	line-height: 1.65;
	color: rgba(255, 255, 255, 0.78);
}

.dt-archive a.dt-cta__btn {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 54px;
	padding: 0 30px;
	border-radius: 999px;
	font-size: 16px;
	font-weight: 650;
	color: var(--dt-ink);
	background: var(--dt-accent);
	transition: transform 0.2s, box-shadow 0.25s, background 0.2s;
}

.dt-archive a.dt-cta__btn:hover {
	background: #5eead4;
	transform: translateY(-2px);
	box-shadow: 0 14px 30px -10px rgba(45, 212, 191, 0.65);
}

.dt-archive a.dt-cta__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1100px) {
	.dt-blog {
		--dt-side-w: 240px;
	}

	.dt-blog__layout {
		gap: 32px;
	}
}

@media (max-width: 900px) {
	.dt-blog__layout {
		grid-template-columns: minmax(0, 1fr);
	}

	/* sidebar becomes a horizontal chip bar, no sticky */
	.dt-blog__side {
		position: static;
	}

	.dt-side-box {
		padding: 0;
		border: 0;
		background: transparent;
	}

	.dt-side-box__title {
		display: none;
	}

	.dt-search {
		margin-bottom: 14px;
	}

	.dt-topics {
		display: flex;
		gap: 8px;
		overflow-x: auto;
		padding-bottom: 6px;
		scrollbar-width: none;
	}

	.dt-topics::-webkit-scrollbar {
		display: none;
	}

	.dt-topics a {
		white-space: nowrap;
		padding: 8px 16px;
		border-radius: 999px;
		border: 1px solid var(--dt-line);
		background: var(--dt-surface);
	}

	.dt-topics a em {
		display: none;
	}

	.dt-cta {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 640px) {
	.dt-posts {
		grid-template-columns: 1fr;
	}

	.dt-cta {
		margin-top: 64px;
	}

	.dt-archive a.dt-cta__btn {
		width: 100%;
	}
}
