/* =====================================================================
   Академсервис — enhance.css
   Доп. слой: анимации появления, микро-интерактив, мобильные правки.
   Не переопределяет базовый дизайн, только дополняет.
   ===================================================================== */

:root {
  --as-accent: #f0a734;
  --as-dark: #0b2a4a;
  --as-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Скрытый, но доступный для SEO/скринридеров текст -------- */
.visually-hidden,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Подменю с направлениями (под шапкой) -------------------- */
.subnav {
  background: #f3f7fb;
  border-bottom: 1px solid #e7ecf2;
}
.subnav__inner {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 0;
}
.subnav__item {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  color: var(--as-dark);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease, transform 0.2s var(--as-ease);
}
.subnav__item:hover {
  background: #e2e9f2;
  transform: translateY(-1px);
}
.subnav__item.is-active {
  background: var(--as-dark);
  color: #fff;
}
@media (max-width: 767.98px) {
  .subnav__inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
  }
  .subnav__inner::-webkit-scrollbar { display: none; }
  .subnav__item {
    flex: 0 0 auto;
    font-size: 14px;
    padding: 8px 14px;
  }
}

/* ---------- Scroll reveal (включается только при активном JS) -------- */
.reveal-ready [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--as-ease), transform 0.7s var(--as-ease);
  will-change: opacity, transform;
}
.reveal-ready [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
.reveal-ready [data-reveal][data-reveal="left"]  { transform: translateX(-32px); }
.reveal-ready [data-reveal][data-reveal="right"] { transform: translateX(32px); }
.reveal-ready [data-reveal][data-reveal="zoom"]  { transform: scale(0.94); }
.reveal-ready [data-reveal].is-visible { transform: none; }

/* поэтапная задержка для соседних карточек в ряду */
.reveal-ready [data-reveal-delay="1"] { transition-delay: 0.08s; }
.reveal-ready [data-reveal-delay="2"] { transition-delay: 0.16s; }
.reveal-ready [data-reveal-delay="3"] { transition-delay: 0.24s; }
.reveal-ready [data-reveal-delay="4"] { transition-delay: 0.32s; }

/* ---------- Микро-интерактив карточек -------------------------------- */
.apc-card,
.benefit,
.stat,
.service-item__header,
.post {
  transition: transform 0.35s var(--as-ease), box-shadow 0.35s var(--as-ease);
}
.apc-card:hover {
  transform: translateY(-6px);
}
.stat:hover,
.benefit:hover {
  transform: translateY(-4px);
}
.card__image img,
.post__image img,
.slider-slide img {
  transition: transform 0.6s var(--as-ease);
}
.apc-card:hover .card__image img,
.post:hover .post__image img,
.slider-slide:hover img {
  transform: scale(1.06);
}

/* плавность на кнопках + лёгкий «лифт» */
.btn {
  transition: transform 0.2s var(--as-ease), box-shadow 0.25s var(--as-ease),
    background-color 0.25s ease, color 0.25s ease, opacity 0.2s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0);
}

/* иконки соцсетей */
.social-item {
  transition: transform 0.25s var(--as-ease), color 0.25s ease, opacity 0.2s ease;
}
.social-item:hover {
  transform: translateY(-3px) scale(1.08);
}

/* пункт услуги: подсветка номера */
.service-item__header .service__num {
  transition: color 0.3s ease, transform 0.3s var(--as-ease);
}
.service-item__header:hover .service__num {
  color: var(--as-accent);
  transform: scale(1.1);
}

/* ---------- Кнопка «наверх» ------------------------------------------ */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--as-dark);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.8);
  transition: all 0.35s var(--as-ease);
  z-index: 1040;
  box-shadow: 0 8px 24px rgba(11, 42, 74, 0.35);
}
.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.to-top:hover {
  background: var(--as-accent);
  transform: translateY(-3px);
}
.to-top svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
}

/* ---------- Прогресс прокрутки страницы ------------------------------ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--as-accent), #ffce7a);
  z-index: 2000;
  transition: width 0.1s linear;
}

/* ---------- Состояния формы ------------------------------------------ */
.feedback .is-invalid,
.form-control.is-invalid {
  border-color: #e23c3c !important;
  box-shadow: 0 0 0 2px rgba(226, 60, 60, 0.12);
}
.form-note {
  font-size: 14px;
  margin-top: 8px;
  min-height: 18px;
}
.form-note.error { color: #e23c3c; }
.form-note.ok { color: #1f9d55; }
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: as-spin 0.7s linear infinite;
}
@keyframes as-spin {
  to { transform: rotate(360deg); }
}

/* honeypot */
.as-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* подсветка активного пункта меню при скролле */
.nav-item.is-active,
.menu-link.is-active {
  color: var(--as-accent);
}

/* ---------- Hero: мягкое появление ----------------------------------- */
.reveal-ready .hero__title { animation: as-fade-up 0.9s var(--as-ease) both; }
.reveal-ready .hero__bottom { animation: as-fade-up 0.9s 0.2s var(--as-ease) both; }
.reveal-ready .sub__menu { animation: as-fade-down 0.8s 0.1s var(--as-ease) both; }
@keyframes as-fade-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}
@keyframes as-fade-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: none; }
}

/* ===================================================================
   МОБИЛЬНЫЕ ПРАВКИ
   =================================================================== */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}
img {
  max-width: 100%;
}

@media (max-width: 575.98px) {
  /* увеличиваем зону нажатия у иконочных ссылок и кнопок */
  .social-item,
  .toggle-menu,
  .offcanvas-close {
    min-width: 44px;
    min-height: 44px;
  }
  .btn {
    min-height: 44px;
  }
  /* кнопка наверх компактнее */
  .to-top {
    right: 14px;
    bottom: 14px;
    width: 44px;
    height: 44px;
  }
  /* у hero текст не должен «вытекать» */
  .hero__title {
    word-break: break-word;
  }
  /* табы-меню в hero: на узких экранах не обрезаем, а делаем
     горизонтально прокручиваемыми (свайпом) */
  .sub__menu {
    max-width: calc(100% - 24px) !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sub__menu::-webkit-scrollbar { display: none; }
  .sub__menu ul {
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .sub__menu li { flex: 0 0 auto; }
  /* поля формы крупнее для удобства тапа */
  .form-control {
    font-size: 16px; /* чтобы iOS не зумил при фокусе */
  }
  /* Реквизиты на странице контактов: убираем фикс. ширину 380px,
     чтобы длинные номера счетов не обрезались по краю экрана */
  .contacts-details,
  .contacts-details-content,
  .info-block,
  .details-block,
  .details-text,
  .information-block,
  .information-row,
  .input-block {
    width: 100% !important;
    max-width: 100% !important;
  }
  .details-text {
    gap: 14px;
  }
  .details-text-meaning {
    text-align: right;
    word-break: break-all;
  }
  /* адрес/телефон/email — в столбик, без тесных двух колонок */
  .information-block {
    flex-direction: column !important;
    gap: 18px;
  }
  .information-row {
    display: block !important;
  }
}

/* планшет: 2 колонки в направлениях остаются, добавим отступ снизу */
@media (max-width: 767.98px) {
  .section {
    overflow: visible;
  }
}

/* ---------- Уважение к настройке «меньше движения» ------------------- */
@media (prefers-reduced-motion: reduce) {
  .reveal-ready [data-reveal],
  .reveal-ready .hero__title,
  .reveal-ready .hero__bottom,
  .reveal-ready .sub__menu {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .apc-card:hover,
  .stat:hover,
  .benefit:hover,
  .btn:hover {
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}


/* ---------- Баннер об использовании файлов cookie ------------------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1080;
  background: #0b2a4a;
  color: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  transform: translateY(160%);
  transition: transform 0.4s ease;
}
.cookie-banner.is-shown {
  transform: translateY(0);
}
.cookie-banner__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 20px;
  max-width: 1180px;
  margin: 0 auto;
}
.cookie-banner__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  flex: 1 1 320px;
  color: #fff;
}
.cookie-banner__text a {
  color: #8fc2ff;
  text-decoration: underline;
}
.cookie-banner__accept {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 575.98px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; }
  .cookie-banner__inner { padding: 14px 16px; gap: 12px; }
  .cookie-banner__accept { width: 100%; }
}

/* ---------- Правки по замечаниям: e-mail, кейсы, карта ------------- */
/* E-mail в футере/контактах — меньше и с переносом длинного адреса */
.f-contact,
.contact__social a,
a.f-contact {
  font-size: 16px !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Кейсы — делаем чуть компактнее (высоту можно донастроить) */
.slider-block .slider .slider-slide {
  max-height: 420px;
}
.slider-block .slider .slider-slide .img-cover {
  height: 420px;
}
.case-item__image img {
  max-height: 280px;
  width: 100%;
  object-fit: cover;
}
@media (max-width: 767.98px) {
  .slider-block .slider .slider-slide,
  .slider-block .slider .slider-slide .img-cover {
    height: 260px;
    max-height: 260px;
  }
  .case-item__image img {
    max-height: 220px;
  }
}

/* Временно скрытые блоки (напр. отзывы — пока их нет) */
.is-hidden-temp {
  display: none !important;
}

/* Интерактивная карта в футере */
.f-map iframe {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border: 0;
  border-radius: 12px;
  display: block;
}

/* ---------- Плитки кейсов (случайный показ на направлениях) -------- */
.cases-dynamic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 991.98px) {
  .cases-dynamic { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .cases-dynamic { grid-template-columns: 1fr; }
}
.case-tile {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  text-decoration: none;
}
.case-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.case-tile:hover img { transform: scale(1.05); }
.case-tile__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px;
  background: linear-gradient(to top, rgba(6, 20, 38, 0.88), rgba(6, 20, 38, 0));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.case-tile__tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #0a84c1;
  padding: 3px 8px;
  border-radius: 999px;
}
.case-tile__title { font-size: 14px; font-weight: 600; line-height: 1.3; }

/* ---------- Новости на главной: одинаковые карточки и картинки ----- */
#news .posts-slider .swiper-slide {
  height: auto; /* слайды тянутся до одной высоты */
}
#news .post {
  height: 100%;
  display: flex;
  flex-direction: column;
}
#news .post__image {
  position: relative;
  aspect-ratio: 16 / 10; /* единый формат для всех превью */
  overflow: hidden;
  flex: 0 0 auto;
}
#news .post__image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* кадрируем, а не растягиваем */
  display: block;
}
#news .post__body {
  flex: 1 1 auto;
}

/* ---------- Спорт: сетка «Нам доверяют чемпионы» ------------------- */
/* В бандле #sport .row = flex nowrap с фикс. колонками 254px — карточки
   вылезали за край. Своя сетка с переносом решает это. */
.sport-serv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 991.98px) {
  .sport-serv-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 479.98px) {
  .sport-serv-grid { grid-template-columns: 1fr; }
}
/* перебиваем #sport .card.apc-card { width:254px; height:473px } */
#sport .sport-serv-grid .card.apc-card {
  width: 100%;
  height: 260px;
  flex-shrink: 1;
}
@media (max-width: 479.98px) {
  #sport .sport-serv-grid .card.apc-card { height: 220px; }
}

/* ---------- Фото директора направления (портрет, без искажений) ---- */
/* Исходная коробка 480x380 была под альбомное фото; портрет 590x823
   растягивался. Коробка 340x474 повторяет пропорции снимка (0.717). */
.director-image {
  width: 340px;
  height: 474px;
  flex: 0 0 auto;
}
.director-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
@media (max-width: 767px) {
  .director .director-image,
  .director .director-image img {
    width: 100%;
    max-width: 320px;
    height: 446px;
  }
  .director .director-image { margin: 0 auto; }
}

/* ---------- CTA-полосы «Связаться с нами» (теперь ссылки) ---------- */
.cta-band {
  text-decoration: none;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.cta-band p,
.cta-band .join-us__title {
  margin: 0;
}
.cta-band .icon-arrow-right {
  display: inline-block;
  margin-left: 14px;
  transition: transform 0.3s ease;
}
.cta-band:hover .icon-arrow-right {
  transform: translateX(8px);
}
.cta-band:focus-visible {
  outline: 3px solid #8fc2ff;
  outline-offset: 3px;
}
a.achievement_contact_us {
  color: #fff;
  gap: 8px;
  padding: 34px 24px;
  text-align: center;
}
a.achievement_contact_us:hover {
  background-color: #043b70;
  box-shadow: 0 14px 40px rgba(2, 45, 88, 0.28);
}
a.grid-join-us {
  color: #fff;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
}
a.grid-join-us:hover {
  background-color: #0f68b0;
  box-shadow: 0 14px 40px rgba(13, 89, 151, 0.3);
}
@media (max-width: 767.98px) {
  a.achievement_contact_us { font-size: 22px; padding: 24px 16px; margin-top: 48px; }
  a.grid-join-us { height: auto; padding: 22px 16px; }
  a.grid-join-us .join-us__title { font-size: 22px; }
}

/* ---------- «Наш опыт в культурных проектах» — зацикленная лента ---- */
.exp-marquee {
  position: relative;
  overflow: hidden;
  padding: 4px 0 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.exp-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: exp-scroll 45s linear infinite;
}
.exp-marquee:hover .exp-track,
.exp-marquee:focus-within .exp-track {
  animation-play-state: paused; /* пауза при наведении — можно прочитать */
}
@keyframes exp-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); } /* ровно один набор карточек */
}
.exp-card {
  position: relative;
  flex: 0 0 300px;
  height: 220px;
  border-radius: 18px;
  overflow: hidden;
  background: #0b2a4a;
  box-shadow: 0 10px 30px rgba(11, 42, 74, 0.18);
  transition: transform 0.3s var(--as-ease), box-shadow 0.3s var(--as-ease);
}
.exp-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(11, 42, 74, 0.32);
}
.exp-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--as-ease);
}
.exp-card:hover .exp-card__img {
  transform: scale(1.07);
}
.exp-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(6, 20, 38, 0.94) 0%,
    rgba(6, 20, 38, 0.72) 55%,
    rgba(6, 20, 38, 0) 100%
  );
}
.exp-card__kind {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #0b2a4a;
  background: var(--as-accent);
  padding: 4px 10px;
  border-radius: 999px;
}
.exp-card__title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}
.exp-card__text {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
}
@media (max-width: 575.98px) {
  .exp-card { flex-basis: 260px; height: 190px; }
  .exp-card__title { font-size: 17px; }
}
/* уважение к «меньше движения» — лента не едет, но её можно листать */
@media (prefers-reduced-motion: reduce) {
  .exp-track { animation: none; }
  .exp-marquee { overflow-x: auto; }
}

/* ---------- «С нами выступали» — компактные карточки ---------------- */
.hotspot-artist {
  font-size: 15px;
  line-height: 1.4;
  color: #5b6b7f;
  margin-bottom: 14px;
}
.hotspot-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 18px;
}
.hotspot-chips li {
  font-size: 13px;
  font-weight: 500;
  color: #0b2a4a;
  background: #eef4fa;
  border: 1px solid #dce7f2;
  padding: 6px 12px;
  border-radius: 999px;
}
.hotspot-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  color: #0d5997;
}
.hotspot-link a .icon-arrow-right {
  transition: transform 0.3s ease;
}
.hotspot-link a:hover .icon-arrow-right {
  transform: translateX(5px);
}

/* ---------- MICE: бывшие дубли id переведены в классы -------------- */
/* (в бандле были правила #no-border и #with-us-content-reverse,
   но id повторялись на странице — это невалидный HTML) */
.hero__bottom.no-border {
  border-top: none;
}
.with-us-content.with-us-content-reverse {
  justify-content: start;
  gap: 20px;
}
