/* ═══════════════════════════════════════════════════════════
   Book Preview — "Look Inside" viewer
   ══════════════════════════════════════════════════════════ */

/* ── Teaser strip (inline on book page) ──────────────────── */
.book-preview-strip {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2218 100%);
    border-radius: 12px;
    margin: 32px 0;
    border: 1px solid rgba(196, 168, 116, 0.25);
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}

.book-preview-strip__icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: rgba(196, 168, 116, 0.12);
    border: 1.5px solid rgba(196, 168, 116, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #C4A874;
}

.book-preview-strip__text {
    flex: 1;
}

.book-preview-strip__heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: #f5f0e8;
    margin: 0 0 4px;
    line-height: 1.3;
}

.book-preview-strip__sub {
    font-size: 13.5px;
    color: rgba(245, 240, 232, 0.65);
    margin: 0;
}

.book-preview-strip__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 24px;
    background: linear-gradient(135deg, #C4A874 0%, #9A7530 100%);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.18s;
    text-decoration: none;
    white-space: nowrap;
}

.book-preview-strip__btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .book-preview-strip {
        flex-direction: column;
        text-align: center;
        padding: 22px 20px;
        gap: 14px;
    }
    .book-preview-strip__icon { display: none; }
    .book-preview-strip__btn { width: 100%; justify-content: center; }
}

/* ── Modal overlay ───────────────────────────────────────── */
.stc-preview-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 8, 6, 0.95);
    flex-direction: column;
    align-items: center;
}

.stc-preview-modal.is-open {
    display: flex;
}

/* ── Modal header ────────────────────────────────────────── */
.stc-preview-modal__header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #111;
    border-bottom: 1px solid rgba(196, 168, 116, 0.2);
    flex-shrink: 0;
    gap: 12px;
}

.stc-preview-modal__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 15px;
    color: #f5f0e8;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.stc-preview-modal__title span {
    color: #C4A874;
    font-style: italic;
}

.stc-preview-modal__badge {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #1a1a1a;
    background: linear-gradient(135deg, #C4A874 0%, #9A7530 100%);
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stc-preview-modal__close {
    flex-shrink: 0;
    background: none;
    border: 1.5px solid rgba(245, 240, 232, 0.25);
    color: #f5f0e8;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    font-size: 18px;
    line-height: 1;
}

.stc-preview-modal__close:hover {
    border-color: #C4A874;
    background: rgba(196, 168, 116, 0.1);
    color: #C4A874;
}

/* ── Viewer canvas area ──────────────────────────────────── */
.stc-preview-modal__body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
    scroll-behavior: smooth;
}

.stc-preview-modal__canvas-wrap {
    position: relative;
    box-shadow: 0 8px 48px rgba(0,0,0,0.6);
    border-radius: 3px;
    line-height: 0;
    max-width: 100%;
}

#stc-preview-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #fff;
    border-radius: 3px;
}

/* Loading state */
.stc-preview-modal__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 400px;
    color: rgba(245, 240, 232, 0.6);
    font-size: 14px;
}

.stc-preview-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(196, 168, 116, 0.15);
    border-top-color: #C4A874;
    border-radius: 50%;
    animation: stcSpin 0.8s linear infinite;
}

@keyframes stcSpin {
    to { transform: rotate(360deg); }
}

/* Last page CTA overlay */
.stc-preview-modal__last-page-cta {
    display: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,8,6,0.97) 0%, rgba(10,8,6,0.6) 55%, transparent 100%);
    border-radius: 3px;
    align-items: flex-end;
    justify-content: center;
    padding: 32px;
    text-align: center;
    flex-direction: column;
}

.stc-preview-modal__last-page-cta.is-visible {
    display: flex;
}

.stc-preview-modal__cta-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    color: #f5f0e8;
    margin: 0 0 8px;
    line-height: 1.3;
}

.stc-preview-modal__cta-sub {
    font-size: 14px;
    color: rgba(245, 240, 232, 0.7);
    margin: 0 0 20px;
}

.stc-preview-modal__cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #C4A874 0%, #9A7530 100%);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 15px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.18s, transform 0.18s;
}

.stc-preview-modal__cta-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ── Modal footer / controls ─────────────────────────────── */
.stc-preview-modal__footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 24px;
    background: #111;
    border-top: 1px solid rgba(196, 168, 116, 0.2);
    flex-shrink: 0;
}

.stc-preview-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: rgba(196, 168, 116, 0.1);
    border: 1.5px solid rgba(196, 168, 116, 0.35);
    color: #C4A874;
    font-weight: 600;
    font-size: 13px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.stc-preview-nav-btn:hover:not(:disabled) {
    background: rgba(196, 168, 116, 0.2);
    border-color: #C4A874;
}

.stc-preview-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.stc-preview-modal__counter {
    font-size: 13.5px;
    color: rgba(245, 240, 232, 0.7);
    min-width: 110px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.stc-preview-modal__counter strong {
    color: #C4A874;
    font-size: 15px;
}

.stc-preview-zoom-btns {
    display: flex;
    gap: 6px;
}

.stc-preview-zoom-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(245, 240, 232, 0.7);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s;
}

.stc-preview-zoom-btn:hover {
    background: rgba(196, 168, 116, 0.12);
    color: #C4A874;
}

@media (max-width: 520px) {
    .stc-preview-zoom-btns { display: none; }
    .stc-preview-modal__footer { gap: 10px; }
    .stc-preview-nav-btn { padding: 9px 14px; font-size: 12px; }
}
