/* C178 · jurisdictions carousel on the home page, variant A of T022 (Vlad 11523).
   Sizes: /root/artist/out/T022/REPORT.md, "Размеры для разработчика".
   Loaded only by templates/pages/home_page.html, after styles.css. */

/* ---------- all widths ---------- */
.jurisdictions .jurisdictions__sliderArea { min-width: 0; }
.jurisdictions .jurisdictionsSlider {
    --jc-card: 84%;
    position: relative;
    min-width: 0;
}
@supports (width: round(down, 10.5px, 1px)) {
    .jurisdictions .jurisdictionsSlider { --jc-card: round(down, 84%, 1px); }
}
.jurisdictionsSlider__rail {
    position: relative;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.jurisdictionsSlider__rail::-webkit-scrollbar { display: none; }
.jurisdictionsSlider__slide {
    display: flex;
    flex: 0 0 auto;
    box-sizing: border-box;
    min-width: 0;
    scroll-snap-align: start;
}
.jurisdictions .jurisdictionsSlider__card { width: 100%; }

.jurisdictions .jurisdictionsSlider__nav { display: flex; align-items: center; }
.jurisdictionsSlider__counter {
    margin: 0;
    color: #2e4396;
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* arrows: states from T022 arrow-states.png */
.jurisdictions .jurisdictionsSlider__button {
    cursor: pointer;
    background-color: transparent;
    transition: background-color .15s ease, border-color .15s ease;
}
.jurisdictions .jurisdictionsSlider__button .sliderButton__icon { transition: fill .15s ease; }
@media (hover: hover) {
    .jurisdictions .jurisdictionsSlider__button:not([aria-disabled="true"]):hover {
        background-color: #c0d5e5;
        border-color: #2e4396;
    }
}
.jurisdictions .jurisdictionsSlider__button:not([aria-disabled="true"]):active {
    background-color: #2e4396;
    border-color: #2e4396;
}
.jurisdictions .jurisdictionsSlider__button:not([aria-disabled="true"]):active .sliderButton__icon { fill: #fff; }
.jurisdictions .jurisdictionsSlider__button:focus:not(:focus-visible) { outline: none; }
.jurisdictions .jurisdictionsSlider__button:focus-visible {
    outline: 2px solid #2e4396;
    outline-offset: 2px;
}
.jurisdictions .jurisdictionsSlider__button[aria-disabled="true"] {
    cursor: default;
    background-color: #f1eeea;
    border-color: #b7bbc3;
}
.jurisdictions .jurisdictionsSlider__button[aria-disabled="true"] .sliderButton__icon { fill: #757984; }

@media (prefers-reduced-motion: reduce) {
    .jurisdictionsSlider__rail { scroll-behavior: auto; }
    .jurisdictions .jurisdictionsSlider__button,
    .jurisdictions .jurisdictionsSlider__button .sliderButton__icon { transition: none; }
}

/* ---------- 360-1023: one column, next card peeks ---------- */
@media (max-width: 1023.98px) {
    .jurisdictions .jurisdictions__container {
        flex-direction: column;
        gap: 0;
        padding-left: 8px;
        padding-right: 8px;
    }
    .jurisdictions .jurisdictions__titleArea {
        max-width: none;
        padding-top: 0;
        margin-bottom: 24px;
    }
    .jurisdictions .jurisdictions__title {
        max-width: 612px; /* 580 text + 2 x 16 padding */
        margin-bottom: 0;
        padding-left: 16px;
        padding-right: 16px;
        font-size: 22px;
        line-height: 28px;
    }
    .jurisdictions .jurisdictions__title b::before { left: -3px; right: -3px; top: 4px; }
    .jurisdictions .jurisdictions__more--desktop { display: none; }

    /* rail R = W - 16; card = floor(84% of R) up to 599, 87% from 600; gap 16 */
    .jurisdictionsSlider__slide { width: calc(var(--jc-card) + 16px); padding-right: 16px; }
    .jurisdictionsSlider__slide:last-child { width: 100%; padding-right: calc(100% - var(--jc-card)); }

    .jurisdictions .jurisdictionsSlider .card {
        min-height: 418px;
        padding: 14px 16px;
        border-radius: 14px;
    }
    .jurisdictions .jurisdictionsSlider .card__imgBox { height: 237px; margin-bottom: 6px; }
    .jurisdictions .jurisdictionsSlider .card__title { font-size: 22px; }
    .jurisdictions .jurisdictionsSlider .card__description { font-size: 16px; }
    .jurisdictions .jurisdictionsSlider .card__button { height: auto; min-height: 48px; padding: 12px 16px; }
    .jurisdictions .jurisdictionsSlider .button__text { font-size: 16px; }

    /* row 44 under the cards: prev at 16 from the screen edge, counter centred, next at 16 */
    .jurisdictions .jurisdictionsSlider__nav {
        justify-content: space-between;
        gap: 8px;
        margin-top: 12px;
        padding: 0 8px;
    }
    .jurisdictions .jurisdictionsSlider__button {
        width: 44px;
        height: 44px;
        border-color: #2e4396;
    }
    .jurisdictions .jurisdictionsSlider__button .sliderButton__icon { width: 24px; height: 24px; fill: #2e4396; }

    /* "Other countries upon request": 20 under the row, 16 from the edges, 48 high, circle 48, gap 6 */
    .jurisdictions .jurisdictions__moreRow { padding-left: 8px; padding-right: 8px; }
    .jurisdictions .jurisdictions__more--mobile {
        display: flex;
        width: 100%;
        max-width: 100%;
        gap: 6px;
        margin: 20px 0 0;
        font-size: 16px;
    }
    .jurisdictions .jurisdictions__more--mobile .arrowButton__text {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
        line-height: 20px;
        white-space: normal;
        text-align: center;
    }
    .jurisdictions .jurisdictions__more--mobile .arrowButton__iconBox {
        width: 48px;
        height: 48px;
        margin-right: 0;
    }
}
@media (min-width: 600px) and (max-width: 1023.98px) {
    .jurisdictions .jurisdictionsSlider { --jc-card: 87%; }
    @supports (width: round(down, 10.5px, 1px)) {
        .jurisdictions .jurisdictionsSlider { --jc-card: round(down, 87%, 1px); }
    }
    .jurisdictions .jurisdictions__title { font-size: 28px; line-height: 34px; }
}

/* ---------- 1024+: title column left, two whole 344 cards right, arrows 74 ---------- */
@media (min-width: 1024px) {
    .jurisdictions .jurisdictions__container {
        flex-direction: row;
        gap: 24px;
        padding-left: 24px;
        padding-right: 20px; /* minimum right gap */
    }
    /* flexible left column: 252 at 1024, up to 442 so the carousel starts at x = 572 inside 1440 */
    .jurisdictions .jurisdictions__titleArea {
        flex: 0 1 442px;
        min-width: 0;
        max-width: 442px;
    }
    .jurisdictions .jurisdictions__sliderArea { flex: 0 0 704px; }
    .jurisdictions .jurisdictionsSlider { width: 704px; }
    .jurisdictions .jurisdictions__moreRow { display: none; }

    .jurisdictionsSlider__slide { width: 360px; padding-right: 16px; }
    .jurisdictionsSlider__slide:last-child { width: 344px; padding-right: 0; }
    .jurisdictionsSlider__rail { margin-bottom: 13px; }

    .jurisdictions .jurisdictionsSlider__nav { justify-content: flex-start; gap: 14px; }
    .jurisdictions .jurisdictionsSlider__button {
        width: 74px;
        height: 74px;
        border-color: #141414;
    }
    .jurisdictions .jurisdictionsSlider__button .sliderButton__icon { width: 32px; height: 32px; fill: #141414; }
    /* the counter stays for screen readers only on desktop */
    .jurisdictionsSlider__counter {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(100%);
        white-space: nowrap;
        border: 0;
    }

    /* request button: 64 high, up to 382 wide, text may wrap to two lines in a narrow column */
    .jurisdictions .jurisdictions__more--desktop {
        width: 100%;
        max-width: 382px;
        gap: 6px;
        margin-right: 0;
        font-size: 16px;
    }
    .jurisdictions .jurisdictions__more--desktop .arrowButton__text {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        min-height: 64px;
        padding: 8px 20px;
        font-size: 16px;
        line-height: 18px;
        white-space: normal;
        text-align: center;
    }
    .jurisdictions .jurisdictions__more--desktop .arrowButton__iconBox {
        width: 64px;
        height: 64px;
        margin-right: 0;
    }
}
@media (min-width: 1024px) and (max-width: 1199.98px) {
    .jurisdictions .jurisdictions__title { font-size: 28px; line-height: 36px; }
    .jurisdictions .jurisdictions__title b::before { left: -3px; right: -3px; top: 4px; }
}
@media (min-width: 1200px) {
    .jurisdictions .jurisdictions__container {
        gap: 26px; /* r3: title column up to 490 + gap 26 (carousel at x = 602 inside 1440; mockup 572 assumed a narrower font) */
        /* 86 inside 1440, layout centred on wider screens; % of the section width, so no scrollbar error */
        padding-left: max(86px, calc((100% - 1440px) / 2 + 86px));
    }
}
@media (min-width: 1200px) {
    /* r3 (27.11): site font needs ~443px for "The jurisdictions in which" and ~487px for the RU pill
       "регистрировать компании"; 442 broke both at 1366 */
    .jurisdictions .jurisdictions__titleArea { flex-basis: 490px; max-width: 490px; }
    /* r3b (audit C178r3): below ~1340 the column is narrower than 490, so the title scales with it
       (42px needs 487px for the RU pill; 0.086 = 42/487; column = 100vw - scrollbar - 86 - 26 - 704 - 20) */
    .jurisdictions .jurisdictions__title { font-size: clamp(28px, calc((100vw - 852px) * 0.086), 42px); }
    /* r4 (audit C178r4): pill background scales with the title; equals the base 9px top / 8px sides at 42px */
    .jurisdictions .jurisdictions__title b::before { left: -0.19em; right: -0.19em; top: 0.214em; }
}
