.bravo-moments {
    width: 81%;
    margin: 0;
    background-color: #0a0a0a;
    padding: 40px 242px;
    flex-direction: column;
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;       /* Центрирует элементы по горизонтали */
    justify-content: center;
}

.gallery-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    justify-content: center;
}

.text-container {
    width: 328px;
    height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: #0a0a0a;
}

.text-container h1 {
    color: #faf6f6;
    font-size: 36px;
    font-family: 'Forum', serif;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 36px;
    margin: 0 0 20px 0;
}

.text-container p {
    color: #faf6f6;
    font-size: 18px;
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    line-height: 21.6px;
    margin: 0;
}

.image-container {
    position: relative;
    width: 328px;
    height: 360px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 18px;
    font-family: 'Dancing Script', cursive;
    font-weight: 400;
    text-align: center;
    padding: 10px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Адаптивные стили для ноутбуков и планшетов */
@media (max-width: 1200px) {
    .bravo-moments {
        padding: 30px 50px;
    }

    .gallery-container {
        gap: 15px;
    }

    .gallery-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .text-container,
    .image-container {
        width: 280px;
        height: 300px;
    }

    .text-container h1 {
        font-size: 32px;
        line-height: 32px;
        margin: 0 0 15px 0;
    }

    .text-container p {
        font-size: 16px;
        line-height: 19.2px;
    }

    .name-overlay {
        font-size: 16px;
        padding: 8px 0;
    }
}

/* Адаптивные стили для мобильной версии: 2x2 с текстовым блоком и 3 изображениями */
@media (max-width: 768px) {
    .bravo-moments {
        padding: 40px 37px;
    }

    .gallery-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .gallery-row {
        display: contents;
    }

    .gallery-container > .gallery-row > .image-container:nth-child(4),
    .gallery-container > .gallery-row:nth-child(2) > .image-container:nth-child(n + 2) {
        display: none;
    }

    .text-container,
    .image-container {
        width: 100%;
        height: 250px;
    }

    .text-container h1 {
        font-size: 24px;
        line-height: 24px;
        margin: 0 0 15px 0;
    }

    .text-container p {
        font-size: 16px;
        line-height: 19.2px;
    }

    .image-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .name-overlay {
        font-size: 16px;
        padding: 8px 0;
    }
}

/* Дополнительные корректировки для очень маленьких экранов */
@media (max-width: 480px) {
    .text-container,
    .image-container {
        height: 180px;
    }

    .text-container h1 {
        font-size: 20px;
        line-height: 20px;
        margin: 0 0 10px 0;
    }

    .text-container p {
        font-size: 14px;
        line-height: 16.8px;
    }

    .image-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .name-overlay {
        font-size: 14px;
        padding: 6px 0;
    }
}

/* Адаптивные стили для очень маленьких смартфонов */
@media (max-width: 320px) {
    .bravo-moments {
        padding: 20px 10px;
    }

    .gallery-container {
        gap: 10px;
    }

    .text-container,
    .image-container {
        height: 150px;
    }

    .text-container h1 {
        font-size: 18px;
        line-height: 18px;
        margin: 0 0 8px 0;
    }

    .text-container p {
        font-size: 12px;
        line-height: 14.4px;
    }

    .name-overlay {
        font-size: 12px;
        padding: 5px 0;
    }
}