/* Страница видео «Медиатеки ДНТ» (ТЗ п.3.1-3.3). Переменные --mdnt-* и компоненты карточек - из media-dnt.css.
   Размеры - в rem. */

.mdnt-video.section {
    padding-bottom: 3rem;
    padding-top: 1.5rem;
}

/* ---------- Шапка: обложка + сведения ---------- */
.mdnt-video__top {
    align-items: start;
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.mdnt-video__cover {
    align-items: center;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #dbe7f3, #c2dcfb);
    border-radius: .55rem;
    display: flex;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.mdnt-video__cover img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
}

.mdnt-video__placeholder {
    color: var(--mdnt-primary);
    height: 4.5rem;
    opacity: .7;
    width: 4.5rem;
}

.mdnt-video__cover .mdnt-card__badge {
    font-size: .9rem;
    padding: .3rem .65rem;
}

.mdnt-video__info {
    min-width: 0;
}

.mdnt-video__title {
    color: var(--mdnt-text);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1.25rem;
    overflow-wrap: anywhere;
}

.mdnt-video__facts {
    display: grid;
    gap: .75rem 2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 1.25rem;
}

.mdnt-video__fact {
    min-width: 0;
}

.mdnt-video__fact dt {
    color: var(--mdnt-muted);
    font-size: .85rem;
    font-weight: 400;
    margin-bottom: .15rem;
}

.mdnt-video__fact dd {
    color: var(--mdnt-text);
    font-size: 1.05rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.mdnt-video__partners {
    color: var(--mdnt-muted);
    display: block;
    font-size: .9rem;
    margin-top: .15rem;
}

.mdnt-video__age {
    background: var(--mdnt-bg);
    border: 1px solid var(--mdnt-border);
    border-radius: .3rem;
    display: inline-block;
    font-weight: 700;
    padding: .1rem .5rem;
}

.mdnt-video__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mdnt-video__tags li {
    margin: 0;
    max-width: 100%;
    min-width: 0;
}

.mdnt-video__tag {
    background: #fff;
    border: 1px solid #b7d3f4;
    border-radius: 1.2rem;
    color: var(--mdnt-primary);
    display: inline-block;
    font-size: .95rem;
    line-height: 1.3;
    max-width: 100%;
    overflow-wrap: anywhere;
    padding: .3rem .8rem;
    text-decoration: none;
    transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .2s ease-in-out;
}

.mdnt-video__tag:hover {
    background: var(--mdnt-bg);
    border-color: var(--mdnt-primary);
    color: var(--mdnt-primary-hover);
}

.mdnt-video__tag:active {
    background: #dbe7f3;
}

.mdnt-video__tag:focus-visible,
.mdnt-actions__btn:focus-visible,
.mdnt-service__report:focus-visible {
    box-shadow: var(--mdnt-focus);
    outline: 0;
}

/* ---------- Аннотация ---------- */
.mdnt-video__section {
    margin-top: 2rem;
}

.mdnt-video__heading {
    color: var(--mdnt-text);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 .75rem;
}

.mdnt-video__annotation {
    color: var(--mdnt-text);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
    max-width: 60rem;
    overflow-wrap: anywhere;
}

/* ---------- Действия ---------- */
.mdnt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.75rem;
}

.mdnt-actions__btn {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    max-width: 100%;
    text-align: center;
}

.mdnt-actions__btn:active {
    transform: translateY(1px);
}

.mdnt-actions__label-added,
.mdnt-actions__label-loading {
    display: none;
}

/* Состояние «добавлено» (переключает срез «Подборка»: класс .is-added и aria-pressed="true") */
.mdnt-actions__btn.is-added {
    background: var(--mdnt-primary);
    border-color: var(--mdnt-primary);
    color: #fff;
}

.mdnt-actions__btn.is-added .mdnt-actions__label-default {
    display: none;
}

.mdnt-actions__btn.is-added .mdnt-actions__label-added {
    display: inline;
}

/* Состояние загрузки PDF */
.mdnt-actions__btn.is-loading {
    cursor: progress;
    opacity: .75;
    pointer-events: none;
}

.mdnt-actions__btn.is-loading .mdnt-actions__label-default {
    display: none;
}

.mdnt-actions__btn.is-loading .mdnt-actions__label-loading {
    display: inline;
}

.mdnt-actions__status {
    font-size: .95rem;
    margin: .75rem 0 0;
    min-height: 0;
}

.mdnt-actions__status:empty {
    display: none;
}

.mdnt-actions__status.is-success {
    color: #1a7f37;
}

.mdnt-actions__status.is-error {
    color: var(--mdnt-danger);
}

/* ---------- Права на показ ---------- */
.mdnt-rights {
    background: var(--mdnt-bg);
    border: 2px solid var(--mdnt-primary);
    border-radius: .55rem;
    margin-top: 2rem;
    padding: 1.5rem;
}

.mdnt-rights__title {
    color: var(--mdnt-text);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1rem;
}

.mdnt-rights__list {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.mdnt-rights__item {
    align-items: center;
    background: #fff;
    border: 1px solid var(--mdnt-border);
    border-radius: .4rem;
    display: flex;
    gap: .75rem;
    justify-content: space-between;
    margin: 0;
    min-width: 0;
    padding: .65rem .9rem;
}

.mdnt-rights__item.is-on {
    border-color: #1a7f37;
}

.mdnt-rights__name {
    color: var(--mdnt-text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.mdnt-rights__value {
    color: var(--mdnt-muted);
    flex: 0 0 auto;
    font-weight: 700;
}

.mdnt-rights__item.is-on .mdnt-rights__value {
    color: #1a7f37;
}

.mdnt-rights__details {
    display: grid;
    gap: .75rem 2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.mdnt-rights__row {
    min-width: 0;
}

.mdnt-rights__row dt {
    color: var(--mdnt-muted);
    font-size: .85rem;
    font-weight: 400;
    margin-bottom: .15rem;
}

.mdnt-rights__row dd {
    color: var(--mdnt-text);
    margin: 0;
    overflow-wrap: anywhere;
}

.mdnt-rights__row dd.is-empty {
    color: var(--mdnt-muted);
    font-style: italic;
}

/* ---------- Похожие материалы ---------- */
.mdnt-similar {
    margin-top: 2.5rem;
}

.mdnt-similar__error {
    background: #fdecee;
    border: 1px solid #f1aeb5;
    border-radius: .55rem;
    color: #842029;
    padding: 1.25rem 1.5rem;
}

.mdnt-similar__error p {
    margin: 0 0 .75rem;
}

/* ---------- Служебное действие ---------- */
.mdnt-service {
    border-top: 1px solid var(--mdnt-border);
    margin-top: 2.5rem;
    padding-top: 1rem;
}

.mdnt-service__report {
    background: none;
    border: 0;
    border-radius: .2rem;
    color: var(--mdnt-muted);
    cursor: pointer;
    font-size: .95rem;
    padding: .25rem .1rem;
    text-decoration: underline;
}

.mdnt-service__report:hover {
    color: var(--mdnt-primary-hover);
}

.mdnt-service__report:active {
    color: var(--mdnt-primary);
}

/* ---------- Адаптивность ---------- */
@media (max-width: 991.98px) {
    .mdnt-video__top {
        gap: 1.5rem;
        grid-template-columns: minmax(0, 1fr);
    }

    .mdnt-video__cover {
        max-width: 40rem;
    }

    .mdnt-video__title {
        font-size: 1.7rem;
    }

    .mdnt-rights__list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .mdnt-video__title {
        font-size: 1.45rem;
    }

    .mdnt-video__facts,
    .mdnt-rights__details {
        grid-template-columns: minmax(0, 1fr);
    }

    .mdnt-actions {
        flex-direction: column;
    }

    .mdnt-actions__btn {
        width: 100%;
    }

    .mdnt-rights {
        padding: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mdnt-video__tag {
        transition: none;
    }

    .mdnt-actions__btn:active {
        transform: none;
    }
}
