/**
 * TT Homepage Hero
 * Colors, radius and max width come from CSS custom properties set inline by the
 * plugin (Settings > TT Homepage Hero). The values below are only fallbacks.
 * Mobile first: one column. Two columns from 900px.
 */

.tt-hero,
.tt-hero *,
.tt-hero *::before,
.tt-hero *::after {
	box-sizing: border-box;
}

.tt-hero {
	--tt-hero-bg: #ffffff;
	--tt-hero-text: #0f172a;
	--tt-hero-muted: #64748b;
	--tt-hero-accent: #1d4ed8;
	--tt-hero-card-bg: #ffffff;
	--tt-hero-border: #e2e8f0;
	--tt-hero-cta-bg: #0b1f3a;
	--tt-hero-cta-text: #ffffff;
	--tt-hero-cta-accent: #38bdf8;
	--tt-hero-cta-muted: #cbd5e1;
	--tt-hero-radius: 12px;
	--tt-hero-max: 1200px;
	--tt-hero-cols: 3;
	--tt-hero-gap: 24px;

	background: var(--tt-hero-bg);
	color: var(--tt-hero-text);
	padding: 24px 16px;
	width: 100%;
}

.tt-hero__inner {
	display: grid;
	gap: var(--tt-hero-gap);
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"featured"
		"cta"
		"latest";
	margin: 0 auto;
	max-width: var(--tt-hero-max);
}

.tt-hero--mobile-form-first .tt-hero__inner {
	grid-template-areas:
		"cta"
		"featured"
		"latest";
}

/*
 * Mobile/tablet: the news column wrapper disappears (display: contents) so the
 * featured post, CTA box and latest posts can be ordered individually above.
 * Desktop turns it into a real column (see the 900px query).
 */
.tt-hero__main     { display: contents; }
.tt-hero__featured { grid-area: featured; min-width: 0; }
.tt-hero__cta      { grid-area: cta; min-width: 0; }
.tt-hero__latest   { grid-area: latest; min-width: 0; }

/* ---------- Cards ---------- */

.tt-hero .tt-hero__card {
	background: var(--tt-hero-card-bg);
	border: 1px solid var(--tt-hero-border);
	border-radius: var(--tt-hero-radius);
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	overflow: hidden;
}

.tt-hero .tt-hero__media {
	aspect-ratio: 16 / 9;
	background: var(--tt-hero-border);
	display: block;
	overflow: hidden;
	position: relative;
}

/* Absolutely positioned so the image never dictates its box's height. */
.tt-hero .tt-hero__img {
	display: block;
	height: 100%;
	inset: 0;
	max-width: none;
	object-fit: cover;
	position: absolute;
	width: 100%;
}

.tt-hero .tt-hero__img--empty {
	background: linear-gradient(135deg, var(--tt-hero-cta-bg), var(--tt-hero-accent));
}

.tt-hero .tt-hero__chip {
	background: var(--tt-hero-accent);
	border-radius: 999px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	left: 14px;
	letter-spacing: .06em;
	line-height: 1;
	padding: 7px 12px;
	position: absolute;
	text-transform: uppercase;
	top: 14px;
}

.tt-hero .tt-hero__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 18px 20px 20px;
}

.tt-hero .tt-hero__meta {
	align-items: center;
	color: var(--tt-hero-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 13px;
	gap: 4px 8px;
	line-height: 1.3;
	margin: 0;
}

.tt-hero .tt-hero__cat {
	color: var(--tt-hero-accent);
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.tt-hero .tt-hero__title {
	color: var(--tt-hero-text);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0;
}

.tt-hero .tt-hero__card--featured .tt-hero__title {
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.15rem);
	line-height: 1.15;
}

.tt-hero .tt-hero__title a {
	color: inherit;
	text-decoration: none;
}

.tt-hero .tt-hero__title a:hover,
.tt-hero .tt-hero__title a:focus-visible {
	color: var(--tt-hero-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tt-hero .tt-hero__excerpt {
	color: var(--tt-hero-muted);
	font-size: 1rem;
	line-height: 1.55;
	margin: 0;
}

/* ---------- Latest ---------- */

.tt-hero .tt-hero__label {
	border-left: 4px solid var(--tt-hero-accent);
	color: var(--tt-hero-text);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .1em;
	line-height: 1;
	margin: 0 0 14px;
	padding-left: 10px;
	text-transform: uppercase;
}

.tt-hero__grid {
	display: grid;
	gap: var(--tt-hero-gap);
	grid-template-columns: minmax(0, 1fr);
}

/* ---------- CTA box ---------- */

.tt-hero .tt-hero__cta {
	background: var(--tt-hero-cta-bg);
	border-radius: var(--tt-hero-radius);
	color: var(--tt-hero-cta-text);
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px 24px;
}

.tt-hero .tt-hero__eyebrow {
	align-self: flex-start;
	background: rgba(255, 255, 255, .08);
	border: 1px solid var(--tt-hero-cta-accent);
	border-radius: 999px;
	color: var(--tt-hero-cta-accent);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .1em;
	line-height: 1;
	padding: 7px 12px;
	text-transform: uppercase;
}

.tt-hero .tt-hero__cta-title {
	color: var(--tt-hero-cta-text);
	font-size: clamp(1.45rem, 1.1rem + 1.1vw, 1.9rem);
	font-weight: 800;
	line-height: 1.15;
	margin: 0;
}

.tt-hero .tt-hero__cta-sub {
	color: var(--tt-hero-cta-muted);
	font-size: 1rem;
	line-height: 1.5;
	margin: 0;
}

.tt-hero .tt-hero__bullets {
	display: grid;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tt-hero .tt-hero__bullets li {
	align-items: flex-start;
	color: var(--tt-hero-cta-text);
	display: flex;
	font-size: .95rem;
	gap: 10px;
	line-height: 1.4;
	margin: 0;
	padding: 0;
}

.tt-hero .tt-hero__check {
	color: var(--tt-hero-cta-accent);
	flex: none;
	margin-top: 1px;
}

.tt-hero .tt-hero__form {
	margin-top: 4px;
}

.tt-hero .tt-hero__fine,
.tt-hero .tt-hero__trust {
	color: var(--tt-hero-cta-muted);
	font-size: 12px;
	line-height: 1.5;
	margin: 0;
}

.tt-hero .tt-hero__fine a,
.tt-hero .tt-hero__link {
	color: var(--tt-hero-cta-accent);
}

.tt-hero .tt-hero__link-wrap {
	margin: 0;
}

.tt-hero .tt-hero__link {
	font-size: .95rem;
	font-weight: 700;
	text-decoration: none;
}

.tt-hero .tt-hero__link:hover,
.tt-hero .tt-hero__link:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tt-hero .tt-hero__trust {
	border-top: 1px solid rgba(255, 255, 255, .14);
	margin-top: auto; /* If the box is stretched to match the news column, this stays at the bottom. */
	padding-top: 12px;
	text-transform: uppercase;
	letter-spacing: .08em;
	font-weight: 700;
}

/* Admin-only configuration warnings. */
.tt-hero .tt-hero__notice {
	background: #fff4e5;
	border: 1px dashed #d97706;
	border-radius: 6px;
	color: #7c2d12;
	font-size: 13px;
	margin: 0;
	padding: 10px 12px;
}

/* ---------- Edge cases ---------- */

.tt-hero--no-cta .tt-hero__inner {
	grid-template-areas:
		"featured"
		"latest";
}

.tt-hero--no-featured .tt-hero__inner,
.tt-hero--no-featured.tt-hero--mobile-form-first .tt-hero__inner {
	grid-template-areas:
		"cta"
		"latest";
}

.tt-hero--no-featured .tt-hero__cta {
	margin: 0 auto;
	max-width: 640px;
	width: 100%;
}

/* ---------- Tablet: latest in two columns ---------- */

@media (min-width: 600px) {
	.tt-hero {
		padding: 32px 24px;
	}

	.tt-hero__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Desktop: featured + CTA side by side ---------- */

@media (min-width: 900px) {
	.tt-hero {
		padding: 40px 24px;
	}

	/*
	 * Two columns: the news column (featured post, then the three latest beneath it)
	 * beside the CTA box. Both sit in one grid row, so their bottoms line up.
	 */
	.tt-hero__inner,
	.tt-hero--mobile-form-first .tt-hero__inner {
		align-items: stretch;
		grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
		grid-template-areas: "main cta";
	}

	.tt-hero--form-left .tt-hero__inner,
	.tt-hero--form-left.tt-hero--mobile-form-first .tt-hero__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.85fr);
		grid-template-areas: "cta main";
	}

	.tt-hero--no-cta .tt-hero__inner,
	.tt-hero--no-cta.tt-hero--form-left .tt-hero__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "main";
	}

	.tt-hero--no-featured .tt-hero__inner,
	.tt-hero--no-featured.tt-hero--form-left .tt-hero__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"cta"
			"main";
	}

	.tt-hero__main {
		display: flex;
		flex-direction: column;
		gap: var(--tt-hero-gap);
		grid-area: main;
		min-width: 0;
	}

	/* The featured post takes whatever height the latest posts leave over. */
	.tt-hero__main .tt-hero__featured {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
	}

	.tt-hero__main .tt-hero__featured .tt-hero__card {
		flex: 1 1 auto;
		height: auto;
	}

	.tt-hero__main .tt-hero__featured .tt-hero__media {
		aspect-ratio: auto;
		flex: 1 1 0;
		min-height: 220px;
	}

	.tt-hero__main .tt-hero__featured .tt-hero__body {
		flex: none;
	}

	/* No CTA box to match: use a normal 16:9 image instead. */
	.tt-hero--no-cta .tt-hero__main .tt-hero__featured .tt-hero__media {
		aspect-ratio: 16 / 9;
		flex: none;
		min-height: 0;
	}

	.tt-hero__latest {
		flex: none;
	}

	.tt-hero__grid {
		grid-template-columns: repeat(var(--tt-hero-cols, 3), minmax(0, 1fr));
	}

	/* The latest cards are narrower here (three across in the news column), so tighten them. */
	.tt-hero .tt-hero__latest .tt-hero__body {
		gap: 6px;
		padding: 12px 14px 14px;
	}

	.tt-hero .tt-hero__latest .tt-hero__title {
		font-size: .95rem;
	}

	.tt-hero .tt-hero__latest .tt-hero__meta {
		font-size: 12px;
	}

	.tt-hero .tt-hero__latest .tt-hero__label {
		margin-bottom: 10px;
	}

	.tt-hero .tt-hero__cta {
		padding: 32px 28px;
	}

	.tt-hero .tt-hero__card--featured .tt-hero__body {
		padding: 22px 26px 26px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.tt-hero .tt-hero__title a {
		transition: color .15s ease;
	}
}
