/*
Theme Name: CarSpotlight Portal
Theme URI: https://carspotlight.ru/
Description: Адаптивная тема автомобильного справочника CarSpotlight.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
Text Domain: carspotlight-portal
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
    --ink: #172431;
    --soft: #485865;
    --muted: #637383;
    --navy: #101e2a;
    --navy-light: #172b3b;
    --page: #edf2f6;
    --card: #fcfdfe;
    --line: #d7e0e8;
    --gold: #f4ba5b;
    --gold-hover: #ffd28b;
    --radius: 12px;
    --page-width: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 28px; }
body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 400 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .19em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 {
    color: inherit;
    font-weight: 400;
    line-height: 1.24;
    margin: 0;
    overflow-wrap: break-word;
}
h1, h2 { letter-spacing: -.034em; }
p { margin: 0; }
ul, ol { margin-block: 0; }
:focus-visible { outline: 2px solid #b66b00; outline-offset: 4px; }
[id] { scroll-margin-top: 22px; }
.csp-sr-only, .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}
.csp-skip {
    position: absolute;
    left: 12px;
    top: 10px;
    z-index: 99999;
    transform: translateY(-200%);
    padding: 10px 14px;
    color: var(--ink);
    background: var(--gold);
    border-radius: 6px;
}
.csp-skip:focus { transform: none; }
.csp-wrap { width: min(var(--page-width), calc(100% - 64px)); margin-inline: auto; }
.csp-header { background: var(--navy); color: #f2f6fb; }
.csp-masthead { min-height: 68px; display: flex; align-items: center; gap: 24px; }
.csp-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 11px; font-size: 23px; letter-spacing: -.05em; line-height: 1.2; text-decoration: none; }
.csp-brand-icon {
    width: 37px;
    height: 33px;
    border-radius: 8px;
    background: var(--gold);
    color: var(--navy);
    display: grid;
    place-items: center;
}
.csp-brand-icon svg { width: 23px; height: 23px; }
.csp-brand-tagline { padding-left: 22px; border-left: 1px solid #576675; color: #c0ccd8; font-size: 13px; }
.csp-header-search { margin-left: auto; width: min(100%, 305px); }
.csp-search {
    width: min(100%, 370px);
    display: flex;
    align-items: center;
    padding: 0 0 0 13px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
}
.csp-search input { flex: 1; width: 0; padding: 7px 0; min-width: 0; border: 0; background: transparent; font-size: 13px; }
.csp-search input::placeholder { color: #637383; }
.csp-search input:focus-visible { outline-offset: 0; }
.csp-search button { display: grid; place-items: center; width: 40px; height: 35px; border: 0; padding: 0; background: transparent; }
.csp-search button svg { width: 19px; height: 19px; }
.csp-search button:hover { color: #965a00; }
.csp-nav-band { border-top: 1px solid #2e404e; }
.csp-menu, .csp-menu .sub-menu, .csp-footer-menu { margin: 0; padding: 0; list-style: none; }
.csp-menu { display: flex; align-items: stretch; flex-wrap: wrap; gap: 7px 26px; }
.csp-menu li { position: relative; }
.csp-menu a { display: block; text-decoration: none; }
.csp-menu > li > a { padding: 12px 1px; border-bottom: 2px solid transparent; font-size: 14px; white-space: nowrap; }
.csp-menu > li > a:hover, .csp-menu > .current-menu-item > a, .csp-menu > .current-menu-ancestor > a { border-color: var(--gold); }
.csp-menu > .menu-item-has-children > a { padding-right: 26px; }
.csp-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: -10px;
    display: none;
    width: 220px;
    z-index: 12;
    padding: 6px;
    border: 1px solid #334957;
    border-radius: 8px;
    background: var(--navy-light);
    color: #f7fbff;
    box-shadow: 0 12px 26px #101e2a2e;
}
.csp-menu .sub-menu .sub-menu { top: -1px; left: 100%; }
.csp-menu .sub-menu a { padding: 8px 13px; border-radius: 4px; font-size: 14px; }
.csp-menu .sub-menu a:hover, .csp-menu .sub-menu a:focus-visible { background: #253f51; }
.csp-menu .menu-item-has-children:hover > .sub-menu,
html:not(.csp-js) .csp-menu .menu-item-has-children:focus-within > .sub-menu,
.csp-menu .has-open-menu > .sub-menu { display: block; }
.nav-submenu-button {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    width: 25px;
    height: 100%;
    max-height: 43px;
    background: transparent;
    border: 0;
    padding: 0;
    color: inherit;
}
.nav-submenu-button::after {
    content: "";
    width: 7px;
    height: 7px;
    transform: translateY(-2px) rotate(45deg);
    border-bottom: 1px solid currentColor;
    border-right: 1px solid currentColor;
}
.csp-menu .sub-menu .menu-item-has-children > a { padding-right: 27px; }
.csp-nav-toggle { display: none; }

.csp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(236px, 25%);
    align-items: start;
    gap: 26px;
    padding-block: 26px 58px;
}
.csp-main, .csp-sidebar { min-width: 0; }
.csp-hero {
    min-height: 335px;
    display: flex;
    align-items: center;
    isolation: isolate;
    overflow: hidden;
    position: relative;
    border-radius: var(--radius);
    background: var(--navy);
    color: #f6f9fd;
}
.csp-hero-picture, .csp-hero::after { position: absolute; inset: 0; z-index: -1; }
.csp-hero-picture img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: right center; }
.csp-hero::after { content: ""; background: linear-gradient(90deg, #0b1723e8 3%, #0b17238c 44%, transparent 76%); }
.csp-hero-content { padding: 35px clamp(24px, 3.6vw, 48px); max-width: min(100%, 570px); }
.csp-hero h1 { font-size: clamp(30px, 3.3vw, 48px); line-height: 1.13; font-weight: 400; letter-spacing: -.047em; text-wrap: balance; }
.csp-hero p { margin-top: 15px; max-width: 330px; color: #d9e4ed; font-size: 15px; }
.csp-hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.csp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.3;
    text-decoration: none;
}
.csp-button-primary { background: var(--gold); color: #19232c; }
.csp-button-primary:hover { background: var(--gold-hover); }
.csp-button-outline { background: #0e1c27b8; border-color: #91a0ac; color: #f8fbff; }
.csp-button-outline:hover { background: #314657; }
.csp-quick-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.csp-quick-links a {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    min-height: 84px;
    padding: 10px 5px;
    text-decoration: none;
    text-align: center;
    font-size: 14px;
    line-height: 1.25;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 9px;
}
.csp-quick-links svg { width: 27px; height: 27px; color: #283f51; }
.csp-quick-links a:hover { background: #fff7e8; border-color: #dfb978; }
.csp-section { margin-top: 32px; }
.csp-section-heading { display: flex; justify-content: space-between; align-items: baseline; column-gap: 18px; row-gap: 8px; margin-bottom: 14px; }
.csp-section h2, .csp-side-panel h2 { font-size: clamp(22px, 2.35vw, 28px); font-weight: 400; }
.csp-section-heading h2::after { content: ""; display: block; margin-top: 10px; width: 29px; height: 2px; background: #cf8c25; }
.csp-text-link { color: #244358; white-space: nowrap; font-size: 13px; text-decoration-color: #8196a5; }
.csp-recommend { display: grid; grid-template-columns: 1.16fr 1fr; gap: 13px; }
.csp-lead-story, .csp-mini-story, .csp-story-card { min-width: 0; }
.csp-lead-story { display: grid; min-height: 255px; }
.csp-lead-story > a {
    display: grid;
    align-items: end;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: var(--radius);
    text-decoration: none;
    color: #fff;
    background: var(--navy-light);
}
.csp-lead-story > a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, #07121bf5, #0a17207a 42%, transparent 80%);
}
.csp-lead-image { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; object-fit: cover; }
.csp-lead-copy { padding: 20px 21px; }
.csp-lead-copy h3 { margin-top: 8px; font-size: clamp(19px, 1.85vw, 25px); line-height: 1.24; }
.csp-story-label { display: inline-block; background: var(--gold); border-radius: 5px; padding: 3px 8px; color: #18252e; font-size: 11px; }
.csp-recommend-list { display: grid; grid-auto-rows: 1fr; gap: 11px; }
.csp-mini-story a, .csp-story-card a {
    display: grid;
    height: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
}
.csp-mini-story a { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: 12px; min-height: 121px; padding: 7px; }
.csp-mini-image { width: 100%; height: 100%; min-height: 100px; max-height: 145px; display: block; object-fit: cover; border-radius: 6px; }
.csp-mini-story h3 { font-size: 15px; line-height: 1.4; padding-right: 6px; }
.csp-mini-story a:hover, .csp-story-card a:hover { background: #fff; border-color: #8fa3b2; }
.csp-lead-story a:hover h3, .csp-mini-story a:hover h3, .csp-story-card a:hover :is(h2, h3) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .16em; }

.csp-sidebar { align-self: start; }
.csp-side-panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.csp-side-panel h2 { font-size: 23px; padding-bottom: 14px; }
.csp-popular { margin: 0; padding: 0; list-style: none; }
.csp-popular li { border-top: 1px solid var(--line); }
.csp-popular a { display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 0; text-decoration: none; font-size: 14px; line-height: 1.33; }
.csp-popular li:last-child a { padding-bottom: 0; }
.csp-popular a:hover span:last-child { text-decoration: underline; }
.csp-popular-image { width: 74px; height: 54px; display: block; object-fit: cover; border-radius: 6px; }
.csp-image-placeholder { background: #e1e9ef; color: #547185; display: grid; place-items: center; }
.csp-image-placeholder svg { width: 27px; height: 27px; }
.csp-lead-image.csp-image-placeholder { background: var(--navy-light); color: #7d97a9; }
.csp-lead-image.csp-image-placeholder svg { width: 65px; height: 65px; }

.csp-technical { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.csp-technical-panel {
    display: flex;
    flex-direction: column;
    align-items: start;
    isolation: isolate;
    position: relative;
    overflow: hidden;
    padding: 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.csp-technical-panel h2 { font-size: clamp(21px, 1.9vw, 25px); }
.csp-technical-panel .csp-text-link { display: inline-block; margin-top: auto; padding-top: 8px; }
.csp-technical-dark { background: var(--navy-light); border-color: var(--navy-light); color: #eff6fc; }
.csp-technical-dark .csp-text-link { color: #ffcb78; text-decoration-color: #cbab77; }
.csp-technical-decoration { position: absolute; right: -25px; bottom: -35px; z-index: -1; width: 178px; color: #769eb587; opacity: .43; stroke-width: .45; transform: rotate(-13deg); }
.csp-link-list { list-style: none; margin-top: 9px; width: 100%; padding: 0; }
.csp-link-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.41; }
.csp-link-list a { text-decoration: none; }
.csp-link-list a:hover { text-decoration: underline; }
.csp-link-list time { white-space: nowrap; color: var(--muted); font-size: 11px; }
.csp-technical-dark .csp-link-list li { justify-content: flex-start; border-color: #d5e4ef26; }
.csp-technical-dark .csp-link-list li::before { content: ""; width: 4px; height: 4px; margin-top: 7px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }

.csp-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.csp-story-card a { display: flex; flex-direction: column; overflow: hidden; }
.csp-card-image { display: block; width: 100%; aspect-ratio: 1.9; object-fit: cover; }
.csp-card-image.csp-image-placeholder { display: grid; }
.csp-card-copy { padding: 13px 15px 16px; }
.csp-card-copy :is(h2, h3) { font-size: 16px; line-height: 1.4; letter-spacing: -.011em; }
.csp-card-copy time { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.csp-about { padding: clamp(19px, 2.7vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.csp-about > p { margin-top: 12px; max-width: 72ch; color: var(--soft); font-size: 15px; }
.csp-about .csp-search { margin-top: 18px; }
.csp-answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 19px; margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line); }
.csp-answers h3 { font-size: 16px; }
.csp-answers p { margin-top: 7px; color: var(--soft); font-size: 13px; line-height: 1.55; }
.csp-all-archive { margin-top: 18px; }
.csp-footer { background: var(--navy); color: #e9f2fb; }
.csp-footer-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 15px 26px; min-height: 81px; padding-block: 17px; }
.csp-footer .csp-brand { font-size: 19px; }
.csp-footer .csp-brand-icon { width: 31px; height: 29px; }
.csp-footer .csp-brand-icon svg { width: 20px; height: 20px; }
.csp-footer-menu { display: flex; column-gap: 19px; row-gap: 8px; flex-wrap: wrap; }
.csp-footer-menu a { color: #d5e2ec; font-size: 13px; text-decoration: none; }
.csp-footer-menu a:hover { text-decoration: underline; }
.csp-copyright { margin-left: auto; color: #becbd5; font-size: 12px; }
.csp-metrika-pixel { position: absolute; left: -9999px; }

.csp-archive-header, .csp-article-header { margin-bottom: 20px; }
.csp-archive-header h1, .csp-article-header h1, .csp-about h1 { font-size: clamp(28px, 3.35vw, 42px); text-wrap: pretty; }
.csp-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 9px; color: var(--muted); font-size: 13px; }
.csp-article-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.csp-archive-description { margin-top: 10px; color: var(--soft); }
.csp-article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: clamp(18px, 3.2vw, 42px); }
.csp-article-cover { margin: 0 0 22px; }
.csp-article-cover img { display: block; border-radius: 8px; }
.csp-entry { overflow-wrap: anywhere; font-size: 17px; }
.csp-entry > * + * { margin-block-start: 1.05em; }
.csp-entry :is(h2, h3, h4) { margin-block-start: 1.35em; }
.csp-entry h2 { font-size: 27px; }
.csp-entry h3 { font-size: 22px; }
.csp-entry li + li { margin-top: .28em; }
.csp-entry img, .csp-entry iframe { max-width: 100%; }
.csp-entry figure { max-width: 100%; margin-inline: 0; }
.csp-entry figcaption, .csp-entry .wp-caption-text { color: var(--muted); font-size: 13px; }
.csp-entry blockquote { padding: 10px 16px; margin-inline: 0; border-left: 3px solid var(--gold); background: var(--page); }
.csp-entry table { max-width: 100%; border-collapse: collapse; font-size: 15px; }
.csp-entry :is(td, th) { padding: 7px; border: 1px solid var(--line); }
.csp-entry pre { overflow: auto; padding: 10px; }
.csp-entry a { color: #23516e; }
.csp-entry .alignleft { float: left; margin: 0 1em 1em 0; }
.csp-entry .alignright { float: right; margin: 0 0 1em 1em; }
.csp-entry .aligncenter { display: block; margin-inline: auto; }
.csp-entry::after { display: block; clear: both; content: ""; }
.csp-page-links, .csp-tags { margin-top: 18px; color: var(--soft); font-size: 13px; }
.csp-empty { margin-bottom: 14px; }
.pagination { margin-top: 21px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.pagination .page-numbers { padding: 6px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 5px; text-decoration: none; }
.pagination .current { background: #ffd89e; border-color: #e2a753; }
.csp-comment-list { margin-top: 12px; }
.comment-respond { margin-top: 15px; }
.comment-form textarea { width: 100%; }

@media (max-width: 1080px) {
    .csp-wrap { width: calc(100% - 44px); }
    .csp-layout { gap: 18px; }
    .csp-hero { min-height: 310px; }
    .csp-hero-content { padding-inline: 24px; }
    .csp-side-panel { padding-inline: 14px; }
    .csp-popular a { grid-template-columns: 65px minmax(0, 1fr); gap: 9px; font-size: 13px; }
    .csp-popular-image { width: 65px; height: 49px; }
}

@media (max-width: 870px) {
    .csp-wrap { width: calc(100% - 32px); }
    .csp-layout { grid-template-columns: minmax(0, 1fr); gap: 27px; padding-top: 16px; padding-bottom: 39px; }
    .csp-sidebar .csp-popular { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 19px; }
    .csp-popular li:last-child a { padding-bottom: 10px; }
    .csp-hero { min-height: 300px; }
    .csp-hero h1 { font-size: clamp(31px, 6vw, 43px); }
}

@media (max-width: 640px) {
    .csp-wrap { width: calc(100% - 28px); }
    .csp-masthead { min-height: 59px; gap: 9px 13px; flex-wrap: wrap; padding-block: 11px; }
    .csp-brand { font-size: 21px; }
    .csp-brand-tagline { display: none; }
    .csp-header-search { order: 3; margin: 0; width: 100%; }
    .csp-header-search .csp-search { width: 100%; }
    .csp-js .csp-nav-toggle {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        color: #f0f6fb;
        background: transparent;
        border: 1px solid #5c6f7d;
        border-radius: 6px;
        padding: 4px 8px;
        margin-left: auto;
        font-size: 13px;
    }
    .csp-nav-toggle svg { width: 19px; height: 19px; }
    .csp-js .csp-navigation:not(.is-open) { display: none; }
    .csp-menu { display: block; padding-bottom: 9px; }
    .csp-menu > li > a { padding: 9px 0; border-bottom: 1px solid #3e5160; }
    .csp-navigation .sub-menu {
        position: static;
        width: auto;
        min-width: 0;
        box-shadow: none;
        margin: 4px 0 7px;
        padding: 3px;
    }
    .csp-js .csp-menu .menu-item-has-children:not(.has-open-menu) > .sub-menu { display: none; }
    .csp-menu .sub-menu .sub-menu { left: auto; }
    .nav-submenu-button { width: 39px; height: 38px; }
    .csp-hero { min-height: 305px; align-items: end; }
    .csp-hero-content { padding: 22px 17px; }
    .csp-hero-picture img { object-position: 72% center; }
    .csp-hero::after { background: linear-gradient(0deg, #091722fa 5%, #091722ad 53%, #09172217 90%); }
    .csp-hero h1 { font-size: clamp(30px, 7.7vw, 40px); }
    .csp-hero p { margin-top: 9px; font-size: 13px; }
    .csp-hero-actions { margin-top: 14px; gap: 7px; }
    .csp-button { padding-inline: 10px; }
    .csp-desktop-break { display: none; }
    .csp-quick-links { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    .csp-quick-links a { min-height: 66px; font-size: 12px; }
    .csp-quick-links svg { width: 22px; height: 22px; }
    .csp-section { margin-top: 25px; }
    .csp-section-heading { flex-wrap: wrap; }
    .csp-recommend, .csp-technical { grid-template-columns: minmax(0, 1fr); }
    .csp-lead-story { min-height: 225px; }
    .csp-mini-story a { min-height: 92px; grid-template-columns: minmax(0, .65fr) minmax(0, 1.35fr); }
    .csp-mini-image { min-height: 78px; max-height: 102px; }
    .csp-answers { grid-template-columns: minmax(0, 1fr); gap: 13px; }
    .csp-card-grid { gap: 8px; }
    .csp-card-copy { padding: 8px 9px 12px; }
    .csp-card-copy :is(h2, h3) { font-size: 14px; }
    .csp-side-panel { padding: 14px; }
    .csp-sidebar .csp-popular { grid-template-columns: minmax(0, 1fr); }
    .csp-popular a { font-size: 14px; }
    .csp-copyright { margin-left: 0; }
    .csp-entry { font-size: 16px; }
    .csp-entry table { display: block; overflow-x: auto; }
}

@media (max-width: 360px) {
    .csp-wrap { width: calc(100% - 20px); }
    .csp-hero h1 { font-size: 28px; }
    .csp-quick-links a { font-size: 11px; }
    .csp-card-grid { grid-template-columns: minmax(0, 1fr); }
}
