/* ========================================
   PERPUSTAKAAN DIGITAL THEME
   ======================================== */

/* Library Grid Layout */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Library Item Card */
.library-item {
    position: relative;
}

.library-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.library-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.2);
}

/* Library Cover */
.library-cover {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.library-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.library-card:hover .library-cover img {
    transform: scale(1.05);
}

.no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8B4513 0%, #5D2E0C 100%);
    color: #DAA520;
}

.no-cover i {
    opacity: 0.5;
}

/* Library Overlay */
.library-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 50%);
    padding: 15px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.library-card:hover .library-overlay {
    opacity: 1;
}

.category-badge {
    background: rgba(139, 69, 19, 0.95);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Library Info */
.library-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.library-info h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-info .author,
.library-info .year,
.library-info .description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.library-info .author i,
.library-info .year i {
    color: #8B4513;
    font-size: 0.85rem;
}

.library-info .description {
    line-height: 1.5;
    margin-top: 8px;
    flex: 1;
}

/* View Button */
.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #8B4513 0%, #5D2E0C 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: auto;
    justify-content: center;
}

.view-btn:hover {
    background: linear-gradient(135deg, #5D2E0C 0%, #3D1E08 100%);
    transform: translateX(4px);
}

.view-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.view-btn:hover i {
    transform: translateX(4px);
}

/* Photo Card Variation */
.photo-card .library-cover {
    height: 280px;
}

/* Section Specific Styles */
.perpustakaan-buku {
    background: #fff;
}

.perpustakaan-arsip {
    background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 100%);
}

.perpustakaan-foto {
    background: #fff;
}

/* Empty State */
.text-center {
    text-align: center;
    color: #999;
    font-size: 1.1rem;
    padding: 60px 20px;
}

/* Button Primary for "Lihat Semua" */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #8B4513 0%, #5D2E0C 100%);
    color: #fff;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5D2E0C 0%, #3D1E08 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-primary i {
    transition: transform 0.3s ease;
}

.btn-primary:hover i {
    transform: translateX(4px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .library-cover {
        height: 280px;
    }

    .photo-card .library-cover {
        height: 240px;
    }

    .library-info h4 {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .library-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .library-cover {
        height: 300px;
    }

    .photo-card .library-cover {
        height: 250px;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.library-item[data-aos="fade-up"] {
    animation: fadeInUp 0.6s ease-out;
}
