/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-gap: 1rem;
    width: 100%;
}

/* Gallery item */
.gallery-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Image wrapper */
.gallery-image-wrapper {
    position: relative;
}

/* Image */
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-item img.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Hover overlay */
.gallery-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.5rem;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-item:hover .gallery-hover {
    opacity: 1;
}

/* Info below image */
.gallery-info {
    padding: 0.5rem;
    text-align: center;
    background: #f9f9f9;
}

.gallery-title {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.gallery-creator-wood {
    font-size: 0.85rem;
    color: #555;
}

/* Filters */
.filter-group {
    margin-bottom: 1em;
}

.filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.3em;
}

.filter-group select {
    width: 100%;
    padding: 0.3em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.filter-archive {
    margin-top: 1.2em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80%;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.modal-caption {
    text-align: center;
    color: white;
    margin-top: 10px;
    font-size: 1rem;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #ccc;
}

/* Responsive */
@media (max-width: 768px) {
    .content-area.with-sidebar .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}
