:root {
    --bento-gold: #CC822E;
    --bento-gold-hover: #b47023;
    --bento-dark-pill: #3a1016;
    --bento-border: #e2e8f0;
}

.academic-gallery-container {
    max-width: 1360px;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.academic-gallery-header {
    text-align: center;
    margin-bottom: 28px;
}

.academic-title {
    color: var(--bento-gold);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}

.academic-title-divider {
    width: 48px;
    height: 3px;
    background-color: var(--bento-gold);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* Compact Category Filter Tabs */
.academic-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
}

.academic-tabs {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 10px;
    max-width: 1100px;
}

.academic-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--bento-border);
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    max-width: 320px;
}

.academic-tab .tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
}

.academic-tab .tab-badge {
    background: #edf2f7;
    color: #718096;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.academic-tab:hover {
    border-color: var(--bento-gold);
    color: var(--bento-gold);
    background-color: #fffaf4;
}

.academic-tab.active {
    background-color: var(--bento-dark-pill);
    border-color: var(--bento-dark-pill);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(58, 16, 22, 0.25);
}

.academic-tab.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Category Title Banner Display on Click */
.academic-active-category-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #faf8f5;
    border-left: 4px solid var(--bento-gold);
    padding: 14px 22px;
    margin-bottom: 25px;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.academic-banner-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.academic-banner-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--bento-gold);
}

.academic-active-cat-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.academic-banner-count {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #ffffff;
    border: 1px solid var(--bento-border);
    padding: 4px 12px;
    border-radius: 999px;
}

/* 4-Column Bento Gallery Grid */
.academic-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    gap: 16px;
}

.academic-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f1f5f9;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.academic-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.academic-card-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.academic-card-tall {
    grid-column: span 1;
    grid-row: span 2;
}

.academic-card-regular {
    grid-column: span 1;
    grid-row: span 1;
}

.academic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.academic-card:hover img {
    transform: scale(1.04);
}

/* Overlay with #CC822E branding */
.academic-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    background: linear-gradient(
        to top,
        rgba(204, 130, 46, 0.94) 0%,
        rgba(204, 130, 46, 0.72) 45%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
}

.academic-card:hover .academic-card-overlay {
    opacity: 1;
}

.academic-category-tag {
    align-self: flex-start;
    background: #ffffff;
    color: var(--bento-gold);
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.academic-card-title {
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.academic-zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    backdrop-filter: blur(4px);
}

.academic-zoom-btn svg {
    width: 16px;
    height: 16px;
}

/* Lightbox Modal */
.academic-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.academic-lightbox.active {
    display: flex;
}

.academic-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(10px);
}

.academic-lightbox-container {
    position: relative;
    z-index: 10;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Precise Circular SVG Buttons */
.academic-circle-btn {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    border-radius: 50% !important;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: background-color 0.2s ease, transform 0.15s ease;
    backdrop-filter: blur(6px);
}

.academic-circle-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

.academic-circle-btn:hover {
    background: var(--bento-gold);
    transform: scale(1.08);
}

.academic-lightbox-close {
    position: absolute;
    top: -55px;
    right: 0;
}

.academic-lightbox-prev {
    position: absolute;
    left: -65px;
    top: 50%;
    transform: translateY(-50%);
}

.academic-lightbox-next {
    position: absolute;
    right: -65px;
    top: 50%;
    transform: translateY(-50%);
}

.academic-lightbox-prev:hover {
    transform: translateY(-50%) scale(1.08);
}

.academic-lightbox-next:hover {
    transform: translateY(-50%) scale(1.08);
}

.academic-lightbox-stage {
    display: flex;
    flex-direction: column;
    max-width: 82vw;
    border-radius: 12px;
    overflow: hidden;
    background: #141416;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.academic-image-holder {
    max-height: 74vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.academic-image-holder img {
    max-width: 100%;
    max-height: 74vh;
    object-fit: contain;
    display: block;
}

.academic-lightbox-footer {
    padding: 16px 22px;
    background: #1a1a1e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.academic-footer-badge {
    display: inline-block;
    color: var(--bento-gold);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.academic-footer-title {
    color: #ffffff;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
}

@media (max-width: 1100px) {
    .academic-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .academic-lightbox-prev { left: 12px; }
    .academic-lightbox-next { right: 12px; }
    .academic-lightbox-close { top: 12px; right: 12px; }
}

@media (max-width: 768px) {
    .academic-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
    .academic-card-wide {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .academic-gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }
    .academic-card-wide,
    .academic-card-tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}
