:root {
    --gold: #C5A059;
    --dark: #000;
    --gray: #888;
    --box: #111;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--dark);
    color: #fff;
    font-family: sans-serif;
    overflow-x: hidden;
}

/* MAIN LAYOUT */
.gallery-page {
    display: flex;
    gap: 35px;
    padding: 120px 5% 60px;
    min-height: 100vh;
}

/* SIDEBAR */
.gallery-sidebar {
    width: 310px;
    flex-shrink: 0;
    background: #0d0d0d;
    border: 1px solid #1f1f1f;
    border-radius: 18px;
    padding: 24px 20px;
    height: calc(100vh - 115px);
    position: fixed;
    top: 95px;
    left: 5%;
    overflow: hidden;
}

.gallery-sidebar h2 {
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* SCROLL SA LOOB NG CATEGORY */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 6px;
}

/* SCROLLBAR STYLE */
.event-list::-webkit-scrollbar {
    width: 6px;
}

.event-list::-webkit-scrollbar-track {
    background: #111;
    border-radius: 20px;
}

.event-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 20px;
}

/* CONTENT ADJUSTMENT PARA HINDI MATAPAN NG SIDEBAR */
.gallery-content {
    flex: 1;
    min-width: 0;
    margin-left: 345px;
    margin-top: -100px;
}

/* SIDEBAR TABS */
.sidebar-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-btn {
    background: #151515;
    color: #ccc;
    border: 1px solid #262626;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: bold;
}

/* VIDEO CONTENT */
.video-box {
    display: none;
    width: 100%;
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 18px;
    padding: 18px;
}

.video-box iframe {
    width: 100%;
    height: 520px;
    border: none;
    border-radius: 14px;
}

.no-video {
    color: #aaa;
    text-align: center;
    padding: 80px 20px;
}

/* CATEGORY BUTTONS */
.event-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-btn {
    width: 100%;
    background: #151515;
    color: #ccc;
    border: 1px solid #262626;
    padding: 13px 15px;
    border-radius: 12px;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}

.event-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
    transform: translateX(5px);
}

.event-btn.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: bold;
}

/* CONTENT */
.gallery-content {
    flex: 1;
    min-width: 0;
}

.gallery-content h1 {
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 18px;
    text-align: center;
}


/* GALLERY GRID */
.gallery-grid {
    margin-top: -5px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    height: 260px;
    background: #111;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #1f1f1f;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.4s;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* RESPONSIVE */
@media (max-width: 1000px) {
    .gallery-page {
        flex-direction: column;
    }

    .gallery-sidebar {
        width: 100%;
        position: static;
    }

    .event-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 600px) {
    .gallery-page {
        padding: 130px 20px 50px;
    }

    .event-list {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        height: 260px;
    }
}

.video-box {
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    background: transparent;
    border: none;
    padding: 0;
}

.content-card {
    background: #111;
    border: 1px solid #1f1f1f;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
}

.content-card:hover {
    transform: translateY(-5px);
}

.content-thumb {
    height: 230px;
    position: relative;
    overflow: hidden;
}

.content-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-card h3 {
    padding: 15px;
    font-size: 0.95rem;
    color: #fff;
}

.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 50000;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.video-modal.show {
    display: flex;
}

.video-modal-content {
    width: min(950px, 95vw);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 18px;
    position: relative;
}

.video-modal-content iframe {
    width: 100%;
    height: 100%;
    border-radius: 18px;
}

.video-close {
    position: fixed;
    top: 22px;
    right: 28px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    font-size: 30px;
    cursor: pointer;
    z-index: 60000;
}

@media (max-width: 1000px) {
    .video-box {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .video-box {
        grid-template-columns: 1fr;
    }
}

.photo-viewer-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50000;
    background: rgba(0,0,0,0.88);
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.photo-viewer-modal.show {
    display: flex;
}

.photo-viewer-modal img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
}

.photo-viewer-close {
    position: fixed;
    top: 22px;
    right: 28px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    font-size: 30px;
    cursor: pointer;
    z-index: 60000;
}

.viewer-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    font-size: 20px;
    cursor: pointer;
    z-index: 60000;
}

.viewer-prev {
    left: 35px;
}

.viewer-next {
    right: 35px;
}

.play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.content-thumb {
    position: relative;
}

/* ================= RESPONSIVE FIX ONLY ================= */

@media (max-width: 1000px) {

    .gallery-page {
        display: flex;
        flex-direction: column;
        padding: 120px 5% 50px;
        gap: 25px;
    }

    .gallery-sidebar {
        position: static;
        width: 100%;
        height: 420px;
        max-height: 420px;
        overflow: hidden;

        display: flex;
        flex-direction: column;
    }

    .gallery-sidebar h2,
    .sidebar-tabs {
        flex-shrink: 0;
    }

    .event-list {
        flex: 1;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }

    .gallery-content {
        margin-left: 0;
        margin-top: 0;
        width: 100%;
    }

    .gallery-grid,
    .video-box {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .gallery-page {
        padding: 110px 20px 45px;
    }

    .gallery-sidebar {
        height: 360px;
        max-height: 360px;
    }

    .sidebar-tabs {
        grid-template-columns: 1fr;
    }

    .event-list {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .gallery-grid,
    .video-box {
        grid-template-columns: 1fr;
    }

    .gallery-item,
    .content-thumb {
        height: 240px;
    }
}