.cosmic-media-slider-wrap {
    position: relative;
    width: var(--cosmic-slider-width, 100%);
    max-width: var(--cosmic-slider-max-width, 960px);
    margin: 24px auto 48px;
}

.cosmic-media-slider-wrap.is-fullscreen {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.cosmic-media-slider {
    position: relative;
    width: var(--cosmic-slider-width, 100%);
    max-width: var(--cosmic-slider-max-width, 960px);
    height: var(--cosmic-slider-height, auto);
    margin: 0;
    background: #0f1114;
    overflow: hidden;
    touch-action: pan-y;
}

.cosmic-media-slider.is-fullscreen {
    width: 100vw;
    max-width: 100vw;
}

.cosmic-media-ribbon {
    position: absolute;
    top: 12px;
    left: -46px;
    z-index: 5;
    width: clamp(110px, 26%, 170px);
    text-align: center;
    padding: 7px 12px;
    background: linear-gradient(135deg, #cf2e2e, #a80000);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: rotate(-35deg);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.cosmic-media-track {
    position: relative;
    display: grid;
}

.cosmic-media-slide {
    grid-area: 1 / 1;
    position: relative;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate3d(24px, 0, 0);
    transition: opacity 520ms ease, transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 520ms;
}

.cosmic-media-slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition: opacity 520ms ease, transform 760ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0s;
}

.cosmic-media-image,
.cosmic-media-video {
    width: 100%;
    height: var(--cosmic-slider-height, auto);
    display: block;
    background: #000;
    object-fit: cover;
    transform: translate3d(0, 0, 0) scale(1.02);
    transition: transform 1300ms ease;
}

.cosmic-media-slide.is-active .cosmic-media-image,
.cosmic-media-slide.is-active .cosmic-media-video {
    animation: cosmicMediaKenBurns 7s ease forwards;
}

.cosmic-media-image {
    cursor: zoom-in;
}

.cosmic-media-video {
    cursor: zoom-in;
}

.cosmic-media-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    color: #f6f6f7;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.4;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.16));
}

.cosmic-media-controls {
    position: absolute;
    inset: 50% 10px auto 10px;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.cosmic-media-bullets {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.cosmic-media-bullet {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    padding: 0;
    cursor: pointer;
}

.cosmic-media-bullet.is-active {
    background: #ffffff;
    border-color: #ffffff;
}

.cosmic-media-shadow {
    position: absolute;
    left: 50%;
    bottom: -43px;
    transform: translateX(-50%);
    width: 100%;
    height: 44px;
    pointer-events: none;
    background: url('../dark.png') center / contain no-repeat;
}

.cosmic-media-slider-wrap.is-fullscreen .cosmic-media-shadow {
    width: 100vw;
}

@keyframes cosmicMediaKenBurns {
    0% {
        transform: translate3d(1.5%, 0, 0) scale(1.06);
    }
    100% {
        transform: translate3d(-1.5%, 0, 0) scale(1.1);
    }
}

.cosmic-media-prev,
.cosmic-media-next {
    pointer-events: auto;
    border: none;
    border-radius: 999px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    background: none;
    color: #fff;
    font-size: 18px;
    outline: none;
}

.cosmic-media-prev:hover,
.cosmic-media-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.cosmic-media-notice {
    border-left: 4px solid #d63638;
    background: #fff;
    padding: 10px 12px;
}

.cosmic-media-lightbox-open {
    overflow: hidden;
}

.cosmic-media-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    padding: 24px;
}

.cosmic-media-lightbox.is-open {
    display: flex;
}

.cosmic-media-lightbox-image {
    max-width: min(96vw, 1800px);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
    transform: scale(1);
    transform-origin: center center;
    transition: transform 120ms ease;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
}

.cosmic-media-lightbox-video {
    display: none;
    max-width: min(96vw, 1800px);
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
    background: #000;
}

.cosmic-media-lightbox.is-zoomed .cosmic-media-lightbox-image {
    cursor: grab;
}

.cosmic-media-lightbox.is-dragging .cosmic-media-lightbox-image {
    cursor: grabbing;
    transition: none;
}

.cosmic-media-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 22px;
}

.cosmic-media-lightbox-prev {
    left: 18px;
}

.cosmic-media-lightbox-next {
    right: 18px;
}

.cosmic-media-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.34);
}

.cosmic-media-lightbox-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.cosmic-media-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.32);
}

.cosmic-media-lightbox-toolbar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.cosmic-media-lightbox-tool-btn {
    min-width: 44px;
    height: 36px;
    border: none;
    border-radius: 999px;
    padding: 0 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.cosmic-media-lightbox-tool-btn:hover {
    background: rgba(255, 255, 255, 0.34);
}

.cosmic-latest-posts-grid {
    --cosmic-post-radius: 0;
    --cosmic-latest-post-columns: 3;
    display: grid;
    grid-template-columns: repeat(var(--cosmic-latest-post-columns), minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.cosmic-latest-post-card {
    margin: 0;
}

.cosmic-latest-post-media {
    position: relative;
    border-radius: var(--cosmic-post-radius);
    overflow: hidden;
    background: #15181d;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.cosmic-latest-post-image-link {
    display: block;
}

.cosmic-latest-post-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #0f1114;
}

.cosmic-latest-post-image--placeholder {
    background: linear-gradient(135deg, #1b1f25, #0d1014);
}

.cosmic-latest-post-category {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    padding: 5px 10px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #f4f4f4;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    max-width: calc(100% - 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cosmic-latest-post-actions {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    max-width: calc(100% - 20px);
}

.cosmic-latest-post-icon-btn {
    appearance: none;
    border: none;
    outline: none;
    border-radius: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: transform 120ms ease, opacity 120ms ease, background-color 120ms ease;
}

.cosmic-latest-post-icon-btn:hover {
    transform: translateY(-1px);
    opacity: 0.94;
}

.cosmic-latest-post-icon-btn svg,
.cosmic-latest-post-title-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.cosmic-latest-post-icon-btn--gallery {
    background: rgba(0, 0, 0, 0.78);
    color: #ffffff;
}

.cosmic-latest-post-title-row {
    margin: 10px 2px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.cosmic-latest-post-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    min-width: 0;
    flex: 1;
}

.cosmic-latest-post-title a {
    color: inherit;
    text-decoration: none;
}

.cosmic-latest-post-title a:hover {
    text-decoration: underline;
}

.cosmic-latest-post-title-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 0;
    color: #101317;
    text-decoration: none;
    flex: 0 0 auto;
    transition: transform 120ms ease, background-color 120ms ease;
}

.cosmic-latest-post-title-icon:hover {
    transform: translateY(-1px);
    background: rgba(0, 0, 0, 0.05);
}

.parallax-effect,
figure.parallax-effect.wp-block-post-featured-image {
    position: relative;
    overflow: hidden;
}

figure.parallax-effect.wp-block-post-featured-image {
    height: 80vh;
    min-height: 420px;
    margin: 0;
}

.parallax-effect img,
img.parallax-effect,
figure.parallax-effect.wp-block-post-featured-image img {
    display: block;
    width: 100%;
    height: 120% !important;
    max-width: none !important;
    object-fit: cover !important;
    transform: translate3d(0, var(--parallax-y, 0px), 0) scale(1.08);
    will-change: transform;
}

@media (max-width: 768px) {
    figure.parallax-effect.wp-block-post-featured-image {
        height: 65vh;
        min-height: 360px;
    }
}

@media (max-width: 640px) {
    .cosmic-media-slider-wrap {
        margin: 16px auto 36px;
    }

    .cosmic-media-prev,
    .cosmic-media-next {
        width: 34px;
        height: 34px;
    }

    .cosmic-media-shadow {
        height: 30px;
        bottom: -23px;
    }

    .cosmic-media-ribbon {
        width: 122px;
        left: -44px;
        font-size: 11px;
    }

    .cosmic-latest-posts-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cosmic-latest-post-btn {
        font-size: 11px;
        padding: 7px 10px;
    }

}
