/* static/css/city_tv.css — Городское Медиа-ТВ (Urban TV), вертикальный свайпер.
   Немонетарный контент-модуль. Нативный CSS scroll-snap (без библиотек).
   Тёмная витрина видео; тема-независимо (медиа лучше на тёмном фоне). */

.ctv-root {
    position: relative;
    width: 100%;
    height: 78vh;
    height: 78dvh;
    min-height: 460px;
    background: var(--dark);
    border-radius: 14px;
    overflow: hidden;
}

.ctv-scroller {
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ctv-scroller::-webkit-scrollbar { display: none; }

.ctv-item {
    position: relative;
    height: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dark);
    overflow: hidden;
}

.ctv-media-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ctv-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}
iframe.ctv-media { object-fit: initial; }

.ctv-media-fallback {
    position: relative;
    background-color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.ctv-media-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ctv-play {
    position: relative;
    z-index: 1;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

/* Затемняющий градиент снизу + инфо-оверлей */
.ctv-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 18px 16px 26px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.32) 55%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}
.ctv-overlay a,
.ctv-overlay button { pointer-events: auto; }

.ctv-meta { max-width: 78%; color: var(--white); }
.ctv-title {
    margin: 0 0 6px;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.ctv-desc {
    margin: 0 0 8px;
    font-size: 0.88rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.86);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ctv-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ctv-chip {
    font-size: 0.76rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: var(--white);
    backdrop-filter: blur(4px);
}

.ctv-cta {
    display: inline-block;
    margin-top: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--info-dark);
    color: var(--white);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 12px color-mix(in srgb, var(--info-dark) 40%, transparent);
}
.ctv-cta:hover { background: var(--info-dark); }

.ctv-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-bottom: 4px;
}
.ctv-like {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: 0;
    color: var(--white);
    cursor: pointer;
    font-size: 0.78rem;
}
.ctv-heart {
    font-size: 2rem;
    line-height: 1;
    transition: transform 0.15s ease;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}
.ctv-like:active .ctv-heart { transform: scale(1.3); }
.ctv-like[data-liked="1"] .ctv-heart { color: var(--danger-light); }

/* Статусы (loading / empty / error) — честные состояния (rule #34) */
.ctv-status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--gray-300);
    text-align: center;
    padding: 24px;
    background: var(--dark);
}
.ctv-status-err { color: var(--danger-lighter); }
.ctv-retry,
.ctv-refresh {
    padding: 8px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: var(--text-code);
    cursor: pointer;
}
.ctv-retry:hover,
.ctv-refresh:hover { background: rgba(255, 255, 255, 0.08); }
.ctv-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--info-light);
    animation: ctv-spin 0.9s linear infinite;
}
@keyframes ctv-spin { to { transform: rotate(360deg); } }

.ctv-sentinel { height: 1px; }

@media (max-width: 640px) {
    .ctv-root { height: 82vh; height: 82dvh; border-radius: 0; }
    .ctv-meta { max-width: 72%; }
}
