:root {
--brand-dark: #162a45;    /* Темно-синий с логотипа */
--brand-blue: #0d5bd9;    /* Ярко-синий акцент с логотипа */
--brand-red: #d91e2a;     /* Красный акцент с логотипа */
--bg-soft: #f4f7fa;       /* Мягкий светло-серый фон для секций */
}

html {
scroll-behavior: smooth;
}

body {
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
color: #1e293b;
background-color: #ffffff;
display: flex;
flex-direction: column;
min-height: 100vh;
}

/* =================================================================
ШАПКА И НАВИГАЦИЯ (Строго изолирована в .navbar-custom!)
================================================================= */
.navbar-custom {
background-color: #ffffff;
box-shadow: 0 2px 15px rgba(22, 42, 69, 0.08);
padding-top: 0.85rem;
padding-bottom: 0.85rem;
}

.navbar-brand-text {
font-weight: 800;
color: var(--brand-dark) !important;
letter-spacing: 0.8px;
font-size: 1.5rem;
text-decoration: none;
}

/* Важно: стилизуем .nav-link ТОЛЬКО внутри .navbar-custom,
чтобы не ломать кнопки годов (.nav-pills) в Календаре! */
.navbar-custom .nav-link {
font-weight: 600;
color: var(--brand-dark) !important;
text-transform: uppercase;
font-size: 0.86rem;
letter-spacing: 0.4px;
padding: 0.5rem 0.9rem !important;
transition: color 0.2s ease;
position: relative;
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
color: var(--brand-red) !important;
}

.navbar-custom .nav-link.active::after {
content: "";
position: absolute;
bottom: 2px;
left: 0.9rem;
right: 0.9rem;
height: 2px;
background-color: var(--brand-red);
border-radius: 2px;
}

/* =================================================================
КНОПКИ И ПЕРЕКЛЮЧАТЕЛИ ГОДОВ (ТАБЫ)
================================================================= */
.btn-brand-primary {
background-color: var(--brand-dark);
color: #ffffff !important;
font-weight: 600;
padding: 0.65rem 1.5rem;
border-radius: 8px;
border: 2px solid var(--brand-dark);
transition: all 0.2s ease;
}

.btn-brand-primary:hover {
background-color: var(--brand-blue);
border-color: var(--brand-blue);
color: #ffffff !important;
transform: translateY(-1px);
}

.btn-brand-outline {
background-color: #ffffff;
color: var(--brand-dark) !important;
font-weight: 600;
padding: 0.65rem 1.5rem;
border-radius: 8px;
border: 2px solid var(--brand-dark);
transition: all 0.2s ease;
}

.btn-brand-outline:hover {
background-color: var(--brand-dark);
color: #ffffff !important;
transform: translateY(-1px);
}

.btn-brand-red {
background-color: var(--brand-red) !important;
color: #ffffff !important;
font-weight: 600;
padding: 0.65rem 1.5rem;
border-radius: 8px;
border: none;
transition: all 0.2s ease;
}

.btn-brand-red:hover {
background-color: #b81620 !important;
color: #ffffff !important;
transform: translateY(-1px);
}

/* Стили табов переключения годов в Календаре */
.calendar-year-tabs .nav-link {
color: var(--brand-dark) !important;
background-color: #f1f5f9;
border: 1px solid #cbd5e1;
font-weight: 700;
border-radius: 8px;
padding: 0.5rem 1.25rem;
transition: all 0.2s ease;
}

.calendar-year-tabs .nav-link:hover {
background-color: #e2e8f0;
}

.calendar-year-tabs .nav-link.active {
background-color: var(--brand-dark) !important;
border-color: var(--brand-dark) !important;
color: #ffffff !important;
}

/* =================================================================
ГЛАВНЫЙ ЭКРАН (HERO), КАРТОЧКИ И СПОНСОРЫ
================================================================= */
.hero-section {
background: linear-gradient(135deg, #f8fafc 0%, #eef2f6 100%);
border-bottom: 1px solid #e2e8f0;
padding: 3.5rem 0;
}

.logo-card-wrapper {
background-color: #ffffff;
border: 1px solid #e2e8f0;
display: inline-block;
max-width: 380px;
width: 100%;
}

.hero-logo-img {
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
}

.card-custom {
border: 1px solid #e2e8f0;
border-radius: 12px;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.3s ease;
background: #ffffff;
}

.card-custom:hover {
transform: translateY(-3px);
box-shadow: 0 12px 24px rgba(22, 42, 69, 0.08);
}

.trainer-photo {
height: 280px;
width: 100%;
object-fit: cover;
object-position: top center;
border-top-left-radius: 11px;
border-top-right-radius: 11px;
background-color: #cbd5e1;
}

/* Варианты отображения логотипа ИП Топоркова (на выбор в v2_index.html) */
.sponsor-logo-full {
height: 32px;
width: auto;
max-width: 165px;
object-fit: contain;
}

/* Если захочется оставить только оранжевый квадратный знак "Т" из полного SVG без фотошопа */
.sponsor-logo-icon-crop {
width: 38px;
height: 34px;
object-fit: cover;
object-position: left center;
}

/* Убираем синюю рамку (box-shadow) у кнопок аккордеона при клике */
.accordion-button:focus {
box-shadow: none !important;
outline: none !important;
}

.accordion-button:not(.collapsed) {
background-color: #f8fafc !important;
color: var(--brand-dark) !important;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08) !important;
}

/* =================================================================
АРХИВ: ЕДИНЫЕ АФИШИ СВЕРХУ И ПОДСВЕТКА ПРИ ПЕРЕХОДЕ ИЗ КАЛЕНДАРЯ
================================================================= */
.archive-poster-wrapper {
width: 100%;
height: 215px;
background-color: #f1f5f9;
border-top-left-radius: 11px;
border-top-right-radius: 11px;
overflow: hidden;
border-bottom: 1px solid #e2e8f0;
}

.archive-poster-img {
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
cursor: zoom-in;
transition: transform 0.25s ease;
}

.archive-poster-img:hover {
transform: scale(1.02);
}

/* Временная подсветка карточки в Архиве при переходе по ссылке из Календаря */
@keyframes raceHighlightPulse {
0% {
border-color: var(--brand-red);
box-shadow: 0 0 0 6px rgba(217, 30, 42, 0.22), 0 12px 24px rgba(22, 42, 69, 0.12);
background-color: #fffafa;
}
70% {
border-color: var(--brand-red);
box-shadow: 0 0 0 4px rgba(217, 30, 42, 0.12);
background-color: #fffdfd;
}
100% {
border-color: #e2e8f0;
box-shadow: none;
background-color: #ffffff;
}
}

.race-card-highlight {
border: 2px solid var(--brand-red) !important;
animation: raceHighlightPulse 3.8s ease-out forwards;
}

/* =================================================================
ТАБЛИЦА КАЛЕНДАРЯ И СТАТУСЫ СТРОК
================================================================= */
.table-calendar th {
background-color: var(--brand-dark) !important;
color: #ffffff !important;
font-weight: 600;
vertical-align: middle;
text-align: center;
font-size: 0.9rem;
border-color: #2c4466 !important;
padding: 0.75rem 0.5rem;
}

.table-calendar td {
vertical-align: middle;
font-size: 0.92rem;
padding: 0.65rem 0.6rem;
}

/* 1. По плану (planned) — чистая белая строка */
.table-calendar tbody tr.row-planned td {
background-color: #ffffff;
color: #1e293b;
}

/* 2. Завершено (completed) — спокойный зеленый текст */
.table-calendar tbody tr.row-completed td {
color: #15803d !important;
background-color: #f8faf9 !important;
}

/* 3. Открыта регистрация (registration) — зеленая заливка всей строки */
.table-calendar tbody tr.row-registration td {
background-color: #d9ead3 !important;
color: #0f172a !important;
font-weight: 600;
}

/* 4. Перенесено (rescheduled) — мягкий красный акцент */
.table-calendar tbody tr.row-rescheduled td {
background-color: #fff5f5 !important;
color: #991b1b !important;
}

/* Зачеркивание старой даты или старого места проведения */
.old-value-strike {
text-decoration: line-through;
color: #dc2626 !important;
display: block;
font-size: 0.85em;
font-weight: 400;
}

.new-value-actual {
font-weight: 700;
color: #dc2626 !important;
display: block;
}

/* =================================================================
АНИМАЦИИ, УТИЛИТЫ И ПОДВАЛ
================================================================= */
.reveal-once {
opacity: 0;
transform: translateY(20px);
transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-once.is-visible {
opacity: 1;
transform: translateY(0);
}

.text-brand-dark { color: var(--brand-dark) !important; }
.text-brand-red { color: var(--brand-red) !important; }
.bg-brand-soft { background-color: var(--bg-soft) !important; }
.bg-brand-dark { background-color: var(--brand-dark) !important; }

.site-footer {
background-color: var(--brand-dark);
color: #cbd5e1;
margin-top: auto;
font-size: 0.9rem;
}

/* =================================================================
ЧИСТАЯ ПЕЧАТЬ / СОХРАНЕНИЕ В PDF (ТОЛЬКО ТАБЛИЦА КАЛЕНДАРЯ)
================================================================= */
@media print {
@page {
size: A4 portrait;
margin: 10mm;
}

.no-print,
.navbar-custom,
.site-footer,
.tab-pane:not(.active) {
    display: none !important;
}

body, main, .container {
    background: #ffffff !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.table-responsive {
    overflow: visible !important;
    border: none !important;
    box-shadow: none !important;
}

.table-calendar {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 9.5pt !important;
}

.table-calendar th {
    background-color: #e2e8f0 !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.table-calendar td {
    border: 1px solid #000000 !important;
    padding: 4px 6px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}


}