/*
Theme Name: dds_ashwaracing.com
Author: Илья Корнеев
Author URI: https://ashwaracing.com
Description: Контентно-сервисный сайт о рефинансировании кредитов с сильной экспертизой в автокредитах, потребительских займах и снижении долговой нагрузки.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dds_ashwaracing
*/

/* ========== Reset / base ========== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Merriweather', Georgia, serif;
    font-size: 16px;
    line-height: 1.65;
    color: #1F2937;
    background: #F8F9FA;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: #1E3A8A; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    color: #1E3A8A;
    line-height: 1.25;
    margin: 1.4em 0 0.6em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

/* tabular figures for numeric data */
table, .figs { font-variant-numeric: tabular-nums; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0 1.2em;
    background: #FFFFFF;
}
table th,
table td {
    border: 1px solid #E5E7EB;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
table th {
    background: #F1F4F9;
    color: #1E3A8A;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

blockquote {
    border-left: 4px solid #0F766E;
    margin: 1em 0;
    padding: 0.4em 1em;
    background: #F0FBF8;
    color: #134E4A;
}

code, pre {
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    background: #F1F4F9;
    border-radius: 4px;
}
code { padding: 1px 6px; font-size: 0.95em; }
pre { padding: 12px 14px; overflow-x: auto; }

hr {
    border: 0;
    height: 1px;
    background: #E5E7EB;
    margin: 1.6em 0;
}

/* ========== Layout ========== */
.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-main {
    padding: 28px 0 48px;
}

.layout-with-sidebar {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}
.layout-with-sidebar .content-area {
    flex: 0 0 67%;
    max-width: 67%;
    min-width: 0;
}
.layout-with-sidebar .sidebar {
    flex: 0 0 27%;
    max-width: 27%;
    min-width: 0;
}
.layout-no-sidebar .content-area {
    width: 85%;
    margin: 0 auto;
}

/* ========== Header ========== */
.site-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    padding: 16px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}
.brand-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: block;
}
.brand-text {
    display: flex;
    flex-direction: column;
}
.brand-name {
    font-family: 'JetBrains Mono', 'Inter', monospace;
    font-weight: 600;
    color: #1E3A8A;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    line-height: 1.1;
}
.brand-desc {
    font-size: 0.78rem;
    color: #6B7280;
    line-height: 1.3;
    max-width: 460px;
    margin-top: 4px;
}

/* primary nav */
.primary-nav {
    margin-left: auto;
}
.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.primary-nav a {
    font-family: 'Inter', sans-serif;
    color: #1F2937;
    font-size: 0.95rem;
    padding: 8px 4px;
    display: inline-block;
}
.primary-nav a:hover {
    color: #1E3A8A;
    text-decoration: none;
    border-bottom: 2px solid #1E3A8A;
    margin-bottom: -2px;
}
.primary-nav .current-menu-item > a {
    color: #1E3A8A;
    font-weight: 600;
}

/* mobile burger */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #1F2937;
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: 0;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
    font-size: 0.95rem;
}
.btn-primary {
    background: #1E3A8A;
    color: #FFFFFF;
}
.btn-primary:hover {
    background: #0F2B5C;
    color: #FFFFFF;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.25);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid #0F766E;
    color: #0F766E;
    padding: 8px 18px;
    border-radius: 8px;
}
.btn-outline:hover {
    background: #0F766E;
    color: #FFFFFF;
    text-decoration: none;
}
.btn-text {
    color: #1E3A8A;
    padding: 10px 0;
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}
.btn-text:hover { text-decoration: underline; }

/* ========== Cards ========== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 0 0 28px;
}

.card {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.18s, transform 0.18s;
}
.card:hover {
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}
.card-thumb {
    display: block;
    background: #EEF2F7;
}
.card-thumb img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}
.card-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    line-height: 1.3;
}
.card-title a { color: #1E3A8A; }
.card-meta {
    font-size: 0.82rem;
    color: #6B7280;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
}
.card-excerpt {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 14px;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-excerpt p:last-child { margin-bottom: 0; }
.card-actions { margin-top: auto; }

/* horizontal card variant (used on archive lists) */
.card-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.card-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: #EEF2F7;
}
.card-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========== Front page sections ========== */
.section {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 32px 32px 28px;
    margin: 0 0 28px;
}
.section-eyebrow {
    display: inline-block;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0F766E;
    margin-bottom: 8px;
}
.section h2 { margin-top: 0.2em; }

/* roadmap (timeline) */
.roadmap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 18px;
}
.roadmap-step {
    background: #F8F9FA;
    border-left: 4px solid #1E3A8A;
    border-radius: 6px;
    padding: 14px 16px;
}
.roadmap-step:nth-child(2) { border-left-color: #0F766E; }
.roadmap-step:nth-child(3) { border-left-color: #F59E0B; }
.roadmap-step:nth-child(4) { border-left-color: #1E3A8A; }
.roadmap-step .step-num {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #6B7280;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.roadmap-step h4 {
    margin: 4px 0 6px;
    font-size: 1rem;
    color: #111827;
}
.roadmap-step p {
    margin: 0;
    font-size: 0.9rem;
    color: #4B5563;
}

/* fact vs myth */
.fact-myth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 14px;
}
.fact-myth .col {
    border-radius: 10px;
    padding: 18px 22px;
    position: relative;
}
.fact-myth .col-myth {
    background: repeating-linear-gradient(45deg, #FEF2F2, #FEF2F2 8px, #FEE2E2 8px, #FEE2E2 16px);
    border: 1px solid #FECACA;
}
.fact-myth .col-fact {
    background: repeating-linear-gradient(45deg, #ECFDF5, #ECFDF5 8px, #D1FAE5 8px, #D1FAE5 16px);
    border: 1px solid #A7F3D0;
}
.fact-myth h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.fact-myth .col-myth h4 { color: #B91C1C; }
.fact-myth .col-fact h4 { color: #065F46; }
.fact-myth blockquote {
    border: none;
    background: rgba(255,255,255,0.7);
    margin: 0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* offer cards (clip-path) */
.offer-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-top: 14px;
}
.offer-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    padding: 20px 22px 28px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}
.offer-card .rate {
    font-family: 'Inter', sans-serif;
    font-size: 1.7rem;
    font-weight: 600;
    color: #1E3A8A;
    font-variant-numeric: tabular-nums;
}
.offer-card .save {
    font-size: 0.92rem;
    color: #0F766E;
    margin-bottom: 10px;
}

/* note badge — "we know engines" plate */
.expert-note {
    background: #F1F4F9;
    border-left: 3px solid #0F766E;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.92rem;
    color: #374151;
    margin: 1.4em 0;
}

/* warning callout (orange) */
.callout-warn {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-left: 4px solid #F59E0B;
    padding: 14px 18px;
    border-radius: 6px;
    margin: 1em 0;
    color: #78350F;
}

/* ========== Single / Page ========== */
.entry-header {
    margin-bottom: 18px;
}
.entry-title { margin: 0 0 8px; }
.entry-meta {
    color: #6B7280;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}
.entry-content {
    font-size: 1.02rem;
}
.entry-content img {
    border-radius: 8px;
    margin: 1em 0;
}

/* ========== Sidebar ========== */
.sidebar .widget {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.sidebar .widget-title,
.sidebar h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #1E3A8A;
}
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 6px 0; border-bottom: 1px solid #F1F4F9; }
.sidebar li:last-child { border-bottom: 0; }

/* ========== Breadcrumbs ========== */
.crumbs {
    font-family: 'Inter', sans-serif;
    font-size: 0.86rem;
    color: #6B7280;
    margin: 18px 0 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.crumbs a { color: #1E3A8A; }
.crumbs .sep { color: #9CA3AF; }
.crumbs .current { color: #374151; }

/* ========== Pagination ========== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin: 28px 0 12px;
    font-family: 'Inter', sans-serif;
}
.pager .page-numbers {
    display: inline-block;
    min-width: 38px;
    padding: 8px 12px;
    text-align: center;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #1E3A8A;
    border-radius: 6px;
    font-size: 0.92rem;
}
.pager .page-numbers:hover {
    background: #1E3A8A;
    color: #FFFFFF;
    text-decoration: none;
    border-color: #1E3A8A;
}
.pager .page-numbers.current {
    background: #1E3A8A;
    color: #FFFFFF;
    border-color: #1E3A8A;
}
.pager .page-numbers.dots:hover {
    background: #FFFFFF;
    color: #1E3A8A;
}

/* ========== Footer ========== */
.site-footer {
    background: #1B2230;
    color: #D1D5DB;
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.footer-cols .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
}
.footer-cols h2,
.footer-cols .widget-title {
    font-size: 1rem;
    color: #FFFFFF;
    margin: 0 0 12px;
}
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { padding: 4px 0; }
.footer-cols a { color: #D1D5DB; }
.footer-cols a:hover { color: #FFFFFF; }
.copyright {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid #2D3748;
    font-size: 0.85rem;
    color: #9CA3AF;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

/* ========== Comments ========== */
.comments-area { margin-top: 32px; }
.comments-area .comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}
.comments-area .comment-list li {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 12px;
}
.comments-area .comment-author {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #1E3A8A;
}
.comments-area .comment-date {
    color: #6B7280;
    font-size: 0.85rem;
}
.comment-respond textarea,
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #FFFFFF;
    margin-bottom: 12px;
}
.comment-respond textarea { min-height: 110px; resize: vertical; }
.comment-respond label { font-family: 'Inter', sans-serif; font-size: 0.9rem; color: #374151; }

/* ========== Search form ========== */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 520px;
    margin: 18px 0;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #FFFFFF;
}
.search-form button {
    background: #1E3A8A;
    color: #FFFFFF;
    border: 0;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}
.search-form button:hover { background: #0F2B5C; }

/* ========== 404 ========== */
.error-404 {
    text-align: center;
    padding: 40px 20px;
}
.error-404 .err-code {
    font-family: 'Inter', sans-serif;
    font-size: 5rem;
    font-weight: 700;
    color: #1E3A8A;
    line-height: 1;
    margin: 0;
}

/* ========== Cookie banner ==========
   Note (rule A11): the [hidden] override must come BEFORE the main block
   so that JS-driven hiding via element.hidden works even when authors set
   an explicit display value below.
*/
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: #1B2230;
    color: #F3F4F6;
    border-radius: 10px;
    padding: 16px 22px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}
.cookie-banner p { margin: 0; flex: 1 1 280px; }
.cookie-banner .btn {
    flex: 0 0 auto;
    background: #F59E0B;
    color: #1B2230;
}
.cookie-banner .btn:hover { background: #D97706; color: #FFFFFF; }

/* ========== Slider (front page hero, optional) ========== */
.hero-slider {
    background: linear-gradient(135deg, #1E3A8A 0%, #0F2B5C 100%);
    color: #FFFFFF;
    border-radius: 12px;
    padding: 36px 32px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.hero-slider .slide { display: none; }
.hero-slider .slide.is-active { display: block; }
.hero-slider h1 {
    color: #FFFFFF;
    margin-top: 0;
}
.hero-slider p { color: #DBE2F1; max-width: 720px; }
.hero-slider .slider-dots {
    margin-top: 16px;
    display: flex;
    gap: 8px;
}
.hero-slider .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    border: 0;
    padding: 0;
    cursor: pointer;
}
.hero-slider .dot.is-active { background: #F59E0B; }

/* ========== Responsive ========== */
@media (max-width: 960px) {
    .layout-with-sidebar { flex-direction: column; }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar {
        flex: 0 0 auto;
        max-width: 100%;
        width: 100%;
    }
    .layout-no-sidebar .content-area { width: 100%; }
    .roadmap { grid-template-columns: repeat(2, 1fr); }
    .footer-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 600px) {
    body { font-size: 15px; }
    h1 { font-size: 1.65rem; }
    h2 { font-size: 1.35rem; }
    .section { padding: 22px 18px; }

    .nav-toggle { display: inline-block; }
    .primary-nav {
        order: 3;
        flex: 1 1 100%;
    }
    .primary-nav ul {
        flex-direction: column;
        gap: 0;
        background: #FFFFFF;
        border: 1px solid #E5E7EB;
        border-radius: 8px;
        padding: 8px 0;
    }
    .primary-nav[hidden] { display: none !important; }
    .primary-nav li {
        border-bottom: 1px solid #F1F4F9;
    }
    .primary-nav li:last-child { border-bottom: 0; }
    .primary-nav a { display: block; padding: 10px 16px; }

    .roadmap { grid-template-columns: 1fr; }
    .fact-myth { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; }
    .posts-grid { grid-template-columns: 1fr; }

    /* horizontal card → vertical on mobile (rule A10) */
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .cookie-banner { padding: 14px 16px; }
}
