/* ioann-presnya breadcrumbs */

.breadcrumbs {
    width: 100%;
    max-width: var(--ip-content-max);
    margin-inline: auto;
    padding: 64px var(--ip-side-padding) 54px;
    display: flex;
    align-items: center;
}

.breadcrumbs__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font: 400 20px/1.1 var(--ip-font-body);
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--ip-text);
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs__link {
    color: inherit;
    text-decoration: none;
}

.breadcrumbs__link:hover {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.breadcrumbs__link:focus-visible {
    outline: 2px solid var(--ip-text);
    outline-offset: 2px;
}

.breadcrumbs__current {
    color: #a33d25;
}

.breadcrumbs__sep {
    display: inline-block;
    color: var(--ip-text);
    user-select: none;
}

/* Row wrapper: breadcrumb + inline month filter (Figma 1:1572) */
.breadcrumbs__row {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

/* ──────────────────────────────────────────────────────────────────────────────
   Month-filter popup — Figma popups 1:445 / 1:446
   Moved here from news.css (task 97) so it is available site-wide wherever
   the breadcrumb renders (filter only injected on the news-list page).
   ────────────────────────────────────────────────────────────────────────────── */

.news-filter {
    position: relative;
}
.news-filter summary {
    list-style: none;
}
.news-filter summary::-webkit-details-marker {
    display: none;
}

.news-filter__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 0;
    background: #ffffff;
    border-bottom: 1px solid #cecece;
    font-family: var(--ip-font-body);
    font-weight: 400;
    font-size: 20px;
    line-height: 1.1;
    text-transform: uppercase;
    color: #a4a4a4;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.news-filter__caret {
    display: inline-flex;
    transition: transform 0.2s ease;
}
.news-filter[open] .news-filter__caret {
    transform: rotate(180deg);
}

.news-filter__menu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #cecece;
    padding: 8px 0;
    list-style: none;
    margin: 0;
    z-index: 100;
}

.news-filter__item {
    display: block;
    padding: 8px 14px;
    font-family: var(--ip-font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.2;
    text-transform: uppercase;
    color: #a4a4a4;
    text-decoration: none;
    transition: color 0.15s ease;
}
.news-filter__item:hover {
    color: #1b1b1b;
}
.news-filter__item--active {
    color: #a33d25;
}

/* Step the breadcrumb down from 20px to 18px on 1440px screens and below. */
@media (max-width: 1440px) {
    .breadcrumbs__list {
        font-size: 18px;
    }
}

@media (max-width: 1199.99px) {
    .breadcrumbs__list {
        gap: 6px;
    }

    .breadcrumbs__item {
        gap: 6px;
    }
}

@media (max-width: 767.99px) {
    /* Reduce vertical padding on mobile; horizontal already equals --ip-side-padding (16px). */
    .breadcrumbs {
        padding: 16px var(--ip-side-padding);
        max-width: 100%;
    }

    /* Smaller font and tighter gap on mobile to keep the trail compact. */
    .breadcrumbs__list {
        font-size: 16px;
        gap: 4px;
    }

    /* Allow flex items to shrink below their content size so they never overflow. */
    .breadcrumbs__item {
        min-width: 0;
        gap: 4px;
    }

    /* Break long unbroken words (single-word slugs, long Cyrillic titles) so they
       wrap rather than forcing horizontal scroll. */
    .breadcrumbs__link,
    .breadcrumbs__current,
    .breadcrumbs__text {
        overflow-wrap: anywhere;
        word-break: break-word;
        min-width: 0;
    }

    /* Stack breadcrumb trail above the month-filter control on mobile so both
       have room to breathe — satisfies "controls stack/wrap" (task 172). */
    .breadcrumbs__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Allow the filter container to take full available width without overflow. */
    .news-filter {
        max-width: 100%;
    }

    /* Let the trigger label wrap if the selected month name is long; the desktop
       rule sets white-space: nowrap which we override here. */
    .news-filter__trigger {
        white-space: normal;
        max-width: 100%;
    }

    /* Constrain month-filter popup width so it never overflows the mobile gutter. */
    .news-filter__menu {
        left: 0;
        max-width: calc(100vw - 2 * var(--ip-side-padding));
    }
}
