/* The shortcut card: a slim tab on the edge of a window, and the keys that work in that window.
   Loaded by Lantern and by both viewer pages; what it shows comes from js/keyboard/catalogue.js. */

.sc-root { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 2147481500; }

.sc-tab {
    position: relative; z-index: 1;            /* the only thing in flow: the tab holds still while the card moves */
    display: grid; place-items: center;
    width: 26px; height: 54px; padding: 0;
    border: 1px solid #d6e0ec; border-right: 0;
    border-radius: 9px 0 0 9px;
    background: rgba(255, 255, 255, .92);
    color: var(--lantern-navy, #0F2844);
    cursor: pointer;
    box-shadow: -2px 0 10px rgba(9, 24, 44, .10);
    transition: background .15s ease, color .15s ease;
}
.sc-tab:hover { background: #fff; color: #1b3d63; }
.sc-root.open .sc-tab { background: var(--lantern-navy, #0F2844); color: #fff; border-color: var(--lantern-navy, #0F2844); }

/* The card glides out from behind the tab and back again, rather than appearing all at once. It is
   laid out at all times — a hidden element cannot be animated — and kept out of reach while it is away. */
.sc-card {
    position: absolute; right: 26px; top: 50%;
    transform: translateY(-50%) translateX(calc(100% + 30px));
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .3s cubic-bezier(.22, .78, .28, 1), opacity .2s ease, visibility 0s linear .3s;
    width: min(340px, 86vw);
    max-height: min(78vh, 620px);
    display: flex; flex-direction: column;
    background: #fff;
    border: 1px solid #d6e0ec; border-right: 0;
    border-radius: 12px 0 0 12px;
    box-shadow: -8px 0 28px rgba(9, 24, 44, .18);
    overflow: hidden;
    font: 400 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #34445c;
}
.sc-root.open .sc-card {
    transform: translateY(-50%) translateX(0);
    opacity: 1; visibility: visible; pointer-events: auto;
    transition: transform .32s cubic-bezier(.22, .78, .28, 1), opacity .22s ease, visibility 0s;
}

.sc-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px 10px 14px;
    background: radial-gradient(120% 160% at 20% 30%, #fdfbf6 0%, #f4f8fd 60%, #eef4fb 100%);
    border-bottom: 1px solid #e6eef7;
}
.sc-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--lantern-navy, #0F2844); }
.sc-x { border: 0; background: transparent; font-size: 19px; line-height: 1; color: #6b7a90; cursor: pointer; padding: 0 2px; }
.sc-x:hover { color: var(--lantern-navy, #0F2844); }

.sc-body { overflow-y: auto; padding: 4px 14px 10px; scrollbar-gutter: stable; }
.sc-body section { padding: 9px 0 2px; }
.sc-body section + section { border-top: 1px solid #eef3f9; }
.sc-body h3 {
    margin: 0 0 6px; font-size: 10.5px; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase; color: #8494a9;
}
/* The ones a provider may change carry the lantern's own colour, so they are told apart at a glance */
.sc-body .sc-yours h3 { color: #9a6b12; }
.sc-body .sc-yours kbd { background: var(--lantern-cream, #FEF1DC); border-color: #efdcb6; color: #6f4700; }

.sc-body dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: baseline; }
.sc-body dt { min-width: 0; }
.sc-body dd { margin: 0; display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }

kbd, .sc-body kbd {
    font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    padding: 3px 6px; border-radius: 5px;
    background: #f2f6fb; border: 1px solid #dae3ee; border-bottom-width: 2px;
    color: var(--lantern-navy, #0F2844); white-space: nowrap;
}

.sc-foot { padding: 9px 14px 11px; border-top: 1px solid #e6eef7; background: #fbfdff; }
.sc-change {
    width: 100%; font: 600 12px/1 inherit; padding: 8px 10px;
    border: 1px solid #cfdbe9; border-radius: 8px; background: #fff;
    color: var(--lantern-navy, #0F2844); cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.sc-change:hover { background: #f3f7fc; border-color: var(--lantern-blue, #82A1C6); }

/* Over a record, which is dark, the tab has to be legible against it too */
@media (prefers-reduced-motion: reduce) {
    .sc-tab, .sc-change { transition: none; }
    .sc-card, .sc-root.open .sc-card { transition: opacity .01s, visibility 0s; transform: translateY(-50%) translateX(0); }
    .sc-card { opacity: 0; }
    .sc-root.open .sc-card { opacity: 1; }
}
