/* Основной контейнер статьи на всю ширину */
.single-listing-container {
    width: 100%;
    padding: 24px 16px;
    box-sizing: border-box;
}

/* Шапка объявления */
.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.listing-title {
    font-size: 2rem;
    line-height: 1.25;
    margin: 0;
    color: #111827;
}

.listing-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #10b981;
    background: #ecfdf5;
    padding: 8px 18px;
    border-radius: 8px;
    white-space: nowrap;
}

/* Двухколоночный макет (Grid) */
.listing-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px; /* Контент занимает всё свободное место, сайдбар — 340px */
    gap: 32px;
    align-items: start;
}

/* Хлебные крошки */
.listing-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #6b7280;
}

.listing-breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.listing-breadcrumbs a:hover {
    color: var(--ast-global-color-0, #2563eb);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #9ca3af;
    user-select: none;
}

/* Блок медиа / Телеграм виджета / контента */
.listing-media-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.telegram-widget-container {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 350px;
}

.telegram-widget-container iframe {
    max-width: 100% !important;
    border-radius: 8px !important;
}

.listing-featured-image {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.listing-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.listing-body-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #374151;
}

/* Сайдбар */
.listing-sidebar {
    position: sticky;
    top: 24px; /* Липкий сайдбар при скролле */
}

.listing-author-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.listing-author-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.2rem;
    color: #111827;
}

.listing-author-action {
    margin-bottom: 16px;
}

.btn-author-link {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 12px 20px;
    background-color: var(--ast-global-color-0, #2563eb);
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.btn-author-link:hover {
    background-color: var(--ast-global-color-1, #1d4ed8);
    color: #ffffff;
}

.listing-no-author {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0;
}

.listing-source-info {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.listing-source-label {
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.listing-source-link {
    color: var(--ast-global-color-0, #2563eb);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
}

.listing-source-link:hover {
    text-decoration: underline;
}

/* Внешняя обертка навигации */
.single-listing-navigation-wrapper {
    width: 100%;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

/* Flex-контейнер для кнопок */
.listing-adjacent-nav {
    display: flex;
    justify-content: space-between; /* Раскидывает элементы по левому и правому краю */
    align-items: stretch;
    gap: 16px;
}

.adjacent-nav-item {
    flex: 1;
    max-width: 40%; /* Чтобы не перекрывали друг друга по центру */
}

.adjacent-nav-next .adjacent-nav-header {
    text-align: right;
    margin-left: auto; /* Если 'Предыдущего' нет, 'Следующее' всё равно прижмется вправо */
}

/* Стилизация ссылок */
.adjacent-nav-link {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    box-sizing: border-box;
}

.adjacent-nav-link:hover {
    border-color: var(--ast-global-color-0, #2563eb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.adjacent-nav-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 4px;
}

.adjacent-nav-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Троеточие, если название слишком длинное */
}

/* Адаптив для экранов смартфонов */
@media (max-width: 600px) {
    .listing-adjacent-nav {
        flex-direction: column;
        gap: 12px;
    }

    .adjacent-nav-item {
        max-width: 100%;
    }

    .adjacent-nav-next {
        text-align: left;
    }
}


/* Мобильный адаптив */
@media (max-width: 900px) {
    .listing-content-wrapper {
        grid-template-columns: 1fr; /* На экранах меньше 900px сайдбар уходит вниз */
        gap: 24px;
    }

    .listing-sidebar {
        position: static;
    }

    .listing-header {
        flex-direction: column;
        align-items: flex-start;
    }
}