@import "./listener-captions.css";

/* A physical frame around the same caption surface used by the live listener. */
.listener-example { min-width: 0; }
.room-artifact#listener-tablet {
    position: relative;
    scroll-margin-top: 120px;
    min-height: 0;
    padding: 17px;
    border: 1px solid #625c53;
    border-radius: 28px;
    background: linear-gradient(145deg, #3a3630, #191715 38%, #302c27);
}
.tablet-camera {
    position: absolute;
    top: 6px;
    left: calc(50% - 3px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #080807;
}
.tablet-screen { position: relative; height: clamp(350px, 32vw, 440px); overflow: hidden; border-radius: 13px; background: #050505; }
.listener-surface {
    --caption-font-size: clamp(20px, 2.2vw, 30px);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #050505;
    color: #fff;
    font-family: var(--font-body);
    color-scheme: dark;
    transform-origin: top left;
}
.listener-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding: 8px 22px; }
.listener-example-label { color: var(--sb-ink-muted); font-size: 12px; }
.listener-caption-window { flex: 1; position: relative; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #4a4543 #050505; }
.listener-caption-track { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 24px; }
.listener-surface .caption-segment { flex: 0 0 auto; width: 100%; margin: 0 0 24px; }
.listener-surface .caption-segment:last-child { margin-bottom: 0; }
.listener-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 18px; }
.listener-controls label { display: flex; align-items: center; gap: 8px; color: var(--sb-ink-soft); font-size: 13px; }
.listener-surface button, .listener-surface select {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--sb-line);
    border-radius: 8px;
    background: var(--sb-surface);
    color: var(--sb-ink);
    font: 500 13px var(--font-body);
    cursor: pointer;
}
.listener-surface button:hover, .listener-surface select:hover { background: var(--sb-surface-hover); }
.listener-surface button:focus-visible, .listener-surface select:focus-visible { outline: 2px solid var(--sb-amber); outline-offset: 3px; }
.listener-surface button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.listener-surface svg, .listener-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.listener-example-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 8px 22px 18px; color: var(--sb-ink-muted); font-size: 11px; }
.listener-surface .listener-expanded-control { display: none; }
.listener-open {
    position: absolute;
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: var(--sb-ink);
    cursor: zoom-in;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding: 24px;
}
.listener-open[hidden] { display: none; }
.listener-open > span { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px; border-radius: 8px; background: var(--sb-ink); color: var(--sb-night-deep); font: 600 13px var(--font-body); }
.listener-open:hover > span { background: var(--sb-amber-bright); }
.listener-open:focus-visible { outline: 2px solid var(--sb-amber); outline-offset: -5px; }
.tablet-screen:has(.listener-open:not([hidden])) .listener-controls { visibility: hidden; }
.tablet-screen:has(.listener-open:not([hidden])) .listener-example-footer { visibility: hidden; }
.listener-invitation { margin: 20px 0 0; text-align: center; color: var(--sb-ink-soft); font-size: 13px; }
.listener-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: transparent;
    color: #fff;
}
.listener-surface:fullscreen { width: 100vw; height: 100dvh; border-radius: 0; }
.listener-dialog::backdrop { background: rgb(5 5 5 / .85); }
.listener-dialog .listener-surface { --caption-font-size: clamp(28px, 4.2vw, 64px); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.listener-dialog .listener-surface[data-size="large"] { --caption-font-size: clamp(34px, 5.4vw, 84px); }
.listener-dialog .listener-surface[data-size="larger"] { --caption-font-size: clamp(40px, 6.6vw, 104px); }
.listener-dialog .listener-expanded-control { display: flex; }
.listener-dialog .listener-toolbar { padding: 12px clamp(18px, 4vw, 60px); }
.listener-dialog .listener-caption-track { max-width: 1400px; margin-inline: auto; padding: 40px clamp(24px, 6vw, 90px); }
.listener-dialog .listener-controls { padding: 12px clamp(18px, 4vw, 60px); }
.listener-dialog .listener-example-footer { padding: 8px clamp(18px, 4vw, 60px) 20px; font-size: 12px; }
.listener-dialog #listener-playback { margin-left: auto; }
html.listener-example-open { overflow: hidden; scrollbar-gutter: auto; }
@media (max-width: 600px) {
    .room-artifact#listener-tablet { padding: 12px; border-radius: 23px; }
    .tablet-camera { top: 4px; width: 4px; height: 4px; }
    .tablet-screen { height: 390px; }
    .listener-dialog .listener-example-label { max-width: 80px; }
    .listener-dialog .listener-caption-track { padding-block: 24px; }
    .listener-dialog .listener-controls { gap: 8px; }
    .listener-dialog #listener-playback { margin-left: 0; }
    .listener-size { flex: 1; }
    .listener-size select { min-width: 0; }
}
