/**
 * The Trig Point: Gear Review styles.
 *
 * Loaded after race.css on pages using the "Gear Review" template. The hero,
 * stats strip, section headings, entry button and affiliate marker all come
 * from race.css (.ttp-race__*); the Expert tip box comes from style.css
 * (.ttp-tip). This file adds only what is new on a gear page. Type and colour
 * inherit from Kadence via the same CSS variables race.css uses.
 */

/* Hero image ------------------------------------------------------------
   race.css makes the hero a full-width strip capped at 460px, which crops
   a product photo to a sliver on desktop. On gear pages the photo sits at
   content width in a 3:2 frame instead, with the crop biased towards the
   lower part of the picture, where the shoe usually is. */

.ttp-gear .ttp-race__hero-image {
	width: 100%;
	max-width: var(--global-content-width, 750px);
	margin: 0 auto;
	aspect-ratio: 3 / 2;
	max-height: min(70vh, 640px);
	border-radius: 6px 6px 0 0;
}

.ttp-gear .ttp-race__hero-img {
	object-position: 50% 60%;
}

/* A smaller overlap than race pages, so the card does not cover the shoe. */
.ttp-gear .ttp-race__hero-inner {
	margin-top: -1.25rem;
}

/* Hero additions -------------------------------------------------------- */

.ttp-gear__verdict {
	margin: 0 0 0.75rem;
	font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
	line-height: 1.4;
	color: var(--global-palette2, #1a1a1a);
}

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

/* Middle dot between the date and the note (no dash). */
.ttp-gear__updated-note::before {
	content: "\00B7";
	margin: 0 0.4rem;
}

.ttp-gear__updated-label {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-right: 0.35rem;
}

/* Disclosure line ------------------------------------------------------- */

.ttp-gear__disclosure {
	margin: 0 0 2rem;
	padding: 0.75rem 1rem;
	font-size: 0.92rem;
	background: var(--global-palette8, #f7f7f5);
	border-left: 4px solid var(--global-palette1, #2c5f2d);
	border-radius: 6px;
}

/* Body content ---------------------------------------------------------- */

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

/* Run and grip tables from the block editor: scroll sideways on narrow
   screens rather than squashing the columns. */
.ttp-gear__prose .wp-block-table {
	overflow-x: auto;
	margin: 1.5rem 0;
}

.ttp-gear__prose .wp-block-table table {
	min-width: 28rem;
}

/* What I liked / What I'd change ---------------------------------------- */

.ttp-gear__pros-cons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1rem;
	margin: 2.5rem 0;
}

.ttp-gear__box {
	padding: 1.1rem 1.25rem;
	border-radius: 6px;
	background: var(--global-palette8, #f7f7f5);
	border-left: 4px solid var(--global-palette1, #2c5f2d);
}

.ttp-gear__box--change {
	background: #fff4e5;
	border-left-color: #c77700;
}

.ttp-gear__box-heading {
	margin: 0 0 0.6rem;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ttp-gear__box ul {
	margin: 0;
	padding-left: 1.2rem;
}

.ttp-gear__box li {
	margin: 0 0 0.4rem;
}

.ttp-gear__box li:last-child {
	margin-bottom: 0;
}

/* Where to buy ---------------------------------------------------------- */

.ttp-gear__buy {
	margin: 2.5rem 0;
	padding: 1.25rem 1.25rem 0.5rem;
	border: 1px solid var(--global-palette6, #e3e3e3);
	border-radius: 6px;
}

.ttp-gear__buy .ttp-race__section-heading {
	margin-bottom: 0.5rem;
}

.ttp-gear__buy-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ttp-gear__buy-item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem 1rem;
	margin: 0;
	padding: 0.9rem 0;
	border-top: 1px solid var(--global-palette6, #e3e3e3);
}

.ttp-gear__buy-item:first-child {
	border-top: none;
}

.ttp-gear__buy-info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
}

.ttp-gear__buy-seller {
	font-weight: 700;
}

.ttp-gear__buy-price {
	font-size: 0.92rem;
}

.ttp-gear__buy-checked {
	color: var(--global-palette5, #555);
}

.ttp-gear__buy-action {
	white-space: nowrap;
}

/* Narrow screens -------------------------------------------------------- */

@media (max-width: 600px) {

	.ttp-gear__buy-item {
		flex-direction: column;
		align-items: flex-start;
	}

	.ttp-gear__buy-action {
		white-space: normal;
	}
}

/* Gear hub (/gear/): tiled grid ------------------------------------------
   Used by archive-gear_review.php. The header comes from archive.css. */

.ttp-gear-tiles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
}

.ttp-gear-tile {
	margin: 0;
}

.ttp-gear-tile__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	text-decoration: none;
	color: var(--ttp-ink, var(--global-palette3, #1c1f1a));
	background: var(--ttp-white, var(--global-palette9, #fff));
	border: 1px solid var(--ttp-line, var(--global-palette6, #d9d3c5));
	border-radius: 8px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.ttp-gear-tile__link:hover,
.ttp-gear-tile__link:focus {
	border-color: var(--ttp-green, var(--global-palette1, #21402e));
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.ttp-gear-tile__photo {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--ttp-line, var(--global-palette6, #d9d3c5));
}

.ttp-gear-tile__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 60%;
	display: block;
	transition: transform 0.25s;
}

.ttp-gear-tile__link:hover .ttp-gear-tile__photo img {
	transform: scale(1.03);
}

.ttp-gear-tile__photo--empty {
	background: linear-gradient(
		160deg,
		var(--global-palette3, #3a4a3a) 0%,
		var(--global-palette4, #5a6b52) 100%
	);
}

.ttp-gear-tile__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 0.35rem;
	padding: 1rem 1.15rem 1.15rem;
}

.ttp-gear-tile__label {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ttp-muted, var(--global-palette5, #4a6678));
}

.ttp-gear-tile__title {
	font-family: var(--global-heading-font-family, 'Bitter', serif);
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1.2;
}

.ttp-gear-tile__verdict {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--ttp-muted, var(--global-palette5, #4a6678));
}

.ttp-gear-tile__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1rem;
	margin-top: auto;
	padding-top: 0.6rem;
	font-size: 0.9rem;
}

.ttp-gear-tile__miles {
	font-weight: 600;
}

.ttp-gear-tile__updated {
	color: var(--ttp-muted, var(--global-palette5, #4a6678));
}

@media (max-width: 600px) {
	.ttp-gear-tiles {
		grid-template-columns: 1fr;
	}
}
