/* =========================
   SPECIAL GALLERY STYLES
   Darur Rashad Educare Trust
   ========================= */

/* ---------- PAGE TITLE (gallery specific) ---------- */
.gallery-page-title {
    padding: 100px 0 60px;
    margin-top: 70px; /* avoid fixed header overlap */
    text-align: center;
    background: linear-gradient(180deg, #FDF8F0 0%, #FEFCF9 100%);
    border-bottom: 1px solid rgba(201, 164, 62, 0.15);
}

.title-emoji {
    font-size: 42px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.9;
}

.gallery-page-title h1 {
    font-size: 48px;
    font-family: "Playfair Display", serif;
    color: #1E1E1E;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.title-subtitle {
    font-size: 18px;
    color: #5A5A5A;
    max-width: 600px;
    margin: 0 auto 25px;
    font-weight: 400;
}

.underline {
    width: 70px;
    height: 3px;
    background: #C9A43E;
    margin: 0 auto;
    border-radius: 2px;
}

/* ---------- FILTER BAR ---------- */
.gallery-filter-bar {
    background: #F8F4EE;
    padding: 30px 0 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.filter-btn {
    background: #FFFFFF;
    border: 1.5px solid #E1D5C0;
    padding: 12px 24px;
    border-radius: 60px;
    font-weight: 600;
    font-size: 15px;
    color: #2E2E2E;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    letter-spacing: 0.4px;
}

.filter-btn:hover {
    background: #FFF9F0;
    border-color: #C9A43E;
    color: #B18B2C;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #C9A43E;
    color: #FFFFFF;
    border-color: #C9A43E;
    box-shadow: 0 8px 18px rgba(201, 164, 62, 0.3);
}

.filter-emoji {
    font-size: 18px;
}

/* ---------- GALLERY SECTION ---------- */
.gallery-section {
    padding: 70px 0;
    background: #F7F5F1; /* soft warm white */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.gallery-item {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: #FFFFFF;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.35s cubic-bezier(0.15, 0.85, 0.35, 1.0), box-shadow 0.35s;
    cursor: pointer;
    aspect-ratio: 1 / 1;  /* perfect square, keeps images uniform */
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
    border-radius: 24px;
}

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

/* Overlay on hover */
.gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 25px 15px 15px;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-radius: 0 0 24px 24px;
}

.gallery-item:hover .overlay {
    opacity: 1;
    transform: translateY(0);
}

.overlay span {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.3px;
    display: block;
}

/* ---------- BLUE PLACEHOLDER (when image missing) ---------- */
.gallery-item.image-missing {
    background: linear-gradient(135deg, #5B9BD5 0%, #2E75B6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item.image-missing img {
    display: none;  /* ensure hidden */
}

.gallery-item.image-missing::before {
    content: "🖼️";
    font-size: 48px;
    opacity: 0.85;
    position: absolute;
    z-index: 2;
}

.gallery-item.image-missing::after {
    content: "Image coming soon";
    position: absolute;
    bottom: 20px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    font-weight: 500;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* The overlay should still appear even on placeholder so caption intact */
.gallery-item.image-missing .overlay {
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    opacity: 1;
    transform: translateY(0);
}

/* ---------- CTA SECTION ---------- */
.gallery-cta {
    background: #FDF8F0;
    padding: 80px 0;
    text-align: center;
    border-top: 1px solid rgba(201, 164, 62, 0.2);
}

.cta-emoji {
    font-size: 44px;
    display: block;
    margin-bottom: 12px;
}

.gallery-cta h2 {
    font-family: "Playfair Display", serif;
    font-size: 38px;
    margin-bottom: 15px;
    color: #1E1E1E;
}

.gallery-cta p {
    font-size: 18px;
    color: #4A4A4A;
    max-width: 500px;
    margin: 0 auto 30px;
}

/* ---------- RESPONSIVE TWEAKS ---------- */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .gallery-page-title h1 {
        font-size: 36px;
    }
    .filter-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    .gallery-cta h2 {
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 0 auto;
    }
    .gallery-page-title h1 {
        font-size: 32px;
    }
    .filter-buttons {
        gap: 10px;
    }
    .filter-btn {
        padding: 8px 16px;
    }
}