/* Bento Gallery Styles - React Replica */
.bento-gallery {
    position: relative;
    padding: 80px 0;
    overflow: hidden;
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-gallery__header {
    text-align: left;
    max-width: 1320px;
    margin: 0 auto 50px;
    padding: 0 15px;
}

/* Wrapper to handle scrolling/dragging */
.bento-scroll-container {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    user-select: none;
}

.bento-scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.bento-scroll-container:active {
    cursor: grabbing;
}

/* The Grid itself */
.bento-grid {
    display: flex;
    width: max-content;
    animation: bento-scroll-infinite 60s linear infinite;
    will-change: transform;
}

.bento-grid__set {
    display: grid;
    grid-auto-flow: column dense;
    grid-auto-columns: clamp(300px, 35vh, 600px);
    grid-template-rows: repeat(2, clamp(300px, 35vh, 600px));
    gap: 20px;
    padding-right: 20px;
}

.bento-scroll-container:hover .bento-grid {
    animation-play-state: paused;
}

@keyframes bento-scroll-infinite {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Bento Item Card */
.bento-item {
    position: relative;
    border-radius: 12px;
    /* rounded-xl */
    overflow: hidden;
    background-color: #f3f3f3;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease;
    cursor: pointer;
}

.bento-item:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: scale(1.01);
}

.bento-item:focus-visible {
    outline: 2px solid var(--nexin-base);
}

/* Grid Spans */
.span-col-2 {
    grid-column: span 2;
}

.span-row-2 {
    grid-row: span 2;
}

/* Position overrides within set */
.bento-item-right-top {
    grid-column: 5;
    grid-row: 1;
}

.bento-item-right-top-extra {
    grid-column: 6;
    grid-row: 1;
}

.bento-item-right-bottom-wide {
    grid-column: 5 / span 2;
    grid-row: 2;
}

.bento-repeat-2-col-1 {
    grid-column: 7 / span 2;
    grid-row: 1 / span 2;
}

.bento-repeat-2-col-5-top-wide {
    grid-column: 9 / span 2;
    grid-row: 1;
}

.bento-repeat-2-col-5-bottom-wide {
    grid-column: 9 / span 2;
    grid-row: 2;
}

/* Grid Spans End */

/* Spans Cleanup Done */

/* Default is span 1 */

/* Image */
.bento-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.bento-item:hover img {
    transform: scale(1.05);
}

/* Overlay & Content */
.bento-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.4) 40%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bento-item:hover .bento-overlay {
    opacity: 1;
}

.bento-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    /* p-4 */
    transform: translateY(16px);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 10;
}

.bento-item:hover .bento-content {
    transform: translateY(0);
    opacity: 1;
}

.bento-title {
    font-size: 18px;
    /* text-lg */
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.bento-desc {
    font-size: 14px;
    /* text-sm */
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Specific Adjustments for Mobile */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-rows: repeat(2, 220px);
        grid-auto-columns: 220px;
    }
}