/* Scroll-triggered reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal-stagger .reveal {
    transition-delay: calc(var(--i, 0) * 0.12s);
}

/* Redacted text hover reveal */
.redacted {
    position: relative;
    background: var(--ink-black);
    color: transparent;
    cursor: help;
    padding: 0 0.15em;
    transition: color 0.3s ease;
    user-select: none;
}

.redacted::after {
    content: attr(data-reveal);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--parchment);
    font-size: 0.75em;
    white-space: nowrap;
    opacity: 0.7;
    pointer-events: none;
    letter-spacing: 0.1em;
}

.redacted:hover,
.redacted:focus {
    background: transparent;
    color: var(--seal-red);
}

.redacted:hover::after,
.redacted:focus::after {
    opacity: 0;
}

/* Archivist note */
.archivist-note {
    font-family: var(--typewriter);
    font-size: 0.6rem;
    color: var(--pencil-grey);
    font-style: italic;
    margin-top: 0.75rem;
    opacity: 0.75;
    transition: opacity 0.3s;
}

.archivist-note::before {
    content: '[ ';
}

.archivist-note::after {
    content: ' ]';
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 6, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 2rem;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

.lightbox-caption {
    margin-top: 1rem;
    color: var(--color-text-muted, #8a8680);
    font-family: var(--font-serif, Georgia, serif);
    font-size: 0.9rem;
    text-align: center;
    max-width: 600px;
}

.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: 1px solid var(--color-accent, #c9a962);
    color: var(--color-accent, #c9a962);
    font-family: var(--font-sans, sans-serif);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.lightbox-close:hover {
    background: var(--color-accent, #c9a962);
    color: var(--color-bg, #0a0a0b);
}

/* Book cover hover lift */
.book-plate {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-plate:hover {
    transform: translateY(-4px) rotate(-1deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Wax seal hover */
.wax-seal {
    transition: transform 0.3s ease;
}

.wax-seal:hover {
    transform: rotate(4deg) scale(1.05);
}
