/* ============================================================================
   Журнал ПБИ — дополнение к Bootstrap 5 и /pbi_style.css

   Порядок: bootstrap.min.css -> pbi_style.css -> pbi_journal.css.
   Основные отступы, цвета, карточки и сетки — через Bootstrap-классы в PHP.
   Здесь остаются только редакционная типографика, специальные сетки и медиа.
   Правила ограничены областью Журнала, не меняют остальные страницы ПБИ.
   ============================================================================ */

/* 1. Общая ширина и типографика --------------------------------------------- */
.journal-page {
    --journal-ink: var(--bs-body-color, #212529);
    --journal-muted: var(--bs-secondary-color, #6c757d);
    --journal-border: var(--bs-border-color, #dee2e6);
    --journal-background: #F6F5F2;
    color: var(--journal-ink);
    font-size: .9375rem;
    line-height: 1.55;
}

.journal-page .j-serif,
.journal-page .jp-serif {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    line-height: 1.16;
    letter-spacing: -.032em;
}

/* Журнальные ссылки в заголовках не подчёркиваются при наведении. */
.journal-page .j-hero-primary h2 a:hover,
.journal-page .j-story h3 a:hover,
.journal-page .arc-story h2 a:hover,
.journal-page .jp-related a:hover {
    text-decoration: none;
}

/* 2. Общая шапка и хлебные крошки ------------------------------------------- */
.pj-head {line-height: 1.55;}
.pj-kicker {
    font-size: .6875rem;
    line-height: 1.3;
    letter-spacing: .08em;
}
.pj-title {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: clamp(2.2rem, 4vw, 3.1875rem);
    line-height: 1.16;
    letter-spacing: -.032em;
}
.pj-head a.link-dark {text-decoration: none;}
.pj-head .pj-title a:hover {text-decoration: none;}
.pj-head .pj-subscribe {align-self: flex-end; padding-bottom: .25rem;}
.pj-head .pj-subscribe:hover,
.pj-head .pj-menu a:hover {text-decoration: underline; text-underline-offset: 3px;}
.pj-menu {white-space: nowrap; scrollbar-width: none;}
.pj-menu::-webkit-scrollbar {display: none;}
.pj-menu a {font-size: .8125rem; text-decoration: none;}
.pj-arrow,
.j-arrow,
.jn-arrow {font-family: Arial, Helvetica, sans-serif; color: inherit;}
.pj-crumbs {min-width: 0; line-height: 1.5;}
.pj-crumbs .text-truncate {min-width: 0; max-width: 100%;}
.pj-crumbs a.link-dark {text-decoration: none;}
.pj-crumbs a.link-dark:hover {text-decoration: underline; text-underline-offset: 3px;}

/* 3. Единый нижний блок подписки -------------------------------------------- */
.pbij-newsletter {color: var(--bs-body-color);}
.pbij-newsletter .jn-kicker {
    font-size: .6875rem;
    letter-spacing: .09em;
}
.pbij-newsletter h2 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 400;
    line-height: 1.16;
    letter-spacing: -.035em;
    margin-bottom: 1rem;
}
.pbij-newsletter .jn-description {font-size: .875rem; color: var(--bs-secondary-color); line-height: 1.6; margin-bottom: 0;}
.pbij-newsletter .jn-action small {font-size: .6875rem;}
.pbij-newsletter .jn-button {text-decoration: none;}

/* 4. Главная Журнала -------------------------------------------------------- */
.pbij a.link-dark {color: var(--journal-ink); text-decoration: none;}
.pbij a.link-dark:hover {text-decoration: underline; text-underline-offset: 3px;}
.pbij .j-hero-primary h2 a.link-dark:hover {text-decoration: none;}
.pbij .j-meta {
    font-size: .6875rem;
    letter-spacing: .05em;
    line-height: 1.5;
    margin-bottom: .75rem;
}
.pbij .j-meta span + span::before {content: "·"; padding-right: .5rem;}
.pbij .j-hero-primary h2 {font-size: clamp(2.25rem, 4vw, 3.375rem); margin-bottom: 1.25rem;}
.pbij .j-hero-primary > p {font-size: 1rem; line-height: 1.7; color: var(--bs-secondary-color); margin-bottom: 1rem;}
.pbij .j-text-link {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    padding-bottom: .25rem;
    border-bottom: 1px solid transparent;
}
.pbij .j-text-link:hover {text-decoration: none !important; border-bottom-color: currentColor;}
.pbij .j-hero-media {max-width: 650px; margin: 1.2rem 0;}
.pbij .j-hero-media a,
.pbij .j-hero-media img {display: block; width: 100%;}
.pbij .j-hero-media img {max-height: 365px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--bs-border-radius-sm);}

.pbij .j-side-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding-bottom: .8rem;
    border-bottom: 2px solid var(--journal-ink);
    margin-bottom: 1rem;
}
.pbij .j-teaser {padding-bottom: 1.125rem; margin-bottom: 1.125rem; border-bottom: 1px solid var(--journal-border);}
.pbij .j-teaser:last-child {border-bottom: 0; margin-bottom: 0; padding-bottom: 0;}
.pbij .j-teaser h3 {font-size: 1.4375rem; margin-bottom: 0;}

.pbij .j-subscribe-mini h2 {font-size: 1.375rem; margin: 0 0 .25rem;}
.pbij .j-subscribe-mini p {font-size: .8125rem; color: var(--bs-secondary-color); margin: 0;}
.pbij .j-mini-link {display: inline-flex; align-items: center; gap: .5rem; flex-shrink: 0; white-space: nowrap;}

.pbij .j-sectionhead {border-bottom: 2px solid var(--journal-ink);}
.pbij .j-sectionhead h2 {font-size: 1.5625rem; font-weight: 700; letter-spacing: -.035em; margin: 0;}
.pbij .j-update {
    display: grid;
    grid-template-columns: 3.625rem minmax(0, 1fr);
    gap: .75rem;
    border-bottom: 1px solid var(--journal-border);
    padding: .875rem 0;
}
.pbij .j-update:first-child {padding-top: 0;}
.pbij .j-update:last-child {border-bottom: 0; padding-bottom: 0;}
.pbij .j-update time {font-size: .75rem; color: var(--bs-secondary-color);}
.pbij .j-update p {font-size: .875rem; line-height: 1.5; margin: 0;}
.pbij .j-update a {display: inline-block; font-size: .75rem; margin-top: .3rem;}
.pbij .j-popular {
    display: grid;
    grid-template-columns: 2.125rem minmax(0, 1fr);
    gap: .75rem;
    border-bottom: 1px solid var(--journal-border);
    padding: .625rem 0 .8125rem;
}
.pbij .j-popular:first-child {padding-top: 0;}
.pbij .j-popular:last-child {border-bottom: 0; padding-bottom: 0;}
.pbij .j-popular-num {font-family: Georgia, serif; font-size: 1.5625rem; color: var(--bs-secondary-color);}
.pbij .j-popular h3 {font-size: 1.1875rem; margin: .2rem 0 0;}
.pbij .j-kicker {font-size: .6875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bs-secondary-color); font-weight: 600; margin-bottom: .5rem;}

/* Только сетка карточки: на мобильном изображение находится между заголовком и интро. */
.pbij .j-story {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "lead" "intro";
    column-gap: 1.5rem;
}
.pbij .j-story-with-image {
    grid-template-columns: minmax(0, 1fr) 230px;
    grid-template-areas: "lead media" "intro media";
}
.pbij .j-story-lead {grid-area: lead; min-width: 0;}
.pbij .j-story-intro {grid-area: intro; font-size: .875rem; color: var(--bs-secondary-color); line-height: 1.6; margin: 0;}
.pbij .j-story-media {grid-area: media; align-self: center; overflow: hidden;}
.pbij .j-story-media img {display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--journal-border); border-radius: var(--bs-border-radius-sm);}
.pbij .j-story h3 {font-size: 1.75rem; margin-bottom: .5rem;}
.pbij .j-story:last-of-type {border-bottom: 0 !important;}
.pbij .j-empty {font-size: .875rem; color: var(--bs-secondary-color);}

/* 5. Архив ------------------------------------------------------------------ */
.pbij-archive a.link-dark {color: inherit; text-decoration: none;}
.pbij-archive a.link-dark:hover {text-decoration: underline;}
.pbij-archive .arc-story h2 a.link-dark:hover {text-decoration: none;}
.pbij-archive .arc-panel h1 {font: 400 clamp(2.1rem, 4vw, 3rem)/1.16 Georgia, serif; margin: .5rem 0 1rem;}
.pbij-archive .arc-menu {
    background: var(--journal-background);
    border-radius: var(--bs-border-radius-xl) 0 var(--bs-border-radius-xl) 0;
}
.pbij-archive .arc-story {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "lead" "intro";
    column-gap: 1.5rem;
}
.pbij-archive .arc-story-with-image {
    grid-template-columns: minmax(0, 1fr) 230px;
    grid-template-areas: "lead media" "intro media";
}
.pbij-archive .arc-story-lead {grid-area: lead; min-width: 0;}
.pbij-archive .arc-story h2 {font: 400 1.6875rem/1.22 Georgia, serif; margin: .375rem 0 .5rem;}
.pbij-archive .arc-meta {font-size: .6875rem; letter-spacing: .04em;}
.pbij-archive .arc-story-intro {grid-area: intro; font-size: .875rem; color: var(--bs-secondary-color); margin: 0;}
.pbij-archive .arc-story:last-child {border-bottom: none !important;}
.pbij-archive .arc-story-media {grid-area: media; align-self: center; overflow: hidden;}
.pbij-archive .arc-story-media img {display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; border: 1px solid var(--journal-border); border-radius: var(--bs-border-radius-sm);}
.pbij-archive .arc-more {margin-top: 1.75rem;}

/* 6. Отдельная статья ------------------------------------------------------- */
.pbij-post {line-height: 1.65;}
.pbij-post a.link-dark {color: var(--journal-ink);}
/* Позиции article/sidebar/ad/related нужны для мобильного порядка элементов. */
.pbij-post .jp-flow {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(265px, 1fr);
    grid-template-areas: "article sidebar" "ad ad" "related related";
    column-gap: 1.25rem;
    row-gap: 1.125rem;
}
.pbij-post .jp-article {grid-area: article; min-width: 0; align-self: start;}
.pbij-post .jp-sidebar {grid-area: sidebar; align-self: start; min-width: 0; display: flex; flex-direction: column;}
.pbij-post .jp-ad-after {grid-area: ad;}
.pbij-post .jp-related {grid-area: related;}
.pbij-post .jp-meta {font-size: .6875rem; color: var(--bs-secondary-color); letter-spacing: .07em; text-transform: uppercase; margin-bottom: .8125rem; line-height: 1.5;}
.pbij-post .jp-article h1 {font-size: clamp(2.125rem, 3.5vw, 3.0625rem); margin-bottom: 1.25rem;}
.pbij-post .jp-intro {font-size: 1.125rem; line-height: 1.63; color: var(--bs-secondary-color); margin-bottom: 1rem;}
.pbij-post .jp-date {font-size: .75rem; color: var(--bs-secondary-color); margin-bottom: 1.875rem;}
.pbij-post .jp-article-body {font-size: 1rem; line-height: 1.78; overflow-wrap: break-word; min-width: 0;}
.pbij-post .jp-article-body h3 {font: 400 1.8125rem/1.22 Georgia, serif; letter-spacing: -.025em; margin: 2.625rem 0 1.1875rem;}
.pbij-post .jp-article-body h4 {font-size: 1.3125rem; font-weight: 600; margin: 1.9375rem 0 .9375rem;}
.pbij-post .jp-article-body p {margin-bottom: 1.1875rem;}
.pbij-post .jp-article-body ul,
.pbij-post .jp-article-body ol {margin-bottom: 1.25rem;}
.pbij-post .jp-article-body table {font-size: .875rem; line-height: 1.5;}
.pbij-post .jp-article-body img {max-width: 100%; height: auto;}
.pbij-post .jp-article-body a.link-dark {text-decoration: underline; text-underline-offset: 2px;}
.pbij-post .jp-share a {text-decoration: none;}
.pbij-post .jp-module {min-width: 0; overflow: hidden;}
.pbij-post .jp-module h3 {font-size: 1.0625rem; font-weight: 600; line-height: 1.34; margin-bottom: .75rem;}
.pbij-post .jp-module p {font-size: .8125rem; color: var(--bs-secondary-color); margin-bottom: .6875rem;}
.pbij-post .jp-module a {font-size: .8125rem;}
.pbij-post .jp-linkitem {display: block; padding: .55rem 0; border-bottom: 1px solid var(--journal-border); text-decoration: none;}
.pbij-post .jp-linkitem:last-of-type {border-bottom: 0;}
.pbij-post .jp-review-module {overflow: hidden; padding: .5rem;}
.pbij-post .jp-review-module .review-embed-qa-block {border: 0 !important;}
.pbij-post .jp-review-module .card-body {background: #fff;}
.pbij-post .jp-review-module h2 {font-size: 1rem !important;}

.pbij-post .jp-related h2 {font-size: 1.6875rem; font-weight: 700; margin-bottom: 1rem;}
.pbij-post .jp-related-feature {display: grid; grid-template-columns: minmax(0,1fr) 200px; gap: 1.5rem; align-items: center;}
.pbij-post .jp-related-feature:not(:has(.jp-related-photo)) {grid-template-columns: minmax(0,1fr);}
.pbij-post .jp-related-feature h3 {font-size: 1.625rem; margin: .25rem 0 .5rem;}
.pbij-post .jp-related-feature p {font-size: .875rem; color: var(--bs-secondary-color); line-height: 1.58; margin: 0;}
.pbij-post .jp-related-photo {display: block; width: 200px; max-width: 100%;}
.pbij-post .jp-related-photo img {width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--bs-border-radius-sm);}
.pbij-post .jp-related a.link-dark,
.pbij-post .jp-related a.link-dark:hover {text-decoration: none;}
.pbij-post .jp-smallgrid {grid-template-columns: repeat(3, minmax(0, 1fr));}
.pbij-post .jp-smallcard {min-height: 163px;}
.pbij-post .jp-smallcard h3 {font: 400 1.1875rem/1.22 Georgia, serif; margin: .75rem 0 0;}
.pbij-post .jp-smallcard a {display: block; height: 100%;}

/* Компактный Q&A использует штатные PHP-функции сайта. */
.pbij-post .pbi-qa-journal h3 {font-size: 1.0625rem; font-weight: 600; margin-bottom: .75rem;}
.pbij-post .pbi-qa-journal-item {display: block; padding: .8125rem 0; border-bottom: 1px solid var(--journal-border); text-decoration: none;}
.pbij-post .pbi-qa-journal-item:last-child {border-bottom: 0;}
.pbij-post .pbi-qa-journal-title {display: block; font-size: .875rem; font-weight: 500;}
.pbij-post .pbi-qa-journal-meta {display: block; font-size: .6875rem; color: var(--bs-secondary-color); margin-top: .3rem;}
.pbij-post .pbi-qa-journal-all {display: inline-block; margin-top: .75rem; font-size: .75rem;}
.pbij-post .pbi-qa-journal-empty {font-size: .8125rem; color: var(--bs-secondary-color);}

/* Галерея отдельна от стандартной Bootstrap-карусели. */
.pbij-post .pbi-gallery {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin: 1.25rem 0;}
.pbij-post .pbi-gallery img {display: block; width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--bs-border-radius-sm); cursor: zoom-in;}
.pbij-post .pbi-gallery:has(>img:nth-child(3):last-child)>img:first-child {grid-row: span 2; aspect-ratio: auto;}
.pbij-post .pbi-gallery:has(>img:only-child) {grid-template-columns: 1fr;}
.pbij-post .pbi-gallery:has(>img:only-child)>img {aspect-ratio: auto; height: auto; max-height: 570px; object-fit: contain;}
.pbij-lightbox {position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; padding: 1.5rem; cursor: zoom-out;}
.pbij-lightbox.is-open {display: flex;}
.pbij-lightbox img {max-width: 100%; max-height: calc(100dvh - 3rem); object-fit: contain;}

/* 7. Адаптивность: только места, где Bootstrap-сетки недостаточно ------------ */
@media (max-width: 1100px) and (min-width: 901px) {
    .pbij .j-story-with-image, .pbij-archive .arc-story-with-image {
        grid-template-columns: minmax(0, 1fr) 195px;
    }
}
@media (max-width: 991.98px) {
    /* Сайдбар под статьёй в содержательном порядке на мобильных/планшетах. */
    .pbij-post .jp-flow {display: flex; flex-direction: column;}
    .pbij-post .jp-article {order: 1; width: 100%;}
    .pbij-post .jp-sidebar {display: contents;}
    .pbij-post .jp-context {order: 2;}
    .pbij-post .jp-reviews {order: 3;}
    .pbij-post .jp-qa {order: 4;}
    .pbij-post .jp-ad-after {order: 5;}
    .pbij-post .jp-related {order: 6; width: 100%;}
    .pbij-post .jp-signup {order: 7;}
    .pbij-post .jp-offers {order: 8;}
    .pbij-post .jp-channels {order: 9;}
    .pbij-post .jp-ad-side {order: 10;}
}
@media (max-width: 900px) {
    .pbij .j-story-with-image, .pbij-archive .arc-story-with-image {
        grid-template-columns: minmax(0,1fr);
        grid-template-areas: "lead" "media" "intro";
    }
    .pbij .j-story-media, .pbij-archive .arc-story-media {
        justify-self: center;
        width: 70%; max-width: 420px;
        margin: 1rem auto;
    }
    .pbij .j-hero-media {margin-inline: auto;}
}
@media (max-width: 767.98px) {
    .pj-head .pj-row {align-items: flex-start !important;}
    .pj-head .pj-title {font-size: 2.1875rem;}
    .pj-crumbs {gap: .4rem !important;}
    .pbij .j-hero-primary h2 {font-size: 2.125rem;}
    .pbij .j-hero-media {width: 88%;}
    .pbij .j-teaser h3 {font-size: 1.375rem;}
    .pbij .j-story h3 {font-size: 1.375rem;}
    .pbij .j-subscribe-mini h2 {font-size: 1.1875rem;}
    .pbij-archive .arc-story h2 {font-size: 1.375rem;}
    .pbij-post .jp-article h1 {font-size: clamp(1.9375rem, 8.5vw, 2.5625rem);}
    .pbij-post .jp-intro {font-size: 1rem;}
    .pbij-post .jp-related-feature {grid-template-columns: 1fr;}
    .pbij-post .jp-related-photo {justify-self: center; width: 70%; max-width: 360px;}
    .pbij-post .jp-smallgrid {grid-template-columns: repeat(2,minmax(0,1fr));}
    .pbij-newsletter .jn-action {align-items: flex-start !important;}
}
@media (max-width: 430px) {
    .pbij-post .jp-smallcard {min-height: 125px;}
    .pbij-post .jp-smallcard h3 {font-size: 1rem;}
    .pbij-post .pbi-gallery {gap: .3125rem;}
}


/* Галерея ПБИ: раскладки строк 1 / 2 / 3 / 4 фото; максимум 10 в блоке. */
.pbij-post .jp-article-body .pbi-gallery {display:flex;flex-direction:column;gap:8px;margin:24px 0;}
.pbij-post .jp-article-body .pbi-gallery__row {display:grid;gap:8px;min-width:0;}
.pbij-post .jp-article-body .pbi-gallery__row--1 {grid-template-columns:1fr;}
.pbij-post .jp-article-body .pbi-gallery__row--2 {grid-template-columns:repeat(2,minmax(0,1fr));}
.pbij-post .jp-article-body .pbi-gallery__row--3 {grid-template-columns:repeat(3,minmax(0,1fr));}
.pbij-post .jp-article-body .pbi-gallery__row--4 {grid-template-columns:repeat(4,minmax(0,1fr));}
.pbij-post .jp-article-body .pbi-gallery__item {display:block;position:relative;overflow:hidden;border-radius:5px;cursor:zoom-in;}
.pbij-post .jp-article-body .pbi-gallery__row .pbi-gallery__item img {display:block;width:100%;height:100%;max-height:none;aspect-ratio:4/3;object-fit:cover;object-position: center center;border-radius:0;}
.pbij-post .jp-article-body .pbi-gallery__row--1 .pbi-gallery__item img {
    max-height: 510px;
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center center;
    background: #fff;
}
.pbij-post .jp-article-body .pbi-gallery__row--2 .pbi-gallery__item img {aspect-ratio:5/3;}
@media(max-width:575.98px) {
    .pbij-post .jp-article-body .pbi-gallery,
    .pbij-post .jp-article-body .pbi-gallery__row {
        gap:5px;
    }
    .pbij-post .jp-article-body .pbi-gallery__row--1 .pbi-gallery__item img {
        max-height:320px;
    }
}
/* Расширенный просмотр; существующий .pbij-lightbox сохраняем. */
.pbij-lightbox .pbij-lightbox-nav {position:absolute;top:50%;transform:translateY(-50%);border:0;background:rgba(255,255,255,.14);color:white;font-size:28px;padding:8px 14px;cursor:pointer;border-radius:5px;}
.pbij-lightbox .pbij-lightbox-prev {left:10px;}.pbij-lightbox .pbij-lightbox-next {right:10px;}
.pbij-lightbox .pbij-lightbox-close {position:absolute;right:16px;top:12px;border:0;background:none;color:white;font-size:30px;cursor:pointer;}
.pbij-lightbox .pbij-lightbox-count {position:absolute;bottom:15px;left:50%;transform:translateX(-50%);font-size:13px;color:white;}

/* Главная публикация: снимок занимает всю ширину левой колонки. */
.pbij.journal-page .j-hero-media {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    overflow: hidden;
    border-radius: 5px;
}
.pbij.journal-page .j-hero-media a {
    display: block;
    width: 100%;
}
.pbij.journal-page .j-hero-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 380px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
}

/* Последние публикации на главной: обложка заполняет высоту текста. */
.pbij.journal-page .j-story.j-story-with-image {
    align-items: stretch;
}
.pbij.journal-page .j-story.j-story-with-image .j-story-media {
    position: relative;
    display: block;
    align-self: stretch;
    width: 100%;
    height: auto;
    min-height: 150px;
    max-width: none;
    overflow: hidden;
    border-radius: 5px;
}
.pbij.journal-page .j-story.j-story-with-image .j-story-media img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center center;
    border: 0;
    border-radius: 0;
}

/* Превью под статьёй в блоке связанных публикаций. */
.pbij-post .jp-related-feature {
    align-items: stretch;
}
.pbij-post .jp-related-feature .jp-related-photo {
    position: relative;
    align-self: stretch;
    display: block;
    width: 100%;
    height: auto;
    min-height: 150px;
    max-width: none;
    overflow: hidden;
    border-radius: 5px;
}
.pbij-post .jp-related-feature .jp-related-photo img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center center;
    border-radius: 0;
}

@media (max-width: 900px) {
    /* Отдельная строка: полная ширина, контролируемая высота с обрезкой. */
    .pbij.journal-page .j-story.j-story-with-image .j-story-media {
        justify-self: stretch;
        align-self: stretch;
        width: 100%;
        max-width: none;
        height: clamp(190px, 52vw, 340px);
        min-height: 0;
        margin: 16px 0;
    }
}
@media (max-width: 767.98px) {
    .pbij-post .jp-related-feature .jp-related-photo {
        justify-self: stretch;
        align-self: stretch;
        width: 100%;
        max-width: none;
        height: clamp(190px, 52vw, 340px);
        min-height: 0;
        margin-top: 14px;
    }
}

/* Открытая галерея: отдать горизонтальное движение обработчику свайпов. */
.pbij-lightbox,
.pbij-lightbox img {
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}
.pbij-lightbox img {
    -webkit-user-drag: none;
}

.pbij-archive .arc-story.arc-story-with-image {
    align-items: stretch;
}
.pbij-archive .arc-story.arc-story-with-image .arc-story-media {
    position: relative;
    display: block;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    height: auto;
    min-height: 150px;
    max-width: none;
    overflow: hidden;
    border-radius: 5px;
}
.pbij-archive .arc-story.arc-story-with-image .arc-story-media img {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center center;
    border: 0;
    border-radius: 0;
}
@media (max-width: 900px) {
    .pbij-archive .arc-story.arc-story-with-image .arc-story-media {
        width: 100%;
        max-width: none;
        height: clamp(190px, 52vw, 340px);
        min-height: 0;
        margin: 16px 0;
        align-self: stretch;
    }
}

/* Убираем нижний отступ у галереи с подписью */
.pbij-post .jp-article-body .pbi-gallery--captioned {
    margin-bottom: 0;
}

.article-disclaimer {
    border-top: 1px solid #e7e7e7;
    border-bottom: 1px solid #e7e7e7;
    margin: 10px 0 20px;
    padding: 12px 0;
    font-size: 11px;
    color: #85888a;
    line-height: 1.55;
}