/* ==========================================================================
   Base — типографика, ссылки, кнопки, теги, утилиты
   Тема "Editorial Soft"
   ========================================================================== */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--fw-regular);
    color: var(--ink);
    background-color: var(--paper);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ни одна страница не должна ехать вбок */
    overflow-x: hidden;
}

/* --- Иконки: только SVG, без эмодзи --- */
.icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.icon--filled { fill: currentColor; stroke: none; }

/* ==========================================================================
   ЗАГОЛОВКИ — Fraunces, регулярное начертание, без uppercase
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-regular);
    line-height: 1.12;
    color: var(--ink);
    letter-spacing: -0.018em;
    text-wrap: balance;
}

h1 { font-size: var(--text-5xl); line-height: 1.05; }
h2 { font-size: var(--text-4xl); line-height: 1.08; }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); line-height: 1.2; }
h5 { font-size: var(--text-xl);  line-height: 1.25; }
h6 { font-size: var(--text-lg);  line-height: 1.3; }

/* Акцентное слово внутри заголовка — курсив охрой */
h1 em, h2 em, h3 em,
.h-accent {
    font-style: italic;
    color: var(--ochre);
}

/* Заголовки на тёмных подложках наследуют цвет секции,
   иначе получают --ink и становятся невидимыми */
.site-footer h1, .site-footer h2, .site-footer h3,
.site-footer h4, .site-footer h5, .site-footer h6,
.city-hero h1, .city-hero h2, .city-hero h3,
.district-hero-sm h1, .district-hero-sm h2, .district-hero-sm h3,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 {
    color: inherit;
}

/* Надзаголовок / эйрбоу */
.kicker {
    display: block;
    font-family: var(--font-body);
    font-size: var(--text-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ochre);
    margin-bottom: var(--space-sm);
}

.kicker--muted { color: var(--ink-4); }

/* Подзаголовок под h1/h2 */
.subheading,
.lede {
    font-family: var(--font-body);
    font-size: var(--text-md);
    font-weight: var(--fw-regular);
    color: var(--ink-3);
    line-height: 1.6;
    letter-spacing: 0;
    text-transform: none;
}

/* Секционный заголовок с подчёркиванием-штрихом */
.section-title {
    position: relative;
    margin-bottom: var(--space-lg);
}
.section-title::after {
    content: '';
    display: block;
    width: 42px;
    height: 3px;
    border-radius: 2px;
    background: var(--ochre);
    margin-top: var(--space-md);
}
.section-title--center { text-align: center; }
.section-title--center::after { margin-left: auto; margin-right: auto; }

/* --- Параграфы --- */
p {
    margin-bottom: var(--space-md);
    max-width: 68ch;
}
p:last-child { margin-bottom: 0; }

/* --- Ссылки --- */
a {
    color: var(--ochre);
    text-decoration-color: rgba(180, 83, 9, 0.3);
    text-underline-offset: 2px;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}
a:hover {
    color: var(--ochre-hover);
    text-decoration-color: currentColor;
}
a:focus-visible {
    outline: 2px solid var(--ochre);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* --- Списки в контенте --- */
.content ul,
.content ol {
    padding-left: var(--space-lg);
    margin-bottom: var(--space-md);
    max-width: 68ch;
}
.content ul { list-style: disc; }
.content ol { list-style: decimal; }
.content li { margin-bottom: var(--space-2xs); }
.content li::marker { color: var(--ink-4); }

/* ==========================================================================
   КНОПКИ
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.75rem 1.375rem;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.005em;
    text-transform: none;
    border-radius: var(--radius-pill);
    transition: background-color var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                box-shadow var(--transition-fast),
                transform var(--transition-fast);
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid transparent;
    line-height: 1.2;
    /* Комфортная цель касания */
    min-height: 42px;
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring-focus);
}

/* Основная — тёмные чернила, не акцент: акцент бережём для смысла */
.btn-primary {
    background-color: var(--ink);
    color: var(--white);
    border-color: var(--ink);
}
.btn-primary:hover {
    background-color: #2E2724;
    border-color: #2E2724;
    color: var(--white);
}
.btn-primary:active { transform: translateY(1px); }

/* Акцентная — там, где действительно нужен охряной зов */
.btn-accent {
    background-color: var(--ochre);
    color: var(--white);
    border-color: var(--ochre);
    box-shadow: var(--shadow-ochre);
}
.btn-accent:hover {
    background-color: var(--ochre-hover);
    border-color: var(--ochre-hover);
    color: var(--white);
}
.btn-accent:active { transform: translateY(1px); }

.btn-outline {
    background-color: transparent;
    color: var(--ink);
    border-color: var(--line-2);
}
.btn-outline:hover {
    background-color: var(--paper-2);
    border-color: var(--ink-4);
    color: var(--ink);
}

.btn-ghost {
    background-color: transparent;
    color: var(--ink-3);
    border-color: transparent;
}
.btn-ghost:hover {
    background-color: var(--paper-2);
    color: var(--ink);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
    min-height: 36px;
}
.btn-lg {
    padding: 0.9375rem 2rem;
    font-size: var(--text-md);
    min-height: 50px;
}
.btn-block { display: flex; width: 100%; }

/* ==========================================================================
   ТЕГИ / БЕЙДЖИ
   ========================================================================== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: 0.3125rem 0.6875rem;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--radius-pill);
    background-color: var(--paper-2);
    color: var(--ink-3);
    line-height: 1.35;
    white-space: nowrap;
}

/* Тег-акцент — для профильных услуг */
.tag-rust,
.tag-accent {
    background-color: var(--ochre-light);
    color: var(--ochre);
}

.tag-outline {
    background-color: transparent;
    box-shadow: inset 0 0 0 1px var(--line-2);
    color: var(--ink-3);
}

.tag-segment-budget,
.tag-segment-budget-mid {
    background-color: var(--budget-bg);
    color: var(--budget-text);
}
.tag-segment-mid {
    background-color: var(--mid-bg);
    color: var(--mid-text);
}
.tag-segment-premium {
    background-color: var(--premium-bg);
    color: var(--premium-text);
}

/* Бейдж «рекомендуем» */
.badge-featured {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: 0.25rem 0.625rem;
    font-size: var(--text-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--white);
}

/* ==========================================================================
   ЗВЁЗДЫ И ОЦЕНКИ
   ========================================================================== */
.stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    color: var(--star);
}

.stars-value {
    font-family: var(--font-body);
    font-weight: var(--fw-bold);
    font-size: var(--text-sm);
    color: var(--ink);
    margin-left: var(--space-2xs);
    font-variant-numeric: tabular-nums;
}

/* Крупная оценка — Fraunces, чтобы цифра выглядела как в журнале */
.score-big {
    font-family: var(--font-display);
    font-weight: var(--fw-regular);
    color: var(--ochre);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

/* --- Разделитель --- */
hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: var(--space-xl) 0;
}

/* --- Выделение текста --- */
::selection {
    background-color: var(--ochre-mid);
    color: var(--ink);
}

/* --- Только для скринридеров --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Утилиты --- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-steel,
.text-muted  { color: var(--ink-3); }
.text-rust,
.text-accent { color: var(--ochre); }
.text-2xs    { font-size: var(--text-2xs); }
.text-xs     { font-size: var(--text-xs); }
.text-sm     { font-size: var(--text-sm); }
.text-lg     { font-size: var(--text-lg); }
.font-ui,
.font-body    { font-family: var(--font-body); }
.font-display { font-family: var(--font-display); }
.tnum        { font-variant-numeric: tabular-nums; }
.mt-0  { margin-top: 0; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-0  { margin-bottom: 0; }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* --- Уважение к настройке «меньше движения» --- */
@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;
    }
}
