/*
Theme Name: TightFit
Theme URI: https://tightfit.example.com
Author: TightFit
Author URI: https://tightfit.example.com
Description: Gritty, workshop-toned block theme for TightFit — automotive fittings, hoses & hardware. Full-site editing, self-hosted brand fonts (Anton, Oswald, Montserrat), black/red/khaki brand palette.
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tightfit
Tags: full-site-editing, block-patterns, one-column, custom-colors, custom-menu

TIGHT WHERE IT COUNTS.
*/

/* Utility classes not expressible via theme.json presets (text-transform / tracking combos). */

.tf-eyebrow {
	display: inline-block;
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.25em;
	color: var(--wp--preset--color--red);
	margin-bottom: 0.5em;
}

.tf-tagline {
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: var(--wp--preset--color--white);
}

.tf-h1-accent {
	color: var(--wp--preset--color--khaki);
}

.tf-card {
	background-color: var(--wp--preset--color--charcoal);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.tf-muted {
	color: var(--wp--preset--color--smoke);
}

/* Full-bleed hero media should sit behind a dark scrim so white/red text stays legible over photography. */
.tf-hero {
	position: relative;
	overflow: hidden;
}

.tf-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.85) 100%);
	pointer-events: none;
	z-index: 1;
}

.tf-hero > .wp-block-group__inner-container,
.tf-hero > * {
	position: relative;
	z-index: 2;
}

/* Nav link hover state — red per brand accent rule. */
.wp-block-navigation .wp-block-navigation-item > a:hover,
.wp-block-navigation .wp-block-navigation-item > a:focus {
	color: var(--wp--preset--color--red) !important;
}

/* Footer lists (Quick Links, etc.) — plain, tight, single column. */
.tf-footer-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: var(--wp--preset--font-size--small);
}

.tf-footer-list li {
	line-height: 1.3;
	margin: 0 0 0.5em;
}

.tf-footer-list li:last-child {
	margin-bottom: 0;
}

/* Dealer directory (Find a Dealer page). */
.tf-dealer-group {
	margin-bottom: var(--wp--preset--spacing--40);
}

.tf-dealer-state-heading {
	border-bottom: 2px solid var(--wp--preset--color--red);
	padding-bottom: 0.5em;
	margin-bottom: var(--wp--preset--spacing--30);
}

.tf-dealer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: var(--wp--preset--spacing--30);
}

.tf-dealer-card {
	padding: var(--wp--preset--spacing--30);
	display: flex;
	flex-direction: column;
}

.tf-dealer-card-name {
	font-family: var(--wp--preset--font-family--oswald);
	font-size: var(--wp--preset--font-size--large);
	margin: 0 0 0.5em;
}

.tf-dealer-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	margin-bottom: 0.75em;
}

.tf-dealer-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-family: var(--wp--preset--font-family--montserrat);
	font-weight: 700;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--smoke);
}

.tf-dealer-badge-icon {
	color: var(--wp--preset--color--red);
	flex-shrink: 0;
}

.tf-dealer-location {
	margin: 0 0 0.75em;
	font-size: var(--wp--preset--font-size--small);
}

.tf-dealer-links {
	margin-top: auto;
}

.tf-dealer-links p {
	margin: 0 0 0.35em;
	font-size: var(--wp--preset--font-size--small);
}

.tf-dealer-links p:last-child {
	margin-bottom: 0;
}

/* Product catalog: sidebar category tree. */
.tf-cat-sidebar-col {
	border-right: 1px solid rgba(255, 255, 255, 0.14);
	padding-right: var(--wp--preset--spacing--30);
}

@media (max-width: 760px) {
	.tf-cat-sidebar-col {
		border-right: none;
		border-bottom: 1px solid rgba(255, 255, 255, 0.14);
		padding-right: 0;
		padding-bottom: var(--wp--preset--spacing--30);
		margin-bottom: var(--wp--preset--spacing--30);
	}
}

.tf-cat-nav {
	font-family: var(--wp--preset--font-family--montserrat);
}

.tf-cat-tree,
.tf-cat-children {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tf-cat-children {
	padding-left: 1.1em;
	border-left: 1px solid rgba(255, 255, 255, 0.08);
	margin: 0.25em 0 0.5em;
}

.tf-cat-children[hidden] {
	display: none;
}

.tf-cat-node {
	position: relative;
}

.tf-cat-node--parent > .tf-cat-link {
	padding-left: 1.75em;
}

.tf-cat-toggle {
	position: absolute;
	top: 0;
	left: 0;
	width: 1.75em;
	height: 2.4em;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	color: var(--wp--preset--color--smoke);
	cursor: pointer;
	font-size: 0.9rem;
	line-height: 1;
}

.tf-cat-toggle:hover {
	color: var(--wp--preset--color--white);
}

.tf-cat-toggle-icon::before {
	content: "+";
}

.tf-cat-toggle[aria-expanded="true"] .tf-cat-toggle-icon::before {
	content: "\2212";
}

.tf-cat-link {
	display: block;
	padding: 0.6em 0.5em 0.6em 0;
	color: var(--wp--preset--color--smoke);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tf-cat-link:hover {
	color: var(--wp--preset--color--white);
}

.tf-cat-node--active > .tf-cat-link {
	color: var(--wp--preset--color--red);
	font-weight: 700;
}

/* Product catalog: parent-category tile grid (categories with children link down, they never list products directly). */
.tf-cat-tile-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--wp--preset--spacing--30);
}

.tf-cat-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: var(--wp--preset--spacing--30);
	text-decoration: none;
	transition: border-color 0.2s ease;
}

.tf-cat-tile:hover {
	border-color: var(--wp--preset--color--red);
}

.tf-cat-tile-image {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 2px;
	margin-bottom: var(--wp--preset--spacing--20);
}

.tf-cat-tile-placeholder {
	background-color: rgba(255, 255, 255, 0.04);
}

.tf-cat-tile-name {
	font-family: var(--wp--preset--font-family--oswald);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--medium);
	margin-bottom: 0.25em;
}

.tf-cat-tile-count {
	font-size: var(--wp--preset--font-size--small);
}

/* Product catalog: leaf-category spec table (columns pulled from the pa_size / pa_thread-spec / pa_material global attributes so they stay consistent across product families). */
.tf-spec-table-wrap {
	overflow-x: auto;
}

.tf-spec-table {
	width: 100%;
	min-width: 780px;
	table-layout: fixed;
	border-collapse: collapse;
	font-family: var(--wp--preset--font-family--montserrat);
}

/* Fixed column widths so SKU / Thread Spec / Material get enough room to
   stay on one line — sized off the widest real values in the catalog
   (e.g. "Metric M12x1.25", "Stainless Steel"). Product carries the
   remainder since names are the only column meant to wrap. */
.tf-spec-table th:nth-child(1),
.tf-spec-table td:nth-child(1) {
	width: 34%;
}

.tf-spec-table th:nth-child(2),
.tf-spec-table td:nth-child(2) {
	width: 14%;
}

.tf-spec-table th:nth-child(3),
.tf-spec-table td:nth-child(3) {
	width: 10%;
}

.tf-spec-table th:nth-child(4),
.tf-spec-table td:nth-child(4) {
	width: 18%;
}

.tf-spec-table th:nth-child(5),
.tf-spec-table td:nth-child(5) {
	width: 15%;
}

.tf-spec-table th:nth-child(6),
.tf-spec-table td:nth-child(6) {
	width: 9%;
}

.tf-spec-table th {
	text-align: left;
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--smoke);
	border-bottom: 2px solid var(--wp--preset--color--red);
	padding: 0.75em 1em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tf-spec-table td {
	padding: 0.75em 1em;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	vertical-align: middle;
	color: var(--wp--preset--color--white);
}

.tf-spec-table td:nth-child(2),
.tf-spec-table td:nth-child(3),
.tf-spec-table td:nth-child(4),
.tf-spec-table td:nth-child(5) {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tf-spec-table-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 2px;
	margin-right: 0.75em;
	vertical-align: middle;
}

.tf-spec-table-product {
	display: flex;
	align-items: center;
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.tf-spec-table-product:hover {
	color: var(--wp--preset--color--red);
}

.tf-spec-table-link {
	color: var(--wp--preset--color--red);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.tf-spec-table-link:hover {
	text-decoration: underline;
}

@media (max-width: 760px) {
	.tf-spec-table-wrap {
		overflow-x: visible;
	}

	.tf-spec-table {
		min-width: 0;
		table-layout: auto;
	}

	.tf-spec-table thead {
		display: none;
	}

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

	.tf-spec-table td:nth-child(2),
	.tf-spec-table td:nth-child(3),
	.tf-spec-table td:nth-child(4),
	.tf-spec-table td:nth-child(5) {
		white-space: normal;
		overflow: visible;
		text-overflow: clip;
	}

	.tf-spec-table tr {
		margin-bottom: var(--wp--preset--spacing--30);
		background-color: var(--wp--preset--color--charcoal);
		border: 1px solid rgba(255, 255, 255, 0.08);
		border-radius: 2px;
		padding: var(--wp--preset--spacing--20);
	}

	.tf-spec-table td {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1em;
		padding: 0.5em 0;
		border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	}

	.tf-spec-table td:last-child {
		border-bottom: none;
	}

	.tf-spec-table td::before {
		content: attr(data-label);
		flex-shrink: 0;
		font-size: 0.7rem;
		text-transform: uppercase;
		letter-spacing: 0.08em;
		color: var(--wp--preset--color--smoke);
	}
}

/* Low-key Amazon mention — plain text, no button, no visual competition. */
.tf-online-note {
	color: var(--wp--preset--color--smoke);
	font-size: var(--wp--preset--font-size--small);
}

.tf-online-note a {
	color: inherit;
	text-decoration: underline;
}

.tf-online-note a:hover {
	color: var(--wp--preset--color--white);
}
