:root {
    --news-bg: #ffffff;
    --news-border: rgba(15, 23, 42, 0.1);
    --news-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --news-muted: #64748b;
    --news-accent: #2152ff;
    --news-accent-soft: rgba(33, 82, 255, 0.12);
    --news-danger: #dc3545;
    --news-success: #157347;
}

.news-page {
    display: grid;
    gap: 2.5rem;
    padding-bottom: 4rem;
}

.news-hero {
    background: linear-gradient(135deg, rgba(33, 82, 255, 0.12), rgba(32, 201, 151, 0.12));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.news-hero__title {
    font-size: clamp(2rem, 2.5vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #0f172a;
}

.news-hero__subtitle {
    margin: 0;
    max-width: 760px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--news-muted);
}

.news-form-wrapper {
    background: var(--news-bg);
    border-radius: 18px;
    border: 1px solid var(--news-border);
    box-shadow: var(--news-shadow);
    padding: 2rem 2.5rem;
}

.news-form__title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #0f172a;
}

.news-form {
    display: grid;
    gap: 1.5rem;
}

.news-form__field textarea,
.news-form__field input[type="text"] {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 1.1rem 1.2rem;
    font-size: 1rem;
    resize: vertical;
    min-height: 140px;
    line-height: 1.6;
}

.news-form__field input[type="text"] {
    min-height: auto;
}

.news-form__field textarea:focus,
.news-form__field input[type="text"]:focus {
    outline: none;
    border-color: rgba(33, 82, 255, 0.4);
    box-shadow: 0 0 0 4px rgba(33, 82, 255, 0.08);
}

.news-form__label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.news-form__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.news-form__upload {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    border-radius: 999px;
    padding-inline: 1.4rem;
}

.news-form__preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    border: 1px dashed rgba(15, 23, 42, 0.14);
    border-radius: 16px;
    padding: 0.9rem;
    background: rgba(15, 23, 42, 0.03);
}

.news-form__preview-item {
    position: relative;
    width: 108px;
    height: 108px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-form__preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-form__preview-item--video {
    background: #0f172a;
    color: #ffffff;
}

.news-form__preview-icon {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.news-form__preview-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0));
    color: #ffffff;
    font-size: 0.7rem;
    padding: 0.35rem 0.45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-form__preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.news-form__preview-remove:hover,
.news-form__preview-remove:focus {
    background: var(--news-danger);
    transform: scale(1.05);
}

.news-form__preview-remove i {
    font-size: 0.85rem;
}

.news-form__submit {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 999px;
    padding-inline: 1.6rem;
    font-weight: 600;
}

.news-form__spinner {
    display: none !important;
}

.news-form__submit.is-loading .news-form__spinner {
    display: inline-block;
}

.news-form__submit.is-loading .news-form__submit-label {
    opacity: 0.6;
}

.news-form__hint {
    margin: 0;
    font-size: 0.9rem;
    color: var(--news-muted);
}

.news-stream {
    display: grid;
    gap: 1.5rem;
}

.news-status {
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    font-weight: 500;
    background: rgba(15, 23, 42, 0.04);
    color: #1f2937;
}

.news-status--error {
    background: rgba(220, 53, 69, 0.12);
    color: var(--news-danger);
}

.news-status--success {
    background: rgba(21, 115, 71, 0.14);
    color: var(--news-success);
}

.is-hidden {
    display: none !important;
}

.news-empty {
    border-radius: 16px;
    border: 1px dashed rgba(15, 23, 42, 0.18);
    padding: 2.2rem 2.4rem;
    text-align: center;
    color: var(--news-muted);
    font-size: 1rem;
    background: rgba(15, 23, 42, 0.02);
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 2.5rem;
}

.news-card {
    --news-card-padding-x: 2.25rem;
    --news-card-padding-y: 2rem;
    background: linear-gradient(135deg, #343a40 0%, #454d55 100%);
    color: #f8f9fa;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 28px 50px -24px rgba(0, 0, 0, 0.6);
    padding: var(--news-card-padding-y) var(--news-card-padding-x);
    display: grid;
    gap: 1.5rem;
}

.news-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 18px 36px -18px rgba(15, 23, 42, 0.4);
    flex-wrap: wrap;
}

.news-card__title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.25;
    flex: 1 1 auto;
}

.news-card__time {
    font-size: 0.95rem;
    color: #475569;
    margin-left: auto;
    white-space: nowrap;
    padding-top: 0.35rem;
}

.news-card__content {
    font-size: 1.02rem;
    line-height: 1.7;
    color: #1f2937;
    display: grid;
    gap: 0.75rem;
    word-break: break-word;
}

.news-card__body {
    display: grid;
    gap: 1rem;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 18px;
    color: #1f2937;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 18px 36px -18px rgba(15, 23, 42, 0.4);
}

.news-card__content p,
.news-card__content ul,
.news-card__content ol,
.news-card__content h1,
.news-card__content h2,
.news-card__content h3,
.news-card__content h4,
.news-card__content h5,
.news-card__content h6,
.news-card__content blockquote {
    margin: 0;
}

.news-card__content ul,
.news-card__content ol {
    padding-left: 1.2rem;
}

.news-card__content img,
.news-card__content video,
.news-card__content iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.75rem auto;
}

.news-card__content figure {
    max-width: 100%;
    margin: 0.75rem auto;
}

.news-card__content figure img,
.news-card__content figure video,
.news-card__content figure iframe {
    max-width: 100%;
    height: auto;
}

.news-card__content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
}

.news-card__content table td,
.news-card__content table th {
    border: 1px solid rgba(15, 23, 42, 0.16);
    padding: 0.5rem;
    word-break: break-word;
}

.news-card__content pre {
    max-width: 100%;
    overflow-x: auto;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 12px;
}

.news-card__content code {
    word-break: break-word;
}



.news-card__gallery {
    --thumb-height: 340px;
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.news-card__gallery--count-1 {
    --thumb-height: 420px;
    grid-template-columns: minmax(0, 1fr);
}

.news-card__gallery--count-2 {
    --thumb-height: 360px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.news-card__gallery--count-3 {
    --thumb-height: 280px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.news-card__gallery--count-4,
.news-card__gallery--count-many {
    --thumb-height: 220px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.news-card__media {
    display: inline-flex;
    position: relative;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    min-height: var(--thumb-height);
}

.news-card__media:hover,
.news-card__media:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.14);
    outline: none;
}

.news-card__media--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card__media--video {
    align-items: center;
    justify-content: center;
}

.news-card__video-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    font-size: 2.5rem;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(33, 82, 255, 0.78), rgba(32, 201, 151, 0.78));
}

.news-card__video-thumb .fa-play {
    filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.35));
}

.news-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    margin-inline: calc(-1 * (var(--news-card-padding-x) - 1rem));
    padding: 1.1rem 1.5rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #800000, #6f0d0e);
    box-shadow: 0 24px 42px -28px rgba(128, 0, 0, 0.75);
    color: rgba(255, 255, 255, 0.92);
}

.news-card__admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.news-card__admin-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
    color: rgba(255, 255, 255, 0.92);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.news-card__admin-actions .btn:hover,
.news-card__admin-actions .btn:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.news-card__admin-actions .btn.btn-outline-danger {
    color: #ffe4e6;
    border-color: rgba(255, 179, 186, 0.55);
}

.news-card__admin-actions .btn.btn-outline-danger:hover,
.news-card__admin-actions .btn.btn-outline-danger:focus-visible {
    color: #ffffff;
    border-color: rgba(255, 99, 132, 0.6);
    background: rgba(255, 99, 132, 0.3);
}

.news-card__reactions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.news-card__reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    font-weight: 500;
    font-size: 0.95rem;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.news-card__reaction-btn i {
    font-size: 0.95rem;
}

.news-card__reaction-btn:hover,
.news-card__reaction-btn:focus-visible {
    border-color: rgba(33, 82, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(33, 82, 255, 0.1);
    color: var(--news-accent);
    outline: none;
}

.news-card__reaction-btn.is-active {
    background: var(--news-accent);
    border-color: var(--news-accent);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(33, 82, 255, 0.25);
}

.news-card__reaction-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

.news-card__reactions.is-loading .news-card__reaction-btn {
    pointer-events: none;
    opacity: 0.6;
}

.news-card__comments-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: inherit;
    font-weight: 600;
}

.news-card__comments-indicator i {
    font-size: 1rem;
}

.news-card__comments {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #343a40 0%, #454d55 100%);
    color: #f8fafc;
    border: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.news-card__comments-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
}

.news-card__comments-empty {
    border: 1px dashed rgba(248, 250, 252, 0.4);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    color: rgba(248, 250, 252, 0.85);
    font-size: 0.95rem;
    background: rgba(15, 23, 42, 0.35);
}

.news-card__comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.85rem;
}

.news-comment {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.9rem;
    align-items: flex-start;
    color: #1f2937;
    box-shadow: 0 12px 30px -18px rgba(15, 23, 42, 0.45);
}

.news-comment__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.news-comment__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-comment__avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.news-comment__content {
    display: grid;
    gap: 0.55rem;
}

.news-comment__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    font-size: 0.9rem;
    color: #64748b;
}

.news-comment__author {
    font-weight: 600;
    color: #0f172a;
}

.news-comment__time {
    white-space: nowrap;
    margin-left: auto;
}

.news-comment__edited {
    font-size: 0.85rem;
    color: #475569;
    font-style: italic;
    display: block;
}

.news-comment__edited.is-hidden {
    display: none;
}

.news-comment__body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #1f2937;
    word-break: break-word;
}

.news-comment__body p {
    margin: 0;
}

.news-comment__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.news-comment__actions.is-hidden {
    display: none;
}

.news-comment__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.news-comment__edit-textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    padding: 0.75rem 0.95rem;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.news-comment__edit-textarea:focus {
    outline: none;
    border-color: rgba(33, 82, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(33, 82, 255, 0.12);
}

.news-comment__edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.news-comment-form {
    display: grid;
    gap: 0.75rem;
}

.news-comment-form__textarea {
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
}

.news-comment-form__textarea:focus {
    outline: none;
    border-color: rgba(33, 82, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(33, 82, 255, 0.12);
}

.news-comment-form__actions {
    display: flex;
    justify-content: flex-end;
}

.news-comment-form--guest {
    display: flex;
    justify-content: flex-start;
}

.news-comment-form--guest .btn {
    border-radius: 999px;
}

.news-auth-tooltip {
    position: fixed;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.94);
    color: #ffffff;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    max-width: 260px;
    text-align: center;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.35);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.news-auth-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.news-auth-tooltip--below {
    transform: translateY(4px);
}

.news-auth-tooltip--below.is-visible {
    transform: translateY(0);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.news-actions {
    display: flex;
    justify-content: center;
}

.news-load-more {
    border-radius: 999px;
    padding-inline: 1.9rem;
    font-weight: 600;
}

.news-load-more.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.news-post-editor {
    width: min(720px, 92vw);
    padding: 1.75rem;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 30px 60px -24px rgba(15, 23, 42, 0.35);
    color: #0f172a;
}

.news-post-editor .form-label {
    font-weight: 600;
    color: #0f172a;
}

.news-post-editor textarea {
    min-height: 320px;
}

.news-post-editor__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.news-lightbox-container {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
}

.news-lightbox__stage {
    background: #0f172a;
    border-radius: 18px;
    padding: 0.75rem;
    max-width: min(86vw, 980px);
    max-height: 82vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-lightbox__content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-lightbox__nav {
    border: none;
    background: rgba(15, 23, 42, 0.65);
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.news-lightbox__nav:hover,
.news-lightbox__nav:focus-visible {
    background: rgba(33, 82, 255, 0.85);
    outline: none;
    transform: translateY(-1px);
}

.news-lightbox__nav.is-hidden {
    display: none;
}

.news-lightbox__nav[disabled] {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

.news-lightbox img,
.news-lightbox video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    display: block;
}

.news-lightbox video {
    background: #000;
}

@media (max-width: 992px) {
    .news-hero {
        padding: 2rem;
    }

    .news-form-wrapper {
        padding: 1.8rem;
    }

    .news-card {
        --news-card-padding-x: 1.6rem;
        --news-card-padding-y: 1.6rem;
        padding: var(--news-card-padding-y) var(--news-card-padding-x);
    }
}

@media (max-width: 768px) {
    .news-page {
        gap: 2rem;
    }

    .news-form__controls {
        flex-direction: column;
        align-items: stretch;
    }

    .news-form__upload,
    .news-form__submit {
        width: 100%;
        justify-content: center;
    }

    .news-card__header {
        gap: 1rem;
    }

    .news-card__gallery {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .news-card__gallery {
        --thumb-height: 240px;
    }

    .news-card__footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .news-card__reactions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .news-card__comments-indicator {
        justify-content: flex-start;
    }

    .news-lightbox-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .news-lightbox__nav {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 576px) {
    .news-hero {
        padding: 1.6rem;
    }

    .news-hero__title {
        font-size: 1.8rem;
    }

    .news-card {
        --news-card-padding-x: 1.4rem;
        --news-card-padding-y: 1.4rem;
        padding: var(--news-card-padding-y) var(--news-card-padding-x);
    }

    .news-card__header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .news-card__time {
        margin-left: 0;
        padding-top: 0;
    }

    .news-card__gallery {
        grid-template-columns: minmax(0, 1fr);
        --thumb-height: 220px;
    }

    .news-card__body,
    .news-card__comments {
        padding: 1.1rem;
        border-radius: 16px;
    }

    .news-comment-form__actions {
        justify-content: flex-start;
    }

    .news-comment-form__actions .btn {
        width: 100%;
    }

    .news-comment {
        grid-template-columns: 40px 1fr;
        gap: 0.65rem;
        padding: 0.75rem;
    }

    .news-comment__avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}
