/* =========================================================
   БЛОК «БЛИЖАЙШИЕ КОНКУРСЫ»
   ========================================================= */

.coi-section--closest-contests {
  --coi-contests-gap: 18px;

  padding: 24px 0;
}

.coi-closest-contests {
  position: relative;

  padding: 26px 30px 24px;
  overflow: hidden;

  background:
    radial-gradient(
      circle at 50% 0,
      rgba(246, 238, 222, 0.62),
      transparent 48%
    ),
    #fff;

  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(39, 62, 92, 0.07);
}


/* =========================================================
   ЗАГОЛОВОК БЛОКА
   ========================================================= */

.coi-closest-contests__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;

  margin-bottom: 18px;
}

.coi-closest-contests__title {
  margin: 0;
}

.coi-closest-contests__all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;

  color: #248267;

  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;

  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.coi-closest-contests__all:hover,
.coi-closest-contests__all:focus-visible {
  color: #17674f;
}

.coi-closest-contests__all svg {
  transition: transform 0.2s ease;
}

.coi-closest-contests__all:hover svg,
.coi-closest-contests__all:focus-visible svg {
  transform: translateX(3px);
}


/* =========================================================
   КАРУСЕЛЬ
   ========================================================= */

.coi-contests-slider {
  position: relative;
}

.coi-contests-slider__viewport {
  overflow: hidden;
}

.coi-contests-slider__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns:
    calc((100% - (var(--coi-contests-gap) * 3)) / 4);
  gap: var(--coi-contests-gap);

  padding: 2px;

  overflow-x: auto;
  overscroll-behavior-inline: contain;

  scroll-behavior: smooth;
  scroll-snap-type: inline mandatory;
  scrollbar-width: none;
}

.coi-contests-slider__track::-webkit-scrollbar {
  display: none;
}

.coi-contests-slider__slide {
  min-width: 0;
  height: 100%;

  scroll-snap-align: start;
}

.coi-contests-slider__slide > * {
  height: 100%;
}


/* =========================================================
   СТРЕЛКИ КАРУСЕЛИ
   ========================================================= */

.coi-contests-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 5;

  display: grid;
  place-items: center;

  width: 42px;
  height: 42px;
  padding: 0;

  color: #294b78;
  background: #fff;

  border: 1px solid #e3eaf2;
  border-radius: 50%;

  box-shadow: 0 4px 14px rgba(35, 63, 97, 0.14);

  cursor: pointer;

  transform: translateY(-50%);

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.coi-contests-slider__arrow:hover,
.coi-contests-slider__arrow:focus-visible {
  color: #17775c;
  background: #f8fcfa;
  border-color: #cfe2da;

  box-shadow: 0 6px 18px rgba(35, 63, 97, 0.2);
}

.coi-contests-slider__arrow--prev {
  left: -25px;
}

.coi-contests-slider__arrow--next {
  right: -25px;
}

.coi-contests-slider__arrow:disabled,
.coi-contests-slider__arrow[hidden] {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}


/* =========================================================
   КАРТОЧКА КОНКУРСА
   ========================================================= */

.coi-contest-card {
  position: relative;

  display: flex;
  flex-direction: column;

  height: 100%;
  min-height: 210px;
  padding: 42px 16px 16px;

  overflow: hidden;

  background: #fff;

  border: 1px solid #e5eaf0;
  border-radius: 15px;

  box-shadow: 0 5px 14px rgba(31, 57, 89, 0.09);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.coi-contest-card:hover {
  transform: translateY(-2px);

  border-color: #d7e1eb;
  box-shadow: 0 9px 22px rgba(31, 57, 89, 0.13);
}


/* =========================================================
   ТИП КОНКУРСА
   ========================================================= */

.coi-contest-card__type {
  position: absolute;
  top: 12px;
  left: 12px;

  max-width: calc(100% - 24px);
  padding: 5px 12px;

  overflow: hidden;

  color: #fff;

  font-size: 11px;
  font-weight: 700;
  line-height: 1;

  text-overflow: ellipsis;
  white-space: nowrap;

  background: #718096;

  border-radius: 6px;

  box-shadow: 0 3px 8px rgba(35, 74, 52, 0.2);
}


/* Интеллектуальный */

.coi-contest-card--intellectual .coi-contest-card__type {
  background: linear-gradient(135deg, #77b52a, #4b9825);
}


/* Творческий */

.coi-contest-card--creative .coi-contest-card__type {
  background: linear-gradient(135deg, #35a6dc, #2385c5);
}


/* Спортивный */

.coi-contest-card--sport .coi-contest-card__type {
  background: linear-gradient(135deg, #ff6d48, #ef4831);
}


/* Экологический */

.coi-contest-card--ecological .coi-contest-card__type {
  background: linear-gradient(135deg, #48a96e, #2d8555);
}


/* Педагогический */

.coi-contest-card--pedagogical .coi-contest-card__type {
  background: linear-gradient(135deg, #9b6fd3, #7550b5);
}


/* Тип по умолчанию */

.coi-contest-card--default .coi-contest-card__type {
  background: linear-gradient(135deg, #8290a3, #667487);
}


/* =========================================================
   ВНУТРЕННЯЯ СЕТКА КАРТОЧКИ
   ========================================================= */

.coi-contest-card__layout {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 14px;

  flex: 1 1 auto;
  height: 100%;
}

.coi-contest-card__visual {
  display: flex;
  align-items: center;
  flex-direction: column;

  min-width: 0;
}

.coi-contest-card__content {
  display: flex;
  align-items: flex-start;
  flex-direction: column;

  min-width: 0;
  height: 100%;
  padding-top: 5px;
}


/* =========================================================
   ДАТА
   ========================================================= */

.coi-contest-card__date {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  width: 58px;
  min-height: 62px;
  padding: 7px 5px;

  color: #17365f;
  background: #fff;

  border: 1px solid #e7ecf1;
  border-radius: 9px;

  box-shadow: 0 3px 8px rgba(35, 62, 95, 0.08);
}

.coi-contest-card__day {
  display: block;

  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

.coi-contest-card__month {
  display: block;

  margin-top: 5px;

  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}


/* =========================================================
   ИЗОБРАЖЕНИЕ
   ========================================================= */

.coi-contest-card__image {
  display: flex;
  align-items: flex-end;
  justify-content: center;

  flex: 1 1 auto;

  width: 92px;
  min-height: 96px;
  margin-top: 8px;
  margin-left: -8px;
}

.coi-contest-card__image .field,
.coi-contest-card__image .field__item {
  display: contents;
}

.coi-contest-card__image img {
  display: block;

  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 105px;

  object-fit: contain;
}


/* =========================================================
   НАЗВАНИЕ
   ========================================================= */

.coi-contest-card__title {
  margin: 0 0 15px;

  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.coi-contest-card__title a {
  color: #2477c2;
  text-decoration: none;

  transition: color 0.2s ease;
}

.coi-contest-card__title a:hover,
.coi-contest-card__title a:focus-visible {
  color: #185b99;
  text-decoration: underline;
  text-underline-offset: 3px;
}


/* =========================================================
   ВОЗРАСТ И СРОК ПРИЁМА
   ========================================================= */

.coi-contest-card__audience,
.coi-contest-card__deadline {
  color: #516680;

  font-size: 12px;
  line-height: 1.45;
}

.coi-contest-card__audience {
  margin-bottom: 14px;
}

.coi-contest-card__deadline {
  margin-bottom: 14px;
}

.coi-contest-card__deadline-label {
  margin-right: 3px;
}

.coi-contest-card__audience .field,
.coi-contest-card__audience .field__item,
.coi-contest-card__deadline .field,
.coi-contest-card__deadline .field__item {
  display: inline;
}


/* =========================================================
   КНОПКА «ПОДРОБНЕЕ»
   ========================================================= */

.coi-contest-card__actions {
  margin-top: auto;
}

.coi-contest-card__actions a,
.coi-contest-card__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 112px;
  min-height: 38px;
  padding: 8px 16px;

  color: #318064;
  background: #fff;

  border: 2px solid #c6dfd1;
  border-radius: 7px;

  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.coi-contest-card__actions a:hover,
.coi-contest-card__actions a:focus-visible,
.coi-contest-card__button:hover,
.coi-contest-card__button:focus-visible {
  color: #fff;
  background: #318064;
  border-color: #318064;

  box-shadow: 0 4px 10px rgba(49, 128, 100, 0.18);
}


/* =========================================================
   ПУСТОЙ РЕЗУЛЬТАТ
   ========================================================= */

.coi-closest-contests__empty {
  padding: 30px;

  color: #5a6e86;
  background: #fff;

  border: 1px solid #e5eaf0;
  border-radius: 14px;

  text-align: center;
}


/* =========================================================
   ФОКУС
   ========================================================= */

.coi-closest-contests a:focus-visible,
.coi-closest-contests button:focus-visible {
  outline: 3px solid rgba(36, 119, 194, 0.28);
  outline-offset: 3px;
}


/* =========================================================
   АДАПТИВ: 3 КАРТОЧКИ
   ========================================================= */

@media (max-width: 1180px) {
  .coi-contests-slider__track {
    grid-auto-columns:
      calc((100% - (var(--coi-contests-gap) * 2)) / 3);
  }

  .coi-contests-slider__arrow--prev {
    left: -22px;
  }

  .coi-contests-slider__arrow--next {
    right: -22px;
  }
}


/* =========================================================
   АДАПТИВ: 2 КАРТОЧКИ
   ========================================================= */

@media (max-width: 860px) {
  .coi-closest-contests {
    padding-right: 22px;
    padding-left: 22px;
  }

  .coi-contests-slider__track {
    grid-auto-columns:
      calc((100% - var(--coi-contests-gap)) / 2);
  }

  .coi-contests-slider__arrow {
    display: none;
  }

  .coi-contests-slider__viewport {
    overflow: visible;
  }

  .coi-contest-card {
    min-height: 220px;
  }
}


/* =========================================================
   АДАПТИВ: 1 КАРТОЧКА
   ========================================================= */

@media (max-width: 560px) {
  .coi-section--closest-contests {
    --coi-contests-gap: 12px;

    padding: 16px 0;
  }

  .coi-closest-contests {
    padding: 20px 16px;

    border-radius: 16px;
  }

  .coi-closest-contests__header {
    align-items: flex-start;
    gap: 14px;

    margin-bottom: 15px;
  }

  .coi-closest-contests__title {
    font-size: 21px;
  }

  .coi-closest-contests__all {
    gap: 6px;

    font-size: 12px;
  }

  .coi-contests-slider__track {
    grid-auto-columns: calc(100% - 24px);
  }

  .coi-contest-card {
    min-height: 220px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .coi-contest-card__layout {
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 12px;
  }

  .coi-contest-card__image {
    width: 84px;
  }

  .coi-contest-card__title {
    font-size: 14px;
  }
}


/* =========================================================
   ОЧЕНЬ УЗКИЕ ЭКРАНЫ
   ========================================================= */

@media (max-width: 380px) {
  .coi-closest-contests__header {
    flex-direction: column;
  }

  .coi-contests-slider__track {
    grid-auto-columns: 100%;
  }

  .coi-contest-card__layout {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
  }

  .coi-contest-card__date {
    width: 54px;
  }

  .coi-contest-card__image {
    width: 76px;
    margin-left: -4px;
  }
}


/* =========================================================
   ОТКЛЮЧЕНИЕ АНИМАЦИЙ
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .coi-contests-slider__track {
    scroll-behavior: auto;
  }

  .coi-contest-card,
  .coi-contests-slider__arrow,
  .coi-closest-contests__all,
  .coi-closest-contests__all svg,
  .coi-contest-card__title a,
  .coi-contest-card__actions a,
  .coi-contest-card__button {
    transition: none;
  }
}


/* =========================================================
   СТРАНИЦА «ВСЕ КОНКУРСЫ»
   ========================================================= */

.coi-section--all-contests {
  padding: 28px 0 50px;
}

.coi-all-contests {
  position: relative;
}

.coi-all-contests__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;

  margin-bottom: 24px;
}

.coi-all-contests__title {
  margin: 0;

  color: #17365f;

  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.15;
}

.coi-all-contests__description {
  max-width: 650px;
  margin: 10px 0 0;

  color: #60738a;

  font-size: 15px;
  line-height: 1.55;
}


/* =========================================================
   ОБЁРТКА ФИЛЬТРОВ
   ========================================================= */

.coi-all-contests__filters {
  margin-bottom: 28px;
}

.coi-contests-filter {
  padding: 22px 24px 24px;

  background:
    radial-gradient(
      circle at 0 0,
      rgba(228, 241, 235, 0.72),
      transparent 42%
    ),
    #fff;

  border: 1px solid #e3eaf0;
  border-radius: 18px;

  box-shadow: 0 7px 24px rgba(32, 59, 91, 0.08);
}

.coi-contests-filter__heading {
  margin-bottom: 18px;
}

.coi-contests-filter__title {
  margin: 0;

  color: #17365f;

  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.coi-contests-filter__hint {
  margin: 5px 0 0;

  color: #708095;

  font-size: 13px;
  line-height: 1.4;
}


/* =========================================================
   СЕТКА ФИЛЬТРОВ
   ========================================================= */

.coi-contests-filter__fields {
  display: grid;
  grid-template-columns:
    minmax(160px, 0.8fr)
    minmax(260px, 1.7fr)
    minmax(140px, 0.7fr)
    minmax(220px, 1.2fr);
  gap: 16px;

  align-items: end;
}

.coi-contests-filter__field {
  min-width: 0;
}

.coi-contests-filter .form-item {
  margin: 0;
}

.coi-contests-filter label {
  display: block;

  margin: 0 0 7px;

  color: #344f70;

  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.coi-contests-filter select {
  display: block;

  width: 100%;
  height: 46px;
  padding: 0 42px 0 14px;

  overflow: hidden;

  color: #354c67;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #52708d 50%),
    linear-gradient(135deg, #52708d 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;

  border: 1px solid #d8e1e9;
  border-radius: 9px;

  font-family: inherit;
  font-size: 14px;
  line-height: 1.2;

  cursor: pointer;
  appearance: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.coi-contests-filter select:hover {
  border-color: #abc8bc;
}

.coi-contests-filter select:focus {
  background-color: #fbfefd;
  border-color: #318064;
  outline: none;

  box-shadow: 0 0 0 3px rgba(49, 128, 100, 0.14);
}


/* =========================================================
   КНОПКИ ФИЛЬТРОВ
   ========================================================= */

.coi-contests-filter__actions {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-top: 18px;
}

.coi-contests-filter__actions .form-actions {
  margin: 0;
}

.coi-contests-filter__actions .form-submit {
  min-width: 132px;
  min-height: 44px;
  padding: 10px 22px;

  color: #fff;
  background: #318064;

  border: 2px solid #318064;
  border-radius: 8px;

  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;

  cursor: pointer;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.coi-contests-filter__actions .form-submit:hover {
  background: #276f56;
  border-color: #276f56;

  box-shadow: 0 5px 13px rgba(49, 128, 100, 0.21);

  transform: translateY(-1px);
}

.coi-contests-filter__actions .form-submit:focus-visible {
  outline: 3px solid rgba(49, 128, 100, 0.25);
  outline-offset: 3px;
}

.coi-contests-filter__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 44px;
  padding: 10px 18px;

  color: #536b84;
  background: #fff;

  border: 1px solid #d7e0e8;
  border-radius: 8px;

  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;

  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.coi-contests-filter__reset:hover,
.coi-contests-filter__reset:focus-visible {
  color: #17365f;
  background: #f4f7f9;
  border-color: #bdcad6;
}


/* =========================================================
   СЕТКА КОНКУРСОВ
   ========================================================= */

.coi-all-contests__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.coi-all-contests__item {
  display: flex;
  min-width: 0;
}

.coi-all-contests__item > * {
  width: 100%;
}

.coi-all-contests__item .coi-contest-card {
  width: 100%;
  min-height: 250px;
}


/* =========================================================
   ТУР
   ========================================================= */

.coi-contest-card__tour {
  display: inline-flex;
  align-items: center;

  margin: -5px 0 13px;
  padding: 4px 9px;

  color: #526982;
  background: #f1f5f8;

  border-radius: 5px;

  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}


/* =========================================================
   ДАТЫ В КАРТОЧКЕ
   ========================================================= */

.coi-contest-card__info {
  display: grid;
  gap: 3px;

  width: 100%;
  margin-bottom: 12px;

  color: #526780;

  font-size: 12px;
  line-height: 1.4;
}

.coi-contest-card__info-label {
  color: #7a899a;

  font-size: 11px;
  font-weight: 600;
}

.coi-contest-card__info-value {
  color: #405873;

  font-weight: 700;
}


/* =========================================================
   ПУСТОЙ РЕЗУЛЬТАТ
   ========================================================= */

.coi-all-contests__empty {
  padding: 38px 24px;

  color: #60738a;
  background: #fff;

  border: 1px solid #e2e9ef;
  border-radius: 16px;

  font-size: 15px;
  line-height: 1.5;
  text-align: center;

  box-shadow: 0 5px 18px rgba(32, 59, 91, 0.06);
}


/* =========================================================
   PAGER
   ========================================================= */

.coi-all-contests__pager {
  margin-top: 30px;
}

.coi-all-contests__pager .pager__items {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.coi-all-contests__pager .pager__item {
  margin: 0;
  padding: 0;
}

.coi-all-contests__pager .pager__item a,
.coi-all-contests__pager .pager__item.is-active {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 40px;
  min-height: 40px;
  padding: 7px 11px;

  color: #405a77;
  background: #fff;

  border: 1px solid #dce4eb;
  border-radius: 8px;

  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.coi-all-contests__pager .pager__item a:hover,
.coi-all-contests__pager .pager__item a:focus-visible,
.coi-all-contests__pager .pager__item.is-active {
  color: #fff;
  background: #318064;
  border-color: #318064;
}


/* =========================================================
   АДАПТИВ
   ========================================================= */

@media (max-width: 1180px) {
  .coi-contests-filter__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .coi-all-contests__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .coi-section--all-contests {
    padding-top: 20px;
  }

  .coi-contests-filter {
    padding: 20px;
  }

  .coi-all-contests__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 620px) {
  .coi-all-contests__header {
    margin-bottom: 18px;
  }

  .coi-all-contests__title {
    font-size: 28px;
  }

  .coi-all-contests__description {
    font-size: 14px;
  }

  .coi-contests-filter {
    padding: 18px 16px;

    border-radius: 14px;
  }

  .coi-contests-filter__fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .coi-contests-filter__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .coi-contests-filter__actions .form-actions {
    display: block;
    width: 100%;
  }

  .coi-contests-filter__actions .form-submit,
  .coi-contests-filter__reset {
    width: 100%;
  }

  .coi-all-contests__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .coi-all-contests__item .coi-contest-card {
    min-height: 230px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coi-contests-filter select,
  .coi-contests-filter__actions .form-submit,
  .coi-contests-filter__reset {
    transition: none;
  }
}