/* ===== Экономический календарь на главной ===== */

.home-calendar {
    width: 100%;
    min-width: 0;
    margin: 24px 0 8px;
    color: #202631;
    font-size: 13px;
    line-height: 1.4;
    container-type: inline-size;
}

.home-calendar,
.home-calendar * {
    box-sizing: border-box;
}

.home-calendar [hidden] {
    display: none !important;
}

/* Заголовок и стрелки */

.home-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.home-calendar .home-calendar__title {
    min-width: 0;
    margin: 0;
}

.home-calendar .home-calendar__title h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 400;
}

.home-calendar__controls {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.home-calendar .home-calendar__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #e0e4e9;
    border-radius: 50%;
    background: #fff;
    color: #252d38;
    font-family: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition:
        background .2s ease,
        color .2s ease,
        opacity .2s ease;
}

.home-calendar .home-calendar__arrow:hover:not(:disabled) {
    background: #202631;
    color: #fff;
}

.home-calendar .home-calendar__arrow:disabled {
    opacity: .3;
    cursor: default;
}

/* Горизонтальная прокрутка */

.home-calendar__viewport {
    --hc-visible: 4;
    --hc-gap: 12px;

    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-calendar__viewport::-webkit-scrollbar {
    display: none;
}

.home-calendar__track {
    display: flex;
    align-items: stretch;
    gap: var(--hc-gap);
}

/* Карточка */

.home-calendar .home-calendar__card {
    display: flex;
    flex: 0 0 calc(
        (100% - (var(--hc-visible) - 1) * var(--hc-gap))
        / var(--hc-visible)
    );
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #dedede;
    border-radius: 12px;
    background: #ededed;
    color: inherit;
    text-decoration: none !important;
    scroll-snap-align: start;
    transition:
        background .2s ease,
        border-color .2s ease;
}

.home-calendar .home-calendar__card:hover {
    background: #ddd;
    border-color: #e5e5e5;
}

/* Страна, флаг и дата */

.home-calendar__country {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #737c89;
    font-size: 12px;
    line-height: 20px;
}

.home-calendar .home-calendar__flag {
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 1px solid #d4d8dd;
    border-radius: 50%;
    object-fit: cover;
}

.home-calendar__country-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-calendar__date {
    flex: 0 0 auto;
    margin-left: auto;
    color: #737c89;
    font-size: inherit;
    white-space: nowrap;
}

/* Название показателя */

.home-calendar .home-calendar__name {
    display: -webkit-box;
    min-height: 0;
	margin: 7px 0 5px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #202631;
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    overflow-wrap: anywhere;
}

/* Период, факт, предыдущее значение и изменение */

.home-calendar__values {
    display: grid;
    grid-template-columns:
        minmax(0, .85fr)
        minmax(0, 1.15fr)
        minmax(0, .9fr)
        auto;
    align-items: start;
    gap: 6px;
    min-width: 0;
    margin-top: 0;
	padding-top: 0;
}

.home-calendar__period-box,
.home-calendar__actual-box,
.home-calendar__previous-box,
.home-calendar__change-box {
    min-width: 0;
}

.home-calendar__label {
    display: block;
    color: #737c89;
    font-size: 11px;
    font-weight: 400;
    line-height: 16px;
    white-space: nowrap;
}

.home-calendar__period {
    display: block;
    color: #68717d;
    font-size: 12px;
    line-height: 16px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.home-calendar__actual-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 4px;
    min-width: 0;
}

.home-calendar__actual {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #202631;
    font-size: 20px;
    font-weight: 700;
    line-height: 27px;
    letter-spacing: -.4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.home-calendar__unit {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: #68717d;
    font-size: 11px;
    line-height: 15px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-calendar__previous,
.home-calendar__change {
    display: block;
    overflow: hidden;
    font-size: 12px;
    line-height: 27px;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.home-calendar__previous {
    color: #68717d;
}

.home-calendar__change {
    color: #737c89;
    font-weight: 600;
}

.home-calendar__change.is-positive {
    color: #218459;
}

.home-calendar__change.is-negative {
    color: #cb4b4b;
}

/* Состояние загрузки и фокус */

.home-calendar__status {
    margin: 8px 0 0;
    color: #858c97;
    font-size: 12px;
}

.home-calendar__card:focus-visible,
.home-calendar__arrow:focus-visible,
.home-calendar__viewport:focus-visible {
    outline: 2px solid #2878c8;
    outline-offset: 2px;
}

/* Адаптация по ширине экрана */

@media (max-width: 1200px) {
    .home-calendar__viewport {
        --hc-visible: 3;
    }
}

@media (max-width: 850px) {
    .home-calendar__viewport {
        --hc-visible: 2;
    }
}

@media (max-width: 580px) {
    .home-calendar__viewport {
        --hc-gap: 10px;
    }

    .home-calendar .home-calendar__card {
        flex-basis: 94%;
        padding: 11px 12px;
    }

    .home-calendar__label {
        font-size: 10px;
        line-height: 14px;
    }

    .home-calendar__period {
        font-size: 11px;
        line-height: 15px;
    }

    .home-calendar__actual {
        font-size: 18px;
    }

    .home-calendar__previous,
    .home-calendar__change {
        font-size: 10px;
    }

    .home-calendar__unit {
        font-size: 9px;
    }
}

/* Адаптация по фактической ширине блока */

@container (max-width: 1200px) {
    .home-calendar__viewport {
        --hc-visible: 3;
    }
}

@container (max-width: 850px) {
    .home-calendar__viewport {
        --hc-visible: 2;
    }
}

@container (max-width: 580px) {
    .home-calendar__viewport {
        --hc-gap: 10px;
    }

    .home-calendar .home-calendar__card {
        flex-basis: 94%;
        padding: 11px 12px;
    }

    .home-calendar__label {
        font-size: 10px;
        line-height: 14px;
    }

    .home-calendar__period {
        font-size: 11px;
        line-height: 15px;
    }

    .home-calendar__actual {
        font-size: 18px;
    }

    .home-calendar__previous,
    .home-calendar__change {
        font-size: 10px;
    }

    .home-calendar__unit {
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-calendar * {
        transition: none !important;
    }
}.cdp-calendar .home-calendar__viewport { --hc-visible:4; scrollbar-width:thin; scrollbar-color:#cbd4df transparent; padding-bottom:6px; }
.cdp-calendar .home-calendar__viewport::-webkit-scrollbar { display:block; height:5px; }
.cdp-calendar .home-calendar__viewport::-webkit-scrollbar-thumb { background:#cbd4df; border-radius:4px; }
@media(max-width:850px) { .cdp-calendar .home-calendar__viewport { --hc-visible:2; } }
@container(max-width:850px) { .cdp-calendar .home-calendar__viewport { --hc-visible:2; } }
