/*
Theme Name:   Understrap Child
Theme URI:    https://cstt01.bytepoint.pro
Description:  Child theme for Understrap. All site-specific customisations live here.
Author:       CtrlSite
Author URI:   https://cstt01.bytepoint.pro
Template:     understrap
Version:      1.0.0
License:      GNU General Public License v3 or later
License URI:  https://www.gnu.org/licenses/gpl-3.0.html
Text Domain:  understrap-child
Tags:         custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =============================================================================
   Car Single Post Template — Layout & Styles
   ============================================================================= */

/* Wrapper */
.single-car #car-detail-wrapper {
	padding: 2rem 0;
}

/* ---- Left column: featured image ---- */
.single-car .car-featured-image {
	margin-bottom: 1.5rem;
}

.single-car .car-featured-image img {
	width: 100%;
	height: auto;
	border-radius: 6px;
	display: block;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ---- Left column: custom fields table ---- */
.single-car .car-fields-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.single-car .car-fields-table th,
.single-car .car-fields-table td {
	padding: 0.6rem 0.75rem;
	border: 1px solid #dee2e6;
	vertical-align: middle;
}

.single-car .car-fields-table th {
	background-color: #f8f9fa;
	font-weight: 600;
	width: 38%;
	color: #343a40;
}

.single-car .car-fields-table td {
	color: #495057;
}

.single-car .car-fields-table tr:nth-child(even) td {
	background-color: #fdfdfd;
}

/* ---- Right column: title & content ---- */
.single-car .car-title {
	font-size: 2rem;
	font-weight: 700;
	margin-bottom: 1rem;
	line-height: 1.2;
	color: #212529;
}

.single-car .car-content {
	font-size: 1rem;
	line-height: 1.75;
	color: #495057;
}

/* ---- Column divider on desktop ---- */
@media (min-width: 768px) {
	.single-car .car-right-col {
		padding-left: 2.5rem;
		border-left: 1px solid #dee2e6;
	}
}

/* ---- Responsive: stack on mobile ---- */
@media (max-width: 767px) {
	.single-car .car-right-col {
		margin-top: 2rem;
	}
}


/* =============================================================================
   Car Archive Template — Layout & Styles
   ============================================================================= */

/* ---- Archive wrapper ---- */
.archive-car #car-archive-wrapper {
	padding-top: 2rem;
	padding-bottom: 4rem;
}

/* ---- Archive header ---- */
.car-archive-header {
	margin-bottom: 2rem;
	text-align: center;
}

.car-archive-title {
	font-size: 2.5rem;
	font-weight: 800;
	color: #212529;
	letter-spacing: -0.02em;
}

/* ---- Search box ---- */
.car-search-wrap {
	margin-bottom: 3rem;
}

.car-search-input-wrap {
	position: relative;
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	border-radius: 30px;
}

.car-search-input {
	padding: 0.75rem 1.5rem;
	padding-right: 3rem;
	border-radius: 30px;
	border: 1px solid #dee2e6;
	font-size: 1.05rem;
	transition: all 0.2s ease;
	background-color: #fff;
}

.car-search-input:focus {
	border-color: #0d6efd;
	box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.15);
	outline: none;
}

/* Spinner shown while fetching */
.car-search-spinner {
	display: none;
	position: absolute;
	right: 1.2rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1.2rem;
	height: 1.2rem;
	border: 2px solid #dee2e6;
	border-top-color: #0d6efd;
	border-radius: 50%;
}

.car-search-spinner.is-active {
	display: block;
	animation: cstt-spin 0.7s linear infinite;
}

@keyframes cstt-spin {
	to { transform: translateY(-50%) rotate(360deg); }
}

/* ---- Results count ---- */
.car-results-count {
	font-size: 0.95rem;
	color: #6c757d;
	margin-bottom: 1.5rem;
	min-height: 1.4em;
	font-weight: 500;
}

/* ---- Card grid ---- */
/*
 * Override Bootstrap's default 15px column padding with a larger gutter.
 * The negative margin on the row compensates so the grid stays aligned
 * with the rest of the page content.
 */
#car-grid {
	margin-left: -1rem;
	margin-right: -1rem;
}

.car-card-col {
	padding-left: 1rem;
	padding-right: 1rem;
	margin-bottom: 2rem;
	display: flex;
}

/* ---- Individual card ---- */
.car-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #ffffff;
	border: 2px solid #e2e8f0;
	border-radius: 16px;
	overflow: hidden;           /* clip image corners at card level */
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.car-card:hover {
	border-color: #0d6efd;
	box-shadow: 0 12px 32px rgba(13, 110, 253, 0.12);
	transform: translateY(-4px);
}

/* ---- Card image ---- */
.car-card-image-link {
	display: block;
	/* No margin — image sits flush at the top of the card */
}

.car-card-image-wrap {
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f1f5f9;
	position: relative;
	/* No border-radius here — the card's overflow:hidden + border-radius handles clipping */
}

.car-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.car-card:hover .car-card-image {
	transform: scale(1.05);
}

/* ---- Card body ---- */
.car-card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.25rem 1.25rem 1.5rem;
}

/* ---- Card title ---- */
.car-card-title {
	font-size: 1.2rem;
	font-weight: 700;
	margin-bottom: 0.85rem;
	line-height: 1.3;
}

.car-card-title a {
	color: #1a202c;
	text-decoration: none;
	transition: color 0.2s ease;
}

.car-card-title a:hover {
	color: #0d6efd;
}

/* ---- Card fields table ---- */
.car-card-fields {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	margin-bottom: 1.25rem;
	flex: 1;
}

.car-card-fields th,
.car-card-fields td {
	padding: 0.45rem 0;
	border: none;
	border-bottom: 1px solid #f1f5f9;
	vertical-align: middle;
}

.car-card-fields tr:last-child th,
.car-card-fields tr:last-child td {
	border-bottom: none;
}

.car-card-fields th {
	font-weight: 600;
	width: 40%;
	color: #64748b;
	text-align: left;
}

.car-card-fields td {
	color: #1a202c;
	font-weight: 500;
	text-align: right;
}

/* ---- Card CTA button ---- */
.car-card-btn {
	margin-top: auto;
	width: 100%;
	text-align: center;
	border-radius: 8px;
	padding: 0.6rem 1.2rem;
	font-size: 0.95rem;
	font-weight: 600;
	transition: all 0.2s ease;
}

/* ---- No results message ---- */
.car-no-results-msg {
	text-align: center;
	color: #6c757d;
	font-size: 1.1rem;
	padding: 3rem 0;
	background: #f8f9fa;
	border-radius: 12px;
	border: 1px dashed #dee2e6;
}

/* ---- Pagination ---- */
.car-pagination {
	margin-top: 2rem;
	text-align: center;
}

.car-pagination .nav-links {
	display: inline-flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	justify-content: center;
}

.car-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.8rem;
	border: 1px solid #dee2e6;
	border-radius: 8px;
	color: #495057;
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 500;
	transition: all 0.2s ease;
}

.car-pagination .page-numbers.current,
.car-pagination .page-numbers:hover {
	background: #0d6efd;
	color: #fff;
	border-color: #0d6efd;
}

/* ---- Responsive ---- */
@media (max-width: 767px) {
	.car-card-col {
		width: 100%;
	}

	.car-archive-title {
		font-size: 2rem;
	}

	#car-grid {
		margin-left: -0.75rem;
		margin-right: -0.75rem;
	}

	.car-card-col {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
		margin-bottom: 1.5rem;
	}
}

@media (min-width: 768px) and (max-width: 991px) {
	/* Two columns on tablet */
	.car-card-col {
		width: 50%;
	}
}
