/* =====================================================
   Wygard — feature pages + features hub
   Loaded on page-feature.php and page-features.php only.
   Shared pieces (severity tokens, .eyebrow, .sev, .faq-*)
   live in main.css.
   ===================================================== */


/* FEATURE HERO ======================================== */
.feature-hero {
	position: relative;
	/* Smaller top padding because the breadcrumb sits directly under it.
	   The hub has no breadcrumb and keeps the original 72px (below). */
	padding: 48px 0 88px;
	overflow: hidden;
}
.feature-hero__inner { position: relative; z-index: 1; text-align: center; }
.feature-hero__title {
	/* Same as the homepage H1: 72px / 1.26 / 600. Section titles below it are
	   56px and 48px, so the hierarchy holds without touching shared blocks. */
	font-size: var(--fs-6xl);
	line-height: 1.26;
	font-weight: 600;
	max-width: 900px;
	margin: 0 auto 24px;
}
.feature-hero__lead {
	font-size: var(--fs-xl);
	line-height: 1.5;
	color: var(--color-text-secondary);
	max-width: 680px;
	margin: 0 auto 32px;
}
.feature-hero__actions {
	display: flex;
	gap: 16px;
	justify-content: center;
	flex-wrap: wrap;
}
.feature-hero__visual {
	margin: 56px auto 0;
	max-width: 940px;
}
.feature-hero__visual img {
	width: 100%;
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-card);
}
.feature-hero--hub { padding-top: 72px; padding-bottom: 40px; }


/* BREADCRUMB ========================================== */
.crumbs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 8px;
	font-size: var(--fs-sm);
	color: var(--color-text-subtle);
	/* The space belongs below the breadcrumb, not above it — the hero's own
	   padding already separates it from the header. */
	margin-bottom: 32px;
}
.crumbs a {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	color: var(--color-text-subtle);
}
.crumbs a:hover { color: var(--color-green); }


/* IMPACT TILES — "What it costs you" ================== */
.section--impact { padding: 88px 0; }
.impact-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-top: 40px;
}
.impact-card {
	position: relative;
	padding: 32px 28px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-white);
}
.impact-card::before {
	content: "";
	position: absolute;
	left: 28px; top: 0;
	width: 40px; height: 3px;
	background: var(--color-danger);
	border-radius: 0 0 3px 3px;
}
.impact-card__title {
	font-size: var(--fs-xl);
	font-weight: 600;
	margin-bottom: 10px;
}
.impact-card p {
	font-size: var(--fs-base);
	line-height: 1.55;
	color: var(--color-text-secondary);
}

/* Accents follow the page severity (class on <main>) */
.sev-heads .impact-card::before { background: var(--color-warning); }


/* TIMELINE — "How an alert reaches you" =============== */
.timeline {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	margin-top: 48px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--color-white);
}
.timeline__step {
	position: relative;
	padding: 32px 28px;
	border-right: 1px solid var(--color-border);
}
.timeline__step:last-child { border-right: 0; }
.timeline__marker {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px; height: 36px;
	border-radius: var(--radius-full);
	background: var(--color-bg-alt);
	color: var(--color-black);
	font-size: var(--fs-sm);
	font-weight: 600;
	margin-bottom: 16px;
}
.timeline__step--alert .timeline__marker {
	background: var(--color-danger-tint);
	color: var(--color-danger-ink);
}
.sev-heads .timeline__step--alert .timeline__marker {
	background: var(--color-warning-tint);
	color: var(--color-warning-ink);
}
.timeline__label {
	display: block;
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-text-subtle);
	margin-bottom: 8px;
}
.timeline__title {
	font-size: var(--fs-xl);
	font-weight: 600;
	margin-bottom: 8px;
}
.timeline__step p {
	font-size: var(--fs-base);
	line-height: 1.55;
	color: var(--color-text-secondary);
}


/* TESTS TABLE ========================================= */
.section--tests { padding: 88px 0; }
.section--tests-alt { background: var(--color-bg-alt); }
.tests-table-wrap {
	margin-top: 40px;
	overflow-x: auto;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-white);
}
.tests-table {
	width: 100%;
	min-width: 720px;
	border-collapse: collapse;
	text-align: left;
}
.tests-table th {
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--color-text-subtle);
	padding: 16px 24px;
	border-bottom: 1px solid var(--color-border);
	white-space: nowrap;
}
.tests-table td {
	padding: 20px 24px;
	border-bottom: 1px solid var(--color-border);
	vertical-align: top;
	font-size: var(--fs-base);
	color: var(--color-text-secondary);
}
.tests-table tr:last-child td { border-bottom: 0; }
.tests-table__name {
	font-weight: 600;
	color: var(--color-black);
	white-space: nowrap;
}
.tests-table__name a { color: var(--color-black); }
.tests-table__name a:hover { color: var(--color-green); }
.tests-table__meta {
	font-size: var(--fs-sm);
	color: var(--color-text-subtle);
	white-space: nowrap;
}


/* CASE STUDIES ========================================
   Rendered only when the group actually has one.
   ===================================================== */
.cs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 24px;
	margin-top: 40px;
}
/* One or two stories shouldn't stretch across the full container */
.cs-grid--few {
	grid-template-columns: repeat(auto-fit, minmax(320px, 440px));
	justify-content: center;
}
.cs-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--color-white);
	transition: transform var(--trans-med), box-shadow var(--trans-med);
}
.cs-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); }
.cs-card__body { padding: 32px 28px; display: flex; flex-direction: column; height: 100%; }
.cs-card__kicker {
	display: inline-block;
	align-self: flex-start;
	padding: 4px 12px;
	margin-bottom: 16px;
	background: var(--color-green-soft);
	color: var(--color-black);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border-radius: var(--radius-full);
}
.cs-card__title { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.25; margin-bottom: 12px; }
.cs-card__title a { color: inherit; }
.cs-card p { color: var(--color-text-secondary); line-height: 1.55; margin-bottom: 20px; }
.cs-card__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	font-weight: 600;
	font-size: var(--fs-sm);
	color: var(--color-black);
}
.cs-card__link svg { width: 14px; height: 14px; transition: transform var(--trans-fast); }
.cs-card:hover .cs-card__link svg { transform: translateX(4px); }


/* RELATED MONITORING ================================== */
.section--related { padding: 88px 0; background: var(--color-bg-alt); }
.related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-top: 40px;
}
.related-card {
	display: block;
	padding: 28px 24px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	transition: transform var(--trans-med), box-shadow var(--trans-med);
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); color: inherit; }
.related-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}
.related-card__title { font-size: var(--fs-xl); font-weight: 600; }
.related-card p { font-size: var(--fs-base); color: var(--color-text-secondary); line-height: 1.5; }
.related-card__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 16px;
	font-weight: 600;
	font-size: var(--fs-sm);
}
.related-card__more svg { width: 14px; height: 14px; transition: transform var(--trans-fast); }
.related-card:hover .related-card__more svg { transform: translateX(4px); }


/* =====================================================
   FEATURES HUB
   ===================================================== */
.section--hub { padding: 24px 0 96px; }

.hub-toolbar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 32px;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 48px;
}
.hub-toolbar__label {
	font-size: var(--fs-sm);
	font-weight: 500;
	color: var(--color-text-subtle);
}
.hub-toggle {
	display: inline-flex;
	padding: 4px;
	background: var(--color-bg-alt);
	border-radius: var(--radius-full);
}
.hub-toggle__btn {
	padding: 8px 20px;
	border: 0;
	background: transparent;
	border-radius: var(--radius-full);
	font-family: var(--font-family);
	font-size: var(--fs-sm);
	font-weight: 600;
	color: var(--color-text-secondary);
	cursor: pointer;
	transition: background var(--trans-fast), color var(--trans-fast);
}
.hub-toggle__btn:hover { color: var(--color-black); }
.hub-toggle__btn.is-active {
	background: var(--color-white);
	color: var(--color-black);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Level sections — hidden as a group when sorting alphabetically */
.hub-level + .hub-level { margin-top: 64px; }
.hub-level__head { margin-bottom: 32px; max-width: 720px; }
.hub-level__title { font-size: var(--fs-3xl); font-weight: 600; line-height: 1.2; margin-bottom: 10px; }
.hub-level__lead { font-size: var(--fs-lg); color: var(--color-text-secondary); }

.hub-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.hub-card {
	display: flex;
	flex-direction: column;
	padding: 28px 24px;
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	transition: transform var(--trans-med), box-shadow var(--trans-med), border-color var(--trans-med);
}
.hub-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-card);
	border-color: transparent;
	color: inherit;
}
.hub-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px; height: 44px;
	background: var(--color-green);
	color: var(--color-white);
	border-radius: var(--radius-full);
	margin-bottom: 20px;
}
.hub-card__icon svg { width: 22px; height: 22px; }
.hub-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}
.hub-card__title { font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; }
.hub-card__text {
	font-size: var(--fs-base);
	line-height: 1.5;
	color: var(--color-text-secondary);
	margin-bottom: 16px;
}
.hub-card__meta {
	display: block;
	font-size: var(--fs-sm);
	color: var(--color-text-subtle);
	margin-top: auto;
	padding-top: 4px;
}
.hub-card__more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 16px;
	font-weight: 600;
	font-size: var(--fs-sm);
	color: var(--color-black);
}
.hub-card__more svg { width: 14px; height: 14px; transition: transform var(--trans-fast); }
.hub-card:hover .hub-card__more svg { transform: translateX(4px); }

/* Alphabetical view: one flat grid, level headings out of the way */
.hub-list.is-alpha .hub-level__head { display: none; }
.hub-list.is-alpha .hub-level + .hub-level { margin-top: 24px; }


/* RESPONSIVE ========================================== */
@media (max-width: 1024px) {
	.feature-hero { padding: 40px 0 64px; }
	.crumbs { margin-bottom: 24px; }
	.feature-hero__title { font-size: var(--fs-5xl); }
	.feature-hero__lead { font-size: var(--fs-lg); }

	.section--impact,
	.section--tests,
	.section--related { padding: 64px 0; }
	.section--hub { padding: 16px 0 64px; }

	.impact-grid,
	.related-grid,
	.hub-grid { grid-template-columns: repeat(2, 1fr); }

	.timeline { grid-template-columns: 1fr; }
	.timeline__step { border-right: 0; border-bottom: 1px solid var(--color-border); }
	.timeline__step:last-child { border-bottom: 0; }

	.hub-level__title { font-size: var(--fs-2xl); }
}

@media (max-width: 640px) {
	.feature-hero { padding: 28px 0 48px; }
	.crumbs { margin-bottom: 20px; }
	.feature-hero__title { font-size: 36px; line-height: 1.2; }
	.feature-hero__lead { font-size: var(--fs-base); }
	.feature-hero__visual { margin-top: 36px; }

	.impact-grid,
	.related-grid,
	.hub-grid { grid-template-columns: 1fr; }

	.impact-card,
	.related-card,
	.hub-card { padding: 24px 20px; }
	.cs-card__body { padding: 24px 20px; }

	/* Drop the min-width and the Scope column so the table fits */
	.tests-table { min-width: 0; }
	.tests-table th,
	.tests-table td { padding: 14px 16px; }
	.tests-table th:nth-child(3),
	.tests-table td:nth-child(3) { display: none; }
	.tests-table__name { white-space: normal; }

	.hub-toolbar {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		margin-bottom: 32px;
	}
	.hub-level + .hub-level { margin-top: 48px; }
}
