/* Mobile Galerie Page Optimization CSS */

/* Gallery Hero Section */
.gallery-hero {
    padding: 2rem 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--bordeaux) 0%, var(--rosa) 100%);
    color: white;
}

@media (max-width: 768px) {
    .gallery-hero {
        padding: 1.5rem 1rem;
    }
    
    .gallery-hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
        line-height: 1.2;
    }
    
    .gallery-hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        opacity: 0.9;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .gallery-hero h1 {
        font-size: 1.75rem;
    }
    
    .gallery-hero p {
        font-size: 0.95rem;
    }
}

/* Gallery Filter Navigation */
.gallery-filters {
    background: white;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

@media (max-width: 768px) {
    .gallery-filters {
        padding: 1rem;
    }
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }
    
    .filter-buttons::-webkit-scrollbar {
        height: 3px;
    }
    
    .filter-buttons::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .filter-buttons::-webkit-scrollbar-thumb {
        background: var(--bordeaux);
        border-radius: 3px;
    }
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--bordeaux);
    background: white;
    color: var(--bordeaux);
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--bordeaux);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.3);
}

@media (max-width: 768px) {
    .filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-width: 100px;
    }
}

/* Gallery Grid Container */
.gallery-container {
    padding: 2rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .gallery-container {
        padding: 1.5rem 0.5rem;
    }
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Gallery Items */
.gallery-item {
    position: relative;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .gallery-item {
        border-radius: 12px;
    }
    
    .gallery-item:hover {
        transform: translateY(-4px);
    }
}

/* Gallery Item Image */
.gallery-item-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-image {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .gallery-item-image {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .gallery-item-image {
        height: 200px;
    }
}

/* Gallery Item Overlay */
.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.8) 0%, rgba(210, 105, 30, 0.8) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    text-align: center;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

@media (max-width: 768px) {
    .gallery-item-overlay {
        padding: 0.75rem;
    }
    
    .gallery-item-overlay h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }
    
    .gallery-item-overlay p {
        font-size: 0.9rem;
        opacity: 0.9;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .gallery-item-overlay .view-btn {
        padding: 0.5rem 1rem;
        background: white;
        color: var(--bordeaux);
        border: none;
        border-radius: 20px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 0.85rem;
    }
    
    .gallery-item-overlay .view-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }
}

/* Gallery Item Info (below image) */
.gallery-item-info {
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .gallery-item-info {
        padding: 1.25rem;
    }
    
    .gallery-item-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
        color: var(--bordeaux);
        font-weight: 600;
    }
    
    .gallery-item-info .category {
        font-size: 0.8rem;
        color: var(--rosa);
        font-weight: 500;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .gallery-item-info .description {
        font-size: 0.85rem;
        color: #666;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .gallery-item-info .tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .gallery-item-info .tag {
        padding: 0.25rem 0.75rem;
        background: #f8f9fa;
        color: #666;
        border-radius: 15px;
        font-size: 0.75rem;
        border: 1px solid #e9ecef;
    }
}

/* Masonry Layout (Alternative) */
.gallery-masonry {
    column-count: 3;
    column-gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-masonry {
        column-count: 1;
    }
}

.gallery-masonry .gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
}

@media (max-width: 768px) {
    .gallery-masonry .gallery-item {
        margin-bottom: 1rem;
    }
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

@media (max-width: 768px) {
    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
        border-radius: 10px;
    }
}

.lightbox-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

.lightbox-info {
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .lightbox-info {
        padding: 1rem;
    }
    
    .lightbox-info h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
        color: var(--bordeaux);
    }
    
    .lightbox-info p {
        font-size: 0.9rem;
        color: #666;
        line-height: 1.6;
    }
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 768px) {
    .lightbox-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
        top: 0.75rem;
        right: 0.75rem;
    }
}

/* Navigation Arrows */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-prev {
    left: 1rem;
    border-radius: 0 25px 25px 0;
}

.lightbox-next {
    right: 1rem;
    border-radius: 25px 0 0 25px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--bordeaux) 0%, var(--rosa) 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    min-width: 150px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .load-more-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Loading States */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--bordeaux);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

@media (max-width: 768px) {
    .gallery-empty {
        padding: 2rem 1rem;
    }
    
    .gallery-empty h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
        color: var(--bordeaux);
    }
    
    .gallery-empty p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* Touch Gestures Support */
@media (max-width: 768px) {
    .gallery-item {
        touch-action: manipulation;
    }
    
    .lightbox-content {
        touch-action: pan-y pinch-zoom;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .gallery-item,
    .lightbox,
    .lightbox-content,
    .load-more-btn {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Focus states */
.filter-btn:focus,
.gallery-item:focus,
.load-more-btn:focus,
.lightbox-close:focus,
.lightbox-nav:focus {
    outline: 2px solid var(--bordeaux);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .gallery-filters,
    .lightbox,
    .load-more-container {
        display: none;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .gallery-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}