/* Общие стили */
*,
::after,
::before {
    box-sizing: border-box;
}

body {
    background-color: #212121;
    color: #fff;
    font-family: monospace, serif;
    letter-spacing: 0.05em;
}

/* Instagram Container Specific Styles */
.instagram-feed .block-cube {
    width: 100%;
    max-width: 1000px; /* Широкий контейнер для десктопов */
    margin: 0 auto;
    padding: 20px 10px 15px; /* Уменьшенные отступы для мобильных */
}

@media (max-width: 640px) {
    .instagram-feed .block-cube {
        padding: 10px 5px 10px; /* Минимальные отступы на мобильных */
    }
}

/* 3D Cube Effect */
.block-cube {
    position: relative;
}

.block-cube .bg-top {
    position: absolute;
    height: 10px;
    background: transparent;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid white;
    bottom: 100%;
    left: 5px;
    right: -5px;
    transform: skew(-45deg, 0);
    margin: 0;
    transition: all 0.2s ease-in-out;
}

.block-cube .bg-top .bg-inner {
    bottom: 0;
}

.block-cube .bg {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    border: 2px solid white;
    transition: all 0.2s ease-in-out;
}

.block-cube .bg-right {
    position: absolute;
    background: transparent;
    border-right: 2px solid white;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
    top: -5px;
    z-index: 0;
    bottom: 5px;
    width: 10px;
    left: 100%;
    transform: skew(0, -45deg);
    transition: all 0.2s ease-in-out;
}

.block-cube .bg-right .bg-inner {
    left: 0;
}

.block-cube .bg .bg-inner {
    transition: all 0.2s ease-in-out;
}

.block-cube .bg-inner {
    background: transparent;
    position: absolute;
    left: 2px;
    top: 2px;
    right: 2px;
    bottom: 2px;
}

/* Подсветка стенок при наведении */
.block-cube.block-cube-hover:hover .bg-top,
.block-cube.block-cube-hover:hover .bg-right,
.block-cube.block-cube-hover:hover .bg {
    background: rgba(255, 0, 0, 0.3); /* Красная подсветка стенок */
    border-color: rgba(255, 0, 0, 0.7); /* Усиленные красные границы */
}

/* Стили для внутренней части контейнера */
.block-cube .relative {
    position: relative;
    z-index: 2;
}

/* Стили для кнопки — изначально прозрачная */
.block-cube.block-cube-hover .bg-top {
    background: transparent;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid white;
}

.block-cube.block-cube-hover .bg {
    background: transparent;
    border: 2px solid white;
}

.block-cube.block-cube-hover .bg-right {
    background: transparent;
    border-right: 2px solid white;
    border-top: 2px solid white;
    border-bottom: 2px solid white;
}

/* Красный и чёрный градиент только при наведении */
.block-cube.block-cube-hover:hover .bg-top {
    background: linear-gradient(
        90deg,
        #020202 0%,
        #cc0101 100%
    ); /* Чёрный в красный */
}

.block-cube.block-cube-hover:hover .bg {
    background: linear-gradient(
        90deg,
        #020202 0%,
        #cc0101 100%
    ); /* Чёрный в красный */
}

.block-cube.block-cube-hover:hover .bg-right {
    background: #bb0000; /* Красный для боковой стенки */
}

.block-cube.block-cube-hover:hover .bg .bg-inner {
    background: rgba(
        255,
        255,
        255,
        0.1
    ); /* Лёгкая прозрачность при наведении */
}

/* Interactive Hover Effects for Posts */
.post-item {
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(204, 1, 1, 0.8);
    z-index: 1;
}

.post-item img {
    transition: transform 0.3s ease;
}

.post-item:hover img {
    transform: scale(1.1);
}

@media (max-width: 640px) {
    .post-item img {
        height: 120px; /* Уменьшаем высоту изображений на мобильных */
    }
}

/* Interactive Hover Effects for Stories */
.story-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.story-item:hover {
    transform: scale(1.1);
    z-index: 1;
}

.story-item .w-12,
.story-item .w-16 {
    width: 12px !important;
    height: 12px !important;
    min-width: 50px; /* Минимальная ширина для пропорций */
    min-height: 50px;
}

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

@media (min-width: 641px) {
    .story-item .w-12,
    .story-item .w-16 {
        width: 16px !important;
        height: 16px !important;
        min-width: 60px;
        min-height: 60px;
    }
}

/* Кнопки с равномерной шириной */
button {
    width: 100%; /* Равная ширина на мобильных */
    text-align: center;
}

@media (min-width: 641px) {
    button {
        width: auto; /* Возвращаем стандартную ширину на десктопах */
    }
}

/* Ensure clickable elements work */
a,
button {
    text-decoration: none;
}

a:hover,
button:hover {
    text-decoration: none;
}

/* Scrollbar for Stories */
.instagram-feed .flex.overflow-x-auto::-webkit-scrollbar {
    height: 4px;
}

.instagram-feed .flex.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 10px;
}

.instagram-feed .flex.overflow-x-auto::-webkit-scrollbar-track {
    background: #1a1a1a;
}

@media (max-width: 640px) {
    .instagram-feed .flex.overflow-x-auto::-webkit-scrollbar {
        height: 2px;
    }
}
