/* Stylesheet: Issue citation dialog.
 * Cascade order is intentional: later component/responsive refinements win.
 * Keep selectors, declaration order and breakpoints in place when editing.
 * Shared palette: --brand and --brand-dark in archive.css; fallbacks retained.
 */

.viewer-page .viewer-actions .citation-open {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--paper,#fff);
    border: 1px solid var(--line,#d9e2ec);
    color: var(--brand,#28536b);
    font-size: 12px;
    text-align: left;
    border-radius: 5px;
}

.viewer-page .viewer-actions .citation-open svg {
    flex: 0 0 16px;
}

.viewer-page .viewer-actions .citation-open:hover,.viewer-page .viewer-actions .citation-open:focus-visible {
    background: #edf2f7;
    border-color: var(--brand,#28536b);
}

.viewer-page .citation-open[hidden],.citation-fallback[hidden] {
    display: none;
}

.citation-open:focus-visible,.issue-citation-dialog button:focus-visible {
    outline: 3px solid #d9a13c;
    outline-offset: 3px;
}

.citation-fallback {
    margin-top: 16px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.issue-citation-dialog {
    width: min(660px,calc(100% - 32px));
    max-height: calc(100dvh - 40px);
    padding: 26px;
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    color: #1f2933;
    background: #fff;
    box-shadow: 0 18px 70px rgb(23 56 75 / 25%);
    font: 14px/1.6 Montserrat,Arial,sans-serif;
    overflow: auto;
}

.issue-citation-dialog::backdrop {
    background: rgb(15 35 45 / 55%);
}

.citation-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.citation-dialog-header h2 {
    margin: 0;
    color: var(--brand, #28536b);
    font: 700 26px/1.3 'Montagu Slab',Georgia,serif;
}

.citation-dialog-header .citation-close {
    flex: 0 0 auto;
    padding: 2px 12px;
    background: #edf2f7;
    color: var(--brand-dark, #17384b);
    font: 26px/1.3 Arial,sans-serif;
}

.citation-entry {
    padding: 18px 0;
    border-top: 1px solid #d9e2ec;
}

.citation-entry h3 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--brand-dark, #17384b);
}

.citation-text {
    padding: 14px;
    background: #f4f7f9;
    border: 1px solid #d9e2ec;
    border-radius: 6px;
    overflow-wrap: anywhere;
    user-select: text;
}

.citation-entry button {
    font-size: 13px;
    padding: 9px 13px;
}

.citation-warning {
    padding: 12px;
    background: #fff6e4;
    border: 1px solid #edd59f;
    border-radius: 6px;
}

.citation-status,.citation-guidance {
    font-size: 12px;
    margin-bottom: 0;
}

@media(min-width:1000px) {
    .viewer-page .viewer-actions .citation-open {
        padding: 12px;
        background: #edf2f7;
    }

}

@media(max-width:500px) {
    .issue-citation-dialog {
        padding: 18px;
    }

    .citation-dialog-header h2 {
        font-size: 23px;
    }

    .citation-entry button {
        width: 100%;
    }

}
