/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #FFFFFF;
  color: #000000;
  scroll-behavior: smooth;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  backdrop-filter: blur(3px);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: white;
  max-width: 1100px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s;
  position: relative;
  border-radius: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-container::-webkit-scrollbar {
  display: none;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-close-btn {
  position: sticky;
  top: 0.75rem;
  float: right;
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 21;
  margin-right: 0.5rem;
  transition: 0.2s;
  line-height: 1;
  padding: 0;
}

.modal-close-btn:hover {
  background: #f5f5f5;
  transform: scale(1.03);
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery-scroll {
  display: flex;
  overflow-x: auto;
  gap: 1rem;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.gallery-scroll img {
  min-width: 200px;
  height: 140px;
  object-fit: cover;
  cursor: pointer;
  filter: grayscale(0.3);
  transition: 0.2s;
  scroll-snap-align: start;
  border-radius: 8px;
  background: white;
}

.gallery-scroll img:hover {
  filter: grayscale(0);
  transform: scale(1.02);
}

/* ===== НАВИГАЦИЯ ===== */
.nav-link.active {
  border-bottom: 2px solid black;
}

/* ===== КАРТОЧКИ ПРОЕКТОВ (ч/б → цвет при наведении) ===== */
.project-card img {
  transition: all 0.3s ease;
    background: white;
}

.project-card:hover img {
  /* без фильтра, но увеличение уже есть в классе group-hover:scale-105 в HTML */
}

/* ===== КАРТОЧКИ СОТРУДНИКОВ (ч/б → цвет при наведении) ===== */
.team-card img {
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.team-card:hover img {
  filter: grayscale(0%);
}

/* ===== HERO-ИЗОБРАЖЕНИЕ ===== */
.hover-scale-img img {
  transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.hover-scale-img:hover img {
  transform: scale(1.03);
}

/* ===== АНИМАЦИЯ ПОЯВЛЕНИЯ ===== */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.7s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.fade-up.appear {
  opacity: 1;
  transform: translateY(0);
}

/* ===== СЕТКА ПРОЕКТОВ ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

/* ===== ПОДВАЛ ===== */
#footer {
  border-top: 1px solid #e5e5e5;
}

/* ===== УТИЛИТЫ ===== */
.link-underline {
  position: relative;
  display: inline-block;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #000;
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}

/* ===== СТИЛИ ДЛЯ СОДЕРЖИМОГО СТАТЕЙ ===== */
.prose {
  max-width: 65ch;
  line-height: 1.6;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose h3 {
  font-size: 1.25rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1rem;
}

.prose img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1rem 0;
}

/* ===== ДЕТАЛЬНЫЕ СТРАНИЦЫ ===== */
.detail-page {
  padding: 2rem 1rem;
  max-width: 1000px;
  margin: 0 auto;
}

.detail-page img {
  max-width: 100%;
  border-radius: 12px;
}

/* Единый стиль для тегов */
.tag {
  display: inline-block;
  background-color: #f3f4f6;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: background-color 0.2s, color 0.2s;
  text-decoration: none;
}
.tag:hover {
  background-color: #e5e7eb;
  text-decoration: none;
}

/* Если теги должны быть кликабельными ссылками */
a.tag:hover {
  background-color: #d1d5db;
  color: #111827;
}

/* Сетка для Revit-семейств */
.revit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  align-items: stretch; /* заставляет карточки растягиваться */
  margin-top: 1.5rem;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .revit-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .revit-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .revit-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ===== КАРУСЕЛЬ ДЛЯ REVIT ===== */
.revit-carousel .carousel-main {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;   /* ← было #f9fafb, стало белый */
  border-radius: 12px;
  overflow: hidden;
}

.revit-carousel .carousel-main img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;          /* или cover, если хотите заполнение без полей */
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.carousel-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.carousel-thumbs img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.carousel-thumbs img:hover {
  transform: scale(1.05);
  border-color: #9ca3af;
}

.article-page-container {
    max-width: 900px;          /* максимум для больших экранов */
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.article-text {
    max-width: 70ch;           /* ограничиваем строку до 70 символов */
    margin: 0 auto;
    line-height: 1.8;
    font-size: 1.1rem;
}

/* На очень больших экранах можно увеличить отступы, чтобы текст не был слишком широким */
@media (min-width: 1400px) {
    .article-page-container {
        padding: 0 40px;
    }
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    max-width: 1100px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s;
    position: relative;
    border-radius: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.modal-container::-webkit-scrollbar {
    display: none;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-close-btn {
    position: sticky;
    top: 0.75rem;
    float: right;
    font-size: 1.8rem;
    font-weight: 300;
    cursor: pointer;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 21;
    margin-right: 0.5rem;
    transition: 0.2s;
    line-height: 1;
    padding: 0;
}

.modal-close-btn:hover {
    background: #f5f5f5;
    transform: scale(1.03);
}

html {
    overflow-y: scroll;
}

/* ===== МОБИЛЬНОЕ МЕНЮ (бургер) ===== */
@media (max-width: 767px) {
  #main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: none;
    z-index: 40;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  #main-nav.open {
    display: flex;
  }

  #main-nav a {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 1rem;
    text-align: center;
  }

  #main-nav a:last-child {
    border-bottom: none;
  }
}

/* На десктопах меню всегда видимо */
@media (min-width: 768px) {
  #main-nav {
    display: flex !important;
    flex-direction: row;
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 0;
    gap: 2.5rem;
    border-bottom: none;
  }

  #main-nav a {
    border-bottom: none;
    padding: 0;
    font-size: 0.875rem;
  }
}

@media (min-width: 768px) {
  #main-nav {
    display: flex !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    /* остальное без изменений */
  }
}

/* Блокируем прокрутку страницы при открытой модалке */
body.modal-open {
  overflow: hidden !important;
}

.modal-container {
  -webkit-overflow-scrolling: touch; /* для плавного скролла внутри модалки */
}