/* ============================================================
   GALLERY.CSS — Dr. Ahmad Zain
   Cinematic Slideshow + Thumbnail Strip Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ==================== ROOT VARIABLES ==================== */
:root {
    --blue-deep:    #0037B8;
    --blue-mid:     #0056D2;
    --blue-light:   #0070ED;
    --gold:         #C9A84C;
    --gold-light:   #F0D080;
    --white:        #ffffff;
    --off-white:    #F7F9FC;
    --text-dark:    #1a2234;
    --text-mid:     #4a5568;
    --text-light:   #718096;
    --thumb-border: 3px solid transparent;
    --thumb-active: 3px solid var(--blue-light);
    --shadow-card:  0 8px 32px rgba(0,0,0,0.12);
    --shadow-deep:  0 20px 60px rgba(0,0,0,0.22);
    --radius-lg:    18px;
    --radius-sm:    10px;
    --transition:   all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== PAGE HERO ==================== */
.gallery-page-hero {
    position: relative;
    margin-top: 64px;
    padding: 80px 20px 70px;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-mid) 55%, var(--blue-light) 100%);
    overflow: hidden;
    text-align: center;
}

.gallery-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
    pointer-events: none;
}

.gallery-hero-content {
    position: relative;
    z-index: 2;
}

.gallery-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 900;
    color: var(--white);
    margin: 0 0 16px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.gallery-hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255,255,255,0.82);
    font-weight: 300;
    max-width: 560px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.gallery-hero-bar {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
    border-radius: 2px;
    margin: 0 auto;
}

/* ==================== SECTION WRAPPER ==================== */
.gallery-section {
    padding: 72px 0;
    background: var(--white);
}

.gallery-section.alt-bg {
    background: var(--off-white);
}

.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==================== SECTION HEADER ==================== */
.section-header {
    text-align: center;
    margin-bottom: 52px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--text-dark);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--blue-deep), var(--gold));
    border-radius: 2px;
    margin: 14px auto 0;
}

.section-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    color: var(--text-light);
    font-weight: 400;
    margin: 18px 0 0;
}

/* ==================== VIDEO SECTION ==================== */
.video-section {
    background: linear-gradient(160deg, var(--blue-deep) 0%, var(--blue-mid) 60%, var(--blue-light) 100%);
}

.video-section .section-title {
    color: var(--white);
}

.video-section .section-title::after {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.video-section .section-subtitle {
    color: rgba(255,255,255,0.72);
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
/*
.video-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    transition: var(--transition);
    background: rgba(0,0,0,0.3);
}

.video-wrapper {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

# Hide the SVG play button and label overlays 
.video-play-btn,
.video-placeholder-label {
    display: none;
}

.video-placeholder video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.video-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}



.video-placeholder:hover {
    background: linear-gradient(135deg, rgba(0,55,184,0.85) 0%, rgba(0,112,237,0.75) 100%);
}

.video-play-btn {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    transition: var(--transition);
    backdrop-filter: blur(6px);
}

.video-placeholder:hover .video-play-btn {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.video-play-btn svg {
    width: 32px;
    height: 32px;
    color: white;
    margin-left: 4px;
}

.video-placeholder-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: white;
    margin: 0 0 6px;
}

.video-placeholder-hint {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
}

.video-card-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    padding: 12px 16px;
    text-align: center;
    letter-spacing: 0.02em;
}*/


/* The new video css for proper display*/

.video-wrapper {
    width: 100%;
    position: relative;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-play-btn,
.video-placeholder-label {
    display: none;
}

.video-placeholder video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* changed from cover — shows full frame, no cropping */
    background: #000;    /* fills letterbox bars with black */
}



/* ==================== SLIDESHOW WRAPPER ==================== */
.slideshow-wrap {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-deep);
    background: #000;
}

/* ==================== MAIN SLIDE STAGE ==================== */
.slide-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #111;
    /* Stage height: responsive */
    height: clamp(340px, 55vw, 640px);
}

.slides-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* ---- Individual Slide ---- */
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* ---- THE CRITICAL IMAGE CSS ----
   Shows FULL image without cropping - adds black bars if needed  */
.slide-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;     /* shows full image, NO cropping */
    object-position: center; /* centers the image */
    display: block;
    background: #000;        /* black background for letterboxing */
    transition: transform 6s ease-out;
    transform: scale(1.0);
}

.slide.active .slide-img {
    transform: scale(1.0);
}

/* ---- Caption ---- */
.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 52px 32px 28px;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.01em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}

.slide.active .slide-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Slide Counter ---- */
.slide-counter {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 10;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.05em;
}

/* ---- Arrow Buttons ---- */
.slide-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    user-select: none;
}

.slide-arrow:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-50%) scale(1.1);
}

.slide-prev { left: 16px; }
.slide-next { right: 16px; }

/* ---- Progress Bar ---- */
.slide-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.15);
    z-index: 10;
}

.slide-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
    width: 0%;
    transition: width 2s linear;
    border-radius: 0 2px 2px 0;
}

/* ==================== THUMBNAIL STRIP ==================== */
.thumb-strip-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: #1a1f2e;
    padding: 14px 0;
}

.thumb-nav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 100%;
    min-height: 80px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.thumb-nav-btn:hover {
    background: rgba(255,255,255,0.14);
    color: white;
}

.thumb-strip {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 12px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.thumb-strip::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* ---- Individual Thumbnail ---- */
.thumb {
    flex-shrink: 0;
    width: 120px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: var(--thumb-border);
    transition: var(--transition);
    position: relative;
    opacity: 0.62;
}

.thumb:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.5);
}

.thumb.active {
    border: var(--thumb-active);
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 112, 237, 0.45);
}

/* ---- THE CRITICAL THUMBNAIL IMAGE CSS ----
   Also forces proper display for thumbnails  */
.thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;       /* fills thumbnail, crops if needed  */
    object-position: center; /* centers the crop                  */
    display: block;
    transition: transform 0.4s ease;
}

.thumb:hover img {
    transform: scale(1.08);
}

.thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 55, 184, 0.0);
    transition: background 0.3s ease;
}

.thumb.active .thumb-overlay {
    background: rgba(0, 112, 237, 0.12);
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

@media (max-width: 900px) {
    .slide-stage {
        height: clamp(240px, 60vw, 480px);
    }

    .thumb {
        width: 90px;
        height: 60px;
    }

    .slide-arrow {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
    }
}

@media (max-width: 600px) {
    .gallery-section {
        padding: 52px 0;
    }

    .slide-stage {
        height: clamp(200px, 66vw, 360px);
    }

    .thumb {
        width: 72px;
        height: 50px;
        border-radius: 6px;
    }

    .slide-arrow {
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
    }

    .thumb-nav-btn {
        width: 30px;
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .thumb-strip {
        gap: 6px;
        padding: 0 8px;
    }
}

/* ==================== ACCESSIBILITY ==================== */
.slide-arrow:focus,
.thumb:focus,
.thumb-nav-btn:focus {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .slide { transition: opacity 0.2s ease; }
    .slide-img { transition: none; transform: scale(1) !important; }
    .slide-progress-bar { transition: none; }
}




/* ==================== YOUTUBE css ==================== */

/* ── YouTube Shorts Section ── */
.yt-shorts-section {
    background: linear-gradient(180deg, #1565c0 0%, #0d47a1 100%);
    padding: 60px 20px;
}

.yt-shorts-container {
    max-width: 1200px;
    margin: 0 auto;
}

.yt-shorts-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.yt-shorts-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    margin-bottom: 40px;
}

.yt-shorts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: start;
}

.yt-short-card {
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.yt-short-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

/* Maintains 9:16 portrait ratio for Shorts */
.yt-short-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 177.78%;
}

.yt-short-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ── Medium screens: 2 columns ── */
@media (max-width: 1024px) {
    .yt-shorts-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 640px;
        margin: 0 auto;
    }
}

/* ── Small screens: 1 column ── */
@media (max-width: 600px) {
    .yt-shorts-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
        margin: 0 auto;
    }

    .yt-shorts-title {
        font-size: 1.5rem;
    }

    .yt-shorts-section {
        padding: 40px 16px;
    }
}