/* ==========================================
   Advanced Gallery Styles & Folder UI
========================================== */
.gallery-header {
    margin-bottom: 30px;
}
.gallery-header h3 {
    font-size: 24px;
    color: #2e3790;
    position: relative;
    padding-bottom: 20px;
    display: inline-block;
    width: 100%;
    border-bottom: 1px solid #eaeaea;
}
.gallery-header h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #2e3790;
}

.modern-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* Base Gallery Card */
.gallery-card {
    position: relative;
    /* border-radius: 12px; */
    overflow: hidden;
    cursor: pointer;
    /* box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);  */
    background: #1d1654;
    aspect-ratio: 4 / 3;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: block; /* for <a> tags */
}
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

/* Image scaling */
.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
    opacity: 0.9;
    display: block;
}
.gallery-card:hover img {
    transform: scale(1.1);
    opacity: 0.6;
}

/* Media Type Icon (Camera / Video) */
.media-type-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2e3790;
    font-size: 14px;
    z-index: 3;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: background 0.3s ease;
}
.gallery-card:hover .media-type-icon {
    background: #2e3790;
    color: #fff;
}

/* Folder Specific Styles */
.gallery-folder-wrapper {
    position: relative;
    margin-top: 20px;
}

.gallery-folder-wrapper::before,
.gallery-folder-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #e0e0e0;
    border-radius: 12px 12px 0 0;
    z-index: 0;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.gallery-folder-wrapper::before {
    width: 92%;
    height: 10px;
    top: -6px;
    background: #cbcbcb;
}
.gallery-folder-wrapper::after {
    width: 84%;
    height: 10px;
        top: -16px;
    /* background: #1d1654d1; */
}

.gallery-folder-wrapper:hover::before {
    top: -12px;
}
.gallery-folder-wrapper:hover::after {
    top: -24px;
}

.gallery-folder-wrapper .gallery-card {
    z-index: 1; /* Place above the pseudo stack */
}

/* Folder Content Overlay */
.folder-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px 20px 20px;
    background: linear-gradient(to top, rgb(29 22 84) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.folder-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}
.folder-meta {
    font-size: 13px;
    color: #e5e5e5;
    display: flex;
    align-items: center;
    gap: 6px;
}
.folder-meta i {
    /* color: var(--secondary-color, #f47920); */
}

/* General Gallery Overlay (for non-folders) */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(1, 82, 137, 0.2);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 2;
}
.gallery-card:hover .gallery-overlay {
    opacity: 1;
}
.gallery-icon-center {
    width: 50px;
    height: 50px;
    background: #ffffff1c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.gallery-card:hover .gallery-icon-center {
    transform: translateY(0);
}

/* Fancybox overrides for premium feel */
.fancybox__container {
    --fancybox-color: #fff;
    --fancybox-bg: rgba(0, 0, 0, 0.95);
    z-index: 99999;
}
.carousel__button.is-close {
    color: #fff;
}
.carousel__button.is-close:hover {
    color: var(--secondary-color, #f47920);
}
