/* ============================================================
   Vue Counter / News — Shared Styles
   ============================================================ */




.counter-panel p { font-size: 18px; margin-bottom: 16px; }
.counter-panel button,
.base-btn {
    padding: 8px 16px;
    margin-right: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}
.counter-panel button:hover,
.base-btn:hover { background: #f2f2f2; }

/* ============================================================
   News Grid — cards with images
   ============================================================ */

.news-lister-wrapper {
    margin-bottom: 40px;
}

.news-lister-wrapper h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.news-lister {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.news-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.news-card__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f5f5f5;
    overflow: hidden;
}

.news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.news-card:hover .news-card__image img {
    transform: scale(1.04);
}

.news-card__image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.news-card__body {
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
    flex: 1;
}

.news-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.news-card__descr {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__date {
    font-size: 13px;
    color: #999;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .news-lister { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .news-lister-wrapper h1 { font-size: 26px; }
}


/* --- News Admin --- */
.news-admin { padding: 20px 0; }
.news-admin h2 { font-size: 24px; margin-bottom: 20px; }

.news-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin-bottom: 30px;
    padding: 16px;
    background: #f7f7f7;
    border-radius: 8px;
}
.news-form input,
.news-form textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.news-form textarea { min-height: 80px; resize: vertical; }
.news-form button {
    align-self: flex-start;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    background: #e30613;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}
.news-form button:hover { background: #c00511; }

.news-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.news-table th,
.news-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e3e3e3;
    font-size: 14px;
}
.news-table th { background: #f7f7f7; font-weight: 600; }
.news-table tr:hover { background: #fafafa; }
.news-table button {
    padding: 4px 8px;
    margin-right: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}
.news-table button:hover { background: #f2f2f2; }

.loading { padding: 20px; color: #888; }
.error {
    padding: 20px;
    color: #d00;
    background: #ffecec;
    border-radius: 4px;
}

/* ============================================================
   News Detail Page
   ============================================================ */

.news-detail {
    padding: 20px;
    max-width: 1470px;
    margin: 0 auto;
}

.news-detail__breadcrumb {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
}
.news-detail__breadcrumb a {
    color: #888;
    text-decoration: none;
}
.news-detail__breadcrumb a:hover {
    color: #e30613;
}

.news-detail__layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.news-detail__main {
    min-width: 0;
}

.news-detail__title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
    color: #1a1a1a;
}

.news-detail__date {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.news-detail__image {
    margin: 0 0 28px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}
.news-detail__image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.news-detail__content {
    font-size: 16px;
    line-height: 1.65;
    color: #333;
}
.news-detail__content p {
    margin: 0 0 16px;
}
.news-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}
.news-detail__content h2,
.news-detail__content h3 {
    margin: 24px 0 12px;
    color: #1a1a1a;
}
.news-detail__content ul,
.news-detail__content ol {
    padding-left: 22px;
    margin: 0 0 16px;
}
.news-detail__content a {
    color: #e30613;
    text-decoration: underline;
}

.news-detail__back {
    display: inline-block;
    margin-top: 32px;
    color: #e30613;
    text-decoration: none;
    font-weight: 600;
}
.news-detail__back:hover {
    text-decoration: underline;
}

/* --- Sidebar --- */
.news-detail__sidebar {
    position: sticky;
    top: 20px;
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
}
.news-detail__sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #1a1a1a;
}
.news-detail__sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.news-detail__sidebar-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.news-detail__sidebar-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.news-detail__sidebar-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.15s;
}
.news-detail__sidebar-list a:hover {
    color: #e30613;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .news-detail__layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .news-detail__sidebar {
        position: static;
    }
    .news-detail__title { font-size: 24px; }
}


/* ============================================================
   News Detail Page
   ============================================================ */

.news-detail {
    padding: 20px;
    max-width: 1470px;
    margin: 0 auto;
}

.news-detail__breadcrumb {
    font-size: 14px;
    color: #888;
    margin-bottom: 24px;
}
.news-detail__breadcrumb a {
    color: #888;
    text-decoration: none;
}
.news-detail__breadcrumb a:hover {
    color: #e30613;
}

.news-detail__layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.news-detail__main {
    min-width: 0;
}

.news-detail__title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
    color: #1a1a1a;
}

.news-detail__date {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.news-detail__image {
    margin: 0 0 28px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
}
.news-detail__image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.news-detail__content {
    font-size: 16px;
    line-height: 1.65;
    color: #333;
}
.news-detail__content p {
    margin: 0 0 16px;
}
.news-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}
.news-detail__content h2,
.news-detail__content h3 {
    margin: 24px 0 12px;
    color: #1a1a1a;
}
.news-detail__content ul,
.news-detail__content ol {
    padding-left: 22px;
    margin: 0 0 16px;
}
.news-detail__content a {
    color: #e30613;
    text-decoration: underline;
}

.news-detail__back {
    display: inline-block;
    margin-top: 32px;
    color: #e30613;
    text-decoration: none;
    font-weight: 600;
}
.news-detail__back:hover {
    text-decoration: underline;
}

/* --- Sidebar --- */
.news-detail__sidebar {
    position: sticky;
    top: 20px;
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
}
.news-detail__sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #1a1a1a;
}
.news-detail__sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.news-detail__sidebar-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}
.news-detail__sidebar-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.news-detail__sidebar-list a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.15s;
}
.news-detail__sidebar-list a:hover {
    color: #e30613;
}

/* --- Responsive --- */
@media (max-width: 991px) {
    .news-detail__layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .news-detail__sidebar {
        position: static;
    }
    .news-detail__title { font-size: 24px; }
}


/* ============================================================
   AppImage + Skeleton loading
   ============================================================ */

.app-image {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

.app-image__skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: app-shimmer 1.4s ease-in-out infinite;
}

@keyframes app-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.app-image__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.app-image__img--loaded { opacity: 1; }

.app-image__error {
    position: absolute;
    inset: 0;
    background: #f0f0f0;
}

/* Card skeleton */
.news-card--skeleton {
    pointer-events: none;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: app-shimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}
.skeleton-line--title { height: 18px; width: 85%; }
.skeleton-line--short { width: 55%; }
.skeleton-line--date  { width: 40%; height: 12px; }

/* Detail page skeleton */
.news-detail__image-skeleton {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: app-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px;
    margin: 20px 0 28px;
}

.news-detail__hero {
    margin-bottom: 25px;
    border-radius: 6px;
    overflow: hidden;
}

/* --- AppImage fit variants --- */
.app-image--contain {
    background: transparent;
}
.app-image--contain .app-image__img {
    object-fit: contain;
    height: auto;
    max-height: 720px;
}

.app-image--cover .app-image__img {
    object-fit: cover;
}

/* Detail hero: natural height, no crop */
.news-detail__hero {
    margin-bottom: 25px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}
.news-detail__hero .app-image__img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   Link styling override — remove underlines inside Vue app
   ============================================================ */


/* Hover: subtle underline only where it helps */

/* --- Links inside article content (v-html) --- */
.news-detail__content a,
.news-detail__content a:visited {
    color: #ee1c24;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.news-detail__content a:hover {
    color: #bd0e2c;
    text-decoration: none;
}

/* --- Remove any inherited borders that look like underlines --- */
.news-card * {
    border-bottom: none;
}
.news-card__date {
    border-bottom: none;
    border-top: 1px solid #f0f0f0;
}

/* ============================================================
   Admin panel + Modal
   ============================================================ */

.news-admin { padding: 20px 0; }

.news-admin__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.news-admin__header h2 {
    font-size: 24px;
    margin: 0;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-primary {
    background: #e30613;
    color: #fff;
}
.btn-primary:hover { background: #c00511; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: #eee;
    color: #333;
}
.btn-secondary:hover { background: #ddd; }

.news-table__actions button {
    padding: 6px 10px;
    font-size: 16px;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    z-index: 9999;
    overflow-y: auto;
}

.modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}
.modal__header h3 {
    margin: 0;
    font-size: 20px;
}

.modal__close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 6px;
}
.modal__close:hover { color: #000; }

.modal__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* --- Form rows --- */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-row > span {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row textarea {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}
.form-row input:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #e30613;
}
.form-row textarea {
    resize: vertical;
    min-height: 70px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row--inline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.form-row--inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.form-preview {
    max-width: 200px;
    max-height: 120px;
    border-radius: 6px;
    margin-top: 6px;
    object-fit: cover;
}

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .modal { max-width: 100%; }
}

/* ============================================================
   News Admin Modal (Teleported to body)
   ============================================================ */

.news-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    z-index: 999999;
    overflow-y: auto;
}

.news-modal {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: auto 0;
}

.news-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}
.news-modal__header h3 {
    margin: 0;
    font-size: 20px;
}

.news-modal__close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 6px;
}
.news-modal__close:hover { color: #000; }

.news-modal__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
}

.news-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* Ensure Bitrix admin toolbar doesn't block */
.news-modal-overlay { z-index: 999999 !important; }

/* ============================================================
   Card image: contain fit + neutral backdrop
   ============================================================ */

.news-card__image {
    position: relative;
    width: 100%;
    background: #f7f7f7;
    border-bottom: 1px solid #f0f0f0;
    overflow: hidden;
}

.news-card__image .app-image {
    background: #f7f7f7;
}

.news-card__image .app-image--contain .app-image__img {
    object-fit: contain;
    object-position: center center;
    width: 100%;
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* Slightly larger pad on mobile so tiny images stay readable */

/* ============================================================
   Natural-aspect image cards
   ============================================================ */

.news-card__image {
    position: relative;
    width: 100%;
    background: #f0f0f0;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

/* Image fills its container which matches its own ratio — zero crop */
.news-card__image .app-image {
    width: 100%;
}
.news-card__image .app-image__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Uniform text body height so cards end up aligned */
.news-card__body {
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
    flex: 1;
    min-height: 140px;
}

.news-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}

.news-card__descr {
    font-size: 14px;
    line-height: 1.5;
    color: #666;
    margin: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

/* ============================================================
   Card image — natural aspect, no crop, no max-height
   ============================================================ */

.news-card__image {
    position: relative;
    width: 100%;
    background: #f0f0f0;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    /* Kill any inherited max-height on descendants */
    max-height: none !important;
}

.news-card__image .app-image {
    width: 100%;
    max-height: none !important;
}

.news-card__image .app-image__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    max-height: none !important;
}

/* Uniform text area so cards still align nicely */
.news-card__body {
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
    flex: 1;
    min-height: 130px;
}

/* ============================================================
   Drag & drop image zones
   ============================================================ */

.drop-zone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: #fafafa;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.drop-zone:hover {
    border-color: #999;
    background: #f5f5f5;
}

.drop-zone--active {
    border-color: #e30613;
    background: #fff0f1;
}

.drop-zone--filled {
    border-style: solid;
    border-color: #e3e3e3;
    background: #fff;
    padding: 8px;
}

.drop-zone__hint {
    text-align: center;
    color: #777;
    font-size: 13px;
    line-height: 1.5;
    pointer-events: none;
}

.drop-zone__hint small {
    color: #aaa;
    font-size: 12px;
}

.drop-zone__icon {
    font-size: 28px;
    margin-bottom: 6px;
    opacity: 0.5;
}

.drop-zone__preview {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    pointer-events: none;
}

.drop-zone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-zone__clear {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.drop-zone__clear:hover {
    background: #e30613;
}

.uploading-note {
    color: #e30613;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 8px;
}

/* ============================================================
   Icon buttons (edit / delete)
   ============================================================ */

.news-table__actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
    background: #fff;
    color: #555;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    box-sizing: border-box;
}

.icon-btn svg {
    display: block;
    pointer-events: none;
}

.icon-btn:hover {
    border-color: #ccc;
    background: #f7f7f7;
}

.icon-btn:active {
    transform: scale(0.96);
}

.icon-btn--edit:hover {
    color: #0066cc;
    border-color: #0066cc;
    background: #f0f6ff;
}

.icon-btn--delete:hover {
    color: #e30613;
    border-color: #e30613;
    background: #fff0f1;
}

/* ============================================================
   App navigation — sits right after the Bitrix breadcrumb
   ============================================================ */


/* The nav is visually attached to the page top,
   with reduced top padding so it sits near the breadcrumb */




/* On mobile: full-width tabs */

/* ============================================================
   App nav — плотно под breadcrumb, выровнен по левому краю
   ============================================================ */


/* Сдвигаем nav вверх — вплотную к breadcrumb */

/* Первая ссылка без левого padding — выравнивается по левому краю breadcrumb */





/* Заголовок страницы — меньше отступа от nav */
.news-lister-wrapper {
    margin-top: 0;
}
.news-lister-wrapper h1 {
    margin-top: 0;
}

/* ============================================================
   Vue app root — passthrough, Bitrix .container управляет padding
   ============================================================ */


/* Обёртка для страниц — просто контейнер без доп. padding */

/* ============================================================
   Nav — табы в стиле сайта, выровнены с breadcrumb
   ============================================================ */







/* ============================================================
   Vue app — прозрачный контейнер, сливается с Bitrix-разметкой
   ============================================================ */

/* Корень Vue не создаёт собственный контейнер.
   Он живёт внутри Bitrix .container, поэтому убираем padding/margin. */
.app-root {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: "Roboto Condensed", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Контент страницы — без обёрток */
.app-content {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* ============================================================
   Nav — табы, прижаты к breadcrumb, выровнены по левому краю
   ============================================================ */

.app-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 0 24px;
    padding: 0;
    border-bottom: 1px solid #e3e3e3;
    /* Страховка: если Bitrix добавляет margin сверху на breadcrumb */
    position: relative;
}

.app-nav a {
    display: inline-block;
    padding: 10px 16px 8px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

/* Первая ссылка без левого padding — идеальное выравнивание с breadcrumb */
.app-nav a:first-child {
    padding-left: 0;
}

.app-nav a:hover {
    color: #e30613;
}

.app-nav a.router-link-active {
    color: #1a1a1a;
    border-bottom-color: #e30613;
}

/* ============================================================
   Сдвиг вверх — вплотную к breadcrumb
   Если Bitrix .bx_breadcrumbs имеет margin-bottom, компенсируем
   ============================================================ */

.bx_breadcrumbs + .app-root .app-nav,
.bx_breadcrumbs ~ .app-root .app-nav {
    margin-top: -12px;
}

/* Но если breadcrumb внутри .container, а app-root тоже там —
   тогда оба на одном уровне, ничего компенсировать не нужно */
.container > .bx_breadcrumbs + * > .app-root > .app-nav {
    margin-top: 0;
}

/* ============================================================
   Мобильная версия
   ============================================================ */

@media (max-width: 550px) {
    .app-nav {
        margin: 0 0 20px;
    }
    .app-nav a {
        flex: 1;
        text-align: center;
        padding: 10px 8px 8px;
        font-size: 14px;
    }
    .app-nav a:first-child {
        padding-left: 8px;
    }
}

/* ============================================================
   News detail content — редакторский HTML
   ============================================================ */

.news-detail__content {
    font-size: 16px;
    line-height: 1.65;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.news-detail__content p {
    margin: 0 0 16px;
}

.news-detail__content br {
    line-height: 1.65;
}

.news-detail__content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: #1a1a1a;
    line-height: 1.3;
}

.news-detail__content h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: #1a1a1a;
}

.news-detail__content ul,
.news-detail__content ol {
    padding-left: 22px;
    margin: 0 0 16px;
}

.news-detail__content li {
    margin-bottom: 8px;
}

.news-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    display: block;
}

.news-detail__content a {
    color: #e30613;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.news-detail__content a:hover {
    color: #bd0e2c;
}

.news-detail__content strong {
    font-weight: 700;
}

/* ============================================================
   Sidebar header — пробелы между "Акции" и "Все акции"
   ============================================================ */

.sidebar-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-header > span {
    font-size: 18px;
    color: #000;
    font-weight: 500;
}

.sidebar-header > a {
    font-size: 15px;
    color: #e30613;
    text-decoration: none;
    white-space: nowrap;
}

.sidebar-header > a:hover {
    color: #bd0e2c;
    text-decoration: underline;
}

/* ============================================================
   News detail content — финальные стили
   ============================================================ */

.news-detail__content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.news-detail__content p {
    margin: 0 0 16px;
}

.news-detail__content br {
    display: inline;
    line-height: 1.7;
}

/* Убираем двойной пробел от <br><br> */
.news-detail__content br + br {
    display: none;
}

.news-detail__content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: #1a1a1a;
    line-height: 1.3;
}

.news-detail__content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: #1a1a1a;
}

.news-detail__content ul,
.news-detail__content ol {
    padding-left: 24px;
    margin: 0 0 20px;
}

.news-detail__content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.news-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

.news-detail__content a {
    color: #e30613;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
    transition: color 0.15s;
}

.news-detail__content a:hover {
    color: #bd0e2c;
    text-decoration: none;
}

.news-detail__content strong {
    font-weight: 700;
    color: #1a1a1a;
}

/* Защита от больших пустот от <br> */
.news-detail__content > br:first-child,
.news-detail__content > br:last-child {
    display: none;
}

/* ============================================================
   Hero image — ограничиваем высоту
   ============================================================ */

.news-detail__hero .app-image {
    max-height: 600px;
}

.news-detail__hero .app-image__img {
    max-height: 600px;
    object-fit: contain;
}

/* ============================================================
   Sidebar — пробелы между элементами
   ============================================================ */

.sidebar-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid #ebebeb;
}

.sidebar-header > span {
    font-size: 18px;
    color: #000;
    font-weight: 600;
}

.sidebar-header > a {
    font-size: 15px;
    color: #e30613;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.sidebar-header > a:hover {
    color: #bd0e2c;
    text-decoration: underline;
}

/* ============================================================
   AppImage contain — серый фон как в админке
   ============================================================ */

.app-image--contain {
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ebebeb;
}

.app-image--contain .app-image__img {
    /* Картинка на сером фоне — сохраняем пропорции */
    object-fit: contain;
    object-position: center center;
}

/* В детальной статье: hero — тот же серый фон */
.news-detail__hero {
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ebebeb;
}

.news-detail__hero .app-image--contain {
    border: none;
    border-radius: 8px;
}

/* Скелетон тоже на сером фоне — не белый */
.app-image--contain .app-image__skeleton {
    background: linear-gradient(90deg, #ebebeb 0%, #e0e0e0 50%, #ebebeb 100%);
    background-size: 200% 100%;
}

/* Тёмный вариант для админ-модалки (если нужен контраст) */
.news-modal .app-image--contain {
    background: #f5f5f5;
}

/* ============================================================
   News detail content — финальные стили (жёсткое сжатие)
   ============================================================ */

.news-detail__content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.news-detail__content > *:first-child {
    margin-top: 0;
}

.news-detail__content p {
    margin: 0 0 16px;
}

.news-detail__content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 32px 0 16px;
    color: #1a1a1a;
    line-height: 1.3;
}

.news-detail__content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 24px 0 12px;
    color: #1a1a1a;
}

.news-detail__content ul,
.news-detail__content ol {
    padding-left: 24px;
    margin: 0 0 20px;
}

.news-detail__content ol {
    list-style: decimal;
}

.news-detail__content ul {
    list-style: disc;
}

.news-detail__content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.news-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    display: block;
}

.news-detail__content a {
    color: #e30613;
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
    transition: color 0.15s;
}

.news-detail__content a:hover {
    color: #bd0e2c;
    text-decoration: none;
}

.news-detail__content strong {
    font-weight: 700;
    color: #1a1a1a;
}

/* Жёстко скрываем одиночные <br> после блок-элементов (страховка) */
.news-detail__content h2 + br,
.news-detail__content h3 + br,
.news-detail__content p + br,
.news-detail__content ol + br,
.news-detail__content ul + br {
    display: none;
}

.news-detail__content br + br {
    display: none;
}

/* ============================================================
   Hero image (contain) — серый фон
   ============================================================ */

.news-detail__hero {
    margin-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #ebebeb;
}

.news-detail__hero .app-image--contain {
    background: #f5f5f5;
    border: none;
}

/* ============================================================
   Sidebar links — убрать подчёркивание
   ============================================================ */

.sidebar-news a,
.sidebar-news a:visited,
.sidebar-header a,
.sidebar-header a:visited {
    text-decoration: none;
}

.sidebar-news a:hover span {
    color: #e30613;
    text-decoration: underline;
}

/* ============================================================
   Content — сжатие пустот (только визуально, без правки HTML)
   ============================================================ */

.news-detail__content br + br + br {
    display: none;
}

.news-detail__content br + br {
    display: none;
}

.news-detail__content > br:first-child,
.news-detail__content > br:last-child {
    display: none;
}

/* Убедиться что <br> в конце параграфа не раздувает отступы */
.news-detail__content p br:last-child {
    display: none;
}

/* Hero — серый фон */
.news-detail__hero {
    background: #f5f5f5;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
}

.news-detail__hero .app-image--contain {
    background: #f5f5f5;
    border: none;
}
