/* =====================================================================
   Реализованные проекты
   Ноды: 539:132 (заголовок), 539:133 / 539:137 / 539:145 / 539:152 (фото
         610x405), 539:134 / 539:140 / 539:146 / 539:153 (плашки 550x60),
         539:135+539:136 и т.д. (название + город),
         539:138 / 539:143 / 539:150 (кнопка «посмотреть»),
         539:80 (кнопка «смотреть все проекты»)
   ===================================================================== */

.efir-projects {
  --projects-yellow: #fccb1b;
  --projects-dark: #262626;
  --projects-gutter: 100px;

  font-family: Montserrat, "Proxima Nova", Arial, Helvetica, sans-serif;
  padding: 90px 0 0;
}

.efir-projects *,
.efir-projects *::before,
.efir-projects *::after { box-sizing: border-box; }

.efir-projects__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--projects-gutter);
}

.efir-projects__title {
  margin: 0 0 30px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
  color: var(--projects-dark);
}

.efir-projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* --- Карточка проекта 610x405 ------------------------------------ */

.efir-project-card {
  position: relative;
  display: block;
  aspect-ratio: 610 / 405;
  overflow: hidden;
  background: var(--projects-dark);
  text-decoration: none;
}

@supports not (aspect-ratio: 1 / 1) {
  .efir-project-card { height: 0; padding-top: 66.39%; }  /* 405 / 610 */
}

.efir-project-card__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.efir-project-card:hover .efir-project-card__img { transform: scale(1.04); }

/* плашка: 550x60, отступ 30px по бокам, 10px от низа карточки */
.efir-project-card__bar {
  position: absolute;
  right: 30px;
  bottom: 10px;
  left: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 9px 10px 8px 13px;
  background: rgba(251, 250, 250, 0.8);
  box-shadow: 0 0 6px 3px rgba(38, 38, 38, 0.05);
  backdrop-filter: blur(2px);
}

.efir-project-card__text { min-width: 0; }

.efir-project-card__name {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--projects-dark);
  overflow-wrap: anywhere;
}

.efir-project-card__place {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--projects-dark);
}

/* кнопка «посмотреть» 200x40 */
.efir-project-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 200px;
  min-height: 40px;
  padding: 10px;
  border: 1px solid var(--projects-dark);
  background: var(--projects-dark);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.efir-project-card:hover .efir-project-card__btn,
.efir-project-card__btn:hover,
.efir-project-card__btn:focus-visible {
  background: var(--projects-yellow);
  border-color: var(--projects-yellow);
  color: var(--projects-dark);
}

/* --- Кнопка «смотреть все проекты» 400x45 ------------------------ */

.efir-projects__more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.efir-projects__more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 400px;
  min-height: 45px;
  padding: 10px;
  border: 1px solid var(--projects-dark);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--projects-dark);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.efir-projects__more-btn:hover,
.efir-projects__more-btn:focus-visible {
  background: var(--projects-dark);
  color: #fff;
}

/* =====================================================================
   Адаптив
   ===================================================================== */

@media (max-width: 1279px) {
  .efir-projects { --projects-gutter: 40px; padding-top: 70px; }
  .efir-project-card__bar { right: 20px; left: 20px; }
  .efir-project-card__name { font-size: 18px; }
  .efir-project-card__btn { width: 170px; }
}

@media (max-width: 1023px) {
  .efir-projects { padding-top: 60px; }
  .efir-projects__title { font-size: 26px; margin-bottom: 24px; }

  /* кнопка перестаёт помещаться рядом с названием — уводим её вниз */
  .efir-project-card__bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .efir-project-card__btn { width: 100%; }
}

@media (max-width: 767px) {
  .efir-projects { --projects-gutter: 20px; padding-top: 40px; }
  .efir-projects__title { font-size: 22px; }
  .efir-projects__grid { grid-template-columns: 1fr; gap: 16px; }

  .efir-project-card__bar {
    flex-direction: row;
    align-items: center;
    right: 12px;
    bottom: 12px;
    left: 12px;
    padding: 10px 12px;
  }
  .efir-project-card__name { font-size: 16px; }
  .efir-project-card__place { font-size: 14px; }
  /* на мобильном вся карточка кликабельна — отдельная кнопка не нужна */
  .efir-project-card__btn { display: none; }

  .efir-projects__more { margin-top: 24px; }
  .efir-projects__more-btn { width: 100%; }
}

/* =====================================================================
   Анимация блока
   ---------------------------------------------------------------------
   Работает только если на <html> есть класс .anim (его ставит скрипт из
   blocks/_core/core.js) и класс .is-in на элементе (его ставит
   IntersectionObserver оттуда же). Без JS контент виден сразу.
   ===================================================================== */
html.anim .efir-projects__title,
html.anim .efir-projects__grid > *,
html.anim .efir-projects__more {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease-out, transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Ховеры ------------------------------------------------------- */

.efir-projects__more-btn {
  transition: background-color 0.2s ease, color 0.2s ease,
              border-color 0.2s ease, transform 0.2s ease;
}
.efir-projects__more-btn:hover { transform: translateY(-2px); }

.efir-project-card__bar { transition: background-color 0.25s ease; }
.efir-project-card:hover .efir-project-card__bar { background: rgba(251, 250, 250, 0.92); }

@media (prefers-reduced-motion: reduce) {
  html.anim .efir-projects__title,
  html.anim .efir-projects__grid > *,
  html.anim .efir-projects__more {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  .efir-projects__more-btn:hover,
  .efir-project-card:hover .efir-project-card__img { transform: none; }
}
