/* Gallery Grid Styles */
.grid-item {
    width: 48%; /* 2 columns on mobile */
    margin-bottom: 16px;
    opacity: 0; /* Start invisible */
    transition: opacity 0.3s ease-in; /* Smooth fade in */
}

.grid-item.is-loaded {
    opacity: 1;
}

@media (min-width: 768px) {
    .grid-item {
        width: 31.33%; /* 3 columns on tablet */
    }
}

@media (min-width: 1024px) {
    .grid-item {
        width: 23%; /* 4 columns on desktop */
    }
}

.grid {
    margin: 0 auto;
    min-height: 200px; /* Minimum height to prevent layout shifts */
    position: relative;
}

/* Loading Indicator */
.grid::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin: -25px 0 0 -25px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #555;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.grid.is-loading::before {
    opacity: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    width: 100%;
    max-height: 90vh;
}

.modal-image {
    max-height: 90vh;
    margin: 0 auto;
    object-fit: contain;
}

.modal-close,
.modal-prev,
.modal-next {
    position: absolute;
    padding: 1rem;
    color: white;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.modal-close:hover,
.modal-prev:hover,
.modal-next:hover {
    color: #d1d5db;
}

.modal-close {
    top: 1rem;
    right: 1rem;
}

.modal-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.modal-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Image hover effect */
.grid-item-inner {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.grid-item-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.grid-item-inner:hover .grid-item-overlay {
    opacity: 1;
}

.grid-item-overlay-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
} 