/* ===========================
   GALLERY PAGE
=========================== */

/* ----- TAB NAVIGATION ----- */
.gallery-tabs-wrap {
    background: var(--white);
    border-bottom: 2px solid var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 50;
}
.gallery-tabs {
    display: flex;
    gap: 0;
}
.gallery-tabs-rtl {
    direction: rtl;
}
.gallery-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 28px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-600);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    font-family: inherit;
}
.gallery-tab:hover {
    color: var(--blue);
}
.gallery-tab-active {
    color: var(--blue);
    border-bottom-color: var(--blue);
}
.gallery-tab svg {
    flex-shrink: 0;
    transition: color 0.2s;
}

/* ----- TAB PANELS ----- */
.gallery-tab-panel {
    padding: 60px 0;
    background: var(--gray-50);
    min-height: 400px;
}
.gallery-tab-panel-hidden {
    display: none;
}
.gallery-rtl {
    direction: rtl;
}

/* ----- ALBUM GRID ----- */
.gallery-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.gallery-album-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.gallery-album-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}
.gallery-album-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: var(--gray-100);
}
.gallery-album-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.gallery-album-card:hover .gallery-album-cover-img {
    transform: scale(1.06);
}
.gallery-album-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    background: var(--gray-100);
}
.gallery-album-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(29,53,87,0.82);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    line-height: 1.4;
    z-index: 2;
}
[dir="rtl"] .gallery-album-count {
    right: auto;
    left: 12px;
}
.gallery-album-overlay {
    position: absolute;
    inset: 0;
    background: rgba(29,53,87,0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.3s ease;
    z-index: 1;
}
.gallery-album-overlay svg { opacity: 0; transition: opacity 0.3s ease; }
.gallery-album-card:hover .gallery-album-overlay {
    background: rgba(29,53,87,0.45);
}
.gallery-album-card:hover .gallery-album-overlay svg {
    opacity: 1;
}
.gallery-album-info {
    padding: 16px 18px;
}
.gallery-album-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 5px;
    line-height: 1.4;
}
.gallery-album-date {
    font-size: 12px;
    color: var(--gray-400);
}
/* Invisible full-card clickable button */
.gallery-album-open-btn {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 3;
}
.gallery-album-open-btn-disabled {
    cursor: default;
}

/* ----- VIDEO GRID ----- */
.gallery-video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.gallery-video-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.gallery-video-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}
.gallery-video-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--navy);
    text-decoration: none;
}
.gallery-video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
}
.gallery-video-card:hover .gallery-video-thumb-img {
    transform: scale(1.04);
    opacity: 0.85;
}
.gallery-video-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    background: var(--navy);
}
/* Play button circle */
.gallery-video-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.gallery-video-play svg {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.92);
    color: var(--navy);
    border-radius: 50%;
    padding: 12px 10px 12px 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transition: transform 0.25s ease, background 0.25s ease;
}
.gallery-video-card:hover .gallery-video-play svg {
    transform: scale(1.12);
    background: #fff;
}
.gallery-video-info {
    padding: 16px 18px 18px;
}
.gallery-video-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
    line-height: 1.4;
}
.gallery-video-desc {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.gallery-video-date {
    font-size: 12px;
    color: var(--gray-400);
}

/* ----- EMPTY STATE ----- */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-400);
}
.gallery-empty svg {
    display: block;
    margin: 0 auto 16px;
    opacity: 0.4;
}
.gallery-empty p {
    font-size: 16px;
    font-weight: 500;
}

/* ----- GLIGHTBOX OVERRIDES ----- */
.glightbox-container .gslide-description {
    background: rgba(0,0,0,0.7);
}

/* ----- ALBUM CARD AS LINK ----- */
a.gallery-album-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ----- RTL ----- */
[dir="rtl"] .gallery-album-info,
[dir="rtl"] .gallery-video-info {
    text-align: right;
}

/* ===========================
   SINGLE ALBUM PAGE
=========================== */

.album-single-section {
    padding: 64px 0 48px;
    background: var(--gray-50);
}

/* Photos grid: 4 columns desktop */
.album-photos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.album-photo-item {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    background: var(--gray-100);
    text-decoration: none;
}

.album-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.album-photo-item:hover .album-photo-img {
    transform: scale(1.06);
}

.album-photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(29,53,87,0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.25s ease;
}

.album-photo-overlay svg {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.album-photo-item:hover .album-photo-overlay {
    background: rgba(29,53,87,0.48);
}

.album-photo-item:hover .album-photo-overlay svg {
    opacity: 1;
    transform: scale(1);
}

/* Back button */
.album-back-wrap {
    padding: 32px 0 64px;
    background: var(--gray-50);
}

.album-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--white);
    color: var(--navy);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.album-back-btn:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    transform: translateX(-3px);
}

.album-back-btn-rtl:hover {
    transform: translateX(3px);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1024px) {
    .gallery-video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .album-photos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .gallery-tab {
        padding: 14px 18px;
        font-size: 14px;
    }
    .gallery-tab-panel {
        padding: 40px 0;
    }
    .gallery-album-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 14px;
    }
    .gallery-video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
@media (max-width: 640px) {
    .album-photos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
}
@media (max-width: 480px) {
    .gallery-album-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .gallery-album-info {
        padding: 12px 14px;
    }
    .gallery-album-title { font-size: 13px; }
    .gallery-tab { padding: 12px 14px; gap: 5px; font-size: 13px; }
}

/* ----- VIDEO PAGINATION ----- */
.video-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 40px 0 0;
}
.vp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    line-height: 1;
}
.vp-btn:hover:not(:disabled) {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.vp-btn.vp-active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    cursor: default;
}
.vp-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.vp-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 40px;
    color: var(--gray-400);
    font-size: 14px;
}

/* ----- YOUTUBE MODAL ----- */
.yt-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.yt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}
.yt-modal__container {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16/9;
    background: #000;
}
.yt-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
}
.yt-modal__close:hover {
    color: #ccc;
}
.yt-modal__iframe-wrap {
    width: 100%;
    height: 100%;
}
.yt-modal__iframe-wrap iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* ----- YOUTUBE BADGE ----- */
.youtube-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FF0000;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin-bottom: 4px;
    text-transform: uppercase;
}
