* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: linear-gradient(#494949b3, #494949b3),
    url('images/Самолет 4.1.jpg') fixed center/cover;
  font-family: 'Jura', sans-serif;
  color: #fff;
  line-height: 1.5;
  font-size:1.1rem;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ========== ШАПКА И МЕНЮ ========== */
#header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

#first {
  font-size: clamp(2rem, 5vw, 3rem);
  color: #862A2B;
  font-family: 'Chivo', sans-serif;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
}

.menu li a {
  text-decoration: none;
  color: #fff;
  font-size: clamp(1.4rem, 2vw, 1.5rem);
  transition: all 0.3s ease;
  position: relative;
}

.menu li a:hover {
  color: #B90003;
  transform: scale(1.1);
}

.menu li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: #862A2B;
  transition: width 0.3s;
}

.menu li a:hover::after {
  width: 100%;
}

/* ========== БЛОКИ С ТЕКСТОМ И КАРТИНКОЙ ========== */
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
  margin: 40px 0;
}

.text-block {
  flex: 1 1 55%;
  min-width: 300px;
}

.image-block {
  flex: 1 1 40%;
  min-width: 300px;
  text-align: center;
}

.image-block img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* Реверсивный порядок (картинка слева, текст справа) */
.row.reverse {
  flex-direction: row-reverse;
}

/* ========== ЗАГОЛОВКИ ========== */
h2 {
  color: #ff9d9d;
  margin-bottom: 15px;
  font-size: clamp(1.8rem, 3vw, 2rem);
}

/* ========== КНОПКА "ПОКАЗАТЬ БОЛЬШЕ" ========== */
.show-image-btn {
  padding: 12px 25px;
  background: #555;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
  font-size: 1rem;
  display: inline-block;
  margin: 20px 0;
}

.show-image-btn:hover {
  background: #777;
}

/* Оверлей для картинок */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.overlay.active {
  display: flex;
}

.modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal img {
  max-width: 100%;
  max-height: 90vh;
  border: 3px solid #fff;
  border-radius: 5px;
}

.close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
}

.close-btn:hover {
  color: #f44;
}

/* ========== СТРАНИЦА "УСТРОЙСТВО САМОЛЕТА" ========== */
#engine {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 30px 0;
}

#engine p {
  flex: 2 1 500px;
}

#engine img {
  flex: 1 1 200px;
  max-width: 100%;
  height: auto;
  opacity: 0.8;
  border-radius: 8px;
}

#h_engine {
  color: #ff9d9d;
  margin: 30px 0 15px;
  font-size: clamp(1.8rem, 3vw, 2rem);
}

/* ========== ПОДВАЛ ========== */
#pidval, #pidval1 {
  margin-top: 50px;
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid #555;
  color: #fff;
}

/* ========== АНИМАЦИЯ ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-text {
  animation: fadeIn 1.5s ease-in-out;
}

/* ========== МЕДИАЗАПРОСЫ ========== */

/* Планшеты (до 1024px) */
@media (max-width: 1024px) {
  .row {
    gap: 20px;
  }
  .text-block, .image-block {
    flex: 1 1 100%;
  }
  .image-block {
    order: 2; /* картинка всегда после текста на планшетах */
  }
  .row.reverse .image-block {
    order: 2; /* для реверсивных блоков тоже */
  }
  .menu {
    justify-content: center;
    gap: 15px;
  }
}

/* Мобильные (до 767px) */
@media (max-width: 767px) {
  #header {
    flex-direction: column;
    text-align: center;
  }
  .menu {
    flex-direction: column;
    align-items: center;
    padding: 0;
  }
  .menu li {
    width: 100%;
    text-align: center;
  }
  .menu li a {
    display: block;
    padding: 10px;
    font-size: 1.2rem;
  }
  .row {
    margin: 20px 0;
  }
  #engine {
    flex-direction: column;
  }
  #engine img {
    max-width: 80%;
    margin: 0 auto;
  }
  #h_engine {
    text-align: center;
  }
}