/*
 * Стиль для свёрнутых bibtex-блоков.
 * Превращает <details>-элемент, созданный скриптом bibtex.js, в аккуратный
 * академический блок.
 */

.bibtex-block {
    margin: 0.5rem 0 1.25rem;
    padding: 0;
    border: 1px solid rgb(231 229 228); /* stone-200 */
    border-radius: 0.375rem;
    background: rgb(250 250 249); /* stone-50 */
    font-size: 0.875rem;
    position: relative;
}

.bibtex-block > summary {
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    user-select: none;
    color: rgb(120 113 108); /* stone-500 */
    font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
    font-size: 0.8125rem;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 0.375rem;
    transition: color 0.15s;
}

.bibtex-block > summary::-webkit-details-marker {
    display: none;
}

.bibtex-block > summary::before {
    content: "▸";
    font-size: 0.75rem;
    transition: transform 0.15s;
    display: inline-block;
    color: rgb(168 162 158); /* stone-400 */
}

.bibtex-block[open] > summary::before {
    transform: rotate(90deg);
}

.bibtex-block > summary:hover {
    color: rgb(68 64 60); /* stone-700 */
}

.bibtex-block__code {
    margin: 0;
    padding: 0.75rem 0.75rem 0.5rem;
    border-top: 1px solid rgb(231 229 228);
    font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgb(41 37 36); /* stone-800 */
    white-space: pre-wrap;        /* переносить, не уезжать в горизонтальный скролл */
    word-break: break-word;
    background: transparent;
}

.bibtex-block__copy {
    display: inline-block;
    margin: 0 0.75rem 0.6rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    color: rgb(68 64 60);
    background: white;
    border: 1px solid rgb(214 211 209); /* stone-300 */
    border-radius: 0.25rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.bibtex-block__copy:hover {
    background: rgb(245 245 244); /* stone-100 */
    border-color: rgb(168 162 158); /* stone-400 */
}

.bibtex-block__copy:focus-visible {
    outline: 2px solid rgb(120 113 108);
    outline-offset: 1px;
}
