/* Simple Gallery CSS - Small thumbnails in rows */ /* Основные стили галереи */ .gallery { display: flex; flex-wrap: wrap; gap: 1.5%; padding: 10px; max-width: 1400px; margin: 0 auto; justify-content: space-between; } /* Контейнер изображения */ .gallery .box { width: 23%; height: 250px; transition: transform 0.2s ease; border: none; border-radius: 15px; } /* Эффект наведения */ .gallery .box:hover { transform: scale(1.05); } /* Figure элемент */ .gallery figure { width: 100%; height: 100%; margin: 0; position: relative; overflow: hidden; border: none; } /* Изображение */ .gallery .img { width: 100%; height: 100%; background-size: cover; background-position: center; background-repeat: no-repeat; border-radius: 15px; } /* Скрываем обычные img теги */ .gallery img { display: none; } /* Ссылка на полное изображение */ .gallery figure a { display: block; width: 100%; height: 100%; } /* Подпись скрыта для компактности */ .gallery figcaption { display: none; } /* Адаптивность */ @media (max-width: 768px) { .gallery .box { width: 23%; height: 180px; } .gallery { gap: 1.5%; } } @media (max-width: 480px) { .gallery { flex-direction: column; gap: 15px; padding: 15px; align-items: center; } .gallery .box { width: 95%; max-width: 400px; height: 250px; border-radius: 12px; } .gallery .img { border-radius: 12px; } } /* Эффекты для подписей */ .gallery.caption-effect-fade figcaption { background: rgba(0, 0, 0, 0.7); transform: none; opacity: 0; transition: opacity 0.3s ease; } .gallery.caption-effect-fade .box:hover figcaption { opacity: 1; } .gallery.caption-position-center figcaption { top: 50%; bottom: auto; transform: translateY(-50%); background: rgba(0, 0, 0, 0.7); text-align: center; padding: 16px; } .gallery.caption-position-center .box:hover figcaption { transform: translateY(-50%); } .gallery.caption-position-none figcaption { display: none; } /* Отдельные figure элементы (не в галерее) */ .box:not(.gallery .box) { display: inline-block; margin: 10px; max-width: 300px; } .box:not(.gallery .box) figure { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); } .box:not(.gallery .box) .img { position: relative; width: 100%; height: 200px; background-size: cover; background-position: center; }