/* Общие стили */
body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #0a1428 0%, #1a2744 100%);
  color: #e8e8e8;
  line-height: 1.6;
  overflow-x: hidden;
  font-size: 16px;
}

/* Анимации */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Основной контент */
.main-content {
  margin-top: clamp(5.625rem, 7.5vw, 7.5rem);
}

/* Блог */
.blog-section {
  padding: clamp(3.75rem, 5vw, 5rem) 0;
}

.section-title {
  font-size: clamp(2rem, 2.5vw, 2.5rem);
  margin-bottom: clamp(2.5rem, 3.75vw, 3.75rem);
  text-align: center;
  color: #ffd700;
  animation: fadeInUp 1s ease forwards;
}

.blog-container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 1.25vw, 1.25rem);
}

.post {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1.25rem;
  padding: clamp(1.875rem, 1.875vw, 1.875rem);
  margin-bottom: clamp(1.875rem, 1.875vw, 1.875rem);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.3);
  animation: fadeInUp 1s ease forwards;
}

.post-title {
  font-size: clamp(1.75rem, 2vw, 2rem);
  margin-bottom: clamp(0.625rem, 0.625vw, 0.625rem);
  color: #ffd700;
}

.post-subtitle {
  font-size: clamp(1.25rem, 1.25vw, 1.25rem);
  margin-bottom: clamp(0.625rem, 0.625vw, 0.625rem);
  color: #e8e8e8;
}

.post-date {
  font-size: clamp(0.875rem, 1vw, 1rem);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: clamp(0.625rem, 0.625vw, 0.625rem);
}

.post-text {
  font-size: clamp(1rem, 1vw, 1rem);
  margin-bottom: clamp(0.625rem, 0.625vw, 0.625rem);
}

.post-gallery,
.post-videos {
  position: relative;
  margin: clamp(1.25rem, 1.25vw, 1.25rem) 0;
}

.gallery-container {
  position: relative;
  overflow: hidden;
  border-radius: 0.625rem;
}

.gallery-images,
.gallery-videos {
  display: flex;
  overflow: hidden; /* Отключаем скролл, используем только transform */
}

.gallery-image,
.gallery-video {
  flex: 0 0 100%;
  transition: transform 0.5s ease;
}

.gallery-image img,
.gallery-video video,
.gallery-video iframe {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.625rem;
}

.image-caption,
.video-caption {
  text-align: center;
  font-size: clamp(0.875rem, 1vw, 1rem);
  color: rgba(255, 255, 255, 0.7);
  margin-top: clamp(0.625rem, 0.625vw, 0.625rem);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 20, 40, 0.7);
  color: #e8e8e8;
  border: none;
  width: clamp(2.5rem, 2.5vw, 2.5rem);
  height: clamp(2.5rem, 2.5vw, 2.5rem);
  font-size: clamp(1.25rem, 1.25vw, 1.25rem);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.gallery-nav:hover {
  background: rgba(255, 215, 0, 0.5);
}

.gallery-prev {
  left: clamp(0.625rem, 0.625vw, 0.625rem);
}

.gallery-next {
  right: clamp(0.625rem, 0.625vw, 0.625rem);
}

.gallery-indicators {
  display: flex;
  justify-content: center;
  gap: clamp(0.625rem, 0.625vw, 0.625rem);
  margin-top: clamp(0.625rem, 0.625vw, 0.625rem);
}

.indicator {
  width: clamp(0.5rem, 0.625vw, 0.625rem);
  height: clamp(0.5rem, 0.625vw, 0.625rem);
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.indicator.active {
  background: #ffd700;
}

.loading,
.error {
  text-align: center;
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  color: #ffd700;
  padding: clamp(1.25rem, 1.25vw, 1.25rem);
}

/* Футер */
.footer {
  background: rgba(10, 20, 40, 0.95);
  padding: clamp(1.875rem, 2.5vw, 2.5rem) 0 clamp(0.9375rem, 1.25vw, 1.25rem);
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.625rem, 1fr));
  gap: clamp(1.25rem, 1.875vw, 1.875rem);
  margin-bottom: clamp(1.875rem, 1.875vw, 1.875rem);
}

.footer-section h3 {
  color: #ffd700;
  margin-bottom: clamp(1.25rem, 1.25vw, 1.25rem);
}

.footer-section p,
.footer-section a {
  color: #b8b8b8;
  text-decoration: none;
  margin-bottom: clamp(0.625rem, 0.625vw, 0.625rem);
  display: block;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #ffd700;
}

.footer-bottom {
  text-align: center;
  padding-top: clamp(1.25rem, 1.25vw, 1.25rem);
  border-top: 1px solid rgba(255, 215, 0, 0.1);
  color: #888;
}

/* Плавающие виджеты */
.floating-widgets {
  position: fixed;
  bottom: clamp(0.9375rem, 1.25vw, 1.25rem);
  right: clamp(0.9375rem, 1.25vw, 1.25rem);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: clamp(0.9375rem, 0.9375vw, 0.9375rem);
}

.whatsapp-widget {
  transform: translate(-11px, -75px);
}

.floating-widget {
  width: clamp(3.75rem, 5.625vw, 5.625rem);
  height: clamp(3.75rem, 5.625vw, 5.625rem);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 2vw, 1.8rem);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.whatsapp-widget {
  background: #25D366;
}

.chat-widget {
  background: linear-gradient(45deg, #ffd700, #d4af37);
  color: #0a1428;
}

.floating-widget:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.chat-popup {
  position: fixed;
  bottom: clamp(3.75rem, 6.25vw, 6.25rem);
  right: clamp(0.9375rem, 1.25vw, 1.25rem);
  width: clamp(15rem, 18.75vw, 18.75rem);
  height: clamp(21.875rem, 25rem, 25rem);
  background: rgba(10, 20, 40, 0.95);
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: clamp(1.25rem, 1.25vw, 1.25rem);
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
}

.chat-popup.active {
  transform: translateY(0);
  opacity: 1;
}

.chat-popup h3 {
  color: #ffd700;
  0.9375rem);
  text-align: center;
}

.chat-popup p {
  color: #c8c8c8;
  text-align: center;
  font-size: clamp(0.875rem, 0.875vw, 0.875rem);
}

/* Дополнение: Стили для улучшенного управления видео */
.gallery-video {
  position: relative;
}

.gallery-video video,
.gallery-video iframe {
  width: 100%;
  height: auto;
  min-height: 300px;
  display: block;
  border-radius: 0.625rem;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.1);
}

/* Эффект при активном видео */
.gallery-video.playing {
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.gallery-video.playing video,
.gallery-video.playing iframe {
  border: 2px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

/* Индикатор воспроизведения */
.video-playing-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 215, 0, 0.9);
  color: #0a1428;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-video.playing .video-playing-indicator {
  opacity: 1;
}

/* Стили для YouTube плеера */
.youtube-player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.youtube-player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 0.625rem;
}

/* Анимация центрирования */
.centering-video {
  animation: highlightVideo 0.5s ease-out;
}

@keyframes highlightVideo {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 215, 0, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  }
}

/* Улучшенные кнопки управления галереей для видео */
.post-videos .gallery-nav {
  background: rgba(255, 215, 0, 0.8);
  color: #0a1428;
  z-index: 20;
}

.post-videos .gallery-nav:hover {
  background: rgba(255, 215, 0, 1);
  transform: translateY(-50%) scale(1.1);
}

/* Плавное появление контролов при наведении */
.post-videos:hover .gallery-nav {
  opacity: 1;
}

.post-videos .gallery-nav {
  opacity: 0.7;
  transition: all 0.3s ease;
}

/* Стили для индикаторов видео галереи */
.post-videos .gallery-indicators .indicator {
  background: rgba(255, 215, 0, 0.3);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.post-videos .gallery-indicators .indicator.active {
  background: #ffd700;
  border-color: rgba(255, 215, 0, 0.5);
  transform: scale(1.2);
}

.post-videos .gallery-indicators .indicator:hover {
  background: rgba(255, 215, 0, 0.6);
  transform: scale(1.1);
}

/* Стили для загрузки YouTube */
.youtube-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0.625rem;
  color: #ffd700;
  font-size: 18px;
}

.youtube-loading::before {
  content: '⏳';
  margin-right: 10px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Адаптивность */
@media (max-width: 768px) {
  
  .main-content {
    margin-top: clamp(6.25rem, 6.25vw, 6.25rem);
  }

  .blog-section {
    padding: clamp(3.125rem, 3.75vw, 3.75rem) 0;
  }

  .post {
    padding: clamp(1.25rem, 1.25vw, 1.25rem);
  }

  .gallery-images,
  .gallery-videos {
    display: flex;
    overflow-x: auto; /* Для свайпа, но без scroll-snap */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .gallery-image,
  .gallery-video {
    flex: 0 0 100%;
    transition: transform 0.5s ease;
  }

  .gallery-nav {
    display: flex;
    width: clamp(2rem, 2.5vw, 2.5rem);
    height: clamp(2rem, 2.5vw, 2.5rem);
    font-size: clamp(0.875rem, 1vw, 1rem);
  }

  .footer {
    padding: clamp(1.5625rem, 1.5625vw, 1.5625rem) 0 clamp(0.625rem, 0.625vw, 0.625rem);
  }

  .floating-widget {
    width: clamp(3.75rem, 5.625vw, 3.75rem);
    height: clamp(3.75rem, 5.625vw, 3.75rem);
    font-size: clamp(1.5rem, 1.875vw, 1.5rem);
  }

  /* Дополнение: Адаптивность для видео */
  .gallery-video video,
  .gallery-video iframe {
    min-height: 200px;
  }

  .gallery-video.playing {
    transform: scale(1.01);
  }
}

@media (max-width: 480px) {
  

  .blog-container {
    padding: 0 clamp(0.75rem, 0.75vw, 0.75rem);
  }

  .section-title {
    font-size: clamp(1.5rem, 2vw, 1.8rem);
    margin-bottom: clamp(1.875rem, 2.5vw, 2.5rem);
  }

  .post-title {
    font-size: clamp(1.5rem, 2vw, 1.8rem);
  }

  .post-subtitle {
    font-size: clamp(1rem, 1.2vw, 1.2rem);
  }

  .post-text {
    font-size: clamp(0.875rem, 1vw, 1rem);
  }

  .footer {
    padding: clamp(1.5625rem, 1.5625vw, 1.5625rem) 0 clamp(0.625rem, 0.625vw, 0.625rem);
  }

  .gallery-nav {
    width: clamp(1.75rem, 2vw, 2rem);
    height: clamp(1.75rem, 2vw, 2rem);
    font-size: clamp(0.75rem, 0.875vw, 0.875rem);
  }

  .floating-widget {
    width: clamp(3.75rem, 3.75vw, 3.75rem);
    height: clamp(3.75rem, 3.75vw, 3.75rem);
    font-size: clamp(1.5rem, 1.5vw, 1.5rem);
  }

  iframe[title="chat widget"] {
    position: fixed !important;
    bottom: calc(clamp(0.9375rem, 1.25vw, 1.25rem) + 3.125rem) !important;
    right: clamp(0.9375rem, 1.25vw, 1.25rem) !important;
    z-index: 1001 !important;
    transform: none !important;
  }

  /* Дополнение: Адаптивность для видео на маленьких экранах */
  .gallery-video video,
  .gallery-video iframe {
    min-height: 180px;
  }

  .video-playing-indicator {
    font-size: 10px;
    padding: 3px 6px;
  }
}

<style>
.divider {
  height: 1px;
  background: #eee;
  margin: 25px 0;
  width: 100%;
}

.cta-section {
  text-align: center;
  padding: 30px;
  background: #b8860b;
  border-radius: 10px;
  margin: 30px 0;
}

.cta-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
}

.cta-button {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 15px 30px;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  margin-top: 15px;
  transition: background 0.3s ease;
}

.cta-button:hover {
  background: #2980b9;
}

.post-date {
  color: #7f8c8d;
  font-size: 0.9em;
  margin-bottom: 20px;
}
</style>
