/* Сворачиваемый стек: страницы с несколькими омонимами.
   Часть v3/word.css; порядок частей важен — см. static/README.md. */
/* ============================================================
   Collapsible auxiliary stack — multi-homonym word pages
   ============================================================ */

/*
 * Before JS: the cluster stack on multi-cluster pages is hidden via inline
 * style set by word-cluster-collapse.js. No CSS hiding here — graceful
 * degradation: without JS the stacks stay visible.
 */

/* Toggle button — centered divider style, no left rail */
.word-aux-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 5px 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--theme-text-muted);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 400;
    line-height: 1.35;
    text-align: start;
    transition:
        color var(--button-transition-duration) var(--button-transition-ease);
}

.word-aux-toggle:hover {
    color: var(--theme-text-normal);
}

.word-aux-toggle:active {
    opacity: 0.65;
}

.word-aux-toggle:focus-visible {
    outline: none;
    border-radius: 4px;
    box-shadow: var(--state-focus-ring-shadow);
}

/* Separator lines on both sides — icon + label centered between them */
.word-aux-toggle::before,
.word-aux-toggle::after {
    content: '';
    flex: 1;
    height: 1px;
    border-radius: 1px;
    background: var(--theme-border-subtle);
    opacity: 0.7;
    transition: opacity var(--button-transition-duration) ease;
}

.word-aux-toggle:hover::before,
.word-aux-toggle:hover::after {
    opacity: 1;
}

.word-aux-toggle .action-icon {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    opacity: 0.65;
    transform: rotate(180deg);
    transition: transform var(--motion-dur-sm) var(--motion-ease);
}

/* When expanded, rotate back to up = pointing up (open) */
.word-aux-toggle[aria-expanded="true"] .action-icon {
    transform: rotate(0deg);
}

.word-aux-toggle:hover .action-icon {
    opacity: 1;
}

/* Collapse stacks immediately at parse time — before JS runs.
   JS removes this effect by setting data-aux-open on the stack when open. */
[data-word-multi-cluster] [data-word-cluster-stack]:not([data-aux-open]) {
    height: 0;
    overflow: hidden;
}

/* Animate the left rail in/out with the aux sections */
[data-word-multi-cluster] [data-word-cluster-stack]::before {
    transition: opacity var(--motion-dur-sm) var(--motion-ease);
}

[data-word-multi-cluster] [data-word-cluster-stack]:not([data-aux-open])::before {
    opacity: 0;
}

@media (max-width: 640px) {
    .word-aux-toggle {
        font-size: var(--font-size-xs);
    }
}

/* Skeleton shimmer: disable moving highlight for reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
    [data-word-async-line]::after {
        animation: none;
    }
}
