/**
 * =============================================================================
 * MOBILE.CSS — Адаптивные стили для мобильных устройств
 * =============================================================================
 *
 * Содержание:
 * 1. Базовые мобильные настройки
 * 2. Адаптивные изображения (пропорции)
 * 3. Адаптивные иконки и SVG
 * 4. Мобильные таблицы (адаптация)
 * 5. Мобильный слайдер (пропорции)
 * 6. Мобильные формы
 * 7. Типографика и отступы
 * 8. Навигация и меню
 * 9. Footer и sidebar
 * 10. Производительность и доступность
 */


/* =============================================================================
   1. БАЗОВЫЕ МОБИЛЬНЫЕ НАСТРОЙКИ
   ============================================================================= */


/* Убираем минимальную ширину тела на мобильных */
@media (max-width: 1024px) {
  body {
    min-width: auto;
    overflow-x: auto;
  }

  /* Коррекция padding-top для корректного отображения под фиксированной шапкой */
  body {
    padding-top: 50px;
  }
}


/* Убираем highlight при тапе на мобильных */
@media (max-width: 1024px) {
  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  }

  a:active,
  button:active {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
}


/* =============================================================================
   2. АДАПТИВНЫЕ ИЗОБРАЖЕНИЯ (ПРОПОРЦИИ)
   ============================================================================= */

/* Базовая адаптивность для всех изображений */
@media (max-width: 1024px) {
  /* Все изображения адаптируются */
  img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
  }

  /* Изображения с классом zoomD - адаптивность */
  .zoomD {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
  }

  /* Изображения zoomD с фиксированной высотой */
  .zoomD[height] {
    height: auto !important;
    max-height: 300px;
  }

  /* Изображения в контенте */
  .contentBox img,
  .article img,
  .beforeText img,
  .twoSections img {
    max-width: 100%;
    display: block;
  }

  /* Плавающие изображения */
  .float-left,
  .float-right {
    float: none !important;
    display: block;
    margin: 15px auto !important;
    max-width: 100%;
  }

  /* Изображения с фиксированной высотой */
  img[height] {
    height: auto !important;
    max-height: 400px;
  }

  /* Изображения в карточках */
  .card-wrapper-image img,
  .mainpage-grids-container .card img {
    width: 100%;
    height: 100%;
  }

  /* Изображения в горизонтальных карточках */
  .horizontal-card-picture img {
    width: 100%;
    height: auto;
  }

  /* Галереи и слайды */
  .slideshow-container img,
  .slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* Thumbnails */
  .slideshow-thumbnails img {
    width: auto;
    height: 100%;
    object-fit: cover;
  }

  /* Логотипы и гербы */
  .logos,
  .logos img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100px;
    object-fit: contain;
  }

  /* Изображения в таблицах */
  table img {
    max-width: 100px;
    height: auto;
    object-fit: contain;
  }

  .headline-index {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .logos,
  .logos img {
    max-height: 80px;
  }

  .logo-pictogram,
  .logo-pictogram img {
    max-height: 100px;
  }



  .slideshow-thumbnails {
    height: 80px;
  }

  .slideshow-thumbnails img {
    height: 100%;
    width: auto;
  }
}

@media (max-width: 480px) {
  .logos,
  .logos img {
    max-height: 60px;
  }

  .logo-pictogram,
  .logo-pictogram img {
    max-height: 80px;
  }

  .horizontal-card-picture {
    max-width: 150px;
  }



  .headline {
    font-size: 1.3rem;
    line-height: 1.1;
  }

  .administration-descr {
    font-size: 1.0rem;
  }

  .slideshow-thumbnails {
    height: 60px;
  }

  /* Очень маленькие изображения в таблицах */
  table img {
    max-width: 60px;
  }
}


/* =============================================================================
   3. АДАПТИВНЫЕ ИКОНКИ И SVG
   ============================================================================= */

/* Примечание: Стили для .mobile-menu-*, .service-icon-*, .contact-icon-* 
   находятся в mobile-menu.css и имеют более высокий приоритет */

@media (max-width: 1024px) {
  /* Иконки в шапке */
  .mediaLinks img,
  .helpers a img,
  .helpers button img {
    width: 22px;
    height: 22px;
    object-fit: contain;
  }

  /* Иконка поиска */
  .searchButton img {
    width: 16px;
    height: 16px;
  }

  /* SVG иконки в кнопках слайдера */
  .prev::before,
  .next::before,
  .playback::before {
    background-size: contain !important;
    background-position: center !important;
  }
}

@media (max-width: 768px) {
  .mediaLinks img,
  .helpers a img,
  .helpers button img {
    width: 20px;
    height: 20px;
  }

  .searchButton img {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {
  .mediaLinks img,
  .helpers a img,
  .helpers button img {
    width: 18px;
    height: 18px;
  }

  .searchButton img {
    width: 12px;
    height: 12px;
  }
}


/* =============================================================================
   4. МОБИЛЬНЫЕ ТАБЛИЦЫ (АДАПТАЦИЯ)
   ============================================================================= */

/* Горизонтальный скролл для таблиц на планшетах */
@media (max-width: 1024px) {
  /* Обёртка для таблиц с горизонтальным скроллом */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  /* Базовые стили таблицы */
  table {
    font-size: 0.85rem;
    width: 100%;
    display: table;
    table-layout: fixed;
  }

  table thead th {
    padding: 10px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    width: auto;
  }

  table td {
    padding: 8px 6px;
    font-size: 0.85rem;
    width: 100%;
    word-wrap: break-word;
  }

  /* Сохраняем пропорции ячеек */

}

/* Карточный вид для таблиц на мобильных */
@media (max-width: 768px) {
  .table-responsive {
    border: none;
  }

  table {
    font-size: 0.8rem;
    width: 100%;
    display: table;
    table-layout: fixed;
  }

  table thead th {
    padding: 8px 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    width: auto;
  }

  table td {
    padding: 6px 5px;
    font-size: 0.8rem;
    width: 100%;
    word-wrap: break-word;
  }
}

/* Полная трансформация таблиц в карточки на очень маленьких экранах */
@media (max-width: 480px) {
  /* Включаем карточный вид только для таблиц с классом table-card-view */
  .table-card-view,
  .table-card-view thead,
  .table-card-view tbody,
  .table-card-view th,
  .table-card-view td,
  .table-card-view tr {
    display: block;
  }

  /* Скрываем заголовок таблицы */
  .table-card-view thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  /* Стили для строк-карточек */
  .table-card-view tr {
    border: 2px solid rgb(49, 139, 45);
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: #efefef;
    padding: 10px;
  }

  .table-card-view tr:nth-child(2n) {
    background-color: rgba(0, 0, 0, 0.04);
  }

  /* Ячейки как строки */
  .table-card-view td {
    border: none;
    position: relative;
    padding-left: 50%;
    padding: 8px 5px 8px 45%;
    text-align: left;
  }

  /* Псевдоэлемент с названием колонки */
  .table-card-view td:before {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 40%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    content: attr(data-label);
    color: rgb(49, 139, 45);
  }

  /* Особые стили для заголовков в карточном виде */
  .table-card-view th {
    display: block;
    background-color: rgb(49, 139, 45);
    color: #fff;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    margin-bottom: 5px;
  }

  /* Скругления для карточек */
  .table-card-view tr:last-child td:first-child {
    border-bottom-left-radius: 10px;
  }

  .table-card-view tr:last-child td:last-child {
    border-bottom-right-radius: 10px;
  }
}


/* =============================================================================
   4.1. АДАПТАЦИЯ КОНТАКТНЫХ СЕТОК
   ============================================================================= */

@media (max-width: 768px) {
  /* Сетка контактов */
  .i-m-tired-naming-grids {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .i-m-tired-naming-grids .grid-tired-element:first-child {
    grid-column: auto;
  }

  .grid-tired-element {
    padding: 15px;
  }

  .list-headings {
    font-size: 1.3rem;
  }

  .subheading {
    font-size: 1.1rem;
  }

  /* Изображения в контактах */
  .grid-tired-element img[align] {
    float: none !important;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px !important;
  }
}

@media (max-width: 480px) {
  .i-m-tired-naming-grids {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .grid-tired-element {
    padding: 12px;
  }

  .list-headings {
    font-size: 1.2rem;
  }

  .subheading {
    font-size: 1rem;
  }

  .grid-tired-element img[align] {
    width: 16px;
    height: 16px;
  }

  .grid-tired-element a {
    word-break: break-word;
  }
}


/* =============================================================================
   5. МОБИЛЬНЫЙ СЛАЙДЕР (ПРОПОРЦИИ)
   ============================================================================= */

/* Слайдер истории - адаптация */
@media (max-width: 1024px) {
  .ancient-slider {
    width: 100%;
    max-width: 700px;
    height: auto;
    aspect-ratio: 16/9;
    min-height: 280px;
  }

  .ancient-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .ext-anc-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  /* ContentBox с фиксированной шириной (страница истории) */
  .contentBox[style*="width"],
  .contentBox[style*="700"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  .ancient-slider {
    min-height: 250px;
  }

  .ext-anc-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .ancient-slider {
    min-height: 200px;
  }

  .ext-anc-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

/* Примечание: Стили для .slider, .container-slider находятся в slider.css */

/* Карусель ссылок в футере — стили находятся в slider.css */


/* =============================================================================
   6. МОБИЛЬНЫЕ ФОРМЫ
   ============================================================================= */

@media (max-width: 1024px) {
  /* Поля ввода */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px; /* Предотвращает зум на iOS */
    padding: 12px;
    min-height: 44px;
    width: 100%;
  }

  /* Кнопки форм
  input[type="submit"],
  input[type="button"],
  button[type="submit"],
  button[type="button"],
  .btn {
    padding: 12px 24px;
    font-size: 1rem;
    min-height: 48px;
    min-width: 48px;
  } */

  /* Формы в ширину экрана */
  .rendered-form {
    width: 100%;
    max-width: 100%;
    padding: 0 10px;
  }

  .rendered-form input,
  .rendered-form textarea {
    padding: 10px;
  }
}

@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  textarea {
    padding: 10px;
  }

  .rendered-form {
    padding: 0 5px;
  }
}

@media (max-width: 480px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  textarea {
    font-size: 16px;
    padding: 10px;
  }

  input[type="submit"],
  button[type="submit"],
  .btn {
    width: 100%;
    padding: 14px;
  }
}


/* =============================================================================
   7. ТИПОГРАФИКА И ОТСТУПЫ
   ============================================================================= */

@media (max-width: 1024px) {
  /* Базовый размер шрифта */
  body {
    font-size: 1rem;
  }

  /* Заголовки */
  h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.3rem;
    line-height: 1.3;
  }

  h4 {
    font-size: 1.1rem;
    line-height: 1.4;
  }

  /* Текст */
  p {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* Уменьшаем внешние отступы контейнеров */
  .narrowWrap {
    padding: 0 15px;
  }

  /* Контентная область */
  .contentBox {
    padding: 0 10px 15px 10px;
  }

  /* Двухсекционный layout */
  .twoSections {
    padding: 15px 0;
  }

  /* Карточки */
  .card-block,
  .card-block-solo {
    padding: 15px;
    margin-bottom: 20px;
    padding-left: 23px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  h4 {
    font-size: 1rem;
  }

  p {
    font-size: 0.95rem;
  }

  .narrowWrap {
    padding: 0 10px;
  }

  .contentBox {
    padding: 0 5px 10px 5px;
  }

  .twoSections {
    padding: 10px 0;
    flex-direction: column;
  }

  .indexBar {
    flex: none;
    width: 100%;
    padding: 0 15px 20px 15px;
  }

  .card-block,
  .card-block-solo {
    padding: 12px;
    margin-bottom: 15px;
    padding-left: 23px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }

  h3 {
    font-size: 1.1rem;
  }

  p {
    font-size: 0.9rem;
  }

  .narrowWrap {
    padding: 0 8px;
  }

  .contentBox {
    padding: 0 3px 8px 3px;
  }

  .card-block,
  .card-block-solo {
    padding: 10px;
    padding-left: 23px;
    margin-bottom: 12px;
  }
}


/* =============================================================================
   8. НАВИГАЦИЯ И МЕНЮ
   ============================================================================= */

/* Хлебные крошки и кнопка "Наверх" — стили остаются в mobile.css */
@media (max-width: 1024px) {
  /* Хлебные крошки */
  .breadcrumb {
    font-size: 14px;
    padding: 0 10px 10px 10px;
  }

  .breadcrumb a,
  .breadcrumb span {
    font-size: 13px;
  }

  .breadcrumb a:not(:last-child)::after,
  .breadcrumb span:not(:last-child)::after {
    width: 12px;
    height: 12px;
    margin: 0 5px;
  }

  /* Кнопка "Наверх" */
  .upButton {
    width: 60px;
    height: 60px;
    right: 20px;
    bottom: 20px;
  }

  .upButton::before {
    position: absolute;
    top: 12px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px transparent;
    border-bottom: 8px solid #efefef;
  }

  .upButton p {
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  .breadcrumb {
    font-size: 13px;
    padding: 0 8px 8px 8px;
    flex-wrap: wrap;
  }

  .breadcrumb a,
  .breadcrumb span {
    font-size: 12px;
  }

  /* Скрываем промежуточные крошки */
  .breadcrumb a:nth-child(2),
  .breadcrumb span:nth-child(2) {
    display: none;
  }

  .breadcrumb a:not(:last-child)::after,
  .breadcrumb span:not(:last-child)::after {
    width: 10px;
    height: 10px;
    margin: 0 4px;
  }

  .upButton {
    width: 55px;
    height: 55px;
    right: 15px;
    bottom: 15px;
  }

  /* Аккордеон */
  .accordion {
    font-size: 1rem;
    padding: 12px;
  }

  .panel a {
    font-size: 0.95rem;
    padding: 10px 15px;
  }
}

@media (max-width: 480px) {
  .upButton {
    width: 50px;
    height: 50px;
    right: 15px;
    bottom: 15px;
  }

  .breadcrumb {
    font-size: 12px;
    padding: 0 5px 5px 5px;
  }

  .breadcrumb a,
  .breadcrumb span {
    font-size: 11px;
  }

  .accordion {
    font-size: 0.95rem;
    padding: 10px;
  }

  .panel a {
    font-size: 0.9rem;
    padding: 8px 12px;
  }
}


/* =============================================================================
   9. FOOTER И SIDEBAR
   ============================================================================= */

@media (max-width: 1024px) {
  /* Скрываем боковое меню */
  .indexBar {
    display: none;
  }

  .slideBar {
    width: 100%;
  }

  /* Footer */
  footer {
    padding: 15px 0;
  }

  .footerContainer {
    flex-direction: column;
    padding: 0 15px;
  }

  footer .pictograms {
    flex-direction: row;
    justify-content: center;
    padding: 0 0 15px 0;
    width: 100%;
    min-width: auto;
  }

  .footerContainer h2 {
    font-size: 1.2rem;
    text-align: center;
  }

  .addressContainer > div {
    text-align: center;
    padding: 0 10px;
    min-width: 100%;
  }

  .governmentLinks p {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .footerContainer h2 {
    font-size: 1.1rem;
  }

  .addressContainer p {
    font-size: 0.9rem;
  }

  .governmentLinks p {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  footer {
    padding: 10px 0;
  }

  .footerContainer {
    padding: 0 10px;
  }

  .footerContainer h2 {
    font-size: 1rem;
  }

  .addressContainer p {
    font-size: 0.85rem;
  }

  .registrationInfo {
    font-size: 0.8rem;
    text-align: center;
  }

  .governmentLinks p {
    gap: 8px;
  }

  .content-spreader {
    flex-direction: column;
  }

  .image-container {
    flex: 100% 0 0;
  }

  .text-container {
    margin: 0;
  }

  .pale-button {
    font-size: 14px;
  }

  

  
}


/* =============================================================================
   12. ЛАЙТБОКС ДЛЯ ИЗОБРАЖЕНИЙ (ZOOM)
   ============================================================================= */

/* Фон лайтбокса */
#lb-back {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999999;
  visibility: hidden;
  opacity: 0;
  transition: all ease 0.3s;
}

#lb-back.show {
  visibility: visible;
  opacity: 1;
}

/* Контейнер изображения */
#lb-img {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90%;
  max-width: 95%;
  position: relative;
}

#lb-img img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  cursor: zoom-in;
  /* Гарантируем центрирование */
  display: block;
  margin: auto;
}

#lb-img img.magnify {
  cursor: zoom-out;
}

/* Кнопка увеличения (лупа) */
.lens {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background-color: #efefef;
  border: 2px solid #383838;
  border-radius: 5px;
  background-image: url('/template/icon/magnifier.svg');
  background-size: 25px 25px;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1000;
  transition: all 0.2s ease;
}

.lens:hover {
  background-color: #fff;
  transform: scale(1.1);
}

/* Кнопка закрытия */
#lb-back::before {
  content: "✕";
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  z-index: 1001;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: all 0.2s ease;
}

#lb-back::before:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Увеличительное стекло */
.img-magnifier-glass {
  position: fixed;
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: none;
  background-repeat: no-repeat;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 100;
  /* Размеры для ПК — большая область для удобного увеличения */
  width: 400px;
  height: 300px;
  /* Указываем, что стекло не должно влиять на layout */
  pointer-events: none;
  /* Оптимизация для плавной работы */
  will-change: transform, background-position;
  transition: none !important;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
  #lb-img {
    height: 80%;
  }

  .lens {
    width: 35px;
    height: 35px;
    bottom: 15px;
    right: 15px;
    background-size: 20px 20px;
  }

  #lb-back::before {
    font-size: 35px;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
  }

  .img-magnifier-glass {
    width: 250px;
    height: 200px;
    position: fixed;
  }
}

@media (max-width: 480px) {
  #lb-img {
    height: 75%;
  }

  .lens {
    width: 30px;
    height: 30px;
    bottom: 10px;
    right: 10px;
    background-size: 18px 18px;
  }

  #lb-back::before {
    font-size: 30px;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .img-magnifier-glass {
    width: 150px;
    height: 120px;
    position: fixed;
  }
}


/* =============================================================================
   13. ПРОИЗВОДИТЕЛЬНОСТЬ И ДОСТУПНОСТЬ
   ============================================================================= */

/* Уменьшаем анимации для пользователей, предпочитающих reduced motion */
@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;
  }
}


/* Увеличенные области клика для touch-устройств */
@media (max-width: 1024px) {
  a, button, input[type="submit"], input[type="button"] {
    min-height: 22px;
    min-width: 44px;
  }

  .nav-menu li a {
    min-height: 48px;
    padding: 12px 16px;
  }

  .searchButton,
  .accessibility,
  .lang__link {
    padding: 8px;
  }
}


/* Скрытие элементов на мобильных */
@media (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }

  .header-top .contacts address > div:last-child {
    display: none;
  }
}

@media (max-width: 768px) {
  .mobile-only {
    display: block !important;
  }

  .title span {
    display: none;
  }
}

@media (max-width: 480px) {
  .helpers a:first-child {
    display: none;
  }
}


/* =============================================================================
   11. КАРТОЧКИ И СЕТКИ
   ============================================================================= */

@media (max-width: 1024px) {
  .grid-3-downto-2-column {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .grid-4-column {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .grid-5-column {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .grid-3-downto-2-column {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .grid-4-column {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .grid-5-column {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .horizontal-card {
    flex-direction: row;
  }

  .horizontal-card-picture {
    width: 200px;
   
  }
}

@media (max-width: 480px) {
  .grid-5-column {
    grid-template-columns: 1fr;
  }

  .card-wrapper-image {
    height: 180px;
  }

  .card-wrapper-text {
    padding: 10px;
  }

   .horizontal-card-picture {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
  }
  .horizontal-card-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}


/* =============================================================================
   12. СПЕЦИАЛЬНАЯ ВЕРСИЯ (ДЛЯ СЛАБОВИДЯЩИХ)
   ============================================================================= */

@media (max-width: 768px) {
  .accessibility-block a {
    left: 10px;
    top: -80px;
  }

  .accessibility-block a:focus {
    top: 60px;
  }

  #special {
    padding: 6px 0;
  }

  #special button {
    font-size: 18px !important;
    min-width: 28px;
  }
}

@media (max-width: 480px) {
  #special {
    padding: 4px 0;
  }

  #special button {
    font-size: 16px !important;
    min-width: 24px;
    padding: 3px;
  }

  #special .special-panel span {
    display: none;
  }

  /* Стили для страницы учреждений */
  .institutions-contact-block {
    gap: 5px;
  }

  .institutions-contact-row {
    flex-wrap: wrap;
    gap: 5px;
  }

  .institutions-contact-row img {
    width: 16px;
    height: 16px;
  }

  .director-name {
    font-size: 1rem;
  }

  .director-descr {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  /* Страница учреждений - вертикальный half */
  .contentBox .half {
    flex-direction: column;
  }

  .contentBox .half figure {
    flex: none;
    width: 100%;
    margin: 0 0 15px 0;
  }

  .contentBox .half figure.institutions-figure {
    max-width: 400px;
    margin: 0 auto 15px auto;
  }

  .contentBox .half h3 {
    font-size: 1.4rem;
  }

  .director-name {
    font-size: 1.1rem;
  }

  .director-descr {
    font-size: 1rem;
  }

  /* Карточка специалиста - горизонтальная на планшетах */
  .employee-card {
    flex-direction: row;
  }

  .employee-photo {
    flex: 0 0 150px;
    max-width: 150px;
  }

  .employee-name {
    font-size: 1.1rem;
  }

  .employee-position {
    font-size: 0.95rem;
  }

  /* Адаптация таблиц для мобильных */
  table {
    font-size: 0.75rem;
    min-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table thead th {
    padding: 6px 4px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  table td {
    padding: 6px 4px;
    font-size: 0.75rem;
  }


  /* Таблицы с классом table-center */
  .table-center.second td:nth-child(2),
  .table-center.third td:nth-child(3),
  .table-center.fourth td:nth-child(4) {
    text-align: center;
  }
}


