body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #fafafa;
}
.hero {
  position: relative;
  height: 80vh;
  /* cover заменили на contain — картинка впишется целиком */
  background: url('images/house01.jfif') center/contain no-repeat;
  background-color: #2c2c2c; /* Темно-серый цвет для пустых мест (чтобы белый текст читался) */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}
.hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
}
.hero .content {
  position: relative;
  z-index: 2;
}
.btn {
  background: #ff5a5f;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
}
.container {
  max-width: 900px;
  margin: 50px auto;
  padding: 0 20px;
}

.gallery {
background: #fff;
padding: 50px 20px;
}
.gallery .grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 10px;
}

h2 {
    text-align: left;
    margin-bottom: 30px;
}

.gallery img, .gallery video {
  width: 100%;
  aspect-ratio: 4 / 3;      /* Оставляем, чтобы сетка сайта была ровной и выглядела аккуратно */
  object-fit: contain;      /* contain вместо cover — фото и видео показываются ПОЛНОСТЬЮ, без обрезки */
  background-color: #e0e0e0; /* Светло-серый фон, который заполнит пустоты внутри карточки */
  border-radius: 8px;
  display: block;
}

form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
form input, form textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100%;
}
form button {
  background: #ff5a5f;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}
footer {
  background: #333;
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}
/* 1. Скрываем поле-ловушку для ботов */
.honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    width: 0;
}

/* 2. Улучшаем UX кнопок и полей (hover и focus) */
.btn:hover, form button:hover {
    background: #e04e53;
    transition: background 0.3s;
}
.btn:focus, form button:focus, form input:focus, form textarea:focus {
    outline: 2px solid #ff5a5f;
    outline-offset: 2px;
}

/* 3. Стили для заголовков формы */
form label {
    font-weight: 600;
    margin-top: 5px;
    color: #555;
}

/* 4. Адаптив для смартфонов (экраны уже 768px) */
@media (max-width: 768px) {
    .hero {
        min-height: 60vh; /* Было height: 80vh, теперь не обрежется */
    }
    .hero h1 {
        font-size: 24px;
    }
    .container {
        margin: 30px auto;
        padding: 0 15px;
    }
    .gallery .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
/* Обёртка для заголовка галереи, чтобы он был в одной линии с другими заголовками */
.gallery-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}
/* Курсор-лупа при наведении на миниатюры */
.gallery-item {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}
.gallery-item:hover {
    transform: scale(1.03); /* Чуть-чуть увеличивается при наведении */
}

/* Сам лайтбокс (темный фон на весь экран) */
.lightbox-modal {
    display: none; 
    position: fixed;
    z-index: 9999;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.92); /* Почти черный фон */
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox-modal.active {
    display: flex; /* Показываем, когда добавляется класс active */
}

/* Картинка внутри лайтбокса */
.lightbox-content img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    cursor: zoom-out; /* Курсор "уменьшить" при наведении на фото */
}

/* Видео внутри лайтбокса */
.lightbox-content video {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    cursor: default; /* Обычный курсор, чтобы не перекрывать кнопки управления плеером */
}

/* Крестик закрытия */
.lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
    user-select: none;
}
.lightbox-close:hover {
    color: #ff5a5f; /* Подсветка красным при наведении */
}
/* Кнопки перелистывания (стрелки) */
.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    font-size: 30px;
    font-weight: bold;
    padding: 20px 15px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 10000;
    border-radius: 4px;
    user-select: none;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}
.lightbox-prev {
    left: 20px;
}
.lightbox-next {
    right: 20px;
}

/* На смартфонах делаем кнопки чуть компактнее */
@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        font-size: 20px;
        padding: 15px 10px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}