/* Журнальное оформление статей блога (кодекс 3.147).
   Все классы с префиксом lf-, чтобы не пересекаться со стилями темы.
   Подключается из catalog/controller/blog/blog.php с версией в адресе — меняя файл, поднимайте ?v=. */

.lf-post,
.lf-gallery,
.lf-more {
    --lf-ink: #141414;
    --lf-text: #242424;
    --lf-muted: #74716c;
    --lf-line: #e7e5e1;
    --lf-soft: #f5f4f1;
    --lf-radius: 20px;
    color: var(--lf-ink);
}

/* ---------- Шапка статьи ---------- */

.lf-hero {
    display: grid;
    gap: 56px;
    align-items: center;
    margin: 0 0 64px;
}
.lf-hero--portrait {
    grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
}
.lf-hero--landscape,
.lf-hero--plain {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    text-align: center;
}
.lf-hero__text {
    max-width: 660px;
}
.lf-hero--landscape .lf-hero__text,
.lf-hero--plain .lf-hero__text {
    margin: 0 auto;
    max-width: 820px;
}
.lf-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--lf-muted);
    margin-bottom: 20px;
}
.lf-hero--landscape .lf-meta,
.lf-hero--plain .lf-meta,
.lf-hero--landscape .lf-author,
.lf-hero--plain .lf-author {
    justify-content: center;
}
.lf-meta a {
    color: var(--lf-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--lf-line);
    transition: border-color .2s ease;
}
.lf-meta a:hover {
    border-color: var(--lf-ink);
}
.lf-meta__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: .7;
}
.lf-hero__title {
    font-family: "Cera Pro", sans-serif;
    font-weight: 500;
    font-size: 46px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--lf-ink);
    margin: 0 0 22px;
    text-wrap: balance;
}
.lf-hero__lead {
    font-size: 19px;
    line-height: 1.6;
    color: var(--lf-text);
    margin: 0 0 32px;
}
.lf-author {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}
.lf-author__logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex: 0 0 44px;
    display: block;
}
.lf-author__name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}
.lf-author__role {
    font-size: 13px;
    line-height: 1.4;
    color: var(--lf-muted);
}
.lf-credits {
    display: grid;
    gap: 8px;
    margin: 28px 0 0;
    padding: 16px 20px;
    border: 1px solid var(--lf-line);
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}
.lf-credits > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}
.lf-credits dt {
    font-weight: 400;
    color: var(--lf-muted);
}
.lf-credits dd {
    margin: 0;
    text-align: right;
    word-break: break-word;
}
.lf-hero__cover {
    margin: 0;
    border-radius: 24px;
    overflow: hidden;
    background: var(--lf-soft);
}
.lf-hero--portrait .lf-hero__cover {
    aspect-ratio: 4 / 5;
}
.lf-hero--landscape .lf-hero__cover {
    aspect-ratio: 16 / 9;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}
.lf-hero__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Текст статьи ---------- */

.lf-body {
    max-width: 1040px;
    margin: 0 auto 72px;
}
.lf-toc {
    max-width: 720px;
    margin: 0 auto 48px;
    padding: 24px 28px;
    background: var(--lf-soft);
    border-radius: var(--lf-radius);
}
.lf-toc__title {
    font-family: "Cera Pro", sans-serif;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 14px;
}
.lf-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: lftoc;
    display: grid;
    gap: 10px;
}
.lf-toc li {
    counter-increment: lftoc;
    display: flex;
    gap: 14px;
    font-size: 15px;
    line-height: 1.45;
}
.lf-toc li::before {
    content: counter(lftoc, decimal-leading-zero);
    color: var(--lf-muted);
    font-variant-numeric: tabular-nums;
    min-width: 20px;
}
.lf-toc a {
    color: var(--lf-ink);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.lf-toc a:hover {
    border-color: var(--lf-ink);
}

/* Узкая колонка для чтения; фото парами, товары и призыв — шире колонки. */
.lf-article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(720px, 100%) minmax(0, 1fr);
    font-size: 17px;
    line-height: 1.7;
    color: var(--lf-text);
}
.lf-article > * {
    grid-column: 2;
    min-width: 0;
}
.lf-article > .lf-duo,
.lf-article > .lf-side,
.lf-article > .lf-products,
.lf-article > .lf-cta,
.lf-article > .lf-figure--wide {
    grid-column: 1 / -1;
}
.lf-article p {
    margin: 0 0 20px;
}
.lf-article p:empty {
    display: none;
}
.lf-article h2 {
    font-family: "Cera Pro", sans-serif;
    font-weight: 500;
    font-size: 30px;
    line-height: 1.2;
    color: var(--lf-ink);
    text-transform: none;
    margin: 56px 0 18px;
    scroll-margin-top: 110px;
}
.lf-article h3 {
    font-family: "Cera Pro", sans-serif;
    font-weight: 500;
    font-size: 22px;
    line-height: 1.3;
    color: var(--lf-ink);
    text-transform: none;
    margin: 36px 0 12px;
}
.lf-article > h2:first-child,
.lf-article > h3:first-child {
    margin-top: 0;
}
.lf-article ul,
.lf-article ol {
    margin: 0 0 22px;
    padding-left: 22px;
}
.lf-article li {
    margin: 0 0 8px;
    padding-left: 4px;
}
.lf-article li::marker {
    color: var(--lf-muted);
}
.lf-article a {
    color: var(--lf-ink);
    text-decoration: underline;
    text-decoration-color: #b9b5ae;
    text-underline-offset: 3px;
    transition: text-decoration-color .2s ease;
}
.lf-article a:hover {
    text-decoration-color: var(--lf-ink);
}
.lf-article b,
.lf-article strong {
    font-weight: 700;
    color: var(--lf-ink);
}
.lf-article blockquote {
    margin: 36px 0;
    padding: 28px 32px;
    border: 0;
    border-radius: var(--lf-radius);
    background: var(--lf-soft);
    font-family: "Cera Pro", sans-serif;
    font-size: 21px;
    line-height: 1.45;
    color: var(--lf-ink);
}
.lf-article blockquote p:last-child {
    margin-bottom: 0;
}
.lf-article hr {
    border: 0;
    height: 1px;
    background: var(--lf-line);
    margin: 48px 0;
}

/* Фото */
.lf-article figure {
    margin: 40px 0;
}
.lf-article img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: var(--lf-radius);
}
.lf-article > figure img,
.lf-article > p img {
    width: auto;
    max-height: 86vh;
    margin: 0 auto;
}
.lf-article figcaption {
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--lf-muted);
    text-align: center;
}
.lf-article figure a,
.lf-article p > a[data-fancybox] {
    display: block;
    text-decoration: none;
}
.lf-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 40px 0;
}
.lf-duo figure {
    margin: 0;
}
.lf-duo img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}
.lf-duo--wide img {
    aspect-ratio: 4 / 3;
}
.lf-side {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 48px;
    align-items: center;
    margin: 48px 0;
}
.lf-side figure {
    margin: 0;
}
.lf-side img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}
.lf-side__text p:last-child {
    margin-bottom: 0;
}
.lf-side__text h2:first-child,
.lf-side__text h3:first-child {
    margin-top: 0;
}

/* Таблицы */
.lf-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0 32px;
    font-size: 15px;
    line-height: 1.5;
}
.lf-article table td,
.lf-article table th {
    padding: 12px 12px 12px 0;
    border: 0;
    border-bottom: 1px solid var(--lf-line);
    text-align: left;
    vertical-align: top;
}
.lf-article table tr:first-child td,
.lf-article table th {
    font-weight: 600;
    color: var(--lf-ink);
}

/* ---------- Товары в тексте ---------- */

.lf-products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 340px));
    justify-content: center;
    gap: 14px;
    margin: 32px 0 44px;
}
.lf-pcard {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--lf-line);
    border-radius: 18px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.lf-pcard:hover {
    border-color: #cfccc6;
    box-shadow: 0 8px 28px rgba(20, 20, 20, .07);
}
.lf-pcard__img {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f3f3;
}
.lf-article .lf-pcard__img img,
.lf-pcard__img img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
    mix-blend-mode: multiply;
}
.lf-pcard__body {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}
.lf-pcard__brand {
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--lf-muted);
    margin-bottom: 3px;
}
.lf-article .lf-pcard__name,
.lf-pcard__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    color: var(--lf-ink);
    text-decoration: none;
}
.lf-pcard__name::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
.lf-pcard__price {
    margin-top: 5px;
    font-size: 16px;
    font-weight: 600;
    color: var(--lf-ink);
    white-space: nowrap;
}
.lf-pcard__old {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 400;
    color: var(--lf-muted);
    text-decoration: line-through;
}
.lf-pcard__stock {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
}
.lf-pcard__stock::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2fb45a;
}
.lf-pcard__cart {
    position: relative;
    z-index: 2;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f1f1f1;
    color: var(--lf-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .2s ease;
}
.lf-pcard__cart:hover {
    background: #e4e4e4;
}

/* Подборка товаров сеткой */
.lf-products--grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    justify-content: stretch;
    gap: 28px 16px;
}
.lf-products--grid .lf-pcard {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 0;
    border: 0;
    box-shadow: none;
}
.lf-products--grid .lf-pcard__img {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 16px;
}
.lf-products--grid .lf-pcard__name {
    font-size: 15px;
}
.lf-products--grid .lf-pcard__price {
    font-size: 18px;
}
.lf-products--grid .lf-pcard__cart {
    flex: none;
    width: 100%;
    height: 42px;
    margin-top: auto;
    border-radius: 600px;
    font-family: Manrope, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ---------- Призыв «Обсудить проект» ---------- */

.lf-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 48px;
    align-items: center;
    margin: 48px 0;
    padding: 40px 48px;
    border-radius: 24px;
    background: #1c1b19;
    color: #fff;
}
.lf-cta p {
    grid-column: 1;
    margin: 0;
}
.lf-article .lf-cta__title {
    font-family: "Cera Pro", sans-serif;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.2;
    color: #fff;
}
.lf-article .lf-cta__text {
    font-size: 16px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .72);
}
.lf-article .lf-cta__action {
    grid-column: 2;
    grid-row: 1 / span 2;
}
.lf-article .lf-cta__btn {
    display: inline-flex;
    align-items: center;
    padding: 16px 28px;
    border-radius: 600px;
    background: #fff;
    color: var(--lf-ink);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color .2s ease;
}
.lf-article .lf-cta__btn:hover {
    background: #ecebe8;
}

/* ---------- Карусель, «Использовалась мебель», «Читайте также» ---------- */

.lf-section-title {
    color: #141414;
    font-family: "Cera Pro", sans-serif;
    font-weight: 500;
    font-size: 30px;
    line-height: 1.2;
    text-transform: none;
    margin: 0 0 24px;
}
.lf-gallery {
    margin: 0 0 72px;
}
.lf-gallery .blog-gallery__slide {
    width: auto;
    height: 520px;
    border-radius: var(--lf-radius);
    overflow: hidden;
    background: var(--lf-soft);
}
.lf-gallery .blog-gallery__slide a,
.lf-gallery .blog-gallery__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lf-gallery .swiper-button-prev,
.lf-gallery .swiper-button-next {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--lf-ink);
}
.lf-gallery .swiper-button-prev::after,
.lf-gallery .swiper-button-next::after {
    font-size: 16px;
    font-weight: 700;
}
.lf-gallery .swiper-button-disabled {
    opacity: 0;
}
.lf-more {
    margin: 16px 0 80px;
    padding-top: 48px;
    border-top: 1px solid var(--lf-line);
}
.lf-more__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}
.lf-more__all {
    font-size: 15px;
    font-weight: 600;
    color: var(--lf-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.lf-more__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.lf-more__card {
    display: block;
    color: var(--lf-ink);
    text-decoration: none;
}
.lf-more__card:hover {
    color: var(--lf-ink);
    text-decoration: none;
}
.lf-more__img {
    aspect-ratio: 4 / 5;
    margin-bottom: 16px;
    border-radius: var(--lf-radius);
    overflow: hidden;
    background: var(--lf-soft);
}
.lf-more__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.lf-more__card:hover .lf-more__img img {
    transform: scale(1.03);
}
.lf-more__meta {
    font-size: 13px;
    color: var(--lf-muted);
    margin-bottom: 6px;
}
.lf-more__title {
    font-family: "Cera Pro", sans-serif;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.3;
}

/* ---------- Планшет и телефон ---------- */

@media (max-width: 1199px) {
    .lf-hero__title { font-size: 38px; }
    .lf-hero--portrait { gap: 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); }
}
@media (max-width: 991px) {
    .lf-hero--portrait { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .lf-hero__text { max-width: none; }
    .lf-hero--portrait .lf-hero__cover { max-width: 560px; width: 100%; }
    .lf-more__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lf-more__card:nth-child(3) { display: none; }
}
@media (max-width: 767px) {
    .lf-hero { margin-bottom: 40px; }
    .lf-hero__title { font-size: 30px; margin-bottom: 16px; }
    .lf-hero__lead { font-size: 17px; margin-bottom: 24px; }
    .lf-meta { font-size: 13px; margin-bottom: 14px; }
    .lf-hero__cover { border-radius: 18px; }
    .lf-body { margin-bottom: 48px; }
    .lf-toc { padding: 20px; margin-bottom: 36px; border-radius: 16px; }
    .lf-article { font-size: 16px; line-height: 1.65; }
    .lf-article h2 { font-size: 24px; margin: 40px 0 14px; scroll-margin-top: 80px; }
    .lf-article h3 { font-size: 19px; margin: 28px 0 10px; }
    .lf-article blockquote { padding: 22px; font-size: 18px; margin: 28px 0; border-radius: 16px; }
    .lf-article figure { margin: 28px 0; }
    .lf-article img { border-radius: 14px; }
    .lf-duo { gap: 10px; margin: 28px 0; }
    .lf-side { grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 32px 0; }
    .lf-products { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .lf-products--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 10px; }
    .lf-products--grid .lf-pcard__cart { height: 38px; font-size: 12px; }
    .lf-cta { grid-template-columns: minmax(0, 1fr); padding: 28px 24px; border-radius: 18px; margin: 36px 0; }
    .lf-article .lf-cta__title { font-size: 22px; }
    .lf-article .lf-cta__action { grid-column: 1; grid-row: auto; margin-top: 12px; }
    .lf-article .lf-cta__btn { width: 100%; justify-content: center; }
    .lf-section-title { font-size: 24px; margin-bottom: 18px; }
    .lf-gallery { margin-bottom: 48px; }
    .lf-gallery .blog-gallery__slide { height: 380px; border-radius: 14px; }
    .lf-gallery .swiper-button-prev,
    .lf-gallery .swiper-button-next { display: none; }
    .lf-more { padding-top: 36px; margin-bottom: 56px; }
    .lf-more__grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .lf-more__card { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 16px; align-items: center; }
    .lf-more__card:nth-child(3) { display: grid; }
    .lf-more__img { margin: 0; border-radius: 14px; }
    .lf-more__title { font-size: 17px; }
}
