:root {
    --bg-dark: #131315;
    --card-bg: #222629;
    --avatar-bg: #86c232;
    --text-main: #ffffff;
    --text-muted: #d0d2d6;
    --accent: #00b2ff;
}

.media-gallery {
    padding: 40px 20px;
    margin: 80px auto;
    max-width: 1400px;
    min-width: 1400px;
}

.media-page {
    background: var(--bg-dark);
    width: 100%;
    justify-content: center;
}

.media-title {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 30px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.media-grid-music {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
    gap: 24px;
}

.media-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-main);
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease;
}

.media-card:hover {
    transform: translateY(-4px);
}

.media-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #1f2937;
    overflow: hidden;
    border-radius: 16px;
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-caption {
    position: relative;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    text-align: left;
    z-index: 2;
    width: 100%;
    color: white;
    text-decoration: none;
}

.media-thumb-link {
    text-decoration: none;
    color: inherit;
    height: 320px;
    background: rgba(255, 255, 255, 0);
}

.media-card-overlay {
    position: absolute;
    min-width: 224px;
    height: 320px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    overflow: hidden;
    z-index: 1;
    bottom: 0;
    top: 0;
    left: 0;
    right: 0;
}

.media-card-overlay-wrapper {
    position: relative;
    min-width: 224px;
    height: 320px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0);
    overflow: hidden;
    border: 0;
}

.media-page .media-gallery .container {
    margin-bottom: 80px;
}

.music-media.media-thumb {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    z-index: 3;
}

@media (max-width: 1440px) {
    .media-gallery {
        padding: 40px 20px;
        margin: 80px auto;
        max-width: 100%;
        min-width: 100%;
    }

    .media-card.music {
        height: 320px;
        min-width: calc((100% - 5rem) / 6);
        max-width: 224px;
    }

    .media-card.video {
        height: 240px;
        min-width: calc((100% - 3rem) / 4);
    }
}

@media (max-width: 1439px) {
    .media-gallery {
        padding: 40px 20px;
        margin: 80px auto;
        max-width: 100%;
        min-width: 100%;
    }

    .media-card.music {
        height: 320px;
        min-width: calc((100% - 5rem) / 6);
        max-width: 224px;
    }

    .media-card.video {
        height: 240px;
        min-width: calc((100% - 3rem) / 4);
    }
}

@media (max-width: 960px) {
    .media-arrows {
        display: none;
    }
}

@media (max-width: 960px) and (orientation: portrait) {
    .media-card.music {
        height: 320px;
        min-width: calc((100% - 5rem) / 2);
        max-width: 224px;
    }

    .media-card.video {
        height: 240px;
        min-width: calc((100% - 3rem) / 2);
    }

    .media-grid .media-card.video {
        height: 300px;
    }

    .media-grid .media-card.video .media-caption {
        font-size: 1.3rem;
    }
}

@media (max-width: 960px) and (orientation: landscape) {
    .media-card.video {
        height: 240px;
        max-width: 300px;
    }
}
