/* Slide viewer (slides.html) — layered on top of index.css */

.viewer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 28px 64px;
}

/* Header */
.viewer-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--rule);
}
.viewer-id {
    min-width: 0;
}
.viewer-event {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}
.viewer-title {
    font-family: "Georgia", serif;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 4px 0 0;
}
.viewer-context {
    margin: 4px 0 0;
    font-size: 0.92rem;
    color: var(--muted);
}
.viewer-empty {
    color: var(--muted);
}

.talk-picker select {
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--fg);
    background: var(--highlight);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 7px 10px;
    max-width: 320px;
    cursor: pointer;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Stage: slide + notes */
.stage {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}
.stage-main {
    flex: 1;
    min-width: 0;
}

.slide-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--highlight);
    border: 1px solid var(--rule);
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
}
.slide-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1;
    transition: opacity 0.14s ease;
}
.slide-img.loading {
    opacity: 0;
}

/* Click/tap targets over the slide edges */
.edge {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    min-width: 44px;
    border: 0;
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
    font-size: 1.1rem;
}
.edge-prev {
    left: 0;
    justify-content: flex-start;
    padding-left: 12px;
}
.edge-next {
    right: 0;
    justify-content: flex-end;
    padding-right: 12px;
}
.slide-frame:hover .edge {
    opacity: 0.35;
}
.edge:hover {
    opacity: 0.9 !important;
}
.edge[disabled] {
    cursor: default;
    opacity: 0 !important;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.ctrl-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ctrl {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: transparent;
    color: var(--fg);
    font-size: 0.85rem;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        opacity 0.15s ease;
}
.ctrl:hover:not([disabled]) {
    background: var(--highlight);
}
.ctrl[disabled] {
    opacity: 0.3;
    cursor: default;
}
.counter {
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
    color: var(--muted);
    min-width: 76px;
    text-align: center;
}
.hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}
.hint kbd {
    font-family: inherit;
    font-size: 0.78rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 1px 5px;
    margin: 0 1px;
}

.progress {
    height: 2px;
    background: var(--rule);
    border-radius: 2px;
    margin-top: 14px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0;
    background: var(--fg);
    opacity: 0.55;
    transition: width 0.18s ease;
}

/* Speaker notes */
.notes {
    flex: 0 0 330px;
    align-self: stretch;
    padding-left: 24px;
    border-left: 1px solid var(--rule);
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.notes-head {
    font-family: "Georgia", serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 10px;
    flex: 0 0 auto;
}
.notes-body {
    font-size: 0.95rem;
    line-height: 1.62;
    overflow-y: auto;
    padding-right: 6px;
    flex: 1 1 auto;
}
.notes-body p {
    margin: 0 0 12px;
}
.notes-body p:last-child {
    margin-bottom: 0;
}
.notes-body .no-notes {
    color: var(--muted);
    font-style: italic;
}
@media (max-width: 980px) {
    .notes {
        flex-basis: 280px;
        padding-left: 20px;
    }
}

/* Mobile: notes move below the slide */
@media (max-width: 820px) {
    .viewer {
        padding: 22px 20px 56px;
    }
    .viewer-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .viewer-title {
        font-size: 1.2rem;
    }
    .stage {
        flex-direction: column;
        gap: 22px;
    }
    .stage-main {
        width: 100%;
    }
    .notes {
        flex: initial;
        width: 100%;
        position: static;
        max-height: none;
        padding: 16px 0 0;
        border-left: 0;
        border-top: 1px solid var(--rule);
    }
    .notes-body {
        overflow-y: visible;
        padding-right: 0;
    }
    .controls {
        justify-content: center;
    }
    .hint {
        display: none;
    }
    .ctrl {
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
    }
    .counter {
        min-width: 84px;
    }
    /* Arrows are always visible on touch, where there is no hover */
    .slide-frame .edge {
        opacity: 0.28;
    }
}
