/**
 * The Trig Point — Single Race styles.
 *
 * Shares the visual language of the relay leg template (hero with overlapping
 * stats card, section rhythm, inherited Kadence tokens) so a race page and its
 * child leg pages read as one coherent resource. Structural styling only;
 * type and colour inherit from Kadence global styles via CSS variables.
 */

/* Layout container ------------------------------------------------------- */

.ttp-race__body {
	max-width: var(--global-content-width, 750px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

/* Hero — matches the leg template construction -------------------------- */

.ttp-race__hero {
	position: relative;
	margin-bottom: 2.5rem;
}

.ttp-race__hero-image {
	width: 100%;
	max-height: 460px;
	overflow: hidden;
}

.ttp-race__hero-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ttp-race__hero-image--placeholder {
	min-height: 220px;
	background: linear-gradient(
		160deg,
		var(--global-palette3, #3a4a3a) 0%,
		var(--global-palette4, #5a6b52) 100%
	);
}

.ttp-race__hero-inner {
	max-width: var(--global-content-width, 750px);
	margin: -3.5rem auto 0;
	position: relative;
	padding: 1.75rem 1.5rem;
	background: var(--global-palette9, #ffffff);
	border-radius: 6px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.ttp-race__eyebrow {
	font-size: 0.85rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	margin: 0 0 0.4rem;
}

.ttp-race__eyebrow a {
	color: var(--global-palette-highlight, var(--global-palette1, #2c5f2d));
	text-decoration: none;
}

.ttp-race__eyebrow a:hover,
.ttp-race__eyebrow a:focus {
	text-decoration: underline;
}

.ttp-race__title {
	margin: 0 0 0.4rem;
	line-height: 1.15;
}

.ttp-race__locale {
	margin: 0 0 1.25rem;
	color: var(--global-palette5, #555);
	font-size: 1rem;
}

.ttp-race__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0;
	border-top: 1px solid var(--global-palette6, #e3e3e3);
}

.ttp-race__stat {
	flex: 1 1 0;
	min-width: 110px;
	margin: 0;
	padding: 0.9rem 1rem 0.9rem 0;
}

.ttp-race__stat + .ttp-race__stat {
	padding-left: 1rem;
	border-left: 1px solid var(--global-palette6, #e3e3e3);
}

.ttp-race__stat-label {
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--global-palette5, #555);
	margin: 0 0 0.25rem;
}

.ttp-race__stat-value {
	font-size: clamp(1.2rem, 1rem + 1.1vw, 1.6rem);
	font-weight: 700;
	line-height: 1.05;
	margin: 0;
	color: var(--global-palette2, #1a1a1a);
}

.ttp-race__stat-value--sm {
	font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
	font-weight: 600;
}

/* Section rhythm -------------------------------------------------------- */

.ttp-race__description,
.ttp-race__distances,
.ttp-race__meta {
	margin-bottom: 2.5rem;
}

.ttp-race__section-heading {
	margin: 0 0 1rem;
}

.ttp-race__prose > *:first-child {
	margin-top: 0;
}

.ttp-race__prose > *:last-child {
	margin-bottom: 0;
}

/* Status notice --------------------------------------------------------- */

.ttp-race__status {
	margin: 0 0 2rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-weight: 600;
	background: #fff4e5;
	border-left: 4px solid #c77700;
}

.ttp-race__status--cancelled,
.ttp-race__status--discontinued {
	background: #fbece9;
	border-left-color: #b3361f;
}

/* Single distance ------------------------------------------------------- */

.ttp-race__single-distance-figure {
	font-size: clamp(1.4rem, 1.1rem + 1.5vw, 2rem);
	font-weight: 700;
	margin: 0 0 1rem;
	color: var(--global-palette2, #1a1a1a);
}

.ttp-race__facts {
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 0.5rem 1.5rem;
}

.ttp-race__facts li {
	margin: 0;
	font-size: 0.95rem;
}

.ttp-race__facts li span {
	display: block;
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--global-palette5, #555);
}

/* Distances table ------------------------------------------------------- */

.ttp-race__distances-table-wrap {
	overflow-x: auto;
}

.ttp-race__distances-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.ttp-race__distances-table th,
.ttp-race__distances-table td {
	text-align: left;
	padding: 0.7rem 0.9rem;
	border-bottom: 1px solid var(--global-palette6, #e3e3e3);
	vertical-align: middle;
}

.ttp-race__distances-table th {
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--global-palette5, #555);
	border-bottom-width: 2px;
}

.ttp-race__table-entry {
	white-space: nowrap;
}

.ttp-race__entry-none {
	color: var(--global-palette5, #999);
}

/* Entry control --------------------------------------------------------- */

.ttp-race__entry-btn {
	display: inline-block;
	font-weight: 600;
	padding: 0.7rem 1.4rem;
	border-radius: 6px;
	text-decoration: none;
	background: var(--global-palette1, #2c5f2d);
	color: #fff;
}

.ttp-race__entry-btn:hover,
.ttp-race__entry-btn:focus {
	background: var(--global-palette2, #1f461f);
}

.ttp-race__entry-btn--compact {
	padding: 0.4rem 0.9rem;
	font-size: 0.9rem;
}

.ttp-race__affiliate-marker {
	display: inline-block;
	font-size: 0.65rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--global-palette5, #777);
	border: 1px solid var(--global-palette6, #ccc);
	border-radius: 3px;
	padding: 0.1rem 0.35rem;
	margin-left: 0.4rem;
	vertical-align: middle;
	cursor: help;
}

/* Word-of-mouth note ---------------------------------------------------- */

.ttp-race__wom-note {
	margin: 1.25rem 0 0;
	padding: 1rem 1.25rem;
	background: var(--global-palette8, #f7f7f5);
	border-left: 4px solid var(--global-palette1, #2c5f2d);
	border-radius: 6px;
	font-style: italic;
}

/* Key facts / meta ------------------------------------------------------ */

.ttp-race__meta {
	padding-top: 1.5rem;
	border-top: 1px solid var(--global-palette6, #e3e3e3);
}

.ttp-race__meta-list {
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem 1.5rem;
}

.ttp-race__meta-item {
	margin: 0;
}

.ttp-race__meta-item dt {
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--global-palette5, #555);
	margin: 0 0 0.2rem;
}

.ttp-race__meta-item dd {
	margin: 0;
	font-size: 0.98rem;
}

/* Leg table (shortcode output) ----------------------------------------- */

.ttp-leg-table-wrap {
	overflow-x: auto;
	margin: 1.5rem 0;
}

.ttp-leg-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.ttp-leg-table th,
.ttp-leg-table td {
	text-align: left;
	padding: 0.7rem 0.9rem;
	border-bottom: 1px solid var(--global-palette6, #e3e3e3);
	vertical-align: middle;
}

.ttp-leg-table th {
	font-size: 0.72rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--global-palette5, #555);
	border-bottom-width: 2px;
}

.ttp-leg-table__num {
	font-weight: 700;
	width: 3rem;
}

.ttp-leg-table a {
	text-decoration: none;
	color: var(--global-palette-highlight, var(--global-palette1, #2c5f2d));
}

.ttp-leg-table a:hover,
.ttp-leg-table a:focus {
	text-decoration: underline;
}

@media (max-width: 600px) {

	.ttp-leg-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.ttp-leg-table,
	.ttp-leg-table tbody,
	.ttp-leg-table tr,
	.ttp-leg-table td {
		display: block;
		width: 100%;
	}

	.ttp-leg-table tr {
		margin-bottom: 1rem;
		border: 1px solid var(--global-palette6, #e3e3e3);
		border-radius: 6px;
		padding: 0.5rem 0.75rem;
	}

	.ttp-leg-table td {
		border-bottom: none;
		padding: 0.3rem 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
	}

	.ttp-leg-table td::before {
		content: attr(data-label);
		font-size: 0.72rem;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--global-palette5, #555);
	}
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 600px) {

	.ttp-race__stat {
		flex: 1 1 45%;
	}

	/* Distances table → stacked cards on narrow screens. */
	.ttp-race__distances-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.ttp-race__distances-table,
	.ttp-race__distances-table tbody,
	.ttp-race__distances-table tr,
	.ttp-race__distances-table td {
		display: block;
		width: 100%;
	}

	.ttp-race__distances-table tr {
		margin-bottom: 1rem;
		border: 1px solid var(--global-palette6, #e3e3e3);
		border-radius: 6px;
		padding: 0.5rem 0.75rem;
	}

	.ttp-race__distances-table td {
		border-bottom: none;
		padding: 0.3rem 0;
		display: flex;
		justify-content: space-between;
		align-items: center;
		gap: 1rem;
	}

	.ttp-race__distances-table td::before {
		content: attr(data-label);
		font-size: 0.72rem;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--global-palette5, #555);
	}
}

/* Author-applied box-outs: Expert tip and Caution ------------------------ */
/* Ported from relay-leg.css so these are also available on race pages. */

.ttp-tip,
.ttp-warning {
	margin: 1.75rem 0;
	padding: 1.1rem 1.25rem;
	border-radius: 6px;
	display: grid;
	grid-template-columns: 1.6rem 1fr;
	grid-template-rows: auto auto;
	column-gap: 0.75rem;
	row-gap: 0.4rem;
}

.ttp-tip > *:last-child,
.ttp-warning > *:last-child {
	margin-bottom: 0;
}

.ttp-tip > *:first-child,
.ttp-warning > *:first-child {
	margin-top: 0;
}

.ttp-tip::before,
.ttp-warning::before {
	grid-column: 1;
	grid-row: 1 / span 2;
	font-size: 1.15rem;
	line-height: 1.2;
}

.ttp-tip::after,
.ttp-warning::after {
	grid-column: 2;
	grid-row: 1;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ttp-tip > *,
.ttp-warning > * {
	grid-column: 2;
}

/* Expert tip — helpful advice */
.ttp-tip {
	background: #eef5ec;
	border-left: 4px solid var(--global-palette1, #2c5f2d);
}

.ttp-tip::before {
	content: "\1F4A1";
}

.ttp-tip::after {
	content: "Expert tip";
	color: var(--global-palette1, #2c5f2d);
}

/* Caution — costly wrong turn, safety, or DQ risk */
.ttp-warning {
	background: #fbece9;
	border-left: 4px solid #b3361f;
}

.ttp-warning::before {
	content: "\26A0";
}

.ttp-warning::after {
	content: "Caution";
	color: #b3361f;
}

/* Author bio card (deep-editorial race pages) --------------------------- */
.ttp-author {
	background: var(--global-palette8, #F7F5EF);
	border-top: 2px solid var(--global-palette6, #D9D3C5);
	padding: 2rem 1.5rem;
}
.ttp-author__inner {
	max-width: 740px;
	margin: 0 auto;
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
}
.ttp-author__photo {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	object-position: top center;
	flex: 0 0 auto;
	border: 2px solid var(--global-palette6, #D9D3C5);
}
.ttp-author__body {
	flex: 1 1 auto;
	min-width: 0;
}
.ttp-author__label {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--global-palette5, #4A6678);
	margin: 0 0 0.15rem;
}
.ttp-author__name {
	font-family: var(--global-heading-font-family, 'Bitter', serif);
	font-weight: 700;
	font-size: 1.1rem;
	margin: 0 0 0.25rem;
}
.ttp-author__name a {
	color: var(--global-palette3, #1C1F1A);
	text-decoration: none;
}
.ttp-author__name a:hover {
	color: var(--global-palette1, #21402E);
}
.ttp-author__bio {
	font-size: 0.95rem;
	color: var(--global-palette4, #2C2F28);
	margin: 0 0 0.5rem;
	line-height: 1.5;
}
.ttp-author__links {
	font-size: 0.88rem;
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin: 0;
}
.ttp-author__links a {
	color: var(--global-palette1, #21402E);
	text-decoration: none;
	font-weight: 600;
}
.ttp-author__links a:hover {
	text-decoration: underline;
}
.ttp-author__links span {
	color: var(--global-palette5, #4A6678);
}
@media (max-width: 480px) {
	.ttp-author__inner {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
	.ttp-author__links {
		justify-content: center;
	}
}
