/**
 * Home page.
 *
 * Restrained on purpose, like the rest of the rebuild. The job of this page is to say what the
 * site is, prove someone competent runs it, and route people to the Error Database — not to
 * decorate. Colour is used for one thing only: the severity tiers, where it carries meaning.
 *
 * Typography comes from cvg-type.css.
 */

.cvg-home__shell {
	max-width: 62rem;
	margin: 0 auto;
	padding: 0 20px;
}

.cvg-home__h2 {
	margin: 0 0 6px;
	font-size: clamp( 1.35rem, 1.2rem + 0.7vw, 1.7rem );
}

.cvg-home__lead {
	margin: 0 0 22px;
	color: var(--cvg-ink-muted);
	font-size: var(--cvg-text-sm);
}

.cvg-home > section { padding: 44px 0; }
.cvg-home > section + section { border-top: 1px solid #eef1f4; }

/* ── Hero ─────────────────────────────────────────────────────────────────────
 *
 * One H1, one sentence under it, two actions. The old page had no H1 at all. */

.cvg-hero { padding: 60px 0 48px !important; }

.cvg-hero__title {
	margin: 0 0 14px;
	max-width: 22ch;
	font-size: clamp( 2rem, 1.4rem + 2.6vw, 3rem );
	line-height: 1.1;
	text-wrap: balance;
}

.cvg-hero__sub {
	margin: 0 0 26px;
	max-width: 54ch;
	font-size: clamp( 1rem, 0.95rem + 0.3vw, 1.2rem );
	color: var(--cvg-ink-muted);
}

.cvg-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.cvg-btn-primary,
.cvg-btn-ghost {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 24px;
	border-radius: 7px;
	font-size: var(--cvg-text-sm);
	font-weight: 600;
	text-decoration: none;
	border: 2px solid transparent;
}

.cvg-btn-primary { background: var(--cvg-accent); color: #fff; }
.cvg-btn-primary:hover { background: #d95a49; color: #fff; }
.cvg-btn-primary__n {
	padding: 2px 8px;
	border-radius: 10px;
	background: rgba( 255, 255, 255, .22 );
	font-size: var(--cvg-text-xs);
	font-weight: 700;
}

.cvg-btn-ghost { border-color: #d5dde5; color: var(--cvg-ink); background: #fff; }
.cvg-btn-ghost:hover { border-color: var(--cvg-ink); color: var(--cvg-ink); }

/* ── Severity tiers ─────────────────────────────────────────────────────────── */

.cvg-home-errors__tiers {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 240px, 1fr ) );
	gap: 14px;
}

.cvg-tier {
	display: block;
	padding: 20px;
	border: 1px solid #e3e8ed;
	border-left: 5px solid #cbd3db;
	border-radius: 9px;
	background: #fff;
	text-decoration: none;
	color: var(--cvg-ink);
}
.cvg-tier:hover { border-color: var(--cvg-ink); }

/* The one place colour carries meaning on this page. */
.cvg-tier--critical      { border-left-color: #e74c3c; }
.cvg-tier--warning       { border-left-color: #f39c12; }
.cvg-tier--informational { border-left-color: #27ae60; }

.cvg-tier__name {
	display: block;
	font-family: var(--cvg-font-display);
	font-weight: 700;
	margin-bottom: 5px;
}
.cvg-tier__blurb { display: block; font-size: var(--cvg-text-sm); color: var(--cvg-ink-muted); }
.cvg-tier__n { display: block; margin-top: 10px; font-size: var(--cvg-text-xs); color: #8a94a3; }

/* ── Cards ────────────────────────────────────────────────────────────────────
 *
 * Featured is one lead card plus two; "More reading" is a plain grid. Both use the same card so
 * they cannot drift apart — the old page drew them from overlapping queries and printed eight
 * posts twice.
 */

.cvg-home-featured__grid {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 260px, 1fr ) );
	gap: 20px;
}
.cvg-home-latest__grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 18px;
}

.cvg-home-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e6ebef;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}
.cvg-home-card:hover { border-color: #cfd8e0; }

/* The lead card spans the full row on wide screens and carries a larger image. */
@media ( min-width: 860px ) {
	.cvg-home-card--lead { grid-column: 1 / -1; flex-direction: row; }
	.cvg-home-card--lead .cvg-home-card__thumb { flex: 0 0 46%; aspect-ratio: auto; }
	.cvg-home-card--lead .cvg-home-card__title { font-size: 1.45rem; }
}

.cvg-home-card__thumb {
	display: block;
	/* Reserved ratio, so a grid of mixed-size images does not reflow as each one loads. */
	aspect-ratio: 16 / 9;
	background: #f2f5f7;
	overflow: hidden;
}
.cvg-home-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cvg-home-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }

.cvg-home-card__label {
	font-size: var(--cvg-text-xs);
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--cvg-ink-muted);
	margin-bottom: 7px;
}
.cvg-home-card__label.is-error { color: var(--cvg-accent); }

.cvg-home-card__title { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.3; }
.cvg-home-card__title a { color: var(--cvg-ink); text-decoration: none; }
.cvg-home-card__title a:hover { color: var(--cvg-accent); }

.cvg-home-card__excerpt {
	margin: 0 0 12px;
	font-size: var(--cvg-text-sm);
	line-height: 1.6;
	color: var(--cvg-ink-muted);
}
.cvg-home-card__meta { margin-top: auto; font-size: var(--cvg-text-xs); color: #8a94a3; }

.cvg-home__more {
	display: inline-block;
	margin-top: 22px;
	font-size: var(--cvg-text-sm);
	font-weight: 600;
	color: #0b6aa2;
	text-decoration: none;
}
.cvg-home__more:hover { text-decoration: underline; }

/* ── About ──────────────────────────────────────────────────────────────────── */

.cvg-home-about__inner { display: flex; gap: 24px; align-items: flex-start; }
.cvg-home-about__avatar { border-radius: 50%; flex-shrink: 0; }
.cvg-home-about__bio {
	margin: 0 0 16px;
	max-width: 62ch;
	color: var(--cvg-ink-muted);
}

@media ( max-width: 600px ) {
	.cvg-home-about__inner { flex-direction: column; gap: 16px; }
}

/* ── YouTube ────────────────────────────────────────────────────────────────── */

.cvg-home-yt__grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 16px;
}

.cvg-yt-card { display: block; text-decoration: none; color: var(--cvg-ink); }

.cvg-yt-card__thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	overflow: hidden;
	background: #e9eef2;
}
.cvg-yt-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cvg-yt-card__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 46px;
	height: 32px;
	border-radius: 7px;
	background: rgba( 0, 0, 0, .68 );
}
.cvg-yt-card__play::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 0;
	height: 0;
	border-left: 11px solid #fff;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
}
.cvg-yt-card:hover .cvg-yt-card__play { background: #e62117; }

.cvg-yt-card__title {
	display: block;
	margin-top: 9px;
	font-size: var(--cvg-text-sm);
	font-weight: 600;
	line-height: 1.35;
}
.cvg-yt-card__meta { display: block; margin-top: 3px; font-size: var(--cvg-text-xs); color: #8a94a3; }

@media ( prefers-reduced-motion: reduce ) {
	.cvg-tier, .cvg-home-card, .cvg-btn-primary, .cvg-btn-ghost { transition: none; }
}
