/*
Theme Name: Car Scope Guide
Theme URI: https://carscopeguide.com
Description: Simple magazine-style child theme for Car Scope Guide, built on GeneratePress.
Author: Car Scope Guide
Author URI: https://carscopeguide.com
Template: generatepress
Version: 1.0.0
Text Domain: generatepress-child
*/

:root {
	--csg-ink: #16181d;
	--csg-ink-soft: #24272e;
	--csg-red: #d5202b;
	--csg-red-dark: #a8181f;
	--csg-bg: #f4f5f7;
	--csg-card: #ffffff;
	--csg-border: #e6e7eb;
	--csg-text: #1c1e22;
	--csg-muted: #6b7078;
	--font-body: "Geist", "Geist Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body {
	background: var(--csg-bg);
	color: var(--csg-text);
}

a {
	transition: color .15s ease;
}

/* ---------- Header ---------- */

.site-header {
	background: var(--csg-ink);
	border-bottom: 3px solid var(--csg-red);
}

.site-header .inside-header {
	align-items: center;
	padding-top: 10px;
	padding-bottom: 10px;
}

/* ---------- Header search ---------- */

.csg-search {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	order: 99;
	margin-left: 10px;
	background: transparent;
	border-radius: 10px;
	transition: background .2s ease;
}

.csg-search.is-open {
	background: var(--csg-ink-soft);
}

.csg-search-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: color .15s ease;
}

.csg-search-toggle:hover,
.csg-search-toggle:focus-visible {
	background: transparent;
	color: var(--csg-red);
}

.csg-search-toggle svg {
	fill: currentColor;
}

.csg-search .csg-search-input,
.csg-search .csg-search-input:focus {
	width: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #fff;
	font-size: .9rem;
	box-shadow: none;
	outline: none;
	opacity: 0;
	transition: width .3s ease, padding .3s ease, opacity .2s ease;
}

.csg-search.is-open .csg-search-input,
.csg-search.is-open .csg-search-input:focus {
	width: 240px;
	padding: 0 2px 0 16px;
	opacity: 1;
}

.csg-search .csg-search-input::placeholder {
	color: #9aa0aa;
}

.csg-search .csg-search-input::-webkit-search-cancel-button {
	display: none;
}

@media (max-width: 768px) {
	.site-header .inside-header {
		position: relative;
	}

	.site-header .csg-search {
		order: 1;
		margin-left: auto;
		margin-right: 4px;
	}

	.site-header .mobile-menu-control-wrapper {
		order: 2;
	}

	.site-header #site-navigation {
		order: 3;
	}

	.main-navigation .menu-toggle,
	.main-navigation .menu-toggle:hover,
	.main-navigation .menu-toggle:focus {
		color: #fff;
	}

	.csg-search.is-open {
		position: absolute;
		left: 30px;
		right: 30px;
		top: 50%;
		transform: translateY(-50%);
		z-index: 10;
		margin: 0;
	}

	.csg-search.is-open .csg-search-input,
	.csg-search.is-open .csg-search-input:focus {
		flex: 1;
		width: auto;
		min-width: 0;
	}

	.site-content {
		padding-left: 16px;
		padding-right: 16px;
	}
}

.site-branding .main-title,
.site-branding .main-title a {
	color: #fff;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .02em;
}

.site-branding .main-title a::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 8px;
	background: var(--csg-red);
	border-radius: 2px;
}

.site-branding .site-description {
	color: #9aa0aa;
}

.site-header .main-nav > .inside-navigation > ul,
#site-navigation .main-nav ul {
	background: transparent;
}

#site-navigation,
.main-navigation {
	background: var(--csg-ink);
}

.main-navigation .main-nav ul li a {
	color: #f2f3f4;
	font-weight: 600;
	font-size: .85rem;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.main-navigation .main-nav ul ul {
	background: var(--csg-ink-soft);
	border-top: 2px solid var(--csg-red);
}

/* ---------- Homepage hero ---------- */

.home .site-content {
	flex-wrap: wrap;
}

.csg-hero {
	flex: 0 0 100%;
	max-width: 100%;
	margin: 30px 0 10px;
}

.csg-hero-main {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	background: var(--csg-ink);
}

.csg-hero-link {
	display: block;
	position: relative;
	text-decoration: none;
}

.csg-hero-link img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 8;
	object-fit: cover;
	transition: transform .5s ease;
}

.csg-hero-link:hover img {
	transform: scale(1.03);
}

.csg-hero-overlay {
	position: absolute;
	inset: auto 0 0 0;
	padding: 90px 32px 28px;
	background: linear-gradient(to top, rgba(10, 11, 14, .88) 0%, rgba(10, 11, 14, .55) 55%, rgba(10, 11, 14, 0) 100%);
}

.csg-hero-title {
	display: block;
	color: #fff;
	font-size: clamp(1.4rem, 2.6vw, 2.1rem);
	font-weight: 800;
	line-height: 1.2;
	max-width: 900px;
	text-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.csg-hero-sub {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
	margin-top: 20px;
}

.csg-hero-thumb {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 10px;
	background: var(--csg-ink);
}

.csg-hero-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform .4s ease;
}

.csg-hero-card:hover .csg-hero-thumb img {
	transform: scale(1.05);
}

.csg-hero-card-title {
	margin: 0 0 4px;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.3;
}

.csg-hero-card-title a {
	color: var(--csg-text);
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.csg-hero-card-title a:hover {
	color: var(--csg-red);
}

.csg-hero-card-meta {
	margin: 0;
	font-size: .78rem;
	color: var(--csg-muted);
}

.csg-hero-card-meta span {
	margin: 0 3px;
	opacity: .6;
}

@media (max-width: 768px) {
	.csg-hero-overlay {
		padding: 60px 18px 18px;
	}

	.csg-hero-link img {
		aspect-ratio: 4 / 3;
	}

	.csg-hero-sub {
		grid-template-columns: 1fr;
	}

	.csg-hero-card {
		display: grid;
		grid-template-columns: 120px 1fr;
		gap: 0 14px;
		align-items: start;
	}

	.csg-hero-thumb {
		grid-row: span 2;
		margin: 0;
	}
}

/* ---------- Category badge ---------- */

.csg-cat-badge {
	display: inline-block;
	background: var(--csg-red);
	color: #fff !important;
	font-size: .68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 4px 10px;
	border-radius: 4px;
	margin-bottom: 10px;
	text-decoration: none;
}

.csg-cat-badge:hover {
	background: var(--csg-red-dark);
}

/* ---------- Post list (home / archive) ---------- */

.csg-list-title {
	margin: 0 0 22px;
	font-size: 1.6rem;
	font-weight: 800;
	line-height: 1.2;
}

body:not(.single):not(.page) #main {
	display: flex;
	flex-direction: column;
	gap: 26px;
}

body:not(.single):not(.page) #main > article {
	background: transparent;
	border: 0;
	margin: 0;
	padding: 0;
}

body:not(.single):not(.page) #main .inside-article {
	display: grid;
	grid-template-columns: minmax(180px, 40%) 1fr;
	grid-template-rows: auto 1fr;
	gap: 0 22px;
	align-items: start;
	padding: 0;
	background: transparent;
}

body:not(.single):not(.page) #main .post-image {
	grid-column: 1;
	grid-row: 1 / span 2;
}

body:not(.single):not(.page) #main .entry-header,
body:not(.single):not(.page) #main .entry-summary {
	grid-column: 2;
}

body:not(.single):not(.page) #main .post-image {
	margin: 0;
	border-radius: 10px;
	overflow: hidden;
	background: var(--csg-ink);
}

body:not(.single):not(.page) #main .post-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	transition: transform .4s ease;
}

body:not(.single):not(.page) #main article:hover .post-image img {
	transform: scale(1.04);
}

body:not(.single):not(.page) #main .entry-header {
	padding: 0;
}

body:not(.single):not(.page) #main .csg-cat-badge {
	background: none;
	color: var(--csg-red) !important;
	padding: 0;
	margin-bottom: 6px;
	font-size: .72rem;
	letter-spacing: .06em;
}

body:not(.single):not(.page) #main .csg-cat-badge:hover {
	background: none;
	text-decoration: underline;
}

body:not(.single):not(.page) #main .entry-title {
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1.3;
	margin: 0 0 8px;
}

body:not(.single):not(.page) #main .entry-title a {
	color: var(--csg-text);
	text-decoration: none;
}

body:not(.single):not(.page) #main .entry-title a:hover {
	color: var(--csg-red);
}

body:not(.single):not(.page) #main .entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
	margin: 0;
	color: var(--csg-muted);
	font-size: .78rem;
	text-transform: uppercase;
	letter-spacing: .03em;
}

body:not(.single):not(.page) #main .entry-summary {
	margin-top: 10px;
	padding: 0;
	color: #4b5058;
	font-family: var(--font-body);
	font-size: .97rem;
	line-height: 1.7;
	letter-spacing: -.003em;
}

body:not(.single):not(.page) #main .entry-summary p {
	margin: 0;
}

#main .entry-header .entry-meta .gp-icon {
	display: inline-flex;
	margin-right: 4px;
	opacity: .8;
}

#main .entry-meta svg {
	width: 12px;
	height: 12px;
	top: 0;
	fill: currentColor;
}

#main .entry-meta > span {
	display: inline-flex;
	align-items: center;
}

#main .entry-meta a {
	color: var(--csg-muted);
	text-decoration: none;
}

#main .entry-meta a:hover {
	color: var(--csg-red);
}

/* ---------- Archive header ---------- */

.page-header {
	position: relative;
	margin: 0 0 26px;
	padding: 6px 0 6px 20px;
	background: transparent;
	border: 0;
}

.page-header::before {
	content: "";
	position: absolute;
	left: 0;
	top: 6px;
	bottom: 6px;
	width: 5px;
	background: var(--csg-red);
	border-radius: 3px;
}

.csg-archive-label {
	display: block;
	margin-bottom: 4px;
	color: var(--csg-red);
	font-size: .75rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .12em;
}

.page-header .page-title {
	margin: 0;
	font-size: 2.2rem;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--csg-text);
}

.csg-archive-count {
	display: block;
	margin-top: 8px;
	color: var(--csg-muted);
	font-size: .85rem;
	font-weight: 600;
}

.page-header .taxonomy-description {
	margin-top: 8px;
	color: #4b5058;
	font-size: .95rem;
}

.page-header .taxonomy-description p {
	margin: 0;
}

/* ---------- Pagination ---------- */

.csg-pagination {
	margin: 40px 0 10px;
}

.csg-pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.csg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--csg-border);
	border-radius: 10px;
	background: var(--csg-card);
	color: var(--csg-text);
	font-size: .9rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.csg-pagination a.page-numbers:hover {
	border-color: var(--csg-red);
	color: var(--csg-red);
	transform: translateY(-1px);
}

.csg-pagination .page-numbers.current {
	background: var(--csg-red);
	border-color: var(--csg-red);
	color: #fff;
	box-shadow: 0 4px 12px rgba(213, 32, 43, .3);
}

.csg-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	min-width: 24px;
	padding: 0;
}

.csg-pagination .prev,
.csg-pagination .next {
	padding: 0 18px;
}

@media (max-width: 480px) {
	.page-header .page-title {
		font-size: 1.7rem;
	}

	.csg-pagination .page-numbers {
		min-width: 38px;
		height: 38px;
		padding: 0 10px;
	}
}

/* ---------- Single post ---------- */

body.single .entry-header {
	padding-bottom: 16px;
}

body.single .entry-title {
	font-size: 2rem;
	line-height: 1.25;
	font-weight: 800;
	margin-bottom: 10px;
}

body.single .entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 16px;
	color: var(--csg-muted);
	font-size: .85rem;
	text-transform: uppercase;
	letter-spacing: .03em;
}

body.single .entry-content {
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.8;
	letter-spacing: -.005em;
	color: #2b2e33;
	-webkit-font-smoothing: antialiased;
}

body.single .entry-content p {
	margin-bottom: 1.4em;
}

body.single .entry-content strong {
	font-weight: 600;
	color: var(--csg-text);
}

body.single .entry-content ul,
body.single .entry-content ol {
	margin-bottom: 1.4em;
}

body.single .entry-content li {
	margin-bottom: .4em;
}

body.single .entry-content h2,
body.single .entry-content h3,
body.single .entry-content h4 {
	font-weight: 800;
	line-height: 1.3;
	color: var(--csg-text);
	letter-spacing: -.01em;
}

body.single .entry-content h2 {
	margin: 1.8em 0 .6em;
	font-size: 1.85rem;
}

body.single .entry-content h3 {
	margin: 1.6em 0 .5em;
	font-size: 1.45rem;
}

body.single .entry-content h4 {
	margin: 1.4em 0 .5em;
	font-size: 1.2rem;
}

@media (max-width: 600px) {
	body.single .entry-content h2 {
		font-size: 1.55rem;
	}

	body.single .entry-content h3 {
		font-size: 1.28rem;
	}
}

body.single .entry-content img {
	border-radius: 8px;
}

/* ---------- Related posts ---------- */

.csg-related {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid var(--csg-border);
}

.csg-related-title {
	font-size: 1.1rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	font-weight: 800;
	margin-bottom: 18px;
}

.csg-related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.csg-related-card {
	display: block;
	text-decoration: none;
	color: inherit;
}

.csg-related-card img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 8px;
	display: block;
}

.csg-related-card-title {
	display: block;
	font-size: .92rem;
	font-weight: 600;
	color: var(--csg-text);
	line-height: 1.4;
}

.csg-related-card:hover .csg-related-card-title {
	color: var(--csg-red);
}

/* ---------- Sidebar ---------- */

#right-sidebar .widget {
	background: var(--csg-card);
	border: 1px solid var(--csg-border);
	border-radius: 12px;
	padding: 22px;
	margin-bottom: 24px;
	box-shadow: 0 2px 10px rgba(20, 22, 26, .04);
}

#right-sidebar .widget-title,
#right-sidebar .widget h2.wp-block-heading {
	position: relative;
	font-size: .85rem;
	text-transform: uppercase;
	letter-spacing: .06em;
	font-weight: 800;
	margin: 0 0 18px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--csg-border);
}

#right-sidebar .widget-title::after,
#right-sidebar .widget h2.wp-block-heading::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 44px;
	height: 3px;
	background: var(--csg-red);
	border-radius: 2px;
}

/* Search */

#right-sidebar .wp-block-search__inside-wrapper {
	display: flex;
	gap: 0;
	background: var(--csg-bg);
	border: 1px solid var(--csg-border);
	border-radius: 999px;
	padding: 4px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

#right-sidebar .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--csg-red);
	box-shadow: 0 0 0 3px rgba(213, 32, 43, .12);
	background: #fff;
}

#right-sidebar .wp-block-search__input {
	flex: 1;
	min-width: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 9px 16px;
	font-size: .9rem;
	color: var(--csg-text);
	outline: none;
}

#right-sidebar .wp-block-search__button {
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: var(--csg-red);
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 9px 20px;
	cursor: pointer;
	transition: background .15s ease;
}

#right-sidebar .wp-block-search__button:hover {
	background: var(--csg-red-dark);
}

/* Random posts */

.csg-rp-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.csg-rp-item {
	display: flex;
	gap: 14px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--csg-border);
}

.csg-rp-item:first-child {
	padding-top: 0;
}

.csg-rp-item:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.csg-rp-thumb {
	flex: 0 0 92px;
	width: 92px;
	height: 72px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--csg-bg);
}

.csg-rp-thumb img,
.csg-rp-noimg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}

.csg-rp-item:hover .csg-rp-thumb img {
	transform: scale(1.08);
}

.csg-rp-body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.csg-rp-cat {
	color: var(--csg-red);
	font-size: .66rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.csg-rp-title {
	color: var(--csg-text);
	font-size: .9rem;
	font-weight: 700;
	line-height: 1.35;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.csg-rp-title:hover {
	color: var(--csg-red);
}

.csg-rp-date {
	color: var(--csg-muted);
	font-size: .72rem;
}

/* Categories / archives lists */

#right-sidebar .widget ul.wp-block-categories,
#right-sidebar .widget ul.wp-block-archives {
	list-style: none;
	margin: 0;
	padding: 0;
}

#right-sidebar .widget ul.wp-block-categories li,
#right-sidebar .widget ul.wp-block-archives li {
	padding: 9px 0;
	border-bottom: 1px dashed var(--csg-border);
}

#right-sidebar .widget ul.wp-block-categories li:last-child,
#right-sidebar .widget ul.wp-block-archives li:last-child {
	border-bottom: 0;
}

#right-sidebar .widget ul li a {
	color: var(--csg-text);
	text-decoration: none;
	font-weight: 600;
}

#right-sidebar .widget ul li a:hover {
	color: var(--csg-red);
}

/* ---------- Footer ---------- */

.site-footer,
footer.site-footer,
.site-info {
	background: var(--csg-ink);
	color: #c7cad0;
}

.site-footer a {
	color: #fff;
}

/* GP's grid-container lays its children out as a flex row by default;
   force the footer menu and copyright line to stack instead so they
   don't collide on the same line. */
.site-info .inside-site-info {
	display: block;
	padding-top: 16px;
	padding-bottom: 14px;
}

.copyright-bar {
	padding: 6px 0 0;
	font-size: .8rem;
	text-align: center;
}

.csg-footer-menu {
	background: var(--csg-ink);
	padding: 0;
	text-align: center;
}

.csg-footer-menu-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.csg-footer-menu-list a {
	color: #c7cad0;
	font-size: .8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .03em;
	text-decoration: none;
}

.csg-footer-menu-list a:hover {
	color: var(--csg-red);
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
	body:not(.single):not(.page) #main .inside-article {
		grid-template-columns: 1fr;
		gap: 12px 0;
	}

	body:not(.single):not(.page) #main .post-image,
	body:not(.single):not(.page) #main .entry-header,
	body:not(.single):not(.page) #main .entry-summary {
		grid-column: 1;
		grid-row: auto;
	}

	body:not(.single):not(.page) #main .entry-title {
		font-size: 1.15rem;
	}
}
