/*
Theme Name: NewGen Cars
Theme URI: https://newgeneration-cars.com
Author: New Generation Cars
Description: A clean, fast, mobile-first blog theme for newgeneration-cars.com. Featured hero post, 2-column grid and card list on the homepage. No categories shown — just your posts. Creates About, Contact, Privacy Policy, Terms and Disclaimer pages on activation.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: newgen-cars
Tags: blog, one-column, custom-logo, custom-menu, featured-images, threaded-comments
*/

:root {
	--accent: #e10600;
	--accent-dark: #b00500;
	--text: #1d1f23;
	--muted: #6b7280;
	--border: #e5e7eb;
	--bg: #ffffff;
	--bg-soft: #f5f6f8;
	--dark: #111317;
	--radius: 10px;
	--max: 1140px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.7;
	color: var(--text);
	background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .6em; color: var(--text); }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 999; top: 8px; left: 8px;
	background: #fff; padding: 8px 14px;
}
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
	background: var(--bg);
	border-bottom: 1px solid var(--border);
	box-shadow: 0 2px 10px rgba(0,0,0,.04);
	position: sticky; top: 0; z-index: 50;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.site-branding { display: flex; align-items: center; gap: 10px; }
.custom-logo { max-height: 48px; width: auto; }
.site-title { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.site-title a { color: var(--text); }
.site-title span { color: var(--accent); }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; }
.main-nav a { color: var(--text); font-weight: 600; font-size: 15px; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
	background: none; border: 0; cursor: pointer; padding: 8px; color: var(--text);
	display: inline-flex; border-radius: 8px;
}
.icon-btn:hover { background: var(--bg-soft); }
.menu-toggle { display: none; }

.header-search { display: none; border-top: 1px solid var(--border); padding: 12px 0; }
.header-search.is-open { display: block; }

@media (max-width: 860px) {
	.menu-toggle { display: inline-flex; }
	.main-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		background: var(--bg); border-bottom: 1px solid var(--border);
	}
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; padding: 8px 16px; }
	.main-nav li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
	.main-nav li:last-child a { border-bottom: 0; }
}

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-field {
	width: 100%; padding: 11px 14px; font-size: 16px; border: 1px solid var(--border);
	border-radius: 8px; font-family: inherit;
}
.search-field:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ---------- Buttons ---------- */
.btn, .search-submit, .ngc-form button, .form-submit .submit {
	display: inline-block; background: var(--accent); color: #fff !important; border: 0;
	padding: 10px 20px; border-radius: 6px; font-weight: 600; font-size: 15px;
	cursor: pointer; font-family: inherit; line-height: 1.4;
}
.btn:hover, .search-submit:hover, .ngc-form button:hover, .form-submit .submit:hover { background: var(--accent-dark); }

/* ---------- Meta ---------- */
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.post-meta span { display: inline-flex; align-items: center; gap: 5px; }
.post-meta svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ---------- Home: hero ---------- */
.site-main { padding: 24px 0 48px; }
.hero {
	position: relative; display: block; border-radius: var(--radius); overflow: hidden;
	background: var(--dark); aspect-ratio: 16 / 9; max-height: 540px; width: 100%;
	margin-bottom: 24px;
}
.hero img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.hero:hover img { transform: scale(1.03); }
.hero-overlay {
	position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
	padding: 28px; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,0) 100%);
}
.hero-badge {
	align-self: flex-start; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .6px; padding: 4px 10px; border-radius: 4px; margin-bottom: 12px;
}
.hero-title { color: #fff; font-size: clamp(22px, 4vw, 38px); margin-bottom: 10px; }
.hero .post-meta { color: rgba(255,255,255,.88); }

/* ---------- Home: grid ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 40px; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
.grid-item .thumb { border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--bg-soft); margin-bottom: 10px; }
.grid-item .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.grid-item:hover .thumb img { transform: scale(1.05); }
.grid-item h3 { font-size: 17px; margin: 6px 0 0; }
.grid-item h3 a { color: var(--text); }
.grid-item h3 a:hover { color: var(--accent); }
.grid-item .post-meta { font-size: 13px; }
@media (max-width: 480px) { .grid-item h3 { font-size: 15px; } .grid-item .post-meta .m-comments { display: none; } }

/* ---------- Section title ---------- */
.section-title {
	font-size: 22px; color: var(--accent); margin: 0 0 22px; padding-bottom: 10px;
	border-bottom: 2px solid var(--border); position: relative;
}
.section-title::after {
	content: ""; position: absolute; left: 0; bottom: -2px; width: 50px; height: 2px; background: var(--accent);
}

/* ---------- Card list ---------- */
.card-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 28px; }
@media (max-width: 760px) { .card-list { grid-template-columns: 1fr; } }
.card .thumb { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-soft); margin-bottom: 14px; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .thumb img { transform: scale(1.04); }
.card h2 { font-size: 24px; margin: 8px 0 10px; }
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); }
.card .excerpt { color: var(--muted); margin: 0 0 16px; }
.no-thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #c3c7cf; }
.no-thumb svg { width: 56px; height: 56px; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers {
	min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-weight: 600;
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Archive header ---------- */
.archive-header { margin-bottom: 28px; }
.archive-header h1 { font-size: 28px; }
.archive-header p { color: var(--muted); margin: 0; }

/* ---------- Single ---------- */
.single-wrap { max-width: 780px; margin: 0 auto; }
.entry-header { margin-bottom: 20px; }
.entry-title { font-size: clamp(28px, 4.5vw, 40px); margin-bottom: 14px; }
.entry-featured { border-radius: var(--radius); overflow: hidden; margin: 0 0 28px; }
.entry-featured img { width: 100%; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

.entry-content { font-size: 18px; }
.entry-content > * { margin-top: 0; margin-bottom: 1.3em; }
.entry-content h2 { font-size: 28px; margin-top: 1.6em; }
.entry-content h3 { font-size: 22px; margin-top: 1.4em; }
.entry-content h4 { font-size: 19px; margin-top: 1.2em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img, .entry-content figure { border-radius: 8px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 6px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
	margin-left: 0; padding: 14px 20px; border-left: 4px solid var(--accent);
	background: var(--bg-soft); border-radius: 0 8px 8px 0; font-style: italic;
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--bg-soft); }
.entry-content pre { background: var(--dark); color: #eee; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 15px; }
.entry-content iframe { max-width: 100%; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: 14px; color: var(--muted); }

.post-tags { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { background: var(--bg-soft); color: var(--text); padding: 4px 12px; border-radius: 20px; font-size: 14px; }
.post-tags a:hover { background: var(--accent); color: #fff; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 32px 0; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share strong { margin-right: 6px; font-size: 15px; }
.share a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.share a svg { width: 18px; height: 18px; fill: currentColor; }
.share .s-fb { background: #1877f2; } .share .s-x { background: #000; } .share .s-wa { background: #25d366; }
.share .s-pin { background: #e60023; } .share .s-li { background: #0a66c2; }
.share a:hover { opacity: .85; color: #fff; }

.author-box { display: flex; gap: 16px; background: var(--bg-soft); padding: 20px; border-radius: var(--radius); margin-bottom: 32px; }
.author-box img { border-radius: 50%; width: 72px; height: 72px; }
.author-box h4 { margin: 0 0 4px; }
.author-box p { margin: 0; color: var(--muted); font-size: 15px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 40px; }
.post-nav a { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-weight: 600; font-size: 15px; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.post-nav .next { text-align: right; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { text-align: left; } }

.related { margin-bottom: 40px; }
.related .grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
@media (max-width: 760px) { .related .grid { grid-template-columns: repeat(2, 1fr); } .related .grid-item:nth-child(3) { display: none; } }

/* ---------- Page ---------- */
.page-wrap { max-width: 780px; margin: 0 auto; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 20px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 30px; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: 13px; }
.comment-metadata a { color: var(--muted); }
.comment-respond input[type=text], .comment-respond input[type=email], .comment-respond input[type=url], .comment-respond textarea,
.ngc-form input, .ngc-form textarea {
	width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; font-family: inherit;
}
.comment-respond label, .ngc-form label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.comment-form p, .ngc-form p { margin: 0 0 16px; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }
.comment-form-cookies-consent input { width: auto; }

/* ---------- Contact form ---------- */
.ngc-form .hp { position: absolute; left: -9999px; }
.ngc-notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
.ngc-notice.ok { background: #e8f8ee; color: #136c34; }
.ngc-notice.err { background: #fdecec; color: #a11212; }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 .big { font-size: 110px; font-weight: 900; color: var(--accent); line-height: 1; margin-bottom: 10px; }
.error-404 .search-form { max-width: 460px; margin: 24px auto 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #b9bec7; padding: 44px 0 24px; font-size: 15px; }
.site-footer a { color: #e5e7eb; }
.site-footer a:hover { color: #fff; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
@media (max-width: 700px) { .footer-top { grid-template-columns: 1fr; } }
.footer-brand .site-title a { color: #fff; }
.footer-brand p { margin: 10px 0 0; max-width: 460px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom { padding-top: 20px; text-align: center; font-size: 14px; }

.back-to-top {
	position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0;
	background: var(--accent); color: #fff; cursor: pointer; display: none; align-items: center; justify-content: center;
	box-shadow: 0 4px 14px rgba(0,0,0,.2); z-index: 40;
}
.back-to-top.show { display: inline-flex; }

/* ---------- Ads ---------- */
.ngc-ad { margin: 28px 0; text-align: center; min-height: 100px; overflow: hidden; }
.ngc-ad-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.card-list + .ngc-ad, .grid + .ngc-ad { margin-top: 0; }

/* ---------- Cookie bar ---------- */
.cookie-bar {
	position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 720px; margin: 0 auto;
	background: var(--dark); color: #e5e7eb; border-radius: var(--radius); padding: 14px 16px;
	display: flex; align-items: center; gap: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 15px;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; flex: 1; }
.cookie-bar a { color: #fff; text-decoration: underline; }
@media (max-width: 520px) { .cookie-bar { flex-direction: column; align-items: stretch; text-align: center; } }
