/*
 * ForTraders.org - Modern Image Styling
 * Современное оформление изображений в статьях
 * Version: 2024.1
 */

/* =============================================================================
   БАЗОВЫЕ СТИЛИ ДЛЯ ИЗОБРАЖЕНИЙ В СТАТЬЯХ
   ============================================================================= */

/* Основные изображения ТОЛЬКО в контенте статей */
.article-content img,
.post-content img,
.entry-content img,
.clearfix.main-post-content img,
.main-post-content img {
  /* Адаптивность */
  max-width: 100%;
  height: auto;
  
  /* Современное оформление */
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  
  /* Отступы для гармонии с текстом */
  margin: 2rem auto;
  display: block;
  
  /* Плавные переходы */
  transition: all 0.3s ease;
}

/* Hover эффект для изображений ТОЛЬКО в статьях */
.article-content img:hover,
.post-content img:hover,
.entry-content img:hover,
.clearfix.main-post-content img:hover,
.main-post-content img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  cursor: zoom-in;
}

/* =============================================================================
   КАРТОЧНЫЙ ДИЗАЙН ДЛЯ ИЗОБРАЖЕНИЙ
   ============================================================================= */

/* Контейнер для изображения-карточки */
.image-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin: 2.5rem auto;
  max-width: 90%;
  transition: all 0.3s ease;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.image-card img {
  border-radius: 8px;
  margin: 0;
  box-shadow: none;
  transition: none;
}

.image-card .image-caption {
  display: none;
}

/* =============================================================================
   ПОДПИСИ К ИЗОБРАЖЕНИЯМ
   ============================================================================= */

/* Подписи к изображениям - отключены ТОЛЬКО в контенте статей */
.wp-caption-text,
.article-content figcaption,
.post-content figcaption, 
.entry-content figcaption,
.main-post-content figcaption,
.articleru figcaption,
.figure-caption,
.image-caption,
.auto-caption {
  display: none !important;
}

.wp-caption {
  max-width: 100% !important;
  margin: 2rem auto !important;
}

figure,
.figure {
  margin: 2.5rem auto;
  text-align: center;
}

figure img,
.figure img {
  margin-bottom: 0;
}

/* =============================================================================
   ПЛАВАЮЩИЕ ИЗОБРАЖЕНИЯ
   ============================================================================= */

/* Изображение слева от текста */
.image-float-left {
  float: left;
  margin: 0.5rem 2rem 1.5rem 0;
  max-width: 45%;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Изображение справа от текста */
.image-float-right {
  float: right;
  margin: 0.5rem 0 1.5rem 2rem;
  max-width: 45%;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Очистка после плавающих элементов */
.clear-float {
  clear: both;
  margin-top: 2rem;
}

/* =============================================================================
   ГАЛЕРЕЯ ИЗОБРАЖЕНИЙ
   ============================================================================= */

/* Контейнер галереи */
.images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem auto;
  max-width: 100%;
}

.gallery-item {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.gallery-item .caption {
  display: none;
}

/* =============================================================================
   СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ ТОРГОВЫХ ГРАФИКОВ
   ============================================================================= */

/* Стили специально для графиков MT4/MT5 */
.trading-chart,
.mt4-screenshot,
.chart-image {
  border: 2px solid #f1f5f9;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  margin: 2.5rem auto;
  max-width: 95%;
  background: #ffffff;
  padding: 1rem;
}

.trading-chart:hover,
.mt4-screenshot:hover,
.chart-image:hover {
  border-color: #9ca3af;
  box-shadow: 0 12px 40px rgba(156, 163, 175, 0.15);
}

/* Подписи для торговых графиков - скрыты */
.chart-caption {
  display: none;
}

/* =============================================================================
   LIGHTBOX ЭФФЕКТ ДЛЯ УВЕЛИЧЕНИЯ ИЗОБРАЖЕНИЙ
   ============================================================================= */

/* Указатель что изображение можно увеличить */
.zoomable {
  cursor: zoom-in;
  position: relative;
}

.zoomable::after {
  content: "🔍";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem;
  border-radius: 50%;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zoomable:hover::after {
  opacity: 1;
}

/* =============================================================================
   АДАПТИВНЫЙ ДИЗАЙН
   ============================================================================= */

@media (max-width: 768px) {
  /* На мобильных устройствах */
  .image-float-left,
  .image-float-right {
    float: none;
    margin: 1.5rem auto;
    max-width: 100%;
    display: block;
  }
  
  .image-card {
    max-width: 95%;
    padding: 1rem;
    margin: 2rem auto;
  }
  
  .images-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 2rem auto;
  }
  
  .trading-chart,
  .mt4-screenshot,
  .chart-image {
    max-width: 100%;
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  /* На очень маленьких экранах */
  .article-content img,
  .post-content img,
  .content img,
  article img {
    margin: 1.5rem auto;
    border-radius: 8px;
  }
  
  .image-card {
    border-radius: 12px;
    margin: 1.5rem auto;
  }
  
  .chart-caption {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}

/* =============================================================================
   УЛУЧШЕНИЯ ПРОИЗВОДИТЕЛЬНОСТИ
   ============================================================================= */

/* Ленивая загрузка изображений - только для контента статей */
.article-content img[loading="lazy"],
.post-content img[loading="lazy"],
.entry-content img[loading="lazy"],
.main-post-content img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.article-content img[loading="lazy"].loaded,
.post-content img[loading="lazy"].loaded,
.entry-content img[loading="lazy"].loaded,
.main-post-content img[loading="lazy"].loaded {
  opacity: 1;
}

/* Оптимизация рендеринга ТОЛЬКО для статей */
.article-content img,
.post-content img,
.entry-content img,
.main-post-content img {
  will-change: transform;
}

/* =============================================================================
   ИНТЕГРАЦИЯ С СУЩЕСТВУЮЩИМИ СТИЛЯМИ FORTRADERS
   ============================================================================= */

/* Приоритет для изображений ТОЛЬКО в основном контенте статей */
.clearfix.main-post-content img,
.main-post-content img {
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
  margin: 2rem auto !important;
  transition: all 0.3s ease !important;
}

/* Совместимость с WordPress блоками ТОЛЬКО в статьях */
.article-content .wp-block-image img,
.post-content .wp-block-image img,
.entry-content .wp-block-image img,
.main-post-content .wp-block-image img {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.article-content .wp-block-image.is-style-rounded img,
.post-content .wp-block-image.is-style-rounded img,
.entry-content .wp-block-image.is-style-rounded img,
.main-post-content .wp-block-image.is-style-rounded img {
  border-radius: 50%;
}
