/* ============================================
   GALLERY CSS
   Theme: High-End Production Ready
   ============================================ */

/* --- SECTION 1: MASONRY GRID (Campus) --- */
.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
    padding: 2rem 0;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease;
}

.masonry-item:hover {
    transform: translateY(-10px) scale(1.02) rotate(1deg);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.25);
}

.masonry-item img {
    width: 100%;
    display: block;
    height: auto;
    border-radius: 12px;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.masonry-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.4) saturate(0.5);
}

.masonry-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.masonry-overlay h4,
.masonry-overlay p {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

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

/* --- HIGHLIGHTS GRID (Uniform Card Grid) --- */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2rem 0;
}

.highlights-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.highlights-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.25);
}

.highlights-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 12px;
    transition: transform 0.5s ease, filter 0.5s ease;
}

.highlights-card:hover img {
    transform: scale(1.05);
    filter: brightness(0.4) saturate(0.5);
}

.highlights-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.highlights-overlay h4 {
    color: #D4AF37;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.highlights-overlay p {
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.highlights-card:hover .highlights-overlay {
    opacity: 1;
}

.masonry-text-item {
    background: linear-gradient(135deg, #110000, #2a0800);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #D4AF37;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.masonry-text-item h3 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin: 0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
    letter-spacing: 2px;
}

/* --- SECTION 2: GLASSMORPHISM CARDS (Student Life) --- */
.glass-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 2rem 0;
}

.glass-card {
    position: relative;
    border-radius: 20px;
    height: 400px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.glass-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.glass-card:hover img {
    transform: scale(1.1);
}

.glass-content {
    position: absolute;
    bottom: -150px;
    /* Initially hidden */
    left: 0;
    width: 100%;
    padding: 2rem;
    background: rgba(89, 28, 33, 0.85);
    /* Deep Maroon */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(212, 175, 55, 0.5);
    /* Gold border */
    color: #fff;
    transition: bottom 0.4s ease;
}

.glass-card:hover .glass-content {
    bottom: 0;
}

.glass-content h4 {
    color: #D4AF37;
    /* Gold primary */
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 1.4rem;
}

.glass-content p {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- SECTION 3: ACADEMIC GRID (3D FLIP CARDS) --- */
.academic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    padding: 3rem 0;
}

.academic-item {
    background-color: transparent;
    border-radius: 16px;
    height: 380px;
    perspective: 1200px;
    /* Essential for 3D effect */
}

.academic-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-radius: 16px;
}

.academic-item:hover .academic-inner {
    transform: rotateY(180deg);
}

.academic-front,
.academic-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
}

.academic-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    transition: filter 0.5s ease;
}

.academic-item:hover .academic-front img {
    filter: brightness(0.4);
}

.academic-info-front {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    width: 100%;
    pointer-events: none;
}

.academic-info-front h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #fff;
    margin: 0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.9);
}

.academic-back {
    background: linear-gradient(135deg, #2a0800, #110000);
    /* Deep astrology dark tone */
    color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.3);
    /* Gold border */
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.6);
}

.academic-back h3 {
    color: #D4AF37;
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.academic-back p {
    color: #f0f0f0;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* --- SECTION 4: TROPHY ROOM (Achievements) --- */

.trophy-section {
    background: #0f0f0f;
    color: #fff;
    padding: 6rem 0;
    text-align: center;
}

.trophy-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
}

.trophy-card {
    background: #1a1a1a;
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 2.5rem;
    border-radius: 16px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.trophy-card:hover {
    transform: translateY(-10px);
    border-color: #D4AF37;
    box-shadow: 0 15px 30px rgba(212, 175, 55, 0.15);
}

.trophy-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
}

.trophy-card h4 {
    color: #fff;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

/* --- SECTION 5: COLLABORATIONS MARQUEE --- */
.collab-marquee-container {
    width: 100%;
    overflow: hidden;
    padding: 3rem 0;
    background: #f9f9f9;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    position: relative;
}

.collab-marquee {
    display: flex;
    gap: 6rem;
    width: max-content;
    animation: marquee-scroll 30s linear infinite;
}

.collab-marquee:hover {
    animation-play-state: paused;
}

.collab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 250px;
    text-align: center;
}

.collab-item img {
    height: 90px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.collab-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.1);
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- SECTION 6: VIDEO HERO --- */
.video-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 500px;
    margin: 4rem 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.video-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
    transition: filter 0.5s ease;
}

.video-hero:hover img {
    filter: brightness(0.8);
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90px;
    height: 90px;
    background: rgba(212, 175, 55, 0.9);
    /* Gold primary */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    animation: pulse-ring 2s infinite;
    z-index: 10;
}

.play-btn::after {
    content: '▶';
    color: #fff;
    font-size: 2.2rem;
    margin-left: 8px;
    /* Optical adjustment for play button */
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }

    70% {
        box-shadow: 0 0 0 25px rgba(212, 175, 55, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .masonry-grid {
        column-count: 2;
    }

    .highlights-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .glass-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .academic-grid {
        grid-template-columns: 1fr;
    }

    .trophy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

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

    .highlights-grid {
        grid-template-columns: 1fr;
    }

    .highlights-card {
        height: 320px;
    }

    .glass-grid {
        grid-template-columns: 1fr;
    }

    .trophy-grid {
        grid-template-columns: 1fr;
    }

    .video-hero {
        height: 300px;
    }
}

/* --- HERO SECTION RE-DESIGN --- */
.gallery-hero {
    height: 60vh;
    min-height: 500px;
    /* Slightly taller to account for overlap */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)), url('../images/gallery-hero-image.png') center/cover no-repeat fixed;
    margin-bottom: 4rem;
    z-index: 1;
}

@media (max-width: 991px) {
    .gallery-hero {
        background-attachment: scroll !important;
        background-position: center !important;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        height: 40vh;
        min-height: 300px;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

@media (max-width: 600px) {
    .gallery-hero {
        min-height: 250px;
        margin-top: 0;
    }
}

.gallery-hero-title {
    color: #D4AF37;
    /* Gold primary */
    font-size: clamp(2.5rem, 5vw + 1rem, 3.5rem);
    font-family: 'Playfair Display', serif;
    margin-bottom: 1rem;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    position: relative;
}

.gallery-hero-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #D4AF37;
    margin: 1rem auto 0;
}

.gallery-hero-subtitle {
    color: #fff;
    font-size: clamp(1rem, 2vw + 0.5rem, 1.2rem);
    letter-spacing: 2px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* --- SECTION 7: TESTIMONIALS (Horizontal Marquee Profile Style) --- */
.testimonial-scroll-container {
    width: 100%;
    overflow: hidden;
    padding: 2rem 0;
    position: relative;
    /* Optional: fade edge effect */
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.testimonial-track {
    display: flex;
    gap: 2rem;
    width: max-content;
    animation: marquee-testimonial 40s linear infinite;
    padding: 1rem;
}

.testimonial-track:hover {
    animation-play-state: paused;
}

@keyframes marquee-testimonial {
    0% {
        transform: translateX(0);
    }

    100% {
        /* Assuming track translates half its total duplicated width if doubled, or entirely */
        transform: translateX(calc(-50% - 1rem));
    }
}