/* UBD Registration Manager — Photo Gallery v1.0.0 */

.ubdrm-gallery-shell { margin-top: 10px; }

/* ---------- Year tab bar (jump to a year) ---------- */
.ubdrm-gallery-tabs-wrap {
    background: var(--ubdrm-white, #fff);
    border: 1px solid var(--ubdrm-line, #e6ebf2);
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(13, 39, 78, .06);
}
.ubdrm-gallery-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.ubdrm-gallery-tabs::-webkit-scrollbar { height: 5px; }
.ubdrm-gallery-tabs::-webkit-scrollbar-thumb { background: var(--ubdrm-line, #dfe6ef); border-radius: 4px; }
.ubdrm-gallery-tabs a {
    flex: 0 0 auto;
    padding: 9px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    color: var(--ubdrm-primary, #0b2a64);
    background: var(--ubdrm-soft, #f5f8fc);
    border: 1px solid var(--ubdrm-line, #e6ebf2);
    white-space: nowrap;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.ubdrm-gallery-tabs a:hover { background: #eaf0fa; }
.ubdrm-gallery-tabs a.active {
    background: var(--ubdrm-primary, #0b2a64);
    border-color: var(--ubdrm-primary, #0b2a64);
    color: #fff;
}

/* ---------- Year card ---------- */
.ubdrm-gallery-year-card {
    scroll-margin-top: 90px; /* keeps the heading clear of a sticky site header when jumped to */
    background: var(--ubdrm-white, #fff);
    border: 1px solid var(--ubdrm-line, #e6ebf2);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 16px 42px rgba(13, 39, 78, .07);
    margin-bottom: 28px;
}
.ubdrm-gallery-year-card:last-child { margin-bottom: 0; }

.ubdrm-gallery-year-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 4px 0 22px;
}
.ubdrm-gallery-year-title .line {
    flex: 1 1 auto;
    max-width: 110px;
    height: 2px;
    border-radius: 2px;
    background: var(--ubdrm-primary, #0b2a64);
    opacity: .35;
}
.ubdrm-gallery-year-title h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: var(--ubdrm-primary, #0b2a64);
    white-space: nowrap;
}

/* ---------- Masonry photo grid (CSS columns — matches irregular photo heights) ---------- */
.ubdrm-gallery-grid {
    column-count: 3;
    column-gap: 12px;
}
.ubdrm-gallery-grid img {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(13, 39, 78, .08);
    break-inside: avoid;
    cursor: zoom-in;
    transition: transform .25s ease, box-shadow .25s ease;
}
.ubdrm-gallery-grid img:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(13, 39, 78, .16);
}

@media (max-width: 760px) {
    .ubdrm-gallery-grid { column-count: 2; column-gap: 10px; }
    .ubdrm-gallery-grid img { margin-bottom: 10px; }
    .ubdrm-gallery-year-card { padding: 18px; border-radius: 14px; }
    .ubdrm-gallery-year-title h2 { font-size: 18px; }
    .ubdrm-gallery-year-title .line { max-width: 60px; }
    .ubdrm-gallery-tabs a { padding: 8px 16px; font-size: 13px; }
}
@media (max-width: 420px) {
    .ubdrm-gallery-grid { column-gap: 8px; }
    .ubdrm-gallery-grid img { margin-bottom: 8px; border-radius: 8px; }
    .ubdrm-gallery-year-card { padding: 14px; }
}

/* ---------- Admin: year list cards ---------- */
.ubdrm-gallery-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}
.ubdrm-gallery-year-admin-card {
    background: var(--ubdrm-white, #fff);
    border: 1px solid var(--ubdrm-line, #e2e8f0);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ubdrm-gallery-year-admin-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--ubdrm-soft, #f5f8fc);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ubdrm-muted, #68758a);
}
.ubdrm-gallery-year-admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ubdrm-gallery-year-admin-body strong { display: block; font-size: 18px; }
.ubdrm-gallery-year-admin-body small { color: var(--ubdrm-muted, #68758a); }

/* ---------- Lightbox ---------- */
.ubdrm-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 14, 26, .92);
}
.ubdrm-gallery-lightbox.is-open { display: flex; }
.ubdrm-gallery-lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}
.ubdrm-gallery-lightbox-close {
    position: absolute;
    top: 18px;
    right: 26px;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}
.ubdrm-gallery-lightbox-close:hover { opacity: 1; }
