/*
Theme Name: Boccia Russia
Theme URI: https://bocciarus.ru
Author: Filin_Family
Author URI: https://bocciarus.ru
Description: Минималистичная тема для Всероссийской федерации бочча. Цвета российского флага, современный чистый дизайн.
ChangeLog 
1.4.5 (29.08.2026)
Поправили отображение страниц
1.4.0 (HotFix)
Исправление мелких недочетов
1.2.7
Добавление анимированной страницы с ошибкой 404
1.2.1
Исправление плавающего меню
Привязка кастомного логотипа к верхнему левому краю
1.2.0
Запилили страницу с ошибкой под дизайн темы
Исправили css для меню
1.1.7 
Устранение некоторых багов с отображением кастомного логотипа
1.1.5 (Merged FilinFamily)
Большая сборка тем
1.1.2
Чистая сборка
Новый подвал
1.0.0 -Базовый релиз-
Version: 1.4.5(HotFix)
Requires at least: 6.9.1
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: boccia-russia
Tags: sports, minimal, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   CSS Variables — Russian Flag Colors
   ========================================================================== */
:root {
  --color-white: #ffffff;
  --color-blue: #0039A6;
  --color-blue-dark: #002b7f;
  --color-blue-light: #e8f0fe;
  --color-red: #D52B1E;
  --color-red-dark: #b01f15;
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f1f3f5;
  --color-gray-200: #e9ecef;
  --color-gray-300: #dee2e6;
  --color-gray-500: #6c757d;
  --color-gray-700: #343a40;
  --color-gray-900: #212529;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 36px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  /* Ширина контента: было 1200px → стало 1440px */
  --container-max: 1340px;
  --container-padding: 12px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray-900);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-blue-dark);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-gray-900);
}

/* ==========================================================================
   Container — увеличенная ширина (1440px вместо 1200px)
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max, 1220px);
  margin: 0 auto;
  padding: 0 var(--container-padding, 12px);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
}

.site-header .container.header-inner,
.site-header .header-inner.container {
  /* логотип у левого края контейнера */
  justify-content: flex-start;
}

.site-header .site-logo {
  /* жёсткая привязка к левому краю шапки */
  align-self: center;
  justify-self: start;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 72px;
  gap: 24px;
  position: relative;
  width: 100%;
}

/* Логотип — как filin.zip: site-branding, слева сверху, ссылка на главную */
.site-branding {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  z-index: 1001;
  margin: 0;
  margin-right: auto;
  margin-left: 0;
  padding: 0;
  order: -1;
  position: relative;
  left: 0;
  top: 0;
}

.site-branding a,
.site-branding .custom-logo-link,
.site-branding .logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 0;
  text-decoration: none;
  color: var(--color-gray-900);
}

.site-branding img,
.site-branding .custom-logo {
  height: 48px;
  width: auto;
  max-height: 48px;
  display: block;
  object-fit: contain;
}

/* совместимость со старым классом */
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-gray-900);
  margin-right: auto;
  flex-shrink: 0;
  order: -1;
}

.site-logo img,
.site-logo .custom-logo {
  height: 48px;
  width: auto;
  max-height: 48px;
  object-fit: contain;
}

.site-logo span {
  color: var(--color-blue);
}

/* Navigation — меню в одну строку, справа; логотип остаётся слева */
.main-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.main-nav ul {
  display: flex;
  flex-direction: row;         /* пункты меню в строчку */
  align-items: left;
  gap: 4px;
  flex-wrap: nowrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li {
  margin: 0;
  padding: 0;
  position: relative;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-gray-700);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;         /* текст не переносится */
  text-decoration: none;
}

.main-nav a:hover {
	color: var(--color-blue);
	background: var(--color-blue-light);
}

.main-nav .current-menu-item > a,
.main-nav .current_page_item > a {
  color: #ffffff;
  background: #D52B1E; /* Заливка как у флага России(красным) */
  font-weight: 600;
}

.main-nav .current-menu-item > a:hover,
.main-nav .current_page_item > a:hover {
  color: #ffffff;
  background: #b01f15;
}

/* Подменю (если есть) */
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  z-index: 100;
  flex-direction: column;
}

.main-nav li:hover > .sub-menu {
  display: flex;
}

.main-nav .sub-menu a {
  padding: 10px 16px;
  white-space: nowrap;
}

/* Mobile menu button — справа на мобильных */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-gray-900);
  flex-shrink: 0;
  margin-left: auto;
}

.menu-toggle svg {
  width: 28px;
  height: 28px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  background: linear-gradient(135deg, #001a4d 0%, #0039A6 50%, #002b7f 100%);
  color: var(--color-white);
  padding: 80px 0 100px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/images/hero-bg.jpg') center/cover no-repeat;
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  flex: 1 1 52%;
}

.hero-grid {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
}

.hero-gallery {
	flex: 1 1 50%;
	min-width: 0; /* чтобы галерея не вылезала за контейнер */
}

.hero-game {
	flex: 0 1 auto;
	max-width: 760px;
	margin-left: 8px;
	margin-right: auto;
}

/* На мобильных колонки складываются */
@media (max-width: 768px) {
	.hero-grid {
		flex-direction: column;
		gap: 32px;
	}

	.hero-content {
		max-width: 100%;
	}

	.hero-game {
		margin-left: 0;
		max-width: 100%;
	}
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--color-white);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 28px;
  max-width: 560px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--color-blue);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-blue-dark);
  color: var(--color-white);
}

.btn-red {
  background: var(--color-red);
  color: var(--color-white);
}

.btn-red:hover {
  background: var(--color-red-dark);
  color: var(--color-white);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-white);
  color: var(--color-white);
}

.btn-outline:hover {
  background: var(--color-white);
  color: var(--color-blue);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding: 64px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
}

.section-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-blue);
  display: flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover {
  color: var(--color-blue-dark);
}

/* ==========================================================================
   Events Cards
   ========================================================================== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.event-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.event-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-blue);
}

.event-date {
  flex-shrink: 0;
  width: 70px;
  text-align: center;
  background: var(--color-blue);
  color: white;
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.3;
}

.event-date.red {
  background: var(--color-red);
}

.event-info h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.event-meta {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-dots {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-blue { background: var(--color-blue); }
.dot-red { background: var(--color-red); }

/* ==========================================================================
   News Cards
   ========================================================================== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-gray-200);
  transition: box-shadow var(--transition);
}

.news-card:hover {
  box-shadow: var(--shadow-md);
}

.news-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-card-body {
  padding: 20px;
}

.news-date {
  font-size: 0.8rem;
  color: var(--color-gray-500);
  margin-bottom: 8px;
}

.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.35;
}

.news-card p {
  font-size: 0.9rem;
  color: var(--color-gray-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Athletes Grid
   ========================================================================== */
.athletes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.athlete-card {
  text-align: center;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  padding: 24px 16px;
  transition: box-shadow var(--transition);
}

.athlete-card:hover {
  box-shadow: var(--shadow-md);
}

.athlete-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--color-blue-light);
}

.athlete-card h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.athlete-class {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--color-blue);
  color: white;
  margin-bottom: 8px;
}

.athlete-class.bc2 { background: var(--color-red); }
.athlete-class.bc3 { background: #6f42c1; }
.athlete-class.bc4 { background: #20c997; }

.athlete-region {
  font-size: 0.85rem;
  color: var(--color-gray-500);
}

/* ==========================================================================
   Filters / Tabs
   ========================================================================== */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter-btn {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--color-gray-300);
  background: var(--color-white);
  color: var(--color-gray-700);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-blue);
  border-color: var(--color-blue);
  color: white;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.page-header {
  display: none;
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--color-gray-200);
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--color-gray-500);
  max-width: 600px;
}

/* ==========================================================================
   Page Content — основной контент страниц
   ========================================================================== */
.page-content {
  width: 100%;
  max-width: var(--container-max, 1240px);
  margin: 0 auto;
  padding: 16px var(--container-padding, 12px) 24px;
  color: var(--color-gray-900);
  font-size: 1.05rem;
  line-height: 1.7;
}

.page-content > *:first-child {
  margin-top: 0;
}

.page-content > *:last-child {
  margin-bottom: 0;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4,
.page-content h5,
.page-content h6 {
  margin-top: 1.75em;
  margin-bottom: 0.6em;
  color: var(--color-gray-900);
  line-height: 1.3;
}

.page-content h1 { font-size: 2rem; }
.page-content h2 { font-size: 1.6rem; }
.page-content h3 { font-size: 1.3rem; }
.page-content h4 { font-size: 1.1rem; }

.page-content p {
  margin-bottom: 1.15em;
}

.page-content a {
  color: var(--color-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

.page-content a:hover {
  color: var(--color-blue-dark);
}

.page-content ul,
.page-content ol {
  margin: 0 0 1.25em 1.25em;
  padding: 0;
  list-style: revert;
}

.page-content ul {
  list-style-type: disc;
}

.page-content ol {
  list-style-type: decimal;
}

.page-content li {
  margin-bottom: 0.4em;
  line-height: 1.6;
}

.page-content li > ul,
.page-content li > ol {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}

.page-content blockquote {
  margin: 1.5em 0;
  padding: 12px 16px;
  background: var(--color-white);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-gray-700);
  font-style: italic;
}

.page-content blockquote p:last-child {
  margin-bottom: 0;
}

.page-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.25em 0;
}

.page-content figure {
  margin: 1.5em 0;
}

.page-content figcaption {
  font-size: 0.875rem;
  color: var(--color-gray-500);
  margin-top: 8px;
  text-align: center;
}

.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}

.page-content th,
.page-content td {
  padding: 12px 16px;
  border: 1px solid var(--color-gray-200);
  text-align: left;
}

.page-content th {
  background: var(--color-gray-50);
  font-weight: 600;
  color: var(--color-gray-900);
}

.page-content tr:nth-child(even) td {
  background: var(--color-gray-50);
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--color-gray-200);
  margin: 2em 0;
}

.page-content .wp-block-image,
.page-content .aligncenter {
  text-align: center;
}

.page-content .alignwide {
  max-width: 100%;
}

.page-content .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Page content inside .container — без двойных отступов */
.container .page-content {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 992px) {
  .page-content {
    padding: 32px var(--container-padding, 24px) 48px;
    font-size: 1rem;
  }

  .page-content h1 { font-size: 1.75rem; }
  .page-content h2 { font-size: 1.4rem; }
  .page-content h3 { font-size: 1.2rem; }
}

@media (max-width: 600px) {
  .page-content {
    padding: 24px 16px 40px;
    font-size: 0.95rem;
  }

  .page-content h1 { font-size: 1.5rem; }
  .page-content h2 { font-size: 1.25rem; }
  .page-content h3 { font-size: 1.1rem; }

  .page-content ul,
  .page-content ol {
    margin-left: 1em;
  }

  .page-content table {
    font-size: 0.85rem;
  }

  .page-content th,
  .page-content td {
    padding: 8px 10px;
  }
}

/* ===== Исключения для responsive-table (сборные) ===== */
.page-content .responsive-table,
.entry-content .responsive-table {
  display: table;           /* отменяем display: block */
  overflow-x: visible;
  width: 100%;
  min-width: 0;
}

.page-content .table-scroll,
.entry-content .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  width: 100%;
}

/* Чтобы theme-стили не перебивали наши th/td */
.page-content .responsive-table th,
.page-content .responsive-table td,
.entry-content .responsive-table th,
.entry-content .responsive-table td {
  padding: inherit;         /* пусть работают стили из responsive-table */
  border: inherit;
  text-align: inherit;
  background: inherit;
}

/* ==========================================================================
   Footer — синий цвет флага РФ (#0039A6)
   ========================================================================== */
.site-footer {
  background: #0039A6;
  background: var(--color-blue, #0039A6);
  color: #ffffff;
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}

.footer-brand span {
  opacity: 0.85;
  font-weight: 400;
  font-size: 0.9rem;
  display: block;
  margin-top: 4px;
}

.footer-tagline {
  opacity: 0.85;
  font-size: 0.9rem;
  margin: 12px 0 16px;
  line-height: 1.5;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  opacity: 0.95;
  color: #fff;
  font-weight: 600;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 8px;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-col a:hover {
  color: #ffffff;
  opacity: 1;
}

.footer-contacts {
  opacity: 0.9;
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.footer-contacts a {
  display: inline;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  text-align: right;
  gap: 16px;
  font-size: 0.85rem;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.85);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0039A6;
  background: #ffffff;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
  background: #D52B1E;
  color: #fff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Mobile Menu Overlay
   ========================================================================== */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-white);
  z-index: 2000;
  padding: 24px;
  overflow-y: auto;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.mobile-nav a {
  display: block;
  padding: 14px 0;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-gray-900);
  border-bottom: 1px solid var(--color-gray-100);
}

.mobile-nav a:hover {
  color: var(--color-blue);
}

/* ==========================================================================
   Responsive — mobile-first enhancements
   ========================================================================== */

/* Tablet and below: hamburger, hide desktop nav */
@media (max-width: 992px) {
  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }

  .header-inner {
    height: 64px;
    gap: 12px;
  }

  .site-branding,
  .site-logo {
    gap: 8px;
    font-size: 1.1rem;
  }

  .site-branding img,
  .site-branding .custom-logo,
  .site-logo img {
    height: 36px;
    max-height: 36px;
  }

  .site-logo svg {
    width: 36px;
    height: 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .hero {
    padding: 56px 0 72px;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 6vw, 2.4rem);
  }

  .hero p {
    font-size: 1.05rem;
  }

  .section-header {
    flex-wrap: wrap;
    gap: 12px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .page-header {
    padding: 32px 0 24px;
    margin-bottom: 28px;
  }

  .page-header h1 {
    font-size: clamp(1.5rem, 5vw, 1.9rem);
  }

  .athletes-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
}

/* Phone */
@media (max-width: 600px) {
  .container {
    padding: 0 16px;
    --container-padding: 16px;
  }

  .header-inner {
    height: 60px;
    gap: 8px;
  }

  .site-logo span {
    font-size: 1rem;
  }

  /* Optionally hide text on very narrow if logo image present — keep both for clarity */
  .site-logo img {
    height: 32px;
  }

  .hero {
    padding: 40px 0 56px;
  }

  .hero h1 {
    font-size: 1.65rem;
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    width: 100%;
    justify-content: center;
  }

  .hero .btn {
    width: auto;
    max-width: 100%;
  }

  .section {
    padding: 40px 0;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 24px;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .events-grid,
  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .event-card {
    padding: 16px;
    gap: 12px;
  }

  .event-date {
    width: 60px;
    font-size: 0.8rem;
    padding: 8px 4px;
  }

  .event-info h3 {
    font-size: 1rem;
  }

  .news-card img {
    height: 180px;
  }

  .athletes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .athlete-card {
    padding: 16px 10px;
  }

  .athlete-photo {
    width: 72px;
    height: 72px;
    margin-bottom: 10px;
  }

  .athlete-card h3 {
    font-size: 0.95rem;
  }

  .filters {
    gap: 6px;
    margin-bottom: 20px;
  }

  .filter-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .page-header {
    padding: 24px 0 20px;
    margin-bottom: 24px;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  /* Footer mobile */
  .site-footer {
    padding: 36px 0 20px;
    margin-top: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
    align-items: center;
  }

  .social-links {
    justify-content: flex-start;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .site-logo span {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .athletes-grid {
    grid-template-columns: 1fr;
  }

  .event-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .event-date {
    width: auto;
    display: inline-block;
    padding: 6px 12px;
  }
}

/* Mobile menu polish */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-white);
  z-index: 2000;
  padding: 20px 20px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.active {
  display: block;
  animation: mobileMenuIn 0.25s ease;
}

@keyframes mobileMenuIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-gray-200);
}

.mobile-menu-header .site-branding img,
.mobile-menu-header .site-logo img {
  height: 36px;
  max-height: 36px;
}
.mobile-menu-header .site-logo {
  font-size: 1.15rem;
}

.mobile-menu-header .menu-toggle {
  display: flex;
  min-width: 44px;
  min-height: 44px;
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav li {
  margin: 0;
}

.mobile-nav a {
  display: block;
  padding: 14px 4px;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-gray-900);
  border-bottom: 1px solid var(--color-gray-100);
  min-height: 48px;
  line-height: 1.4;
}

.mobile-nav a:hover,
.mobile-nav .current-menu-item > a {
  color: var(--color-blue);
}

/* Родитель с дочерними — аккордеон */
.mobile-nav .menu-item-has-children {
  position: relative;
}

.mobile-nav .menu-item-has-children > a {
  padding-right: 48px;
}

/* Кнопка-стрелка — только в мобильном меню */
.mobile-nav .submenu-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-gray-100);
  cursor: pointer;
  color: var(--color-gray-900);
  padding: 0;
  z-index: 2;
}

.mobile-nav .submenu-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.mobile-nav .menu-item-has-children.open > .submenu-toggle svg {
  transform: rotate(180deg);
}

.mobile-nav .menu-item-has-children.open > .submenu-toggle {
  color: var(--color-blue);
}

/* Подменю скрыто, раскрывается по .open */
.mobile-nav .sub-menu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0 0 0 12px;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-100);
  overflow: hidden;
}

.mobile-nav .menu-item-has-children.open > .sub-menu {
  display: block;
  animation: submenuSlide 0.25s ease;
}

@keyframes submenuSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav .sub-menu a {
  font-size: 1rem;
  font-weight: 400;
  padding: 12px 4px;
  min-height: 44px;
  color: var(--color-gray-700);
}

.mobile-nav .sub-menu a:hover,
.mobile-nav .sub-menu .current-menu-item > a {
  color: var(--color-blue);
}

/* Не показывать кнопку аккордеона в десктопном меню шапки */
.main-nav .submenu-toggle {
  display: none !important;
}

/* Tables (if any content tables) */
.entry-content table,
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 0.9rem;
}

/* Prevent horizontal scroll on body */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

img, video {
  max-width: 100%;
  height: auto;
}

iframe {
	max-width: 100%;
	width: 640px;
	height: auto;
	aspect-ratio: 16/9;
	display: block;
	border: 0;
	margin-left: auto;
	margin-right: auto
}

/* Touch-friendly focus */
@media (hover: none) and (pointer: coarse) {
  .main-nav a,
  .filter-btn,
  .btn,
  .menu-toggle {
    min-height: 44px;
  }

  .event-card:hover,
  .news-card:hover,
  .athlete-card:hover {
    box-shadow: none;
  }
}

/* ==========================================================================
   Utility
   ========================================================================== */
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ==========================================================================
   404 Error Page — стилистика сайта + анимированные мячи бочча (флаг РФ)
   ========================================================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bocciaFloat {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(18px, -22px) rotate(8deg);
  }
  50% {
    transform: translate(-12px, -36px) rotate(-6deg);
  }
  75% {
    transform: translate(22px, -14px) rotate(10deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

@keyframes bocciaDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(-30px, 20px) scale(1.05);
  }
  66% {
    transform: translate(24px, -18px) scale(0.95);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes bocciaRoll {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  50% {
    transform: translateX(40px) rotate(180deg);
  }
  100% {
    transform: translateX(0) rotate(360deg);
  }
}

.error-404 {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(160deg, #f8f9fc 0%, #e8f0fe 40%, #f5eaea 100%);
  color: var(--color-gray-900);
  padding: 80px 0 100px;
}

/* слой с мячами */
.error-404-balls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.boccia-ball {
  position: absolute;
  border-radius: 50%;
  box-shadow:
    inset -6px -8px 16px rgba(0, 0, 0, 0.18),
    inset 4px 4px 10px rgba(255, 255, 255, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.12);
  opacity: 0.55;
  will-change: transform;
}

/* Белый (jack) */
.boccia-ball.white {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #f0f0f0 45%, #d8d8d8 100%);
  width: 48px;
  height: 48px;
  top: 18%;
  left: 12%;
  animation: bocciaFloat 9s ease-in-out infinite;
}

/* Синий — флаг */
.boccia-ball.blue {
  background: radial-gradient(circle at 32% 28%, #4a7fd4 0%, #0039A6 55%, #00205a 100%);
  width: 88px;
  height: 88px;
  top: 55%;
  left: 8%;
  animation: bocciaDrift 11s ease-in-out infinite;
}

/* Красный — флаг */
.boccia-ball.red {
  background: radial-gradient(circle at 32% 28%, #e86a5e 0%, #D52B1E 55%, #8b1a12 100%);
  width: 72px;
  height: 72px;
  top: 22%;
  right: 10%;
  animation: bocciaFloat 8s ease-in-out infinite 0.5s;
}

.boccia-ball.blue-sm {
  background: radial-gradient(circle at 32% 28%, #4a7fd4 0%, #0039A6 55%, #00205a 100%);
  width: 36px;
  height: 36px;
  bottom: 18%;
  right: 22%;
  animation: bocciaRoll 14s linear infinite;
  opacity: 0.45;
}

.boccia-ball.red-sm {
  background: radial-gradient(circle at 32% 28%, #e86a5e 0%, #D52B1E 55%, #8b1a12 100%);
  width: 42px;
  height: 42px;
  top: 70%;
  left: 28%;
  animation: bocciaDrift 10s ease-in-out infinite 1s;
  opacity: 0.5;
}

.boccia-ball.white-sm {
  background: radial-gradient(circle at 32% 28%, #ffffff 0%, #ececec 50%, #cfcfcf 100%);
  width: 28px;
  height: 28px;
  top: 40%;
  right: 30%;
  animation: bocciaFloat 7s ease-in-out infinite 0.8s;
  opacity: 0.5;
}

.error-404-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 560px;
  margin: 0 20px;
  padding: 40px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius, 12px);
  box-shadow: 0 8px 32px rgba(0, 57, 166, 0.12);
  border: 1px solid rgba(0, 57, 166, 0.08);
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 0.9s ease forwards 0.2s;
}

.error-404 .error-code {
  font-size: clamp(4.5rem, 14vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #0039A6, #D52B1E);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.error-404 .error-message {
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 600;
  color: var(--color-gray-900);
  margin-bottom: 12px;
  line-height: 1.4;
}

.error-404 .error-hint {
  font-size: 1rem;
  color: var(--color-gray-500);
  margin-bottom: 28px;
  line-height: 1.6;
}

.error-404 .btn-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #0039A6, #002b7f);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 57, 166, 0.3);
  text-decoration: none;
}

.error-404 .btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 57, 166, 0.4);
  color: #fff;
}

.error-404 .btn-home svg {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .error-404-content {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .boccia-ball {
    animation: none !important;
  }
}

@media (max-width: 600px) {
  .error-404 {
    padding: 48px 16px 64px;
    min-height: calc(100vh - 60px);
  }

  .error-404-content {
    padding: 28px 20px;
  }

  .error-404 .error-code {
    font-size: 4rem;
  }

  .error-404 .error-message {
    font-size: 1.1rem;
  }

  .boccia-ball.blue {
    width: 56px;
    height: 56px;
  }

  .boccia-ball.red {
    width: 48px;
    height: 48px;
  }
}

/* ===== Карточка-ссылка ===== */
.boccia-event__link {
  display: block;              /* ссылка занимает всю ширину */
  text-decoration: none;       /* убираем подчёркивание */
  color: inherit;              /* текст наследует цвет карточки, а не синий цвет ссылки */
  border-radius: 16px;         /* повторяем скругление карточки, чтобы тень/обводка hover не выходили за углы */
}

/* Подсветка при наведении на всю карточку */
.boccia-event__link:hover .boccia-event {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
  border-color: #aa15ac;       /* можно поменять на свой акцентный цвет */
}

/* Подсветка заголовка при наведении */
.boccia-event__link:hover .boccia-event__title {
  color: #aa15ac;              /* акцентный цвет заголовка */
}

/* Плавная анимация (сама карточка должна уметь анимироваться) */
.boccia-event {
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease,
    border-color 0.25s ease;
}

.boccia-event__title {
  transition: color 0.25s ease;
}

/* Состояние фокуса с клавиатуры (доступность) */
.boccia-event__link:focus-visible {
  outline: 3px solid #2d6cdf;
  outline-offset: 3px;
  border-radius: 16px;
}

/*= Иконки для ссылок на файлы =*/
/* Иконка для пдф файлов */
a[href$=".pdf"]::before,
a[href$=".PDF"]::before {
	content: "";
	display: inline-block;
	width: 48px;
	height: 48px;
	margin-right: 8px;
	vertical-align: middle;
	background: url('_includes/img/pdf.svg') no-repeat center;
	background-size: contain;
}
/* Иконка для ексель файлов */
a[href$=".xls"]::before,
a[href$=".xlsx"]::before,
a[href$=".XLS"]::before,
a[href$=".XLSX"]::before {
	content: "";
	display: inline-block;
	width: 48px;
	height: 48px;
	margin-right: 8px;
	vertical-align: middle;
	background: url('_includes/img/xls.svg') no-repeat center;
	background-size: contain;
}
/* Иконка для ворда файлов */
a[href$=".doc"]::before,
a[href$=".docx"]::before,
a[href$=".DOC"]::before,
a[href$=".DOCX"]::before {
	content: "";
	display: inline-block;
	width: 48px;
	height: 48px;
	margin-right: 8px;
	vertical-align: middle;
	background: url('_includes/img/doc.svg') no-repeat center;
	background-size: contain;
}
/* Иконка для презентаций */
a[href$=".ppt"]::before,
a[href$=".pptx"]::before,
a[href$=".PPT"]::before,
a[href$=".PPTX"]::before {
	content: "";
	display: inline-block;
	width: 48px;
	height: 48px;
	margin-right: 8px;
	vertical-align: middle;
	background: url('_includes/img/ppt.svg') no-repeat center;
	background-size: contain;
}
/* Иконка для Rar/Zip/Архивов */
a[href$=".rar"]::before,
a[href$=".RAR"]::before,
a[href$=".zip"]::before,
a[href$=".ZIP"]::before,
a[href$=".7z"]::before,
a[href$=".7Z"]::before {
	content: "";
	display: inline-block;
	width: 48px;
	height: 48px;
	margin-right: 8px;
	vertical-align: middle;
	background: url('_includes/img/rar.png') no-repeat center;
	background-size: contain;
}
/* ============================================================
   Меняем пагинацию на кнопку Загрузить еще
   ============================================================ */
.loadmore-wrapper {
  text-align: center;
  margin: 0 0 64px;
}

#boccia-loadmore {
  min-width: 200px;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

#boccia-loadmore:hover:not(:disabled) {
  transform: translateY(-1px);
}

#boccia-loadmore:disabled,
#boccia-loadmore.is-loading {
  opacity: 0.7;
  cursor: wait;
}

.loadmore-done {
  font-size: 0.95rem;
  color: #666;
  margin-top: 12px;
  text-align: center;
}
/* кнока вверх */
.scroll-to-top {
	position: fixed;
	bottom: 28px;
	right: 28px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #0039A6;
	border: none;
	cursor: pointer;
	z-index: 999;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	box-shadow: 
	inset -6px -6px 12px rgba(0, 0, 0, 0.25),
	inset 4px 4px 10px rgba(255, 255, 255, 0.15),
	0 6px 18px rgba(0, 57, 166, 0.45);
	transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
	opacity: 0;
	visibility: hidden;
}

.scroll-to-top.visible {
	opacity: 1;
	visibility: visible;
}

.scroll-to-top::before {
	content: '';
	position: absolute;
	top: 10px;
	left: 12px;
	width: 16px;
	height: 10px;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	transform: rotate(-30deg);
	pointer-events: none;
	z-index: 0;
}

.scroll-to-top .arrow {
	position: relative;
	z-index: 2;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	opacity: 0;
	transform: translateY(4px) scale(0.7);
	transition: opacity 0.2s ease, transform 0.25s ease;
	text-shadow: 
	0 1px 2px rgba(0, 0, 0, 0.45),
	0 0 6px rgba(0, 0, 0, 0.2);
	pointer-events: none;
}

.scroll-to-top:hover {
	background: #D52B1E;
	box-shadow: 
	inset -6px -6px 12px rgba(0, 0, 0, 0.3),
	inset 4px 4px 10px rgba(255, 255, 255, 0.12),
	0 8px 22px rgba(213, 43, 30, 0.5);
	transform: translateY(-3px);
}

.scroll-to-top:hover .arrow {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.scroll-to-top:active {
	transform: translateY(-1px) scale(0.96);
}

/* ==========================================================================
   Boccia Russia — 2 стиля шапки (classic / gradient)
   Полоска флага снизу + лого на белом фоне в gradient
   ========================================================================== */

/* ----- Общие ----- */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.site-header .header-inner,
.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 72px;
  gap: 24px;
  position: relative;
  width: 100%;
}

.site-branding {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  z-index: 1001;
  margin: 0;
  margin-right: auto;
  order: -1;
}

.site-branding a,
.site-branding .custom-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 0;
}

.site-branding img,
.site-branding .custom-logo {
  height: 48px;
  width: auto;
  max-height: 48px;
  object-fit: contain;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.main-nav ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 50px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

/* Полоска флага снизу (общая для обоих вариантов) */
.site-header::after {
  content: '';
  display: block;
  height: 4px;
  width: 100%;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #ffffff 33.33%,
    #0039A6 33.33%,
    #0039A6 66.66%,
    #D52B1E 66.66%,
    #D52B1E 100%
  );
}

/* ==========================================================================
   ВАРИАНТ 1 — Классический (белый + красный active + флаг снизу)
   body.header-style-classic
   ========================================================================== */
body.header-style-classic .site-header {
  background: #ffffff;
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0, 57, 166, 0.08);
}

body.header-style-classic .site-branding a,
body.header-style-classic .site-logo,
body.header-style-classic .site-title {
  color: #212529;
}

body.header-style-classic .site-title span,
body.header-style-classic .site-logo span {
  color: #0039A6;
}

body.header-style-classic .main-nav a {
  color: #343a40;
}

body.header-style-classic .main-nav a:hover {
  color: #0039A6;
  background: #e8f0fe;
}

body.header-style-classic .main-nav .current-menu-item > a,
body.header-style-classic .main-nav .current_page_item > a {
  color: #ffffff !important;
  background: #D52B1E !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(213, 43, 30, 0.3);
}

body.header-style-classic .main-nav .current-menu-item > a:hover,
body.header-style-classic .main-nav .current_page_item > a:hover {
  background: #b01f15 !important;
  color: #ffffff !important;
}

body.header-style-classic .menu-toggle {
  color: #212529;
}

/* ==========================================================================
   Boccia Russia — 2 стиля шапки (classic / gradient)
   Hover по фото:
   - classic: светлая таблетка + синее подчёркивание
   - gradient: полупрозрачная таблетка + белое подчёркивание
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.site-header .header-inner,
.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 72px;
  gap: 24px;
  position: relative;
  width: 100%;
}

.site-branding {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  z-index: 1001;
  margin: 0;
  margin-right: auto;
  order: -1;
}

.site-branding a,
.site-branding .custom-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  line-height: 0;
}

.site-branding img,
.site-branding .custom-logo {
  height: 48px;
  width: auto;
  max-height: 48px;
  object-fit: contain;
  display: block;
}

.main-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.main-nav ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav li {
  margin: 0;
  padding: 0;
  position: relative;
}

.main-nav a {
  display: block;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 50px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
}

/* Подчёркивание при hover (для не-active) */
.main-nav a:not(.active)::after,
.main-nav li:not(.current-menu-item):not(.current_page_item) > a::after {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 55%;
  height: 2px;
  border-radius: 2px;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.main-nav a:not(.active):hover::after,
.main-nav li:not(.current-menu-item):not(.current_page_item) > a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* У active подчёркивания нет */
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after,
.main-nav a.active::after {
  display: none !important;
}

/* Полоска флага снизу */
.site-header::after {
  content: '';
  display: block;
  height: 4px;
  width: 100%;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #ffffff 33.33%,
    #0039A6 33.33%,
    #0039A6 66.66%,
    #D52B1E 66.66%,
    #D52B1E 100%
  );
}

/* ==========================================================================
   ВАРИАНТ 1 — Классический (фото 1)
   белый фон, active красный, hover = светлая таблетка + синее подчёркивание
   ========================================================================== */
body.header-style-classic .site-header {
  background: #ffffff;
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0, 57, 166, 0.08);
}

body.header-style-classic .site-branding a,
body.header-style-classic .site-logo,
body.header-style-classic .site-title {
  color: #212529;
}

body.header-style-classic .site-title span,
body.header-style-classic .site-logo span {
  color: #0039A6;
}

body.header-style-classic .main-nav a {
  color: #343a40;
}

/* Hover — как на фото 1: светло-голубая таблетка + синее подчёркивание */
body.header-style-classic .main-nav a:hover {
  color: #0039A6;
  background: #e8f0fe;
}

body.header-style-classic .main-nav a:not(.active)::after,
body.header-style-classic .main-nav li:not(.current-menu-item):not(.current_page_item) > a::after {
  background: #0039A6;
}

/* Active — красный */
body.header-style-classic .main-nav .current-menu-item > a,
body.header-style-classic .main-nav .current_page_item > a,
body.header-style-classic .main-nav a.active {
  color: #ffffff !important;
  background: #D52B1E !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(213, 43, 30, 0.3);
}

body.header-style-classic .main-nav .current-menu-item > a:hover,
body.header-style-classic .main-nav .current_page_item > a:hover,
body.header-style-classic .main-nav a.active:hover {
  background: #b01f15 !important;
  color: #ffffff !important;
}

body.header-style-classic .menu-toggle {
  color: #212529;
}

/* ==========================================================================
   Boccia Russia — 2 стиля шапки (classic / gradient)
   Hover: classic = светлая таблетка + синее подчёркивание
          gradient = полупрозрачная + белое подчёркивание
   Мобильное/планшетное меню НЕ ломается
   ========================================================================== */

/* ----- Общие (не трогаем display:none на мобильном) ----- */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

/* Полоска флага снизу */
.site-header::after {
  content: '';
  display: block;
  height: 4px;
  width: 100%;
  background: linear-gradient(
    to right,
    #ffffff 0%,
    #ffffff 33.33%,
    #0039A6 33.33%,
    #0039A6 66.66%,
    #D52B1E 66.66%,
    #D52B1E 100%
  );
}

.main-nav a {
  border-radius: 50px;
  position: relative;
  transition: all 0.2s ease;
}

/* Подчёркивание при hover (только не-active) */
.main-nav a:not(.active)::after,
.main-nav li:not(.current-menu-item):not(.current_page_item) > a::after {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 55%;
  height: 2px;
  border-radius: 2px;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.main-nav a:not(.active):hover::after,
.main-nav li:not(.current-menu-item):not(.current_page_item) > a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after,
.main-nav a.active::after {
  display: none !important;
}

/* ==========================================================================
   ВАРИАНТ 1 — Классический
   ========================================================================== */
body.header-style-classic .site-header {
  background: #ffffff;
  border-bottom: none;
  box-shadow: 0 2px 12px rgba(0, 57, 166, 0.08);
}

body.header-style-classic .site-branding a,
body.header-style-classic .site-logo,
body.header-style-classic .site-title {
  color: #212529;
}

body.header-style-classic .site-title span,
body.header-style-classic .site-logo span {
  color: #0039A6;
}

body.header-style-classic .main-nav a {
  color: #343a40;
}

body.header-style-classic .main-nav a:hover {
  color: #0039A6;
  background: #e8f0fe;
}

body.header-style-classic .main-nav a:not(.active)::after,
body.header-style-classic .main-nav li:not(.current-menu-item):not(.current_page_item) > a::after {
  background: #0039A6;
}

body.header-style-classic .main-nav .current-menu-item > a,
body.header-style-classic .main-nav .current_page_item > a,
body.header-style-classic .main-nav a.active {
  color: #ffffff !important;
  background: #D52B1E !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(213, 43, 30, 0.3);
}

body.header-style-classic .main-nav .current-menu-item > a:hover,
body.header-style-classic .main-nav .current_page_item > a:hover,
body.header-style-classic .main-nav a.active:hover {
  background: #b01f15 !important;
  color: #ffffff !important;
}

body.header-style-classic .menu-toggle {
  color: #212529;
}

/* ==========================================================================
   ВАРИАНТ 2 — Синий градиент + лого на белом
   ========================================================================== */
body.header-style-gradient .site-header {
  background: linear-gradient(135deg, #001a4d 0%, #0039A6 50%, #002b7f 100%);
  border-bottom: none;
  box-shadow: 0 4px 20px rgba(0, 26, 77, 0.35);
}

body.header-style-gradient .site-branding {
  background: #ffffff;
  border-radius: 12px;
  padding: 6px 14px 6px 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

body.header-style-gradient .site-branding a,
body.header-style-gradient .site-logo,
body.header-style-gradient .site-title {
  color: #212529;
}

body.header-style-gradient .site-title span,
body.header-style-gradient .site-logo span {
  color: #0039A6;
}

body.header-style-gradient .main-nav a {
  color: rgba(255, 255, 255, 0.92);
}

body.header-style-gradient .main-nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

body.header-style-gradient .main-nav a:not(.active)::after,
body.header-style-gradient .main-nav li:not(.current-menu-item):not(.current_page_item) > a::after {
  background: #ffffff;
}

body.header-style-gradient .main-nav .current-menu-item > a,
body.header-style-gradient .main-nav .current_page_item > a,
body.header-style-gradient .main-nav a.active {
  color: #ffffff !important;
  background: #D52B1E !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(213, 43, 30, 0.4);
}

body.header-style-gradient .main-nav .current-menu-item > a:hover,
body.header-style-gradient .main-nav .current_page_item > a:hover,
body.header-style-gradient .main-nav a.active:hover {
  background: #b01f15 !important;
}

body.header-style-gradient .menu-toggle {
  color: #ffffff;
}

body.header-style-gradient .main-nav .sub-menu {
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

body.header-style-gradient .main-nav .sub-menu a {
  color: #343a40;
}

body.header-style-gradient .main-nav .sub-menu a:hover {
  background: #e8f0fe;
  color: #0039A6;
}

body.header-style-gradient .main-nav .sub-menu a::after {
  display: none !important;
}

/* ==========================================================================
   ПЛАНШЕТ / МОБИЛЬНЫЙ — обязательно восстанавливаем поведение темы
   ========================================================================== */
@media (max-width: 992px) {
  /* Десктоп-меню скрыто, бургер виден (как в оригинале темы) */
  .main-nav {
    display: none !important;
  }

  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }

  /* Лого-подложка компактнее на градиенте */
  body.header-style-gradient .site-branding {
    padding: 4px 10px 4px 8px;
    border-radius: 10px;
  }

  body.header-style-gradient .site-branding img,
  body.header-style-gradient .site-branding .custom-logo {
    height: 36px;
    max-height: 36px;
  }

  /* Мобильное оверлей-меню — всегда светлое, независимо от варианта шапки */
  .mobile-menu {
    background: #ffffff !important;
  }

  .mobile-menu-header .site-branding,
  .mobile-menu-header .site-logo {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .mobile-nav a {
    color: #212529 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .mobile-nav a::after {
    display: none !important;
  }

  .mobile-nav a:hover,
  .mobile-nav .current-menu-item > a {
    color: #0039A6 !important;
    background: transparent !important;
  }

  .mobile-nav .sub-menu a {
    color: #343a40 !important;
  }

  /* Бургер: цвет по варианту шапки */
  body.header-style-classic .menu-toggle {
    color: #212529 !important;
  }

  body.header-style-gradient .menu-toggle {
    color: #b01f15 !important;
  }
}

@media (max-width: 600px) {
  body.header-style-gradient .site-branding {
    padding: 4px 8px;
  }
}