/*
  Theme Name: Molham
  Author: Moez Tech
*/


/* ******************************************************************************* */
/* ******************************* ACHIEVEMENTS HERO ***************************** */
/* ******************************************************************************* */
.achievements-hero {
    overflow: hidden;
    background-color: #000;
    position: relative; 
}

#heroFx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.achievements-hero .layer {
    position: absolute;
    z-index: 0;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.7;
}

/* ******************************************************************************* */
/* ********************************* GALLERY TITLE ******************************* */
/* ******************************************************************************* */
.gallery-title-section {
    background-color: var(--dark-color);
    overflow: hidden;
}

#galleryTitleFx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.7;
}


/* ******************************************************************************* */
/* ************************* INTERACTIVE ACHIEVEMENTS GALLERY ******************** */
/* ******************************************************************************* */

.achievements-gallery-interactive {
    width: 100%;
    height: var(--app-height, 100vh); /* Use custom property for mobile height */
    background-color: var(--dark-color);
    overflow: hidden;
    position: relative;
}

.gallery-scroll-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.gallery-scroll-container::-webkit-scrollbar {
    display: none;
}

.gallery-card {
    flex: 0 0 var(--app-height, 100vh); /* Use custom property */
    width: 100vw;
    height: var(--app-height, 100vh); /* Use custom property */
    padding: 6vh 16vw; 
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
    position: relative;
    overflow: hidden; /* Changed to hidden to better contain zoom effect */
}

.card-content {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 80vh; /* Reduced height slightly */
    position: relative; /* For positioning the caption and overlay */
    border-radius: 20px;
    overflow: hidden; /* To contain the zoomed image */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    
    /* MODIFIED: Reverted background color */
    background-color: transparent;
    padding: 0;
    display: block;

    /* Animation styles */
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Add a gradient overlay for text readability */
.card-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 1;
    pointer-events: none; /* Allows clicking through */
    transition: opacity 0.4s ease;
}

.gallery-card.is-visible .card-content {
    opacity: 1;
    transform: scale(1);
}

/* MODIFIED: New hover effect zooms the entire card */
.gallery-card:hover .card-content {
    transform: scale(1.03);
}

.gallery-media {
    width: 100%;
    height: 100%;
    /* MODIFIED: Reverted to 'cover' to fill the frame */
    object-fit: cover; 
    border-radius: 20px; /* Match parent */
    margin-bottom: 0;
}

.gallery-caption {
    position: absolute;
    bottom: 2rem;
    right: 2.5rem;
    z-index: 2;
    color: var(--light-color);
    font-size: 2rem; /* Larger font */
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    text-align: right;
    
    /* Animation for appearing */
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s ease 0.2s, opacity 0.5s ease 0.2s;

    /* Remove old styles */
    margin-top: 0;
    padding-top: 0;
    height: auto;
}

/* Animate caption when card is visible */
.gallery-card.is-visible .gallery-caption {
    transform: translateY(0);
    opacity: 1;
}

/* --- Responsive Galleries --- */
/* Hide mobile-specific cards by default (on desktop) */
.gallery-card.mobile-card {
    display: none;
}


/* --- Dot Navigation --- */
.gallery-dots {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease-in-out;
}

.gallery-dots.dots-visible {
    opacity: 1;
    pointer-events: auto;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    padding: 0;
}

.dot:hover {
    background-color: rgba(192, 183, 154, 0.7);
    transform: scale(1.2);
}

.dot.active {
    background-color: var(--secondary-color);
    transform: scale(1.4);
    border-color: rgba(255, 255, 255, 0.8);
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .card-content {
        transition: opacity 0.5s ease;
        transform: scale(1);
    }
    .gallery-card.is-visible .card-content {
        opacity: 1;
    }
    .dot, .dot:hover, .dot.active {
        transition: background-color 0.3s ease;
        transform: scale(1);
    }
    .gallery-dots {
        transition: opacity 0.4s ease;
    }
    .gallery-card:hover .card-content {
        transform: scale(1);
    }
    .gallery-caption {
        transition: none;
    }
}

/* ******************************************************************************* */
/* ********************************* RESPONSIVENESS ****************************** */
/* ******************************************************************************* */

@media (max-width: 991.98px) {
    .achievements-hero {
        height: 70vh;
    }
}

@media (max-width: 767.98px) {
    /* Professional title section for mobile */
    .gallery-title-section .section-title {
        font-size: 1.6rem; /* Smaller title on mobile */
    }
    .gallery-title-section .lead {
        font-size: 0.85rem; /* Smaller subtitle */
        padding: 0 1rem;
        margin-top: 0.5rem;
    }

    /* On mobile, hide desktop cards and show mobile ones */
    .gallery-card.desktop-card {
        display: none;
    }
    .gallery-card.mobile-card {
        display: flex;
    }

    /* Change gallery to horizontal scroll on mobile */
    .achievements-gallery-interactive {
        height: auto; /* Let content define height */
        display: flex;
        flex-direction: column;
    }

    .gallery-scroll-container {
        order: 1;
        /* MODIFIED: Reduced height for a landscape/horizontal feel */
        height: 55vh; 
        flex-direction: row;
        overflow-y: hidden;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .gallery-card {
        flex: 0 0 100vw; /* Each card is full viewport width */
        width: 100vw;
        height: 100%; /* Height is now from the container */
        /* MODIFIED: Adjusted padding to make cards wider */
        padding: 2rem 4rem;
    }
    
    .card-content {
        max-width: none;
        max-height: none;
    }

    .gallery-caption {
        font-size: 1.2rem;
        bottom: 1.5rem;
        right: 1.5rem;
        max-width: calc(100% - 3rem); /* Prevent text overflow */
    }

    /* Reposition dots to be below the gallery */
    .gallery-dots {
        /* --- Overrides & Reset --- */
        position: relative; /* Not fixed */
        order: 2;
        top: auto;
        bottom: auto;
        right: auto;
        transform: none; /* Reset transform */
        opacity: 1; /* Always visible */
        pointer-events: auto; /* Always interactive */
        
        /* --- Layout & Centering --- */
        display: flex;
        flex-direction: row;
        justify-content: center;
        width: fit-content; /* Allow margin auto to work */
        margin: 1rem auto 0; /* Center horizontally and add vertical space */

        /* --- Styling --- */
        gap: 12px;
        background-color: rgba(0, 0, 0, 0.3);
        padding: 8px 15px;
        border-radius: 20px;
    }

    .dot {
        width: 10px;
        height: 10px;
    }
}
