/* =========================
   PLAYER
========================= */

.player {
    position: relative;
    overflow: hidden;

    border-radius: 9px 9px 0 0;

    aspect-ratio: 16 / 9;
    /* 🔥 фиксируем размер до загрузки */
    background: #000;
    /* чтобы не было прозрачного дергания */
}

.player-video {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* затемнение */
.player-dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    transition: opacity .25s ease;
}

/* кнопка play */

.player-play:active {
    transform: scale(.92);
}

.player-play {
    position: absolute;
    inset: 0;
    margin: auto;

    width: 37px;
    height: 37px;

    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .0);
    background: rgba(0, 0, 0, .55);

    display: flex;
    align-items: center;
    justify-content: center;
}

/* PLAY (по умолчанию) */
.player-play .icon {
    width: 0;
    height: 0;

    border-left: 9px solid rgb(231, 231, 231);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;

    transform: translateX(1px);
}

/* PAUSE состояние */
.player.playing .player-play .icon {
    width: 10px;
    height: 10px;

    border: none;
    display: flex;
    gap: 3px;
}

.player.playing .player-play .icon::before,
.player.playing .player-play .icon::after {
    content: '';
    width: 3px;
    height: 10px;
    background: rgb(231, 231, 231);
}

/* HUD */
.player-hud {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 14px;

    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;

    opacity: 0;
    transform: translateY(6px);
    transition: .25s ease;
}

.player-hud.show {
    opacity: 1;
    transform: translateY(0);
}

.hud-bar {
    position: relative;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, .18);
    border-radius: 10px;
    overflow: visible;
}


/* 🔥 слой буфера (серый) */
.hud-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, .35);
}

/* линия прогресса */
.hud-fill {
    position: relative;
    /* 🔥 добавить */
    height: 100%;
    width: 0%;
    background: #7E0000;
    border-radius: 10px;
}

/* 🔥 кружок */
.hud-fill::after {
    content: '';
    position: absolute;

    left: 100%;
    /* 🔥 вместо right */
    top: 50%;
    transform: translate(-50%, -50%);

    width: 8px;
    height: 8px;
    border-radius: 50%;

    background: #7E0000;
}

.hud-time {
    font-size: 12px;
    color: #ccc;
    font-weight: 500;

    margin-bottom: 4px;
    /* регулируй 3–6px */
}

/* =========================
   PLAYER STATES (ВАЖНО)
========================= */

/* кнопку НИКОГДА не отключаем */
.player-play {
    opacity: 0;
    pointer-events: auto;
    /* ← ВАЖНО */
    transition: opacity .2s ease;
}

/* показываем когда paused или HUD */
.player:not(.playing) .player-play,
.player.controls .player-play {
    opacity: 1;
}

/* playing — только затемнение убираем */
.player.playing .player-dim {
    opacity: 0;
}

/* ========================================
   HUD GRADIENT (читабельность)
======================================== */

.player-gradient {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 80px;

    pointer-events: none;

    background: linear-gradient(to top,
            rgba(0, 0, 0, .65) 0%,
            rgba(0, 0, 0, .45) 35%,
            rgba(0, 0, 0, .18) 60%,
            rgba(0, 0, 0, 0) 100%);

    opacity: 0;
    transition: opacity .25s ease;
}

/* показываем только когда HUD активен */
.player.controls .player-gradient {
    opacity: 1;
}

.player.loading .player-play {
    opacity: .5;
}

/* =========================
   SPINNER (buffering)
========================= */

.player-spinner {
    position: absolute;
    inset: 0;
    margin: auto;

    width: 26px;
    height: 26px;

    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .15);
    border-top-color: #fff;

    animation: spin .7s linear infinite;

    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* показываем только когда loading */
.player.loading .player-spinner {
    opacity: 1;
}

/* во время загрузки прячем play */
.player.loading .player-play {
    opacity: 0;
}

.player-fullscreen {
    position: absolute;
    top: 10px;
    right: 10px;

    z-index: 6;

    width: 34px;
    height: 34px;

    border-radius: 8px;

    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .08);

    color: rgba(255, 255, 255, .86);
    font-size: 16px;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;

    backdrop-filter: blur(10px);

    transition:
        background .2s ease,
        transform .2s ease,
        opacity .2s ease;
}

.player.controls .player-fullscreen,
.player:not(.playing) .player-fullscreen {
    opacity: 1;
}

.player-fullscreen:hover {
    background: rgba(255, 255, 255, .14);
}

.player-fullscreen:active {
    transform: scale(.94);
}

/* =========================
   PLAYER TAG
========================= */

.player-tag {
    position: absolute;
    top: 10px;
    left: 10px;

    z-index: 4;

    padding: 4px 10px;

    font-size: 11px;
    font-weight: 600;

    border-radius: 999px;

    backdrop-filter: blur(6px);

    background: rgba(0, 0, 0, .45);
    color: rgba(255, 255, 255, 0.8);

    letter-spacing: .02em;

    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .25s ease, transform .25s ease;
}

/* показываем только когда HUD активен */

.player.controls .player-tag {
    opacity: 1;
    transform: translateY(0);
}

/* категории */

.tag-edit {
    background: rgba(0, 0, 0, 0.55);
}

.tag-motion {
    background: rgba(0, 0, 0, 0.55);
}

.tag-design {
    background: rgba(0, 0, 0, 0.55);
}

.tag-3d {
    background: rgba(0, 0, 0, 0.55);
}

.slide-tag {

    position: absolute;
    top: 10px;
    left: 10px;

    padding: 4px 10px;

    font-size: 11px;
    font-weight: 600;

    border-radius: 999px;

    background: rgba(0, 0, 0, .45);
    color: #fff;

    backdrop-filter: blur(6px);
}

.article-slide-inner {
    position: relative;
}