/*
 * Гид по этикеткам: страница со списком материалов и шаблон статьи.
 * Подключается только на страницах гида — лендинг эти стили не тянет.
 */

.dl-guide,
.dl-article-page {
    padding-bottom: 60px;
}

.dl-guide__intro,
.dl-guide__groups {
    width: calc(100% - 48px);
    max-width: 1232px;
    margin: 0 auto;
}

/* Статья: контейнер шире текстовой колонки. Сам текст остаётся узким —
   при 18px это ~70 знаков в строке, комфортная норма чтения, — а схемы,
   карточки и таблицы выходят на всю ширину и заполняют полосу. */
.dl-breadcrumbs,
.dl-article,
.dl-article__footer {
    width: calc(100% - 48px);
    max-width: 1040px;
    margin: 0 auto;
}

.dl-article__body > p,
.dl-article__body > h2,
.dl-article__body > h3,
.dl-article__body > ul:not(.dl-checklist),
.dl-article__body > ol:not(.dl-steps),
.dl-article__header {
    max-width: 860px;
}

/* ШАПКА СТРАНИЦЫ ГИДА */

.dl-guide__intro {
    padding: 32px 0 28px;
}

.dl-guide__title {
    font-size: 32px;
    font-weight: 600;
    line-height: 1.3;
    color: #333333;
    text-transform: uppercase;
}

.dl-guide__subtitle {
    max-width: 780px;
    margin-top: 12px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: #6a6a6a;
}

/* ТРИ ТЕМАТИЧЕСКИЕ ГРУППЫ */

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

/* Растягиваем колонки до одной высоты: строка карточек должна
   заканчиваться ровно, даже если заголовки разной длины. */
.dl-group {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border-radius: 16px;
    background: #ffffff;
}

.dl-group__title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #241f1f;
    text-transform: uppercase;
}

.dl-group__text {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #6a6a6a;
}

/* Карточки тянутся на всю оставшуюся высоту колонки: так три группы
   заканчиваются на одной линии и ряд выглядит ровным. */
.dl-cards {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
    list-style: none;
}

.dl-cards__item {
    display: flex;
    flex: 1 1 0;
    list-style: none;
}

.dl-cards__item > .dl-card {
    flex: 1 1 auto;
}

/* КАРТОЧКА СТАТЬИ */

.dl-card {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 44px;
    padding: 10px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #ffffff;
    transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}

a.dl-card:hover,
a.dl-card:focus-visible {
    border-color: #ce1a30;
    background: #fffafa;
}

a.dl-card:focus-visible {
    outline: 2px solid #ce1a30;
    outline-offset: 2px;
}

.dl-card__media {
    flex: 0 0 auto;
}

.dl-card__icon {
    display: block;
    width: 56px;
    height: 56px;
}

.dl-card__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dl-card__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #333333;
}

a.dl-card:hover .dl-card__title {
    color: #ce1a30;
}

.dl-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: #8a8a8a;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.dl-card--soon {
    opacity: 0.55;
    cursor: default;
}

/* ХЛЕБНЫЕ КРОШКИ */

.dl-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 24px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #8a8a8a;
}

.dl-breadcrumbs__link {
    color: #6a6a6a;
    border-bottom: 1px solid #d9d9d9;
}

.dl-breadcrumbs__link:hover {
    color: #ce1a30;
    border-bottom-color: #ce1a30;
}

.dl-breadcrumbs__sep {
    color: #d9d9d9;
}

/* На странице гида крошки идут по ширине карточек, а не текстовой колонки. */
.dl-guide .dl-breadcrumbs {
    max-width: 1232px;
    padding-bottom: 4px;
}

/* НИЖНИЙ ЭКРАН С ФОРМОЙ */

.dl-guide .mini__form-block {
    margin-top: 56px;
}

/* Памятка «Важно перед расчётом»: на лендинге она набрана тем же кеглем,
   что и подзаголовок, и перетягивает на себя внимание. Здесь — мелким
   и приглушённым, как сноска рядом с формой. */
.dl-form__note {
    max-width: 435px;
    margin-top: 22px;
    font-size: 14px;
    line-height: 1.55;
    color: #6a6a6a;
}

.dl-form__note strong,
.dl-form__note b {
    font-weight: 600;
    color: #333333;
}

.dl-form__note p {
    margin-bottom: 8px;
}

.dl-form__note p:last-child {
    margin-bottom: 0;
}

.dl-form__note ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
}

.dl-form__note li {
    position: relative;
    padding-left: 18px;
}

.dl-form__note li::before {
    position: absolute;
    top: 9px;
    left: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d9d9d9;
    content: "";
}

/* СТАТЬЯ */

.dl-article {
    display: flex;
    flex-direction: column;
}

.dl-article__header {
    padding: 24px 0 8px;
}

.dl-article__title {
    font-size: 34px;
    font-weight: 600;
    line-height: 1.25;
    color: #241f1f;
}

.dl-article__meta {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: #8a8a8a;
}

.dl-article__body {
    padding-top: 18px;
    font-size: 18px;
    line-height: 1.65;
    color: #333333;
}

.dl-article__body > p {
    margin-bottom: 18px;
}

.dl-article__body h2 {
    margin: 38px 0 14px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: #241f1f;
}

.dl-article__body h3 {
    margin: 26px 0 10px;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
    color: #241f1f;
}

.dl-article__body ul,
.dl-article__body ol {
    margin: 0 0 18px;
    padding-left: 0;
    list-style: none;
}

.dl-article__body ul > li,
.dl-article__body ol > li {
    position: relative;
    margin-bottom: 9px;
    padding-left: 26px;
}

.dl-article__body ul > li::before {
    position: absolute;
    top: 11px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ce1a30;
    content: "";
}

.dl-article__body ol {
    counter-reset: dl-ol;
}

.dl-article__body ol > li {
    counter-increment: dl-ol;
    padding-left: 32px;
}

.dl-article__body ol > li::before {
    position: absolute;
    top: 0;
    left: 0;
    font-weight: 600;
    color: #ce1a30;
    content: counter(dl-ol) ".";
}

.dl-article__body b,
.dl-article__body strong {
    font-weight: 600;
    color: #241f1f;
}

/* НУМЕРОВАННЫЕ КАРТОЧКИ */

.dl-article__body .dl-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
    counter-reset: dl-step;
}

.dl-article__body .dl-steps > li {
    counter-increment: dl-step;
    margin: 0;
    padding: 18px 18px 18px 58px;
    border-radius: 14px;
    background: #ffffff;
}

.dl-article__body .dl-steps > li::before {
    position: absolute;
    top: 16px;
    left: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f3f1f1;
    font-size: 14px;
    font-weight: 600;
    color: #ce1a30;
    content: counter(dl-step);
}

.dl-article__body .dl-steps__title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: #241f1f;
}

.dl-steps p {
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.55;
    color: #4a4a4a;
}

.dl-steps p:last-child {
    margin-bottom: 0;
}

.dl-article__body .dl-steps ul {
    margin: 8px 0 0;
}

.dl-article__body .dl-steps ul > li {
    margin-bottom: 5px;
    padding-left: 18px;
    font-size: 15px;
    line-height: 1.5;
    background: none;
}

.dl-article__body .dl-steps ul > li::before {
    top: 9px;
    left: 2px;
    width: 5px;
    height: 5px;
    background: #d9d9d9;
    content: "";
}

/* ПОЛОСА ЦВЕТОВ */

.dl-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
}

.dl-palette__chip {
    display: flex;
    flex: 1 1 96px;
    flex-direction: column;
    gap: 6px;
}

.dl-palette__swatch {
    display: block;
    height: 46px;
    border: 1px solid rgba(36, 31, 31, 0.12);
    border-radius: 8px;
}

.dl-palette__name {
    font-size: 13px;
    line-height: 1.35;
    color: #6a6a6a;
}

/* ТАЙМЛАЙН ЭТАПОВ */

.dl-article__body .dl-timeline {
    position: relative;
    margin: 0 0 26px;
    padding: 0 0 0 46px;
    list-style: none;
    counter-reset: dl-stage;
}

.dl-article__body .dl-timeline::before {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 15px;
    width: 2px;
    background: #e6e6e6;
    content: "";
}

.dl-article__body .dl-timeline > li {
    counter-increment: dl-stage;
    position: relative;
    margin: 0 0 18px;
    padding: 0;
}

.dl-article__body .dl-timeline > li::before {
    position: absolute;
    top: 0;
    left: -46px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #ce1a30;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    content: counter(dl-stage);
}

.dl-timeline__title {
    margin-bottom: 4px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    color: #241f1f;
}

.dl-timeline__term {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 20px;
    background: #f3f1f1;
    font-size: 13px;
    font-weight: 600;
    color: #ce1a30;
    vertical-align: 2px;
}

.dl-article__body .dl-timeline p {
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #4a4a4a;
}

/* ТАБЛИЦА */

.dl-table-wrap {
    margin: 0 0 24px;
    overflow-x: auto;
}

.dl-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 14px;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
}

.dl-table th,
.dl-table td {
    padding: 13px 16px;
    text-align: left;
    vertical-align: top;
}

.dl-table thead th {
    background: #241f1f;
    font-weight: 600;
    color: #ffffff;
}

.dl-table tbody tr + tr td {
    border-top: 1px solid #ececec;
}

/* ЧЕК-ЛИСТ */

.dl-article__body .dl-checklist {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.dl-article__body .dl-checklist > li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-height: 44px;
    margin-bottom: 6px;
    padding: 11px 16px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dl-article__body .dl-checklist > li::before {
    display: none;
}

.dl-checklist__box {
    position: relative;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    border: 2px solid #d9d9d9;
    border-radius: 5px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dl-checklist__box::after {
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg);
    transition: opacity 0.2s ease;
    content: "";
}

.dl-checklist > li.is-checked {
    border-color: #ce1a30;
    background: #fffafa;
}

.dl-checklist > li.is-checked .dl-checklist__box {
    border-color: #ce1a30;
    background: #ce1a30;
}

.dl-checklist > li.is-checked .dl-checklist__box::after {
    opacity: 1;
}

.dl-checklist > li.is-checked .dl-checklist__label {
    color: #8a8a8a;
}

.dl-checklist > li:focus-visible {
    outline: 2px solid #ce1a30;
    outline-offset: 2px;
}

.dl-checklist__progress {
    margin: 0 0 24px;
    font-size: 14px;
    font-weight: 500;
    color: #6a6a6a;
}

/* ЗАМЕТКИ */

.dl-note,
.dl-warn {
    margin: 0 0 24px;
    padding: 16px 20px;
    border-left: 3px solid #00457c;
    border-radius: 0 12px 12px 0;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.6;
}

.dl-warn {
    border-left-color: #ce1a30;
}

.dl-note__title,
.dl-warn__title {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #00457c;
}

.dl-warn__title {
    color: #ce1a30;
}

.dl-article__body .dl-note p:last-child,
.dl-article__body .dl-warn p:last-child {
    margin-bottom: 0;
}

/* СХЕМЫ */

.dl-figure {
    margin: 0 0 26px;
    padding: 20px;
    border-radius: 16px;
    background: #ffffff;
}

.dl-figure__svg {
    display: block;
    width: 100%;
    height: auto;
}

.dl-figure__caption {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    color: #8a8a8a;
}

/* ПРИЗЫВ К ДЕЙСТВИЮ */

.dl-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 26px;
    padding: 26px 28px;
    border-radius: 16px;
    background: #241f1f;
}

.dl-cta--final {
    max-width: 100%;
    margin-top: 34px;
}

.dl-cta__text {
    flex: 1 1 320px;
}

.dl-cta__title {
    margin-bottom: 6px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
}

.dl-cta__subtitle {
    margin-bottom: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #b8b8b8;
}

.dl-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.dl-cta__secondary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 12px 26px;
    border: 1px solid #6a6a6a;
    border-radius: 90px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.dl-cta__secondary:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* ЧИТАЙТЕ ТАКЖЕ */

.dl-related {
    margin-top: 40px;
}

.dl-related__title {
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
    color: #241f1f;
}

.dl-related__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    list-style: none;
}

.dl-related__item {
    list-style: none;
}

.dl-article__back {
    margin-top: 24px;
}

/* Возврат к гиду — отдельная плашка во всю ширину: под ней уже ничего нет,
   и обычная текстовая ссылка в этом месте выглядела потерянной. */
.dl-article__back-link {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 12px 24px;
    border: 1px solid #dcdcdc;
    border-radius: 14px;
    background: #ffffff;
    font-size: 15px;
    font-weight: 600;
    color: #333333;
    transition: border-color 0.25s ease, color 0.25s ease;
}

.dl-article__back-link::before {
    font-size: 18px;
    line-height: 1;
    color: #ce1a30;
    content: "←";
}

.dl-article__back-link:hover {
    border-color: #ce1a30;
    color: #ce1a30;
}

/* АДАПТИВ */

@media screen and (max-width: 1279px) {
    .dl-group {
        padding: 20px;
    }

    .dl-card__icon {
        width: 48px;
        height: 48px;
    }

    .dl-card__title {
        font-size: 14px;
    }
}

@media screen and (max-width: 979px) {
    .dl-guide__groups {
        grid-template-columns: repeat(2, 1fr);
    }

    /* В две колонки строка пользы уже не помещается в два ряда. */
    .dl-card__excerpt {
        -webkit-line-clamp: 3;
    }

    .dl-article__title {
        font-size: 28px;
    }

    .dl-article__body .dl-steps {
        grid-template-columns: 1fr;
    }

    .dl-related__list {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 767px) {
    .dl-guide__intro {
        padding: 24px 0 20px;
    }

    .dl-guide__title {
        font-size: 24px;
    }

    .dl-guide__subtitle {
        font-size: 15px;
    }

    .dl-guide__groups {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dl-article__title {
        font-size: 24px;
    }

    .dl-article__body {
        font-size: 16px;
    }

    .dl-article__body h2 {
        margin: 30px 0 12px;
        font-size: 21px;
    }

    .dl-figure {
        padding: 14px;
    }

    .dl-cta {
        padding: 22px 20px;
    }

    .dl-cta__actions {
        width: 100%;
    }

    .dl-cta__actions > a {
        flex: 1 1 100%;
        justify-content: center;
        text-align: center;
    }

    /* Таблица на узком экране разворачивается в карточки: горизонтальный
       скролл в тексте статьи читается заметно хуже. */
    .dl-table,
    .dl-table tbody,
    .dl-table tr,
    .dl-table td {
        display: block;
        width: 100%;
    }

    .dl-table thead {
        position: absolute;
        overflow: hidden;
        clip: rect(0 0 0 0);
        width: 1px;
        height: 1px;
    }

    .dl-table tbody tr {
        margin-bottom: 12px;
        border-radius: 14px;
        background: #ffffff;
        overflow: hidden;
    }

    .dl-table tbody tr + tr td {
        border-top: none;
    }

    .dl-table td {
        padding: 10px 16px;
    }

    .dl-table td + td {
        border-top: 1px solid #f3f1f1;
    }

    .dl-table td[data-label]::before {
        display: block;
        margin-bottom: 3px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.3px;
        text-transform: uppercase;
        color: #8a8a8a;
        content: attr(data-label);
    }
}

@media screen and (max-width: 480px) {
    .dl-guide__intro,
    .dl-guide__groups,
    .dl-breadcrumbs,
    .dl-article,
    .dl-article__footer {
        width: calc(100% - 32px);
        max-width: none;
    }

    .dl-card {
        gap: 12px;
    }

    .dl-card__icon {
        width: 44px;
        height: 44px;
    }

    .dl-card__excerpt {
        -webkit-line-clamp: 3;
    }

    .dl-article__body .dl-steps > li {
        padding: 16px 16px 16px 16px;
    }

    .dl-article__body .dl-steps > li::before {
        position: static;
        margin-bottom: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dl-card,
    .dl-checklist > li,
    .dl-checklist__box,
    .dl-cta__secondary {
        transition: none;
    }
}
