/* Новости: карточки списка, окно новости, «Нравится», «Поделиться», комментарии */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.news-tile {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.news-tile:hover {
    transform: translateY(-5px);
    border-color: var(--gold-soft);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.40);
}

.news-tile-img {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #050b0f;
    overflow: hidden;
}

.news-tile-img video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.news-tile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.news-tile:hover .news-tile-img img { transform: scale(1.04); }

.news-tile-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(5, 11, 15, 0.72);
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 20px;
    padding-left: 4px;
}

.news-tile-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
}

.news-tile-body time,
.news-body time {
    color: var(--gold);
    font-size: 13px;
    font-weight: 600;
}

.news-tile-body h2 {
    font-size: 19px;
    line-height: 1.25;
}

.news-tile-body p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.news-tile-stats {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
}

.news-tile-stats b { color: var(--text); font-weight: 600; }


/* ---- Окно новости ---- */

body.news-open { overflow: hidden; }

.news-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    padding: 70px 16px 24px;
}

.news-modal[hidden] { display: none; }

.news-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 9, 0.82);
    backdrop-filter: blur(3px);
}

.news-modal-dialog {
    position: relative;
    width: min(880px, 100%);
    max-height: 100%;
    overflow-y: auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #0d1a21, #071016);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.news-modal-body.loading {
    min-height: 360px;
    opacity: 0.5;
}

.news-modal-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 12px;
}

.news-modal-nav button {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: rgba(13, 26, 33, 0.92);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
}

.news-modal-nav button:first-child { margin-bottom: 6px; font-size: 20px; }
.news-modal-nav button:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.news-modal-nav button:disabled { opacity: 0.3; cursor: default; }


/* ---- Новость целиком ---- */

.news-media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 0;
    background: #000;
    overflow: hidden;
}

.news-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-video { cursor: pointer; }

.news-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 76px;
    transform: translate(-50%, -50%);
    transition: transform 0.2s;
}

.news-video:hover .news-play { transform: translate(-50%, -50%) scale(1.08); }

.news-frame video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.news-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.news-body {
    padding: 24px 28px 8px;
}

.news-body h2 {
    margin: 8px 0 14px;
    font-size: 26px;
    line-height: 1.2;
}

.news-text p {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
}

.news-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 28px 22px;
    border-bottom: 1px solid var(--line);
}

.news-action-group { display: contents; }

.news-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
}

.news-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.news-btn b { color: var(--gold); font-size: 16px; }
.news-btn:hover { border-color: var(--gold-soft); }

.news-btn.on {
    background: rgba(234, 184, 79, 0.14);
    border-color: var(--gold);
    color: var(--gold);
}

.news-share { margin-left: auto; }


/* ---- Комментарии ---- */

.news-comments {
    padding: 22px 28px 28px;
    scroll-margin-top: 20px;
}

.news-comments h3 {
    margin-bottom: 14px;
    font-size: 18px;
}

.news-comment {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.news-comment-head {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin-bottom: 4px;
}

.news-comment-head time { color: var(--muted); font-size: 12px; }

.news-comment p {
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
    white-space: pre-line;
}

.news-comment-form {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.news-comment-form input,
.news-comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: #050b0f;
    color: var(--text);
    font: inherit;
    outline: none;
    resize: vertical;
}

.news-comment-form input:focus,
.news-comment-form textarea:focus { border-color: var(--gold); }

.news-comment-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.news-form-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
}

.news-form-msg.ok { background: rgba(80, 200, 120, 0.12); color: #7ddc9a; }
.news-form-msg.error { background: rgba(230, 80, 80, 0.12); color: #ff8a8a; }


/* ---- Отдельная страница новости ---- */

.news-page { max-width: 920px; }

.news-page-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #0d1a21, #071016);
}

.news-page-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
}

.news-page-nav a { color: var(--gold); text-decoration: none; }


@media (max-width: 700px) {
    .news-modal { padding: 0; }
    .news-modal-dialog { border-radius: 0; border: 0; }
    .news-modal-nav {
        position: absolute;
        right: 10px;
        top: 10px;
        z-index: 2;
        flex-direction: row;
        margin: 0;
    }
    .news-modal-nav button { width: 40px; height: 40px; }
    .news-modal-nav button:first-child { order: 3; margin: 0; }
    .news-modal .news-body { padding-top: 20px; }
    .news-body,
    .news-actions,
    .news-comments { padding-left: 16px; padding-right: 16px; }
    .news-body h2 { font-size: 21px; }
    .news-share { margin-left: 0; }
    .news-grid { grid-template-columns: 1fr; }
}
