/*
Theme Name: AutoWTrasę
Theme URI: https://autowtrase.pl
Author: SEOHOUSE
Author URI: https://seohouse.pl
Description: Lekki motyw contentowy dla autowtrase.pl – poradniki, huby lokalne, modele aut, integracja z CarsMe.pl i Parkaro.pl. Bez jQuery, bez page buildera, gotowy pod SEO/GEO.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: autowtrase
*/

/* ---------- Tokeny ---------- */
:root {
	--paper: #F5F6F3;
	--surface: #FFFFFF;
	--ink: #1F272E;
	--muted: #5A6670;
	--line: #D8DCD6;
	--road: #26323C;
	--road-ink: #F1F3F4;
	--signal: #F2B51D;
	--link: #0D5AA7;
	--park: #1D7650;
	--r-s: 6px;
	--r-l: 14px;
	--wrap: 1160px;
	--measure: 68ch;
	--f-head: "Barlow Semi Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
	--f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--paper: #12181D;
		--surface: #1A2229;
		--ink: #E4E8EB;
		--muted: #9AA6B0;
		--line: #2C3740;
		--road: #0D1317;
		--link: #7DB8F2;
		--park: #4FBF8A;
		color-scheme: dark;
	}
}

/* ---------- Baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 1.0625rem/1.65 var(--f-body);
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--f-head); line-height: 1.12; margin: 0 0 var(--s2); letter-spacing: -.005em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.35rem; font-weight: 600; }
p, ul, ol, table, blockquote { margin: 0 0 var(--s2); }
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--signal); color: #111; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- Nagłówek ---------- */
.site-header {
	background: var(--road);
	color: var(--road-ink);
	position: relative;
}
.site-header::after { /* linia przerywana jak oznakowanie poziome */
	content: "";
	position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
	background: repeating-linear-gradient(90deg, var(--signal) 0 28px, transparent 28px 48px);
}
.head-row { display: flex; align-items: center; gap: var(--s2); min-height: 68px; padding-bottom: 4px; }
.brand { font-family: var(--f-head); font-weight: 700; font-size: 1.6rem; color: var(--road-ink); text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.custom-logo-link img { max-height: 44px; width: auto; }
.nav-toggle { display: none; background: none; border: 1px solid #ffffff40; color: var(--road-ink); border-radius: var(--r-s); padding: .45rem .8rem; font: inherit; cursor: pointer; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; }
.primary-nav a { color: var(--road-ink); text-decoration: none; padding: .5rem .7rem; border-radius: var(--r-s); display: block; font-weight: 500; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: #ffffff18; }
.primary-nav .sub-menu { display: none; }
.head-search input { background: #ffffff14; border: 1px solid #ffffff30; color: var(--road-ink); border-radius: var(--r-s); padding: .45rem .7rem; width: 11rem; font: inherit; }
.head-search input::placeholder { color: #ffffffa0; }
@media (max-width: 900px) {
	.nav-toggle { display: inline-block; }
	.head-search { display: none; }
	.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--road); padding: var(--s2); z-index: 20; border-top: 1px solid #ffffff20; }
	.primary-nav.is-open { display: block; }
	.primary-nav ul { flex-direction: column; }
}

/* ---------- Okruszki ---------- */
.crumbs { font-size: .9rem; color: var(--muted); margin: var(--s3) 0 var(--s2); }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.crumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--line); }
.crumbs a { color: var(--muted); }

/* ---------- Hero i trasa ---------- */
.hero { padding: var(--s5) 0 var(--s4); }
.hero h1 { max-width: 18ch; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 52ch; margin-bottom: var(--s4); }
.route {
	list-style: none; margin: 0; padding: var(--s3) var(--s3) var(--s3);
	background: var(--road); color: var(--road-ink);
	border-radius: var(--r-l);
	display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3);
	position: relative; counter-reset: stop;
}
.route::before { /* oś jezdni */
	content: ""; position: absolute; left: 3rem; right: 3rem; top: calc(var(--s3) + 15px); height: 3px;
	background: repeating-linear-gradient(90deg, var(--signal) 0 22px, transparent 22px 38px);
}
.route li { position: relative; counter-increment: stop; padding-top: 44px; }
.route li::before {
	content: counter(stop);
	position: absolute; top: 0; left: 0;
	width: 32px; height: 32px; border-radius: 50%;
	background: var(--signal); color: #1b1b1b; font: 700 1rem/32px var(--f-head); text-align: center;
	box-shadow: 0 0 0 5px var(--road);
}
.route strong { display: block; font-family: var(--f-head); font-size: 1.35rem; margin-bottom: .25rem; }
.route p { color: #C9D1D6; margin: 0 0 .6rem; font-size: .97rem; }
.route a { color: #fff; font-weight: 600; }
@media (max-width: 760px) {
	.route { grid-template-columns: 1fr; }
	.route::before { left: calc(var(--s3) + 15px); right: auto; top: var(--s3); bottom: var(--s3); width: 3px; height: auto;
		background: repeating-linear-gradient(180deg, var(--signal) 0 18px, transparent 18px 30px); }
	.route li { padding: 0 0 0 52px; }
}

/* ---------- Sekcje strony głównej ---------- */
.band { padding: var(--s4) 0; }
.band + .band { border-top: 1px solid var(--line); }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.band-head h2 { margin: 0; }
.band-head p { margin: .3rem 0 0; color: var(--muted); max-width: 60ch; }
.band-more { font-weight: 600; white-space: nowrap; }

/* Kafelki ofert z ekosystemu */
.eco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s2); list-style: none; padding: 0; margin: 0; }
.eco-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; display: flex; flex-direction: column; }
.eco-item img { aspect-ratio: 16/10; object-fit: cover; width: 100%; background: var(--line); }
.eco-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.eco-body h3 { font-size: 1.2rem; margin: 0; }
.eco-body h3 a { color: var(--ink); text-decoration: none; }
.eco-body h3 a:hover { text-decoration: underline; }
.eco-sub { color: var(--muted); font-size: .93rem; margin: 0; }
.eco-price { margin-top: auto; padding-top: .4rem; font-weight: 700; }
.eco-badge { align-self: flex-start; font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: .05rem .55rem; color: var(--muted); }
.eco--parkaro .eco-item { border-left: 4px solid var(--park); }
.eco--parkaro .eco-price { color: var(--park); }
.eco-empty { color: var(--muted); }

/* Artykuły na stronie głównej */
.news { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s4); }
.news-lead img { border-radius: var(--r-s); aspect-ratio: 16/9; object-fit: cover; margin-bottom: var(--s2); }
.news-lead h3 { font-size: 1.8rem; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.news-list li:first-child { padding-top: 0; }
.news-list a { color: var(--ink); text-decoration: none; font-family: var(--f-head); font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.news-list a:hover { text-decoration: underline; }
.news-list .meta { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
@media (max-width: 860px) { .news { grid-template-columns: 1fr; } }

/* Huby lokalne i tematy */
.hubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 var(--s3); list-style: none; padding: 0; margin: 0; }
.hubs li { border-top: 2px solid var(--road); padding: .8rem 0 1rem; }
.hubs a { font-family: var(--f-head); font-size: 1.3rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.hubs a:hover { text-decoration: underline; }
.hubs p { margin: .25rem 0 0; color: var(--muted); font-size: .95rem; }
.topics { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.topics a { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; background: var(--surface); }
.topics a:hover { border-color: var(--ink); }
.topics span { color: var(--muted); font-size: .85rem; margin-left: .3rem; }

/* ---------- Listy wpisów ---------- */
.archive-head { padding: var(--s3) 0 var(--s2); }
.archive-head .term-desc { color: var(--muted); max-width: var(--measure); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); }
.card { display: flex; flex-direction: column; }
.card img { border-radius: var(--r-s); aspect-ratio: 16/10; object-fit: cover; margin-bottom: .8rem; }
.card h2, .card h3 { font-size: 1.4rem; margin-bottom: .4rem; }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }
.card p { color: var(--muted); margin: 0 0 .4rem; }
.card .meta { font-size: .85rem; color: var(--muted); }
.pagination { margin: var(--s4) 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: var(--r-s); text-decoration: none; color: var(--ink); background: var(--surface); }
.pagination .current { background: var(--road); color: var(--road-ink); border-color: var(--road); }

/* ---------- Artykuł ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
@media (min-width: 1080px) {
	.article-layout.has-toc { grid-template-columns: minmax(0, 1fr) 260px; }
	.toc-aside { position: sticky; top: 1.5rem; align-self: start; }
}
.entry-head { max-width: var(--measure); }
.entry-meta { color: var(--muted); font-size: .92rem; margin-bottom: var(--s3); display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.entry-meta a { color: var(--muted); }
.entry-cat { display: inline-block; font-weight: 600; margin-bottom: .6rem; text-decoration: none; }
.entry-thumb img { border-radius: var(--r-s); width: 100%; aspect-ratio: 16/9; object-fit: cover; margin-bottom: var(--s3); }
.entry-content { max-width: var(--measure); }
.entry-content h2 { margin-top: var(--s4); }
.entry-content h3 { margin-top: var(--s3); }
.entry-content li { margin-bottom: .35rem; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .97rem; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.entry-content th { background: var(--surface); font-weight: 600; }
.entry-content blockquote { border-left: 4px solid var(--line); padding-left: var(--s2); color: var(--muted); }
.takeaways { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--signal); border-radius: var(--r-s); padding: var(--s2) var(--s3); margin-bottom: var(--s3); max-width: var(--measure); }
.takeaways h2 { font-size: 1.3rem; margin: 0 0 .5rem; }
.takeaways ul { margin: 0; padding-left: 1.2rem; }
.toc { font-size: .95rem; margin-bottom: var(--s3); max-width: var(--measure); }
.toc-aside { display: none; }
@media (min-width: 1080px) { .toc-aside { display: block; } .has-toc .toc-mobile { display: none; } }
.toc summary { font-family: var(--f-head); font-weight: 700; font-size: 1.15rem; cursor: pointer; }
.toc ol { padding-left: 1.2rem; margin: .6rem 0 0; }
.toc li { margin-bottom: .35rem; }
.toc a { color: var(--ink); }
.faq { max-width: var(--measure); margin-top: var(--s4); }
.faq details { border-top: 1px solid var(--line); padding: .8rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
.faq details p { margin: .6rem 0 0; }
.eco-box { max-width: var(--measure); margin: var(--s4) 0; padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.eco-box h2 { font-size: 1.5rem; }
.eco-box .eco-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.author-box { max-width: var(--measure); display: flex; gap: var(--s2); padding: var(--s3) 0; border-top: 1px solid var(--line); margin-top: var(--s4); }
.author-box img { border-radius: 50%; flex: none; }
.author-box p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }
.related { padding: var(--s4) 0; border-top: 1px solid var(--line); margin-top: var(--s3); }

/* ---------- Formularze ---------- */
.search-form { display: flex; gap: .5rem; max-width: 520px; }
.search-form input[type="search"] { flex: 1; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--ink); font: inherit; }
.btn, .search-form button { background: var(--road); color: var(--road-ink); border: 0; border-radius: var(--r-s); padding: .65rem 1.1rem; font: 600 1rem var(--f-body); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover, .search-form button:hover { background: var(--ink); color: var(--paper); }

/* ---------- Stopka ---------- */
.site-footer { background: var(--road); color: #C9D1D6; margin-top: var(--s5); padding: var(--s4) 0 var(--s3); font-size: .95rem; }
.site-footer a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s4); }
.foot-grid h2 { color: #fff; font-size: 1.2rem; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li { margin-bottom: .45rem; }
.foot-bottom { border-top: 1px solid #ffffff22; margin-top: var(--s3); padding-top: var(--s2); font-size: .85rem; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; gap: var(--s3); } }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .site-header, .site-footer, .toc-aside, .eco-box, .related { display: none; } }
