/* ==================================================
   GALLERY CAPTION OVERLAY STYLES
   These match the admin panel preview exactly
   ================================================== */

/* Import Bebas Neue font - REQUIRED for matching style */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

/* Gallery Item Base Styles */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    aspect-ratio: 4/3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* STYLIZED CAPTION OVERLAY - MATCHES ADMIN PREVIEW */
.caption-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 20px;
    z-index: 10;
}

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

/* Stylized Title - BEBAS NEUE FONT (matches admin) */
.caption-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 42px;
    letter-spacing: 2px;
    text-transform: uppercase;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0 0 10px 0;
    word-wrap: break-word;
    /* Color will be set inline from database */
}

/* Photo Count (below title) */
.caption-count {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin: 0;
    /* Color will be set inline from database */
}

/* Gallery Placeholder (for galleries without cover images) */
.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.gallery-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.05) 10px,
        rgba(255, 255, 255, 0.05) 20px
    );
    animation: placeholderShift 20s linear infinite;
}

@keyframes placeholderShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.placeholder-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Gallery Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .caption-title {
        font-size: 32px;
    }
    
    .caption-count {
        font-size: 13px;
    }
    
    .placeholder-text {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .caption-title {
        font-size: 28px;
        letter-spacing: 1px;
    }
    
    .caption-count {
        font-size: 12px;
    }
    
    .caption-overlay {
        padding: 15px;
    }
}

/* Ensure caption overlay is above any other elements */
.gallery-item {
    z-index: 1;
}

.gallery-item:hover {
    z-index: 10;
}
