/* MOBILE STYLES - ONLY FOR MAX-WIDTH 768PX */
@media (max-width: 768px) {
  
  /* HEADER: Fixed positioning */
  header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
  }
  
  body {
    padding-top: 72px !important;
  }
  
  .nav-row {
    padding: 10px 14px;
    min-height: 56px;
    align-items: center;
    position: relative;
  }
  
  /* HIDE desktop navigation on mobile */
  nav.main-nav {
    display: none !important;
  }
  
  .more-dropdown {
    display: none !important;
  }
  
  .socials {
    display: none !important;
  }
  
  /* LANGUAGE SELECTOR: show on mobile, position on the left side - ВЫШЕ */
  .lang-wrap {
    display: flex !important;
    position: absolute !important;
    left: 16px !important;
    right: auto !important;
    top: 6px !important; /* поднято чуть выше */
    transform: none !important; /* сбрасываем translateY(-50%) из desktop-правил */
    z-index: 130 !important;
  }
  
  /* LANGUAGE DROPDOWN: появляется в том же месте */
  .lang-wrap .lang-dropdown,
  .lang-wrap [class*="dropdown"],
  .lang-wrap + div,
  div[id*="lang"] {
    position: absolute !important;
    left: 0 !important;
    right: auto !important;
    top: 100% !important;
    margin-top: 4px !important;
  }
  
  /* BRAND: keep logo visible on mobile */
  .brand {
    display: flex !important;
    align-items: center;
  }
  
  /* Уменьшаем лого футер в header в 3 раза на ВСЕХ страницах */
  #site-logo,
  .brand img {
    width: 73px !important; /* 220 / 3 ≈ 73 */
    height: auto !important;
  }
  
  /* MOBILE TOGGLE: позиция выше и правее */
  #mobileToggle {
    display: inline-flex !important;
    position: absolute;
    right: 16px;
    top: 8px; /* еще выше на мобильной версии */
    background: transparent;
    border: 0;
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 130;
  }
  
  .mobile-toggle-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
  }
  
  /* MOBILE MENU: список вертикально */
  .mobile-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(11, 99, 183, 0.98), rgba(11, 99, 183, 0.98));
    color: #fff;
    padding: 18px;
    display: none;
    z-index: 200;
    overflow-y: auto;
    transform: translateY(-8%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
  }
  
  .mobile-menu.open {
    display: block !important;
    transform: translateY(0);
    opacity: 1;
  }
  
  /* Кнопки в мобильном меню - СПИСОК (вертикально, не в разброс) */
  .mobile-menu nav {
    display: flex;
    flex-direction: column; /* ВЕРТИКАЛЬНЫЙ список */
    gap: 0;
  }
  
  .mobile-menu a {
    display: block;
    padding: 16px 12px; /* Больше padding для удобства */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    text-align: left;
    font-size: 16px;
  }
  
  .mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .close-btn {
    display: inline-block !important;
    margin-bottom: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #fff;
    border: 0;
    cursor: pointer;
    font-weight: 700;
  }
  
  /* FEDERATION BLOCK: Сохраняем десктопную версию (НЕ расплющиваем) */
  .federation-hero {
    padding: 20px 0 !important;
  }
  
  .federation-container {
    display: flex !important;
    flex-direction: row !important; /* НЕ column */
    align-items: center !important;
    justify-content: space-between !important;
    width: 95% !important;
    max-width: 95% !important;
    margin: 0 auto !important;
    padding: 15px 20px !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    background: linear-gradient(
      90deg,
      #5ea5e6 0%,
      #5da1e0 11%,
      #e8e8e8 25%,
      #e6e6e7 70%,
      #f9fafb 85%,
      #ffffff 100%
    ) !important;
  }
  
  .federation-logo {
    flex-shrink: 0;
  }
  
  .federation-logo img {
    width: 80px !important;
    height: auto !important;
    object-fit: contain !important;
  }
  
  .federation-text {
    text-align: center !important;
    flex: 1 !important;
    margin: 0 10px !important;
  }
  
  .federation-text h1 {
    font-size: 11px !important;
    line-height: 1.2 !important;
    margin: 2px 0 4px !important;
    font-weight: 800 !important;
    color: #0b63b7 !important;
  }
  
  .federation-text h2 {
    font-size: 7px !important;
    margin: 2px 0 !important;
    font-weight: 700 !important;
    color: #333 !important;
    line-height: 1.2 !important;
  }
  
  /* CONTENT: reduce sizes */
  .section h2 {
    font-size: 22px !important;
  }
  
  .news-title {
    font-size: 16px !important;
  }
  
  .news-excerpt {
    font-size: 14px !important;
  }
  
  /* MAP: smaller on mobile */
  .map-frame {
    height: 360px !important;
    border: 0 !important; /* убираем синюю рамку */
  }
  
  /* DOCUMENTS/EVENTS: ВЕРТИКАЛЬНЫЙ СПИСОК */
  .events-grid {
    display: flex !important;
    flex-direction: column !important; /* ВЕРТИКАЛЬНО */
    gap: 16px !important;
    padding-bottom: 12px !important;
  }
  
  .events-grid .event-card {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
  }
  
  /* УБИРАЕМ стрелки для прокрутки документов на главной */
  #docsLeft,
  #docsRight {
    display: none !important;
  }
  
  /* NEWS: ВЕРТИКАЛЬНЫЙ СПИСОК */
  .news-grid {
    display: flex !important;
    flex-direction: column !important; /* ВЕРТИКАЛЬНО */
    gap: 16px !important;
    padding-bottom: 12px !important;
  }
  
  .news-card {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* FOOTER: убираем навигацию, оставляем только соц сети и лого */
  .footer-nav {
    display: none !important;
  }
  
  .footer-inner nav {
    display: none !important;
  }
  
  .footer-inner {
    flex-direction: column !important;
    gap: 12px !important;
    padding: 18px !important;
  }
  
  /* Footer logo and socials VISIBLE on mobile */
  .footer-logo-large {
    display: flex !important;
    justify-content: center;
    padding: 12px;
  }
  
  .footer-logo-large img {
    width: 160px !important;
    height: 60px !important;
  }
  
  .footer-socials {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .footer-socials a img {
    width: 32px !important;
    height: 32px !important;
  }
  
  /* УБИРАЕМ стрелки для прокрутки на главной */
  .news-arrow,
  .docs-arrow {
    display: none !important;
  }
  
  /* Container adjustments */
  .container {
    padding: 18px 12px !important;
  }
  
  /* УБИРАЕМ socials из header - они только в футере */
  header .footer-socials {
    display: none !important;
  }
  
  /* LEADERSHIP.HTML: убираем кнопку языка и центрируем лого */
  body[class*="leadership"] .lang-wrap,
  [href*="leadership"] ~ .lang-wrap {
    display: none !important;
  }
  
  /* Центрируем лого в шапке на leadership.html */
  body:has([href*="leadership.html"]) .brand,
  body:has(a[href="leadership.html"]) .brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0 auto;
  }
  
  /* MEDIA.HTML: убираем синюю рамку у изображений */
  .slider img,
  .lightbox-content img {
    border: 0 !important;
  }
  
  /* УБИРАЕМ язык со всех страниц кроме index.html */
  body:not(:has(#news, #docs)) #langWrap {
    display: none !important;
  }
}
