/* Custom styles for EscaeGallery */

/* Photo card hover effect */
.photo-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Photo detail page */
.photo-detail-img {
    max-height: 70vh;
    width: auto;
    margin: 0 auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Category badges */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: hsl(var(--p) / 0.2);
    color: hsl(var(--p));
    transition: background-color 0.2s ease;
}

.category-badge:hover {
    background-color: hsl(var(--p) / 0.3);
}

/* Gallery masonry layout for larger screens */
@media (min-width: 768px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
        column-gap: 1.5rem;
    }
}

@media (min-width: 1280px) {
    .masonry-grid {
        column-count: 4;
        column-gap: 2rem;
    }
}

.masonry-grid .photo-card {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

/* Ratio uniforme pour que les cartes s'alignent proprement malgré des photos
   de formats différents (portrait/paysage) */
.photo-card figure img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    width: 100%;
}

/* Admin form styles */
.admin-form .form-control {
    margin-bottom: 1.5rem;
}

.admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

/* Loading animation */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: hsl(var(--p));
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Image upload preview */
.upload-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 1rem;
    border-radius: 0.375rem;
}