.line{
    background-color: var(--white);
    height: 3px;
    width: 100%;
}
.grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    width: 100%;
    max-width:1130px ;
    gap: 8px;
}
@media (min-width: 765px){
    .grid{
        grid-template-columns: 1fr 1fr 1fr;
        row-gap: 30px;
    }
}
.gallery-item {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 350px; 
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
/* ===== OVERLAY ===== */
.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    transform: translateY(100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 0.5rem 0.25rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}@media (min-width: 765px){
    .gallery-item .overlay {
        padding: 2rem 1rem;
    }
}


/* ===== CONTENT ===== */
.gallery-item .content {
    color: #fff;
    width: 100%;
}
.gallery-item .content h5 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}
.gallery-item .content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.9;
    margin-left: auto;
    margin-right: auto;
}

/* ===== BUTTON ===== */
.content-btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border: 2px solid #fff;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: transparent;
}
.content-btn:hover {
    background: #fff;
    color: #333;
}

/* ===== DESKTOP: HOVER TO SHOW ===== */
@media (min-width: 766px) {
    .gallery-item:hover .overlay {
        transform: translateY(0);
    }
    
    .gallery-item:hover img {
        transform: scale(1.05);
    }
}

/* ===== MOBILE: TAP TO TOGGLE ===== */
@media (max-width: 765px) {
    .gallery-item .overlay {
        transform: translateY(100%);
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.9) 0%,
            rgba(0, 0, 0, 0.5) 60%,
            rgba(0, 0, 0, 0.2) 100%
        );
    }
    
    .gallery-item.active .overlay {
        transform: translateY(0);
    }
    
    .gallery-item .content h5 {
        font-size: 1rem;
    }
    
    .gallery-item .content p {
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .content-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.85rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .gallery-item .overlay,
    .gallery-item img {
        transition: none;
    }
}