/**
 * Стили фотогалереи ButGallery на фронтенде
 */

.butgallery-album-wrap,
.butgallery-collection-wrap,
.butgallery-all-albums-wrap {
    margin: 25px 0;
    font-family: inherit;
    box-sizing: border-box;
}

.butgallery-album-wrap *,
.butgallery-collection-wrap *,
.butgallery-all-albums-wrap * {
    box-sizing: border-box;
}

/* Заголовок и описание альбома */
.bg-album-header,
.bg-collection-header {
    margin-bottom: 25px;
    text-align: left;
}

.bg-album-title,
.bg-collection-title {
    font-size: 1.8rem;
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.bg-album-description,
.bg-collection-description {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #4a4a4a;
}

/* Адаптивная сетка фотографий */
.bg-photos-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.bg-cols-1 { grid-template-columns: 1fr; }
.bg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.bg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.bg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.bg-cols-5 { grid-template-columns: repeat(5, 1fr); }
.bg-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Карточка фотографии */
.bg-photo-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.bg-photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Блок картинки */
.bg-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f3f4f6;
    cursor: pointer;
}

.bg-gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bg-photo-card:hover .bg-gallery-image {
    transform: scale(1.04);
}

.bg-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-photo-card:hover .bg-image-overlay {
    opacity: 1;
}

.bg-zoom-icon {
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transform: scale(0.85);
    transition: transform 0.2s ease;
}

.bg-photo-card:hover .bg-zoom-icon {
    transform: scale(1);
}

/* Тело карточки */
.bg-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.bg-card-title {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
}

.bg-card-description {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    flex-grow: 1;
}

/* Метаданные (Дата, Автор, Источник) */
.bg-card-metadata {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
    font-size: 0.85rem;
}

.bg-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
}

.bg-meta-date svg {
    color: #9ca3af;
}

.bg-meta-label {
    font-weight: 600;
    color: #4b5563;
}

.bg-meta-link {
    color: #2563eb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.bg-meta-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.bg-meta-text {
    color: #374151;
}

/* Футер карточки с кнопкой скачивания */
.bg-card-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.bg-btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    transition: all 0.2s ease;
}

.bg-btn-download:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.bg-btn-download svg {
    transition: transform 0.2s ease;
}

.bg-btn-download:hover svg {
    transform: translateY(1px);
}

/* Сетка списка альбомов (Archive View) */
.bg-albums-grid {
    display: grid;
    gap: 24px;
    margin: 25px 0;
}

.bg-album-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bg-album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.bg-album-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.bg-album-card-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #e5e7eb;
    overflow: hidden;
}

.bg-album-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bg-album-card:hover .bg-album-card-cover img {
    transform: scale(1.05);
}

.bg-album-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.bg-album-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.bg-album-card-body {
    padding: 18px;
}

.bg-album-card-title {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
}

.bg-album-card-desc {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Адаптивность для мобильных */
@media screen and (max-width: 1024px) {
    .bg-cols-4, .bg-cols-5, .bg-cols-6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .bg-cols-3, .bg-cols-4, .bg-cols-5, .bg-cols-6 {
        grid-template-columns: repeat(2, 1fr);
    }
    .bg-albums-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 540px) {
    .bg-cols-2, .bg-cols-3, .bg-cols-4, .bg-cols-5, .bg-cols-6 {
        grid-template-columns: 1fr;
    }
    .bg-albums-grid {
        grid-template-columns: 1fr;
    }
}
