/* ========== АДАПТИВНОСТЬ ДО 768px ========== */
@media (max-width: 768px) {
  /* ----- ЕДИНЫЕ ОТСТУПЫ ДЛЯ ВСЕГО КОНТЕНТА ----- */
  .site-wrapper {
    max-width: 100%;
    padding: 0 15px !important;
    box-sizing: border-box;
  }

  /* Шапка — без отступов, они есть у родителя */
  .header {
    padding: 20px 0 10px 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
  }

  /* Скрываем обычный контент .title-row в .page-content */
  .page-content .title-row {
    display: none !important;
  }

  /* Показываем мобильный заголовок в шапке */
  .mobile-only {
    display: block !important;
  }

  /* Стили для мобильного заголовка */
  .header__title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-top: 10px;
  }

  .header__title-row .title-row {
    justify-content: flex-start !important; /* ← отменяем space-between */
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .header__title-row .title-row p {
    font-size: 14px;
    margin: 0;
  }

  .header__title-row .large-text {
    font-size: 20px;
  }

  .header__title-row .link-with-arrow {
    font-size: 12px;
    gap: 4px;
  }

  .header__title-row .link-with-arrow .arrow-icon {
    width: 12px;
    height: 12px;
  }

  /* Контейнер бургера */
  .header__container {
    display: flex !important;
    justify-content: flex-end !important; /* прижимаем к правому краю */
    padding: 0 !important;
    margin-top: 0 !important;
  }

  /* ===== КНОПКА БУРГЕРА ===== */
  .burger {
    display: flex !important; /* показываем бургер */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    position: relative;
  }

  /* Изображение шапки */
  .header__image {
    width: 100%;
    max-width: 100%;
  }

  .burger__line {
    width: 100%;
    height: 2px;
    background-color: #032d69;
    transition: all 0.3s ease;
  }

  /* Анимация бургера в крестик */
  .burger.active .line1 {
    transform: translateY(9px) rotate(45deg);
  }

  .burger.active .line2 {
    opacity: 0;
  }

  .burger.active .line3 {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Меню (выезжающее) */
  .menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    margin: 0;
    padding: 80px 20px 30px !important;
    background-color: #fff;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .menu::before,
  .menu::after {
    display: none;
  }

  .menu.active {
    left: 0;
  }

  .menu__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }

  .menu__item {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
  }

  .menu__link {
    font-size: 18px;
  }

  /* Выпадающий список */
  .menu__item--dropdown {
    position: static;
  }

  .menu__sublist {
    position: static;
    display: none;
    width: 100%;
    background-color: #f9f9f9;
    margin-top: 10px;
    padding: 10px 0;
  }

  .menu__item--dropdown.active .menu__sublist {
    display: block;
  }

  /* Поиск в меню */
  .menu__item--search {
    margin-left: 0;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
  }

  /* ----- ОСНОВНОЙ КОНТЕНТ ----- */
  .main {
    padding: 0 !important;
    margin: 0 !important;
  }

  .page-content {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ----- ЗАГОЛОВОК С НОМЕРОМ ----- */
  .title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0 !important;
    margin: 0 0 20px 0;
  }

  .title-row p {
    font-size: 14px;
    margin: 0;
  }

  .large-text {
    font-size: 28px;
  }

  .link-with-arrow {
    font-size: 14px;
    gap: 8px;
  }

  .link-with-arrow .arrow-icon {
    display: none;
  }

  .link-with-arrow::after {
    content: ' →';
    font-size: 16px;
    font-weight: bold;
    color: #032d69;
  }

  /* ----- ГОРИЗОНТАЛЬНАЯ ЧЕРТА ----- */
  .title-hr {
    margin: 20px 0;
    width: 100%;
  }

  /* ----- ГЛАВНАЯ СТАТЬЯ ----- */
  .lead-article-link {
    display: block;
    margin: 0 0 15px 0;
  }

  .lead-article-link h1 {
    font-size: 28px;
    margin: 0 0 0 0;
  }

  .content-image {
    width: 100%;
    height: auto;
    margin-bottom: 15px;
  }

  .lead {
    font-size: 16px;
    line-height: 1.5;
  }

  /* ----- СЕТКА НОВОСТЕЙ ----- */
  .news-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 20px 0;
    padding: 0 !important;
  }

  .news-card {
    margin: 0;
  }

  .news-image {
    height: auto;
  }

  .news-image img {
    width: 100%;
    height: auto;
  }

  .news-title {
    font-size: 18px;
    margin-top: 10px;
  }

  .news-tag {
    font-size: 14px;
  }

  /* ----- АРХИВ ----- */
  .archive-title {
    font-size: 22px;
    margin: 30px 0 20px 0;
  }

  .archives-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px 0;
    padding: 0 !important;
  }

  .archives-card {
    width: 100%;
  }

  .archives-card img {
    width: 100%;
    height: auto;
  }

  .archives-card .link-number {
    font-size: 16px;
  }

  .archives-card .link-date {
    font-size: 12px;
  }

  .archives-card.button-card {
    display: flex !important;
    justify-content: center !important; /* центр по горизонтали */
    align-items: center !important; /* центр по вертикали */
  }

  .more-button {
    max-width: 138px;
    margin: 0 !important;
  }

  /* ===== ФУТЕР ===== */
  .site-footer {
    padding: 0 0 20px 0 !important;
    margin: 40px 0 0 0 !important;
    background-color: #f6f6f6;
  }

  .footer-container {
    padding: 0 15px !important;
    gap: 20px !important;
  }

  .footer-divider-top {
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    display: block;
  }

  .footer-divider-bottom {
    width: 100% !important;
    margin: 0 auto 0 auto !important;
    display: block;
    height: 1px;
    background-color: #032d69;
    border: none;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .footer-logo {
    flex-shrink: 1;
    width: 100%;
    text-align: center;
  }

  .footer-logo img {
    width: 100%;
    height: auto;
  }

  .footer-right {
    align-items: flex-start;
    width: 100%;
    gap: 15px;
  }

  /* ===== МЕНЮ ФУТЕРА В ОДНУ СТРОКУ ===== */
  .footer-nav {
    width: 100%;
    overflow-x: auto; /* если не влезают — скролл */
  }

  .footer-nav ul {
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 0 !important;
    flex-wrap: nowrap !important; /* ЗАПРЕЩАЕМ ПЕРЕНОС */
  }

  .footer-nav li {
    flex: 1;
    text-align: center;
    list-style: none;
  }

  .footer-nav a {
    font-size: 10px !important;
    white-space: nowrap;
    text-decoration: none;
  }

  /* Убираем все переносы */
  .footer-nav ul li:nth-child(4),
  .footer-nav ul li:nth-child(5) {
    flex-basis: auto !important;
    flex: 1 !important;
  }

  .footer-copyright p {
    font-size: 14px;
    text-align: left;
    margin-bottom: 0 !important;
  }

  .footer-extra p {
    font-size: 12px;
    text-align: left;
    margin-bottom: 0 !important;
  }

  /* Принудительно ставим кнопку под заголовок */
  .header__title-row .title-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 5px !important;
  }

  /* Убираем лишние отступы у кнопки */
  .header__title-row .link-with-arrow {
    margin-left: 0 !important;
    margin-right: auto !important;
  }

  .search-page {
    padding: 0 15px;
  }

  .search-page h1 {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .search-form-large {
    flex-direction: column;
    gap: 10px;
  }

  .search-form-large button {
    width: 100%;
  }

  .search-result-item h3 a {
    font-size: 18px;
  }
}
