/* ========================================
   GALLERY PAGE STYLES
   Image gallery with modal viewer and presentation section
   ======================================== */

.gallery-page {
    background: var(--background-color);
}

/* Gallery Header */
.gallery-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
}

.page-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    margin-bottom: var(--spacing-xs);
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Image Gallery Section */
.image-gallery-section {
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--white);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* Gallery Item */
.gallery-item {
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    display: block;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--shadow-dark);
    border-color: var(--accent-color);
}

/* Folder Icon for Collection Links */
.gallery-folder .gallery-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.folder-icon {
    font-size: 5rem;
    opacity: 0.8;
    transition: var(--transition);
}

.gallery-folder:hover .folder-icon {
    transform: scale(1.2);
    opacity: 1;
}

/* Folder preview images */
.folder-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Folder overlay badge */
.folder-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.folder-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Touch-friendly folder links */
@media (hover: none) and (pointer: coarse) {
    .gallery-folder:active .folder-icon {
        transform: scale(1.15);
        opacity: 1;
    }
    
    .gallery-folder:active .folder-preview {
        transform: scale(1.05);
    }
}

/* Image Wrapper with Overlay */
.gallery-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--background-color);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

/* Image Overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.7), rgba(217, 119, 6, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

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

.overlay-icon {
    font-size: 3rem;
    color: var(--white);
}

/* Gallery Caption */
.gallery-caption {
    padding: var(--spacing-md);
}

.caption-title {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
    font-size: 1.2rem;
}

.caption-text {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Presentation Section */
.presentation-section {
    padding: var(--spacing-xl) var(--spacing-md);
    background: #b4c5e4;
}

.section-description {
    text-align: center;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto var(--spacing-md);
    font-size: 1.1rem;
}

/* Presentation Placeholder */
.presentation-placeholder {
    background: var(--card-background);
    border-radius: 12px;
    padding: var(--spacing-xl);
    box-shadow: 0 5px 15px var(--shadow);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

/* PDF Embed Container */
.pdf-embed-container {
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
    border: 1px solid var(--border-color);
    margin-top: var(--spacing-md);
}

.pdf-embed-container iframe {
    display: block;
    border: none;
    border-radius: 12px;
}

/* Mobile-friendly PDF embed */
@media (max-width: 768px) {
    .pdf-embed-container iframe {
        height: 600px !important;
    }
}

@media (max-width: 480px) {
    .pdf-embed-container iframe {
        height: 500px !important;
    }
}

.placeholder-content {
    text-align: center;
}

.placeholder-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: var(--spacing-md);
}

.placeholder-content h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-size: 1.8rem;
}

.placeholder-content p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    animation: fadeIn 0.3s ease;
}

/* Modal Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--white);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10000;
}

.modal-close:hover {
    color: var(--accent-light);
    transform: scale(1.2);
}

/* Modal Caption */
.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 5px;
    max-width: 80%;
}

/* Modal Navigation Arrows */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    font-size: 2rem;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: var(--transition);
    border-radius: 5px;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-header {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .image-gallery-section,
    .presentation-section {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--spacing-sm);
    }
    
    .gallery-image-wrapper {
        height: 200px;
    }
    
    .gallery-caption {
        padding: var(--spacing-sm);
    }
    
    .caption-title {
        font-size: 1.1rem;
    }
    
    .caption-text {
        font-size: 0.9rem;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    .modal-caption {
        font-size: 0.9rem;
        max-width: 90%;
        bottom: 10px;
    }
    
    .modal-nav {
        font-size: 1.5rem;
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .modal-prev {
        left: 5px;
    }
    
    .modal-next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .gallery-image-wrapper {
        height: 220px;
    }
    
    .gallery-caption {
        padding: var(--spacing-sm);
    }
    
    .caption-title {
        font-size: 1rem;
    }
    
    .presentation-placeholder {
        padding: var(--spacing-md);
        min-height: 300px;
    }
    
    .placeholder-icon {
        font-size: 3rem;
    }
    
    .placeholder-content h3 {
        font-size: 1.3rem;
    }
    
    .placeholder-content p {
        font-size: 0.9rem;
    }
    
    .modal-close {
        top: 5px;
        right: 10px;
        font-size: 25px;
    }
    
    .modal-nav {
        font-size: 1.2rem;
        padding: 8px 12px;
    }
}
