/*
Theme Name: АвтоТрай Pro
Description: Современная редакционная тема для автомобильных новостей, обзоров и практических материалов.
Version: 1.0.0
Requires at least: 7.0.2
Tested up to: 7.0.2
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: autotry-pro
Tags: blog, news, custom-logo, custom-menu, featured-images, translation-ready, accessibility-ready, wide-blocks
*/

:root {
	--color-background: #f3f0e9;
	--color-surface: #ffffff;
	--color-panel: #e7e2d8;
	--color-text: #111820;
	--color-muted: #69747f;
	--color-accent: #ef4d23;
	--color-accent-strong: #c83212;
	--color-signal: #ffc857;
	--color-border: #c8c2b7;
	--font-sans: Inter, Arial, Helvetica, system-ui, sans-serif;
	--radius-small: 0.15rem;
	--radius-large: 0.35rem;
	--shadow-card: 0.55rem 0.55rem 0 rgba(17, 24, 32, 0.09);
	--space-section: clamp(3rem, 7vw, 6.5rem);
	--content-width: 78rem;
	--reading-width: 48rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--color-background); color: var(--color-text); font-family: var(--font-sans); font-size: 1rem; line-height: 1.62; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--color-accent-strong); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0.2rem solid var(--color-accent); outline-offset: 0.2rem; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.7em; font-family: var(--font-sans); font-weight: 850; line-height: 1.03; letter-spacing: -0.035em; }
p { margin: 0 0 1.25em; }
.site-container { width: min(100% - 2rem, var(--content-width)); margin-inline: auto; }
.narrow-content { max-width: var(--reading-width); }
.site-main { min-height: 55vh; padding-block: clamp(2rem, 5vw, 5rem); }
.homepage-main { padding-block: 0; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { top: .5rem; left: .5rem; z-index: 100000; width: auto; height: auto; padding: .75rem 1rem; clip: auto; background: var(--color-surface); color: var(--color-text); }

.site-header { position: relative; z-index: 10; background: var(--color-text); color: #fff; }
.site-header__roadline { height: .45rem; background: repeating-linear-gradient(115deg, var(--color-accent) 0 5rem, var(--color-signal) 5rem 6.25rem, transparent 6.25rem 7rem); }
.site-header__inner { display: flex; min-height: 6.4rem; align-items: center; justify-content: space-between; gap: 2rem; }
.site-branding { position: relative; padding-left: 1.1rem; border-left: .45rem solid var(--color-accent); }
.site-title { margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 950; letter-spacing: -.07em; text-transform: uppercase; }
.site-title a { color: #fff; text-decoration: none; }
.site-description { max-width: 34rem; margin: .25rem 0 0; color: #bbc2c8; font-size: .84rem; }
.custom-logo { max-height: 4.8rem; width: auto; }
.primary-navigation { position: relative; }
.primary-menu, .footer-menu { display: flex; align-items: center; gap: 1.35rem; margin: 0; padding: 0; list-style: none; }
.primary-menu a { color: #fff; font-size: .88rem; font-weight: 760; text-decoration: none; text-transform: uppercase; letter-spacing: .045em; }
.primary-menu a:hover { color: var(--color-signal); }
.menu-toggle { display: none; padding: .65rem .9rem; border: 1px solid #4a535d; border-radius: 0; background: transparent; color: #fff; font: inherit; }

.home-section { position: relative; padding-block: var(--space-section); }
.home-section--news, .home-section--legal, .home-section--moto { background: var(--color-surface); }
.home-section--test_drives, .home-section--sport { background: var(--color-text); color: #fff; }
.home-ad-slot { min-height: 1px; background: var(--color-background); }
.home-ad-slot__pair { display: grid; gap: 1rem; }
.section-heading { display: flex; align-items: end; gap: 1rem; margin-bottom: 2rem; border-bottom: .32rem solid currentColor; }
.section-heading::after { content: ""; width: clamp(3rem, 10vw, 9rem); height: .55rem; margin-left: auto; background: var(--color-accent); clip-path: polygon(8% 0,100% 0,92% 100%,0 100%); }
.section-heading h2 { margin: 0 0 .65rem; font-size: clamp(2rem, 5vw, 4.5rem); text-transform: uppercase; }

.post-grid, .post-collection--grid .post-collection__items { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(1rem,2.5vw,2rem); }
.category .post-grid > .post-card { order: var(--archive-position-order, 0); }
.category-inline-ad { min-width: 0; grid-column: 1 / -1; }
.category-inline-ad--first { order: 35; }
.category-inline-ad--second { order: 65; }
.post-collection--list .post-collection__items { display: grid; gap: 0; border-top: 2px solid currentColor; }
.post-collection--list .post-card { display: grid; grid-template-columns: minmax(11rem,.32fr) 1fr; align-items: stretch; border-width: 0 0 1px; box-shadow: none; }
.post-collection--list .post-card__image, .post-collection--list .post-card__placeholder { aspect-ratio: 16/8; }
.post-collection--featured-with-list .post-collection__items { display: grid; grid-template-columns: minmax(0,1.45fr) repeat(2,minmax(0,.65fr)); gap: 1.2rem; }
.post-collection--featured-with-list .post-card--featured { grid-row: span 2; }

.post-card { overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-large); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-card); }
.post-card__image { display: block; aspect-ratio: 16/10; overflow: hidden; background: #d8d5ce; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.88) contrast(1.04); transition: transform 180ms ease; }
.post-card:hover .post-card__image img { transform: scale(1.025); }
.post-card__placeholder { position: relative; aspect-ratio: 16/10; background: linear-gradient(145deg,#202a34 0 48%,#ef4d23 48% 54%,#c8c2b7 54%); }
.post-card__placeholder::after { content: ""; position: absolute; inset: 18% 12%; border: 1px solid rgba(255,255,255,.28); transform: skewX(-12deg); }
.post-card__body { padding: clamp(1rem,2vw,1.5rem); }
.post-card__category { display: inline-flex; margin-bottom: .7rem; padding: .18rem .55rem; background: var(--color-accent); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-decoration: none; text-transform: uppercase; }
.post-card__title { margin: 0; font-size: clamp(1.2rem,2vw,1.8rem); }
.post-card__title a { color: inherit; text-decoration: none; }
.post-card__excerpt { margin-top: 1rem; color: var(--color-muted); }
.post-card__excerpt > :last-child { margin-bottom: 0; }

.home-hero { overflow: hidden; padding-block: 0; background: var(--color-text); color: #fff; }
.home-hero::after { content: ""; position: absolute; right: -4rem; bottom: -3rem; width: 18rem; height: 7rem; border-top: 1rem solid var(--color-signal); transform: rotate(-10deg); opacity: .85; }
.home-hero .site-container { width: min(100%, 92rem); }
.home-hero .post-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; color: inherit; }
.home-hero .post-card__category { background: var(--color-signal); color: var(--color-text); }
.home-hero .post-card__title { max-width: 14ch; font-size: clamp(2.5rem,7vw,6.6rem); text-transform: uppercase; }
.home-hero .post-card__title a { color: inherit; }
.home-hero .post-card__excerpt { max-width: 42rem; color: #d5d9dc; font-size: 1.08rem; }
.home-hero--split .post-card { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; }
.home-hero--split .post-card__image, .home-hero--split .post-card__placeholder { min-height: 34rem; }
.home-hero--cover .post-card { position: relative; min-height: min(78vh,55rem); display: grid; align-items: end; }
.home-hero--cover .post-card__image, .home-hero--cover .post-card__placeholder { position: absolute; inset: 0 0 0 38%; height: 100%; opacity: .62; clip-path: polygon(12% 0,100% 0,100% 100%,0 100%); }
.home-hero--cover .post-card__image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,var(--color-text),transparent 65%); }
.home-hero--cover .post-card__body { position: relative; z-index: 1; width: min(100% - 2rem,var(--content-width)); margin-inline: auto; padding: clamp(4rem,9vw,8rem) 0; }

.home-section--news .post-card__image, .home-section--news .post-card__placeholder, .home-section--legal .post-card__image, .home-section--legal .post-card__placeholder { max-height: 8rem; }
.home-section--news .post-card__title, .home-section--legal .post-card__title, .home-section--moto .post-card__title { font-size: clamp(1.05rem,2vw,1.5rem); }
.home-section--test_drives .post-card, .home-section--sport .post-card { border-color: #3b4650; background: #1b252e; color: #fff; box-shadow: .5rem .5rem 0 rgba(239,77,35,.22); }
.home-section--test_drives .post-card__category, .home-section--sport .post-card__category { background: var(--color-signal); color: var(--color-text); }
.home-section--moto { border-top: .7rem solid var(--color-signal); }

.content-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(16rem,.3fr); gap: clamp(2rem,5vw,5rem); }
.primary-sidebar .widget { margin-bottom: 1.5rem; padding: 1.2rem; border: 1px solid var(--color-border); border-left: .35rem solid var(--color-accent); background: var(--color-surface); }
.entry-title, .archive-title { font-size: clamp(2.2rem,6vw,5.5rem); text-transform: uppercase; }
.entry-featured-image { margin: 2rem 0; border-bottom: .5rem solid var(--color-accent); }
.entry-content, .page-entry { max-width: var(--reading-width); }
.entry-content > * { max-width: 100%; }
.archive-header { margin-bottom: 3rem; padding-bottom: 1.3rem; border-bottom: .45rem solid var(--color-text); }
.navigation.pagination { margin-top: 3rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.page-numbers, .button { display: inline-flex; padding: .65rem 1rem; border: 1px solid var(--color-border); border-radius: 0; background: var(--color-surface); color: var(--color-text); text-decoration: none; }
.page-numbers.current, .button { border-color: var(--color-accent); background: var(--color-accent); color: #fff; }
.empty-state { padding: 2rem; border: 1px dashed var(--color-border); background: rgba(255,255,255,.5); }
.eyebrow { color: var(--color-accent); font-size: .8rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.site-footer { padding-block: 4rem 2rem; border-top: .65rem solid var(--color-accent); background: var(--color-text); color: #fff; }
.site-footer a { color: inherit; }
.site-footer__grid { display: grid; grid-template-columns: minmax(0,1.4fr) repeat(2,minmax(10rem,.7fr)); gap: 2rem; }
.site-footer__section h2 { font-size: 1.05rem; text-transform: uppercase; }
.site-footer__about h2 { color: var(--color-signal); font-size: clamp(1.8rem,4vw,3.3rem); }
.site-footer .footer-menu { align-items: flex-start; flex-direction: column; gap: .65rem; }
.footer-widgets { display: grid; grid-template-columns: repeat(3,1fr); gap: 2rem; }
.footer-widgets, .site-footer__bottom { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #3c4650; }
.site-info { margin: 0; color: #b6bec5; }

.utility-page__article { display: grid; grid-template-columns: minmax(14rem,.52fr) minmax(0,1fr); gap: clamp(2rem,5vw,5rem); }
.utility-page__header { padding-top: 1rem; border-top: .5rem solid var(--color-accent); }
.utility-page__body { max-width: var(--reading-width); font-size: 1.06rem; }
.category-navigation { margin-top: clamp(3rem,7vw,6rem); padding-top: 2rem; border-top: .35rem solid var(--color-text); }
.category-navigation__list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; margin: 0; padding: 0; list-style: none; }
.category-navigation__list a { display: block; min-height: 100%; padding: 1rem; border-left: .35rem solid var(--color-accent); background: var(--color-surface); color: var(--color-text); font-weight: 750; text-decoration: none; }
.not-found { position: relative; overflow: hidden; padding: clamp(2rem,6vw,5rem); background: var(--color-text); color: #fff; }
.not-found::after { content: ""; position: absolute; right: -5rem; bottom: 1rem; width: 18rem; border-top: 1rem solid var(--color-signal); transform: rotate(-13deg); }

input, textarea, select, button { font: inherit; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], textarea, select { width: 100%; padding: .75rem .85rem; border: 1px solid var(--color-border); border-radius: 0; background: var(--color-surface); color: var(--color-text); }

@media (max-width: 56rem) {
	.menu-toggle { display: inline-flex; }
	.primary-menu { display: none; position: absolute; top: calc(100% + .75rem); right: 0; min-width: 16rem; flex-direction: column; align-items: stretch; padding: 1rem; border: 1px solid #3c4650; background: var(--color-text); box-shadow: var(--shadow-card); }
	.primary-navigation.is-open .primary-menu { display: flex; }
	.content-layout, .home-hero--split .post-card { grid-template-columns: 1fr; }
	.home-hero--split .post-card__image, .home-hero--split .post-card__placeholder { min-height: 18rem; }
	.home-hero--cover .post-card__image, .home-hero--cover .post-card__placeholder { left: 25%; opacity: .42; }
	.post-grid, .post-collection--grid .post-collection__items, .post-collection--featured-with-list .post-collection__items { grid-template-columns: repeat(2,minmax(0,1fr)); }
	.category-inline-ad--first { order: 45; }
	.category-inline-ad--second { order: 85; }
	.post-collection--featured-with-list .post-card--featured { grid-column: 1/-1; grid-row: auto; }
	.site-footer__grid, .utility-page__article { grid-template-columns: 1fr; }
	.category-navigation__list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 36rem) {
	.site-header__inner { align-items: flex-start; padding-block: 1rem; }
	.site-title { font-size: 2rem; }
	.site-description { display: none; }
	.home-hero--cover .post-card { min-height: 38rem; }
	.home-hero--cover .post-card__image, .home-hero--cover .post-card__placeholder { inset: 0; clip-path: none; opacity: .34; }
	.post-grid, .post-collection--grid .post-collection__items, .post-collection--featured-with-list .post-collection__items { grid-template-columns: 1fr; }
	.category-inline-ad--first { order: 25; }
	.category-inline-ad--second { order: 65; }
	.post-collection--list .post-card { grid-template-columns: minmax(7rem,.34fr) 1fr; }
	.post-collection--list .post-card__body { padding: .85rem; }
	.footer-widgets, .category-navigation__list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
