.ttg-home-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    margin: 20px auto;
    max-width: 1600px;
    padding: 0 15px;
}

.ttg-full-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px auto;
    max-width: 1600px;
    padding: 0 15px;
}

.ttg-gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #f0f0f0;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.ttg-gallery-item:hover {
    transform: translateY(-5px);
}

.ttg-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ttg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ttg-gallery-item:hover .ttg-overlay {
    opacity: 1;
}

.ttg-text {
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    padding: 10px;
}

/* Modal styles */
.ttg-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.ttg-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    border-radius: 8px;
}

.ttg-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.ttg-prev,
.ttg-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 15px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.ttg-next {
    right: 20px;
}

.ttg-prev {
    left: 20px;
}

.ttg-prev:hover,
.ttg-next:hover {
    background-color: rgba(0, 0, 0, 0.95);
}

/* Responsive Styles */
/* Tablet View (768px and below) */
@media screen and (max-width: 768px) {
    .ttg-home-gallery,
    .ttg-full-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 10px;
    }

    .ttg-gallery-item {
        border-radius: 6px;
    }

    .ttg-text {
        font-size: 1.1em;
    }
}

/* Mobile View (480px and below) */
@media screen and (max-width: 480px) {
    .ttg-home-gallery,
    .ttg-full-gallery {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 8px;
    }

    .ttg-gallery-item {
        max-width: 100%;
        margin: 0 auto;
    }

    .ttg-text {
        font-size: 1em;
    }

    .ttg-prev,
    .ttg-next {
        width: 35px;
        height: 35px;
        padding: 10px;
    }

    .ttg-close {
        font-size: 30px;
        right: 15px;
        top: 10px;
    }

    .ttg-modal-content {
        max-width: 95%;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .ttg-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.4);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .ttg-gallery-item,
    .ttg-gallery-item img,
    .ttg-overlay,
    .ttg-text,
    .ttg-prev,
    .ttg-next {
        transition: none;
    }
}
