/* Knowledge-base articles: single article and "Статьи" archive. */

.ml-article {
    --article-width: 720px;
    --article-wide: 960px;
    padding: 0 0 72px;
    background: var(--surface);
    color: var(--text);
}

.ml-article__narrow {
    width: min(var(--article-width), calc(100% - 2 * var(--page-gutter)));
    margin: 0 auto;
}

/* Hero: text and cover side by side on wide screens */

.ml-article__hero {
    width: min(var(--article-width), calc(100% - 2 * var(--page-gutter)));
    margin: 0 auto;
    padding: 48px 0 0;
}

.ml-article__hero.has-cover {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 56px;
    align-items: center;
    width: min(1240px, calc(100% - 2 * var(--page-gutter)));
    padding-bottom: 16px;
}

.ml-article__hero.has-cover .ml-article__title {
    font-size: clamp(30px, 3.2vw, 44px);
}

.ml-article__hero.has-cover .ml-article__lead {
    font-size: clamp(17px, 1.4vw, 19px);
}

.ml-article__hero.has-cover .ml-article__cover {
    width: auto;
    margin: 0;
}

.ml-article__crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ml-article__crumbs a {
    color: var(--accent);
    text-decoration: none;
}

.ml-article__crumbs span {
    color: var(--soft);
}

.ml-article__title {
    margin: 0;
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 900;
    line-height: 1.06;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.ml-article__lead {
    margin: 24px 0 0;
    color: #3f3a38;
    font-size: clamp(19px, 2.2vw, 22px);
    line-height: 1.55;
}

.ml-article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.ml-article__cover {
    width: min(var(--article-wide), calc(100% - 2 * var(--page-gutter)));
    margin: 40px auto 0;
}

.ml-article__cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 24px;
}

/* Table of contents */

.ml-article__toc {
    margin: 40px 0 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ml-article__toc summary {
    padding: 16px 0;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.ml-article__toc summary::-webkit-details-marker {
    display: none;
}

.ml-article__toc summary::after,
.ml-article__faq summary::after {
    content: "+";
    float: right;
    color: var(--accent);
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    transition: transform .2s;
}

.ml-article__toc[open] summary::after,
.ml-article__faq details[open] summary::after {
    transform: rotate(45deg);
}

.ml-article__toc ol {
    margin: 0 0 18px;
    padding-left: 22px;
    display: grid;
    gap: 8px;
}

.ml-article__toc a {
    color: var(--text);
    text-decoration: none;
}

.ml-article__toc a:hover {
    color: var(--accent);
}

/* Body typography */

.ml-article__body {
    margin-top: 40px;
    font-size: 19px;
    line-height: 1.75;
}

.ml-article__body > * {
    margin: 0 0 24px;
}

.ml-article__body h2 {
    margin: 56px 0 18px;
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -.025em;
    scroll-margin-top: 110px;
}

.ml-article__body > h2:first-child {
    margin-top: 0;
}

.ml-article__body h3 {
    margin: 32px 0 12px;
    font-size: 22px;
    line-height: 1.3;
}

.ml-article__body a {
    color: var(--accent);
    text-underline-offset: 3px;
}

.ml-article__body strong {
    font-weight: 800;
}

.ml-article__body ul,
.ml-article__body ol {
    padding-left: 24px;
}

.ml-article__body li + li {
    margin-top: 10px;
}

.ml-article__body ol li::marker {
    color: var(--accent);
    font-weight: 900;
}

/* Images break out of the text column a little. */
.ml-article__body > figure.wp-block-image,
.ml-article__body > .ml-pov {
    margin: 40px calc((min(var(--article-wide), 100vw - 2 * var(--page-gutter)) - 100%) / -2);
}

.ml-article__body img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 20px;
}

.ml-article__body figcaption {
    max-width: var(--article-width);
    margin: 12px auto 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
}

.ml-article__body .wp-block-table {
    margin: 32px 0;
    border: 0;
    overflow-x: auto;
}

.ml-article__body table {
    border: 0;
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
}

.ml-article__body .wp-block-table th,
.ml-article__body .wp-block-table td {
    padding: 14px 16px 14px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.ml-article__body .wp-block-table th {
    border-bottom: 2px solid var(--text);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ml-article__body td:first-child {
    font-weight: 800;
    white-space: nowrap;
}

/* Sections after the text */

.ml-article__section-title {
    margin: 0 0 24px;
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 900;
    letter-spacing: -.025em;
}

.ml-article__products {
    margin: 72px 0 0;
    padding: 56px 0;
    background: var(--bg);
}

.ml-article__products .mg-product-related__grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.ml-article__faq {
    margin-top: 64px;
    scroll-margin-top: 110px;
}

.ml-article__faq details {
    border-top: 1px solid var(--line);
}

.ml-article__faq details:last-child {
    border-bottom: 1px solid var(--line);
}

.ml-article__faq summary {
    padding: 20px 0;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    list-style: none;
}

.ml-article__faq summary::-webkit-details-marker {
    display: none;
}

.ml-article__faq details p {
    margin: 0 0 22px;
    color: #3f3a38;
    font-size: 17px;
    line-height: 1.7;
}

.ml-article__cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 64px;
    padding: 32px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent), var(--deep-red));
    color: #fff;
}

.ml-article__cta strong {
    display: block;
    font-size: 22px;
    line-height: 1.25;
}

.ml-article__cta p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, .8);
    font-size: 16px;
    line-height: 1.5;
}

.ml-article__cta-btn {
    flex: none;
    padding: 14px 22px;
    border-radius: 999px;
    background: #fff;
    color: var(--accent);
    font-weight: 900;
    text-decoration: none;
    transition: transform .2s;
}

.ml-article__cta-btn:hover {
    transform: translateY(-1px);
}

.ml-article__verified {
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.ml-article__related {
    margin-top: 72px;
}

/* Archive */

.ml-article-archive {
    padding: 40px 0 64px;
}

.ml-article-archive__head .ml-article__title {
    font-size: clamp(32px, 4.5vw, 48px);
}

.ml-article-archive__head p {
    max-width: 680px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.55;
}

.ml-article-archive__topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0 32px;
}

.ml-article-archive__topics a {
    padding: 9px 16px;
    border: 1px solid var(--line-2);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.ml-article-archive__topics a.is-active,
.ml-article-archive__topics a:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.ml-article-archive__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px 24px;
}

.ml-article-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.ml-article-card__thumb {
    display: block;
    overflow: hidden;
    border-radius: 18px;
    background: var(--bg);
}

.ml-article-card__thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform .3s;
}

.ml-article-card:hover .ml-article-card__thumb img {
    transform: scale(1.03);
}

.ml-article-card .ml-article__label {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ml-article-card__title {
    font-size: 20px;
    line-height: 1.3;
    letter-spacing: -.01em;
}

.ml-article-card:hover .ml-article-card__title {
    color: var(--accent);
}

.ml-article-card__text {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
}

@media (max-width: 960px) {
    .ml-article__hero,
    .ml-article__hero.has-cover {
        display: block;
        width: calc(100% - 2 * var(--page-gutter));
        padding-top: 28px;
        padding-bottom: 0;
    }

    .ml-article__hero.has-cover .ml-article__cover {
        margin-top: 28px;
    }

    .ml-article__cover {
        margin-top: 28px;
    }

    .ml-article__cover img,
    .ml-article__body img {
        border-radius: 16px;
    }

    .ml-article__body {
        font-size: 17px;
        line-height: 1.7;
    }

    .ml-article__body h2 {
        margin-top: 44px;
    }

    .ml-article__body .wp-block-table thead {
        display: none;
    }

    .ml-article__body .wp-block-table table,
    .ml-article__body .wp-block-table tbody,
    .ml-article__body .wp-block-table tr,
    .ml-article__body .wp-block-table td {
        display: block;
    }

    .ml-article__body .wp-block-table tr {
        padding: 18px 0;
        border-bottom: 1px solid var(--line);
    }

    .ml-article__body .wp-block-table tr:first-child {
        border-top: 2px solid var(--text);
    }

    .ml-article__body .wp-block-table td {
        padding: 4px 0;
        border: 0;
    }

    .ml-article__body .wp-block-table td:first-child {
        margin-bottom: 6px;
        font-size: 19px;
        white-space: normal;
    }

    .ml-article__body .wp-block-table td[data-label]:not(:first-child)::before {
        content: attr(data-label) ": ";
        color: var(--muted);
        font-weight: 700;
    }

    .ml-article__products {
        padding: 40px 0;
    }

    .ml-article__cta {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }
}

/* Inline product strip inside the article text */

.ml-article__body .ml-product-strip {
    margin: 32px calc((min(var(--article-wide), 100vw - 2 * var(--page-gutter)) - 100%) / -2);
    padding: 20px;
    border-radius: 20px;
    background: var(--bg);
}

.ml-product-strip__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    font-size: 15px;
    line-height: 1.3;
}

.ml-product-strip__head span {
    font-weight: 900;
}

.ml-product-strip__head a {
    flex: none;
    color: var(--accent);
    font-weight: 800;
    text-decoration: none;
}

.ml-product-strip__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding-bottom: 4px;
    contain: paint;
}

.ml-article__body .ml-product-strip__card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    scroll-snap-align: start;
    transition: box-shadow .2s;
}

.ml-product-strip__card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.ml-product-strip__img {
    display: grid;
    place-items: center;
    height: 110px;
    overflow: hidden;
}

.ml-article__body .ml-product-strip__img img {
    width: 100%;
    height: 100%;
    max-height: 110px;
    object-fit: contain;
    border-radius: 0;
}

.ml-product-strip__name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ml-product-strip__price {
    margin-top: auto;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
}

.ml-product-strip__price del {
    display: block;
    color: var(--soft);
    font-size: 12px;
    font-weight: 600;
}

.ml-product-strip__price ins {
    text-decoration: none;
}

@media (max-width: 960px) {
    .ml-article__body .ml-product-strip {
        margin-left: calc(-1 * var(--page-gutter));
        margin-right: calc(-1 * var(--page-gutter));
        padding: 16px var(--page-gutter);
        border-radius: 0;
    }

    .ml-product-strip__track {
        grid-auto-columns: 150px;
    }
}

/* "How to choose" list: situation → answer */

.ml-article__body .ml-checklist {
    margin: 24px 0 0;
    padding: 8px 24px;
    border-radius: 20px;
    background: var(--bg);
    list-style: none;
}

.ml-article__body .ml-checklist li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
    padding: 16px 0;
    font-size: 17px;
    line-height: 1.4;
}

.ml-article__body .ml-checklist li + li {
    border-top: 1px solid var(--line-2);
}

.ml-article__body .ml-checklist a {
    flex: none;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: background .2s;
}

.ml-article__body .ml-checklist a:hover {
    background: var(--accent-dark);
}

@media (max-width: 960px) {
    .ml-article__body .ml-checklist {
        padding: 4px 16px;
    }

    .ml-article__body .ml-checklist li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* "Camera view" comparison: a gallery with class ml-pov */

.ml-article__body .ml-pov {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 12px;
}

.ml-article__body .ml-pov > figure.wp-block-image {
    display: flex;
    flex-direction: column;
    width: auto !important;
    margin: 0;
}

.ml-article__body .ml-pov img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 14px;
}

.ml-article__body .ml-pov figcaption {
    position: static;
    margin: 10px 0 0;
    padding: 0;
    background: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    text-align: left;
}

.ml-article__body .ml-pov > figcaption.blocks-gallery-caption {
    grid-column: 1 / -1;
    margin: 4px auto 0;
    color: var(--muted);
    font-weight: 400;
    text-align: center;
}

@media (max-width: 700px) {
    .ml-article__body .ml-pov {
        grid-template-columns: minmax(0, 1fr);
    }
}
