/* Gaveta de prévia da obra (v1.73.0-beta.10). Visual da ficha pública do plugin; campos pela regra de exibição do Tainacan. */
.tbp-drawer {
    --tbp-ink: #16212b; --tbp-head: #1d3557; --tbp-muted: #5a6874; --tbp-line: #e3e8ec; --tbp-soft: #f4f7f9;
    --tbp-accent: #2d6da3; --tbp-accent-soft: #e8f0f8; --tbp-title: #10243e;
    position: fixed; top: var(--wp-admin--admin-bar--height, 0px); right: 0; bottom: 0; z-index: 99990;
    width: min(440px, 100vw); display: flex; flex-direction: column;
    background: #fff; border-left: 1px solid var(--tbp-line); box-shadow: -12px 0 32px rgba(16, 32, 48, .14);
    color: var(--tbp-ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: tbp-in .2s ease-out;
}
.tbp-drawer[hidden] { display: none; }
.tbp-drawer *, .tbp-drawer *::before, .tbp-drawer *::after { box-sizing: border-box; }
@keyframes tbp-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tbp-drawer { animation: none; } }

/* A lista abre espaço para a gaveta em telas largas (não cobre os cartões). */
@media (min-width: 1100px) {
    body.tbp-open #tainacan-items-page, body.tbp-open .wp-block-tainacan-faceted-search { margin-right: 440px; transition: margin-right .2s ease; }
}
.tbp-is-open, .tbp-is-open .tainacan-card { outline: 2px solid var(--tbp-accent, #2d6da3); outline-offset: 2px; border-radius: 12px; }

.tbp-drawer .tbp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--tbp-line); }
.tbp-drawer .tbp-pos { font-size: 12.5px; color: var(--tbp-muted); font-variant-numeric: tabular-nums; }
.tbp-drawer .tbp-nav { display: flex; gap: 4px; }
.tbp-drawer .tbp-btn {
    all: unset; box-sizing: border-box; cursor: pointer; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--tbp-line); color: var(--tbp-head); font-size: 20px; line-height: 1; background: #fff;
}
.tbp-drawer .tbp-btn:hover { background: var(--tbp-soft); }
.tbp-drawer .tbp-btn:focus-visible, .tbp-drawer a:focus-visible, .tbp-drawer [tabindex="-1"]:focus-visible { outline: 2px solid var(--tbp-accent); outline-offset: 2px; }

.tbp-drawer .tbp-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.tbp-drawer .tbp-loading { padding: 24px 16px; color: var(--tbp-muted); margin: 0; }
.tbp-drawer .tbp-top { display: flex; gap: 14px; align-items: flex-start; }
.tbp-drawer .tbp-cover { width: 96px; height: 136px; object-fit: cover; border-radius: 6px; border: 1px solid var(--tbp-line); flex-shrink: 0; background: var(--tbp-soft); }
.tbp-drawer .tbp-id { min-width: 0; display: grid; gap: 5px; }
.tbp-drawer .tbp-eyebrow { margin: 0; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tbp-muted); }
.tbp-drawer .tbp-title { margin: 0; padding: 0; border: 0; font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif; text-transform: none; letter-spacing: -.005em; font-size: 21px; font-weight: 700; line-height: 1.22; color: var(--tbp-title); }
.tbp-drawer .tbp-title:focus { outline: none; }
/* Autoria, editora e ano em destaque logo abaixo do título (1.73.0-beta.12). */
.tbp-drawer .tbp-author { margin: 4px 0 0; font-size: 16.5px; font-weight: 700; line-height: 1.3; color: var(--tbp-head); }
.tbp-drawer .tbp-imprint { margin: 2px 0 0; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--tbp-ink); }
.tbp-drawer .tbp-imprint .tbp-v--publisher, .tbp-drawer .tbp-imprint .tbp-v--year { font-weight: 700; }
.tbp-drawer .tbp-imprint .tbp-v--year { font-variant-numeric: tabular-nums; }
.tbp-drawer .tbp-call { margin: 2px 0 0; font-size: 12.5px; color: var(--tbp-muted); }
.tbp-drawer .tbp-call code { font-size: 12.5px; background: var(--tbp-soft); border: 1px solid var(--tbp-line); border-radius: 5px; padding: 1px 6px; color: var(--tbp-ink); }

.tbp-drawer .tbp-avail { display: inline-flex; align-items: center; gap: 8px; margin: 0; justify-self: start; padding: 5px 12px 5px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; background: #f1f1f1; color: #6b7280; }
.tbp-drawer .tbp-avail--available { background: #e6f6ee; color: #12704e; }
.tbp-drawer .tbp-avail--on_loan { background: #fff4e0; color: #8a5a00; }
.tbp-drawer .tbp-avail--reference { background: #e8f0f8; color: #2d5f8a; }
.tbp-drawer .tbp-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; display: inline-block; }

.tbp-drawer .tbp-h { margin: 0 0 6px; padding: 0; border: 0; font-family: inherit; text-transform: none; letter-spacing: normal; font-size: 13.5px; font-weight: 700; color: var(--tbp-head); }
.tbp-drawer .tbp-branch { border: 1px solid var(--tbp-line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.tbp-drawer .tbp-branch-name { margin: 0; padding: 7px 12px; background: var(--tbp-soft); font-size: 12.5px; font-weight: 700; color: var(--tbp-head); }
.tbp-drawer .tbp-list { list-style: none; margin: 0; padding: 0; }
.tbp-drawer .tbp-copy { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 12px; border-top: 1px solid var(--tbp-line); }
.tbp-drawer .tbp-copy:first-child { border-top: 0; }
.tbp-drawer .tbp-copy-id { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.tbp-drawer .tbp-copy-id code { font-size: 12px; color: var(--tbp-muted); background: none; padding: 0; }
.tbp-drawer .tbp-copy-where { grid-column: 1; font-size: 12.5px; color: var(--tbp-ink); }
.tbp-drawer .tbp-copy-status { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; display: grid; justify-items: end; gap: 0; font-size: 12.5px; font-weight: 600; }
.tbp-drawer .tbp-copy-status > i { display: none; }
.tbp-drawer .tbp-copy-status small { font-weight: 400; color: var(--tbp-muted); font-size: 11.5px; }
.tbp-drawer .tbp-copy-status small.tbp-overdue { color: #a4372b; font-weight: 600; }
.tbp-drawer .tbp-st--available { color: #12704e; }
.tbp-drawer .tbp-st--on_loan, .tbp-drawer .tbp-st--on_hold { color: #8a5a00; }
.tbp-drawer .tbp-st--in_processing, .tbp-drawer .tbp-st--in_transit { color: #2d5f8a; }
.tbp-drawer .tbp-st--lost, .tbp-drawer .tbp-st--damaged, .tbp-drawer .tbp-st--unavailable { color: #6b7280; }
.tbp-drawer .tbp-muted { color: var(--tbp-muted); font-size: 12.5px; margin: 0; }

.tbp-drawer .tbp-author a, .tbp-drawer .tbp-imprint a, .tbp-drawer .tbp-tag a, .tbp-drawer .tbp-fields a { color: inherit; text-decoration: none; font-weight: inherit; }
.tbp-drawer .tbp-author a:hover, .tbp-drawer .tbp-imprint a:hover, .tbp-drawer .tbp-tag a:hover, .tbp-drawer .tbp-fields a:hover { text-decoration: underline; }
.tbp-drawer .tbp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tbp-drawer .tbp-chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; background: var(--tbp-soft); border: 1px solid var(--tbp-line); color: var(--tbp-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tbp-drawer .tbp-chip b { font-weight: 700; font-size: 10.5px; letter-spacing: .04em; color: #7b8894; }
.tbp-drawer .tbp-meta { display: grid; gap: 10px; }
.tbp-drawer .tbp-fields { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.tbp-drawer .tbp-fields dt { color: #7b8894; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; line-height: 1.6; }
.tbp-drawer .tbp-fields dd { margin: 0; color: var(--tbp-ink); min-width: 0; overflow-wrap: anywhere; }
.tbp-drawer .tbp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tbp-drawer .tbp-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--tbp-accent-soft); color: #2d5f8a; font-size: 12.5px; text-decoration: none; }
.tbp-drawer a.tbp-tag:hover { text-decoration: underline; }
.tbp-drawer .tbp-excerpt { margin: 0; font-size: 13px; color: var(--tbp-muted); }

.tbp-drawer .tbp-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--tbp-line); background: #fff; }
.tbp-drawer .tbp-primary, .tbp-drawer .tbp-secondary {
    display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; text-decoration: none;
}
.tbp-drawer .tbp-primary { flex: 1; background: var(--tbp-accent); color: #fff; }
.tbp-drawer .tbp-primary:hover { background: #245a87; color: #fff; }
.tbp-drawer .tbp-secondary { border: 1px solid var(--tbp-line); color: var(--tbp-accent); background: #fff; }
.tbp-drawer .tbp-secondary:hover { background: var(--tbp-soft); }

@media (max-width: 600px) {
    .tbp-drawer { width: 100vw; border-left: 0; }
    .tbp-drawer .tbp-cover { width: 72px; height: 104px; }
}
