/* ========================================================================
   modules/breadcrumbs/breadcrumbs.css — «Навигационная цепочка»

   Строка крошек берёт цвет и шрифт у блока (inherit) — выглядит уместно на
   любой теме владельца, а фон, рамка, отступы задаются стилем секции.
   Выпадающий список — отдельный слой поверх страницы, поэтому у него СВОЙ
   белый фон и явный цвет текста (как у подсказок поиска в /help): на
   тёмной теме полупрозрачное меню слилось бы с тем, что под ним.

   !important здесь нет намеренно — свойства, которые есть в редакторе
   стилей, должны им перебиваться (claude/conventions.md).
   ======================================================================== */

.bc {
    position: relative;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bc-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bc-item {
    display: inline-flex;
    align-items: center;
    position: relative;
    min-width: 0;
}

.bc-sep {
    margin: 0 4px;
    opacity: 0.5;
    user-select: none;
}

/* Крошка: ссылка, <summary> или просто подпись — вид один. */
.bc-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 20em;
    padding: 3px 7px;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s;
}
.bc-link:hover,
.bc-drop[open] > .bc-link {
    background: rgba(127, 127, 127, 0.14);
    color: inherit;
    text-decoration: none;
}
.bc-link:focus-visible {
    outline: 2px solid rgba(13, 110, 253, 0.6);
    outline-offset: 1px;
}
.bc-link-static {
    cursor: default;
}
.bc-link-static:hover {
    background: none;
}

.bc-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bc-current .bc-text {
    font-weight: 600;
}

/* <summary> без родного треугольника. */
.bc-drop > summary {
    list-style: none;
}
.bc-drop > summary::-webkit-details-marker {
    display: none;
}

/* Стрелка ▾ рамкой, а не символом шрифта — одинакова во всех шрифтах. */
.bc-caret {
    display: inline-block;
    flex: none;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.6;
    transition: transform 0.15s, margin-top 0.15s;
}
.bc-drop[open] > summary .bc-caret {
    transform: rotate(-135deg);
    margin-top: 3px;
}
.bc-link-children {
    /* Одна стрелка без текста — держим высоту строки и ширину под палец. */
    min-height: calc(1.4em + 6px);
    min-width: 28px;
    justify-content: center;
    padding-left: 9px;
    padding-right: 9px;
}

/* ---- Выпадающий список ---- */
.bc-drop {
    position: relative;
}

.bc-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1060;
    min-width: 200px;
    max-width: min(340px, calc(100vw - 16px));
    max-height: min(60vh, 420px);
    overflow-y: auto;
    margin: 0;
    padding: 5px;
    list-style: none;
    background: #fff;
    color: #212529;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    font-size: 0.95rem;
    font-weight: 400;
    text-align: left;
    animation: bc-menu-in 0.12s ease-out;
}

@keyframes bc-menu-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.bc-menu li {
    margin: 0;
    padding: 0;
}

.bc-opt {
    display: block;
    padding: 7px 11px;
    border-radius: 6px;
    color: #212529;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}
.bc-opt:hover,
.bc-opt:focus {
    background: #f1f3f5;
    color: #212529;
    text-decoration: none;
    outline: none;
}
.bc-opt.is-active {
    background: #e8f0fe;
    color: #0b57d0;
    font-weight: 600;
}

/* Контейнеры открытого списка (секция, элемент объекта, поле формы) —
   поверх соседей: у них бывает своя плоскость наложения из-за анимаций,
   и список уходил под следующий блок. */
.bc-raised {
    z-index: 1050;
}

/* Тёмная тема сайта (body.theme-dark) — список тоже тёмный. */
body.theme-dark .bc-menu {
    background: #2b2d31;
    color: #e6e6e6;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
body.theme-dark .bc-opt {
    color: #e6e6e6;
}
body.theme-dark .bc-opt:hover,
body.theme-dark .bc-opt:focus {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
body.theme-dark .bc-opt.is-active {
    background: rgba(110, 168, 254, 0.18);
    color: #9ec5fe;
}

/* Цепочка полем формы / элементом объекта — без нижнего отступа поля. */
.bc-field,
.bc-object {
    margin: 0;
}

/* Текст только для экранных читалок (свой класс: Bootstrap на странице
   может и не быть, а тогда подпись вылезала рядом со стрелкой). */
.bc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Подсказка администратору, когда цепочку построить не из чего. */
.bc-admin-note {
    padding: 6px 10px;
    border: 1px dashed rgba(127, 127, 127, 0.5);
    border-radius: 6px;
    font-size: 0.85rem;
    opacity: 0.75;
}

@media (max-width: 576px) {
    .bc-link {
        max-width: 12em;
    }
}
