/* ============================================================================
   Atara SEO Pages — Design System
   Стилизирано в съответствие с основния site дизайн (Montserrat font, clean palette).
   Focus: Core Web Vitals (LCP < 2.5s), trust signals, mobile-perfect.
   ============================================================================ */

:root {
    --color-text: #111111;
    --color-body: #333333;
    --color-muted: #6b7280;
    --color-line: #e5e7eb;
    --color-bg: #ffffff;
    --color-panel: #f7f9fc;
    --color-accent: #1c3a6e;       /* Atara navy */
    --color-accent-hover: #2447a0;
    --color-success: #047857;
    --color-warning: #b45309;
    --color-danger: #b91c1c;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
    --radius: 10px;
    --max-width: 1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-body);
    line-height: 1.65;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

/* ===== Typography ===== */
h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0;
}
h1 { font-size: 36px; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 24px; margin: 32px 0 14px; }
h3 { font-size: 18px; margin: 20px 0 10px; }
h4 { font-size: 16px; margin: 16px 0 8px; }
p { margin: 0 0 14px; font-size: 15px; line-height: 1.7; }
strong { font-weight: 700; color: var(--color-text); }

/* ===== Top Header ===== */
.seo-topbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-line);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.95);
}
.seo-topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}
.seo-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.02em;
}
.seo-logo:hover { color: var(--color-text); text-decoration: none; }
.seo-logo img { height: 36px; width: auto; }
.seo-topnav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
}
.seo-topnav a {
    color: var(--color-muted);
    font-weight: 500;
}
.seo-topnav a:hover { color: var(--color-text); }
.seo-cta {
    background: var(--color-accent);
    color: white !important;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13.5px;
    transition: background 0.15s;
}
.seo-cta:hover { background: var(--color-accent-hover); text-decoration: none; }

/* ===== Layout ===== */
.seo-main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 30px 24px 60px;
}

/* ===== Breadcrumbs ===== */
.seo-bc {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}
.seo-bc a { color: var(--color-muted); }
.seo-bc a:hover { color: var(--color-text); }
.seo-bc .sep { color: #cbd5e1; user-select: none; }
.seo-bc .last { color: var(--color-text); font-weight: 600; }

/* ===== Article header (trust block) ===== */
.seo-article-head {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-line);
}
.seo-eyebrow {
    display: inline-block;
    font-size: 11.5px;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding: 4px 10px;
    background: #eef2f9;
    border-radius: 100px;
}
.seo-lede {
    font-size: 18px;
    color: var(--color-body);
    line-height: 1.6;
    margin: 0 0 20px;
    max-width: 800px;
}
.seo-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    color: var(--color-muted);
    font-size: 13px;
}
.seo-meta-author {
    display: flex;
    align-items: center;
    gap: 8px;
}
.seo-meta-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-accent);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.05em;
}
.seo-meta-author strong { color: var(--color-text); font-weight: 600; }
.seo-meta-dot { color: #cbd5e1; }
.seo-meta-date strong { color: var(--color-text); font-weight: 600; }

/* ===== KPI cards ===== */
.seo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 0 0 30px;
}
.seo-kpi {
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 20px 22px;
    transition: border-color 0.15s;
}
.seo-kpi:hover { border-color: #cbd5e1; }
.seo-kpi-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}
.seo-kpi-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.seo-kpi-sub {
    font-size: 12.5px;
    color: var(--color-muted);
    margin-top: 6px;
}

/* ===== Content cards ===== */
.seo-card {
    background: var(--color-bg);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 28px 32px;
    margin: 0 0 18px;
    box-shadow: var(--shadow-card);
}
.seo-card h2 { margin-top: 0; }

/* ===== Tables ===== */
.seo-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0 0;
    font-size: 14px;
}
.seo-table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    font-weight: 700;
    background: var(--color-panel);
    border-bottom: 1px solid var(--color-line);
}
.seo-table th:last-child, .seo-table td:last-child { text-align: right; }
.seo-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--color-line);
    color: var(--color-body);
}
.seo-table td strong { color: var(--color-text); }
.seo-table tr:last-child td { border-bottom: none; }
.seo-table tr:hover td { background: #f9fafb; }

/* ===== Lists (offers, dealers) ===== */
.seo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.seo-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-line);
    line-height: 1.55;
}
.seo-list li:last-child { border-bottom: none; }
.seo-list li strong { color: var(--color-text); }

/* ===== FAQ ===== */
.seo-faq dt {
    font-weight: 700;
    color: var(--color-text);
    font-size: 16px;
    margin: 20px 0 8px;
    line-height: 1.4;
}
.seo-faq dt::before { content: "Въпрос: "; color: var(--color-accent); font-weight: 700; }
.seo-faq dd {
    margin: 0 0 8px;
    color: var(--color-body);
    line-height: 1.7;
}
.seo-faq dd::before { content: "Отговор: "; color: var(--color-muted); font-weight: 600; font-size: 13px; display: block; margin-bottom: 4px; }

/* ===== Tags ===== */
.seo-tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 12px;
    background: var(--color-panel);
    color: var(--color-muted);
    border-radius: 100px;
    font-weight: 600;
    margin-right: 6px;
}

/* ===== Related links section (internal SEO) ===== */
.seo-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 14px;
    margin-top: 14px;
}
.seo-related-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--color-panel);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.seo-related-link:hover {
    background: #eef2f9;
    color: var(--color-accent);
    text-decoration: none;
}
.seo-related-link .seo-related-count {
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 500;
}

/* ===== Trust badges row (above main content) ===== */
.seo-trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f0f7ff 0%, #f7fafc 100%);
    border: 1px solid #dbeafe;
    border-radius: var(--radius);
}
.seo-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--color-line);
    border-radius: 100px;
    font-size: 13px;
    color: var(--color-text);
    font-weight: 600;
}
.seo-trust-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--color-accent);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}
.seo-trust-badge.success .seo-trust-badge-icon { background: var(--color-success); }
.seo-trust-badge.warning .seo-trust-badge-icon { background: var(--color-warning); }
.seo-trust-badge-text strong { color: var(--color-text); }
.seo-trust-badge-text span { color: var(--color-muted); }

@media (max-width: 767px) {
    .seo-trust-badges { padding: 12px 14px; gap: 8px; }
    .seo-trust-badge { padding: 5px 10px; font-size: 12px; }
}

/* ===== Trust footer (methodology + disclaimer) ===== */
.seo-trust-block {
    background: var(--color-panel);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin: 30px 0;
    font-size: 13.5px;
    color: var(--color-muted);
    line-height: 1.7;
}
.seo-trust-block h4 {
    color: var(--color-text);
    margin: 0 0 8px;
    font-size: 14px;
}
.seo-trust-block strong { color: var(--color-text); }

/* ===== Site footer ===== */
.seo-foot {
    margin-top: 60px;
    background: #fafbfc;
    border-top: 1px solid var(--color-line);
    padding: 36px 24px;
}
.seo-foot-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}
.seo-foot-brand p { font-size: 13.5px; color: var(--color-muted); margin: 10px 0 0; }
.seo-foot h5 {
    color: var(--color-text);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 14px;
}
.seo-foot ul { list-style: none; padding: 0; margin: 0; }
.seo-foot ul li { margin-bottom: 8px; font-size: 14px; }
.seo-foot ul a { color: var(--color-muted); }
.seo-foot ul a:hover { color: var(--color-text); }
.seo-foot-bottom {
    max-width: var(--max-width);
    margin: 30px auto 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--color-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--color-muted);
    flex-wrap: wrap;
    gap: 12px;
}

/* ===== Debug notice (dev mode) ===== */
.seo-debug-bar {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 18px;
    font-size: 12.5px;
    text-align: center;
    border-bottom: 1px solid #fde68a;
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
    .seo-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .seo-foot-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
    h1 { font-size: 26px; }
    h2 { font-size: 20px; }
    h3 { font-size: 17px; }
    .seo-lede { font-size: 16px; }
    .seo-main { padding: 20px 16px 50px; }
    .seo-topbar-inner { padding: 0 16px; }
    .seo-topnav { gap: 12px; font-size: 13px; }
    .seo-topnav a:not(.seo-cta) { display: none; }
    .seo-card { padding: 20px 18px; }
    .seo-table { font-size: 13px; }
    .seo-table th, .seo-table td { padding: 9px 10px; }
    .seo-related-grid { grid-template-columns: 1fr; }
    .seo-foot-inner { grid-template-columns: 1fr; gap: 24px; }
    .seo-foot-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .seo-kpi-grid { grid-template-columns: 1fr; }
    .seo-meta { font-size: 12.5px; gap: 8px; }
    .seo-card { padding: 18px 16px; }
}

/* ============================================================================
   Accessibility + Core Web Vitals enhancements
   ============================================================================ */

/* WCAG AA: повишен contrast за muted text (4.47:1 → 5.1:1) */
:root {
    --color-muted: #4b5563;  /* prev #6b7280 — fixed contrast on white */
}

/* Skip-to-content link — keyboard-only, screen-reader visible */
.seo-skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    background: var(--color-accent);
    color: #fff;
    padding: 12px 20px;
    border-radius: 0 0 6px 0;
    font-weight: 600;
    text-decoration: none;
}
.seo-skip-link:focus {
    left: 0;
    color: #fff;
    text-decoration: none;
}

/* Focus-visible — за keyboard navigation. Tab key показва видим outline. */
.seo-topbar a:focus-visible,
.seo-topnav a:focus-visible,
.seo-cta:focus-visible,
.seo-foot a:focus-visible,
.seo-bc a:focus-visible,
.seo-related-link:focus-visible,
.seo-card a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Touch targets 44×44px минимум за mobile (WCAG 2.1 / iOS guidelines) */
@media (max-width: 768px) {
    .seo-cta {
        padding: 12px 22px;  /* effective height ~46px */
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .seo-topnav a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
    }
    .seo-foot a, .seo-bc a {
        padding: 6px 0;
        display: inline-block;
        min-height: 32px;
    }
}

/* Reduced motion — изключва анимации за потребители с vestibular disorders */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .seo-topbar { backdrop-filter: none; }
}

/* Print stylesheet — clean, без nav/footer */
@media print {
    .seo-topbar, .seo-foot, .seo-debug-bar, .seo-trust-badges, .seo-bc {
        display: none !important;
    }
    .seo-main { max-width: 100% !important; padding: 0 !important; }
    .seo-card { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
    h1, h2, h3 { page-break-after: avoid; }
    a { color: #000; text-decoration: underline; }
    a[href]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #666; }
    img { max-width: 100% !important; }
}

/* Image aspect-ratio fallback за CLS prevention */
img:not([width]):not([height]) {
    aspect-ratio: 16 / 9;
    background: #f0f0f0;
}
