/* ============================================================
   GALLERY MODULE V2 — Frontend Styles
   Shared between Photo + Video pages
   ============================================================ */

/* Hero */
.hge-gallery-hero {
    background: linear-gradient(135deg, #0f2444 0%, #1a3a6b 100%);
    color: #fff;
    padding: 3rem 1rem 2.5rem;
    text-align: center;
}
.hge-gallery-hero h1 {
    margin: 0 0 .5rem;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -.01em;
}
.hge-gallery-hero p {
    margin: 0;
    font-size: 1rem;
    opacity: .9;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.hge-gallery-bc {
    display: flex;
    justify-content: center;
    gap: .5rem;
    font-size: .8rem;
    margin-bottom: 1rem;
    opacity: .85;
}
.hge-gallery-bc a { color: #c9a84c; text-decoration: none; }
.hge-gallery-bc a:hover { text-decoration: underline; }
.hge-gallery-bc span { opacity: .5; }

/* Page wrap */
.hge-gallery-wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}
@media (max-width: 900px) {
    .hge-gallery-wrap {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.hge-gallery-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #edf2f7;
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.hge-gallery-sidebar h3 {
    margin: 0 0 .75rem;
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #0f2444;
    padding-bottom: .5rem;
    border-bottom: 1px solid #e2e8f0;
}
.hge-gallery-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.hge-gallery-cat-list li a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .75rem;
    border-radius: 8px;
    color: #2d3748;
    text-decoration: none;
    font-size: .9rem;
    transition: all .15s;
    border-left: 3px solid transparent;
}
.hge-gallery-cat-list li a:hover {
    background: #f7fafc;
    color: #0f2444;
}
.hge-gallery-cat-list li a.is-active {
    background: #f0f4ff;
    color: #0f2444;
    font-weight: 600;
    border-left-color: #c9a84c;
}
.hge-gallery-cat-list .cat-cover {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0f2444, #1a3a6b);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c9a84c;
    font-weight: 700;
    font-size: 1rem;
}
.hge-gallery-cat-list .cat-meta {
    flex: 1;
    min-width: 0;
}
.hge-gallery-cat-list .cat-name {
    display: block;
    line-height: 1.2;
    font-weight: inherit;
}
.hge-gallery-cat-list .cat-count {
    display: block;
    font-size: .7rem;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 2px;
}
.hge-gallery-search {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.hge-gallery-search input {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid #d2d6dc;
    border-radius: 8px;
    font-size: .85rem;
}
.hge-gallery-search input:focus {
    outline: none;
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201,168,76,.15);
}

/* Content */
.hge-gallery-content {
    min-width: 0;
}
.hge-gallery-content h2 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f2444;
}
.hge-gallery-content .hge-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.hge-gallery-content .hge-gallery-search-input {
    max-width: 280px;
    padding: .55rem .75rem;
    border: 1px solid #d2d6dc;
    border-radius: 8px;
    font-size: .9rem;
}

/* Grid */
.hge-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.hge-gallery-item {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #edf2f7;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.hge-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,36,68,.12);
}
.hge-gallery-item__img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f1f5f9;
}
.hge-gallery-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}
.hge-gallery-item:hover .hge-gallery-item__img img {
    transform: scale(1.05);
}
.hge-gallery-item__caption {
    padding: .75rem .9rem;
    font-size: .85rem;
    color: #1a202c;
    font-weight: 500;
    line-height: 1.3;
}
.hge-gallery-item__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,.55) 100%);
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    padding: .5rem;
    opacity: 0;
    transition: opacity .2s;
}
.hge-gallery-item:hover .hge-gallery-item__overlay {
    opacity: 1;
}
.hge-gallery-item__count {
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* Empty state */
.hge-gallery-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #4a5568;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #edf2f7;
}
.hge-gallery-empty h3 {
    color: #2d3748;
    margin-bottom: .5rem;
}

/* Lightbox */
.hge-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}
.hge-lightbox.is-active {
    display: flex;
    animation: hge-lightbox-fade .2s ease-out;
}
@keyframes hge-lightbox-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.hge-lightbox__img-wrap {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.hge-lightbox__img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,.5);
    object-fit: contain;
}
.hge-lightbox__caption {
    position: absolute;
    bottom: -3rem;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: .9rem;
    font-weight: 500;
    padding: .5rem;
}
.hge-lightbox__counter {
    position: absolute;
    top: -2.5rem;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,.7);
    font-size: .8rem;
    font-weight: 500;
}
.hge-lightbox__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,.1);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .2s;
}
.hge-lightbox__close:hover {
    background: rgba(255,255,255,.25);
}
.hge-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.1);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background .2s;
}
.hge-lightbox__nav:hover {
    background: rgba(255,255,255,.25);
}
.hge-lightbox__nav--prev { left: 1rem; }
.hge-lightbox__nav--next { right: 1rem; }
@media (max-width: 600px) {
    .hge-lightbox__nav--prev { left: .5rem; }
    .hge-lightbox__nav--next { right: .5rem; }
    .hge-lightbox__close { top: .5rem; right: .5rem; }
}

/* Video cards */
.hge-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}
.hge-video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #edf2f7;
    transition: transform .2s, box-shadow .2s;
    cursor: pointer;
}
.hge-video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,36,68,.12);
}
.hge-video-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f2444;
}
.hge-video-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .9;
    transition: opacity .2s, transform .35s;
}
.hge-video-card:hover .hge-video-card__thumb img {
    opacity: 1;
    transform: scale(1.05);
}
.hge-video-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.hge-video-card__play svg {
    width: 64px;
    height: 64px;
    background: rgba(220,38,38,.9);
    color: #fff;
    border-radius: 50%;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
    transition: transform .2s, background .2s;
}
.hge-video-card:hover .hge-video-card__play svg {
    transform: scale(1.1);
    background: rgba(220,38,38,1);
}
.hge-video-card__body {
    padding: 1rem;
}
.hge-video-card__cat {
    font-size: .7rem;
    color: #c9a84c;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    margin-bottom: .25rem;
}
.hge-video-card__title {
    margin: 0 0 .35rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f2444;
    line-height: 1.3;
}
.hge-video-card__desc {
    font-size: .85rem;
    color: #4a5568;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Player Modal */
.hge-video-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.hge-video-modal.is-active {
    display: flex;
    animation: hge-lightbox-fade .2s ease-out;
}
.hge-video-modal__frame {
    position: relative;
    width: 100%;
    max-width: 1100px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0,0,0,.5);
}
.hge-video-modal__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.hge-video-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hge-video-modal__close:hover {
    background: rgba(255,255,255,.3);
}

/* Homepage Tabs */
.hge-home-gallery {
    padding: 2.5rem 1rem 3rem;
    background: #fff;
}
.hge-home-gallery__inner {
    max-width: 1200px;
    margin: 0 auto;
}
.hge-home-gallery h2 {
    text-align: center;
    margin: 0 0 1.5rem;
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f2444;
}
.hge-home-gallery__tabs {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.hge-home-gallery__tab {
    background: transparent;
    border: 2px solid #0f2444;
    color: #0f2444;
    padding: .55rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: .9rem;
    transition: all .15s;
}
.hge-home-gallery__tab.is-active {
    background: #0f2444;
    color: #fff;
}
.hge-home-gallery__tab:hover {
    background: #1a3a6b;
    color: #fff;
    border-color: #1a3a6b;
}
.hge-home-gallery__panel {
    display: none;
}
.hge-home-gallery__panel.is-active {
    display: block;
}
.hge-home-gallery__footer {
    text-align: center;
    margin-top: 1.5rem;
}
.hge-home-gallery__btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .65rem 1.5rem;
    background: #c9a84c;
    color: #0f2444;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    transition: background .2s;
}
.hge-home-gallery__btn:hover {
    background: #b8943f;
}

/* Album card variant — clicking the card navigates to the album detail page */
.hge-album-card {
    display: block;
    color: inherit;
    text-decoration: none;
}
.hge-album-card .hge-gallery-item__count {
    background: rgba(15,36,68,.85);
    color: #fff;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}
.hge-album-card:hover .hge-gallery-item__count {
    background: var(--school-secondary, #c9a84c);
    color: #0f2444;
}

/* Album detail page */
.hge-album-hero .hge-album-description {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: .92;
}
.hge-album-hero .hge-album-description p { margin: 0 0 .75rem; }

.hge-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.hge-album-photo {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    border: 1px solid #edf2f7;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.hge-album-photo:hover,
.hge-album-photo:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,36,68,.12);
    outline: none;
}
.hge-album-photo img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .35s;
}
.hge-album-photo:hover img { transform: scale(1.04); }

@media (max-width: 600px) {
    .hge-album-grid { grid-template-columns: repeat(2, 1fr); gap: .65rem; }
    .hge-album-photo img { height: 140px; }
}


