/* The Climate Bug homepage. Uses tokens from climatebug.css. */

.cb-home { font-family: var(--cb-sans); color: var(--cb-ink); }
.cb-home :where(h1, h2, h3, p, ul, figure) { margin: 0; padding: 0; }
.cb-home :where(ul) { list-style: none; }

.cb-section-title {
	font-family: var(--cb-serif);
	font-size: 28px;
	line-height: 1.2;
	color: var(--cb-forest);
	font-weight: 700;
}
.cb-section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	margin-bottom: 28px;
}

.cb-kicker {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--cb-earth-ink);
	text-decoration: none;
}
a.cb-kicker:hover { color: var(--cb-forest); }
.cb-meta { font-size: 15px; color: var(--cb-muted); display: flex; gap: 6px; flex-wrap: wrap; }

.cb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--cb-radius);
	background: var(--cb-green);
	color: #FFFFFF !important;
	font-family: var(--cb-sans);
	font-size: 17px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.cb-button:hover { background: var(--cb-forest); }
[data-darkmode="dark"] .cb-button { color: #10201A !important; }
[data-darkmode="dark"] .cb-button:hover { background: var(--cb-forest); }

.cb-textlink {
	font-weight: 600;
	font-size: 17px;
	color: var(--cb-green);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	text-decoration-color: var(--cb-botanical);
}
.cb-textlink:hover { color: var(--cb-forest); text-decoration-color: currentColor; }

/* ---------- Hero ---------- */
.cb-hero { padding-block: 56px 64px; }
.cb-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: 56px;
	align-items: center;
}
.cb-hero__title {
	font-family: var(--cb-serif);
	font-size: clamp(34px, 4.4vw, 52px);
	line-height: 1.12;
	letter-spacing: -0.01em;
	color: var(--cb-forest);
	font-weight: 700;
	text-wrap: balance;
}
.cb-hero__lede {
	margin-top: 20px !important;
	font-size: 20px;
	line-height: 1.55;
	color: var(--cb-ink);
	max-width: 36ch;
}
.cb-hero__actions {
	margin-top: 32px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
}
.cb-hero__media { position: relative; }
.cb-hero__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--cb-radius);
}
.cb-credit {
	margin-top: 8px !important;
	font-size: 13px;
	color: var(--cb-muted);
}

/* ---------- Featured ---------- */
.cb-featured { padding-block: 0 72px; }
.cb-featured .cb-section-title { margin-bottom: 24px; }
.cb-featured__card {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: 40px;
	align-items: center;
	padding-top: 28px;
	border-top: 2px solid var(--cb-forest);
}
.cb-featured__media { display: block; }
.cb-featured__title {
	margin-top: 10px !important;
	font-family: var(--cb-serif);
	font-size: clamp(24px, 2.6vw, 32px);
	line-height: 1.2;
	font-weight: 700;
	text-wrap: balance;
}
.cb-featured__title a { color: var(--cb-forest); text-decoration: none; }
.cb-featured__title a:hover { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 2px; }
.cb-featured__excerpt { margin-top: 14px !important; font-size: 18px; line-height: 1.6; }
.cb-featured__body .cb-meta { margin-top: 14px; }
.cb-featured__body .cb-textlink { display: inline-block; margin-top: 18px; }

/* ---------- Card images and soil-profile placeholder ---------- */
.cb-card__img,
.cb-card__ph {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: var(--cb-radius);
	object-fit: cover;
	height: auto;
}
/* Placeholder drawn as a simple soil profile: surface, topsoil, subsoil, parent material */
.cb-card__ph {
	position: relative;
	overflow: hidden;
	background:
		linear-gradient(180deg,
			var(--cb-sage) 0 46%,
			#7FA06F 46% 50%,
			#5E4A36 50% 64%,
			#8A6E50 64% 80%,
			#B39B7B 80% 100%);
}
.cb-card__ph span {
	position: absolute;
	left: 14px;
	top: 12px;
	font-family: var(--cb-serif);
	font-size: 17px;
	font-weight: 700;
	color: var(--cb-forest);
}
[data-darkmode="dark"] .cb-card__ph {
	background:
		linear-gradient(180deg,
			#22322B 0 46%,
			#4E6B45 46% 50%,
			#3E3125 50% 64%,
			#5A4834 64% 80%,
			#76644F 80% 100%);
}

/* ---------- Latest grid ---------- */
.cb-latest { padding-block: 64px 72px; border-top: 1px solid var(--cb-line); }
.cb-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 44px 32px;
}
.cb-card__link {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	color: inherit;
	text-decoration: none;
}
.cb-card__media { display: block; margin-bottom: 6px; }
.cb-card__title {
	font-family: var(--cb-serif);
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--cb-forest);
	text-wrap: balance;
}
.cb-card__link:hover .cb-card__title { text-decoration: underline; text-underline-offset: 0.15em; }
.cb-card__excerpt { font-size: 16px; line-height: 1.55; color: var(--cb-muted); }
.cb-card .cb-meta { margin-top: auto; padding-top: 4px; font-size: 14px; }

/* ---------- Topics ---------- */
.cb-topics { background: var(--cb-sage); padding-block: 64px 72px; }
.cb-topics .cb-section-title { margin-bottom: 32px; }
.cb-topics__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 40px 48px;
}
.cb-topic { border-top: 1px solid var(--cb-botanical); padding-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.cb-topic__title { font-family: var(--cb-serif); font-size: 23px; line-height: 1.25; font-weight: 700; }
.cb-topic__title a { color: var(--cb-forest); text-decoration: none; }
.cb-topic__title a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
.cb-topic__count { font-size: 14px; font-weight: 600; color: var(--cb-earth-ink); }
.cb-topic__desc { font-size: 17px; line-height: 1.55; max-width: 60ch; }
.cb-topic__recent { margin-top: 6px !important; display: grid; gap: 6px; }
.cb-topic__recent li { font-size: 16px; line-height: 1.4; padding-left: 14px; position: relative; }
.cb-topic__recent li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 1px; background: var(--cb-botanical); }
.cb-topic__recent a { color: var(--cb-ink); text-decoration: none; }
.cb-topic__recent a:hover { color: var(--cb-green); text-decoration: underline; }

/* ---------- About ---------- */
.cb-about { padding-block: 72px; }
.cb-about__grid {
	display: grid;
	grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
	gap: 24px 56px;
	align-items: start;
}
.cb-about__text { display: grid; gap: 16px; font-size: 19px; line-height: 1.65; max-width: 62ch; }

/* ---------- Search ---------- */
.cb-search { padding-block: 0 80px; }
.cb-search__inner {
	display: grid;
	gap: 18px;
	padding-top: 40px;
	border-top: 1px solid var(--cb-line);
}
.cb-search__form { display: flex; gap: 10px; max-width: 640px; }
.cb-search__form input[type="search"] {
	flex: 1;
	min-width: 0;
	min-height: 48px;
	padding: 0 16px;
	font-size: 17px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
	.cb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	.cb-hero { padding-block: 32px 48px; }
	.cb-hero__grid { grid-template-columns: 1fr; gap: 28px; }
	.cb-hero__lede { max-width: none; }
	.cb-featured__card { grid-template-columns: 1fr; gap: 20px; }
	.cb-about__grid { grid-template-columns: 1fr; }
	.cb-topics__list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.cb-grid { grid-template-columns: 1fr; gap: 36px; }
	.cb-section-title { font-size: 24px; }
	.cb-latest, .cb-topics { padding-block: 48px 56px; }
	.cb-about { padding-block: 56px; }
	.cb-hero__lede { font-size: 18px; }
}

/* The topic already appears as the kicker under the image */
.cb-card__ph span { display: none; }

/* Dark-mode link colours: beat BlogHash's [data-darkmode] content link rule */
.cb-home .cb-topic__recent a,
[data-darkmode="dark"] .cb-home .cb-topic__recent a { color: var(--cb-ink); }
.cb-home .cb-topic__recent a:hover,
[data-darkmode="dark"] .cb-home .cb-topic__recent a:hover { color: var(--cb-green); }
