/* Booklet PHP — layout static indexabil (MVC) */

.booklet-php .booklet__stage--static {
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.booklet-page {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(1rem, 3vw, 2rem);
    min-height: 100%;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    align-items: start;
    position: relative;
    isolation: isolate;
}

.booklet-page__backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.booklet-page__backdrop-img {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    margin: auto;
    object-fit: contain;
    object-position: center;
    opacity: 0.34;
    filter: blur(14px) saturate(1.1);
    transform: scale(1.08);
}

.booklet-page__backdrop-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 10%, rgba(120, 0, 255, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.52) 100%);
}

.booklet-page--has-artwork .booklet-page__visual,
.booklet-page--has-artwork .booklet-page__content {
    position: relative;
    z-index: 1;
}

.booklet-page__visual {
    position: sticky;
    top: 0;
}

.booklet-page__content {
    max-width: none;
}

.booklet-toc {
    margin: 1.25rem 0 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(196, 160, 85, 0.14);
}

.booklet-toc__title {
    margin: 0 0 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-gold);
    font-family: var(--font-sans);
    font-weight: 500;
}

.booklet-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.35rem;
}

.booklet-toc__list a {
    color: var(--color-white-muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s ease;
}

.booklet-toc__list a:hover,
.booklet-toc__list a:focus-visible {
    color: var(--color-gold);
}

.booklet-contents-link {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-gold);
    text-decoration: none;
    text-align: center;
}

.nav-btn--link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
}

.nav-btn--disabled {
    display: inline-block;
    width: 2.5rem;
    height: 2.5rem;
}

.booklet-page:has(.artwork.has-image) {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: stretch;
    min-height: calc(100dvh - 7.5rem);
}

.booklet-page:has(.artwork.has-image) .booklet-page__visual {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100dvh - 7.5rem);
    min-height: min(72dvh, 36rem);
}

.booklet-page:has(.artwork.has-image) .page-visual,
.booklet-page:has(.artwork.has-image) .page-visual__frame {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.booklet-page:has(.artwork.has-image) .page-visual__frame {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-visual__frame:has(.artwork.has-image) .page-visual__emblem {
    display: none;
}

@media (max-width: 900px) {
    .booklet-page {
        grid-template-columns: 1fr;
    }

    .booklet-page__visual {
        position: static;
    }

    .booklet-page:has(.artwork.has-image) {
        min-height: auto;
    }

    .booklet-page:has(.artwork.has-image) .booklet-page__visual {
        position: static;
        height: auto;
        min-height: 0;
        max-height: none;
        padding: 0.5rem 0 1rem;
    }

    .booklet-page:has(.artwork.has-image) .page-visual__frame {
        min-height: 0;
    }

    .booklet-page:has(.artwork.has-image) .artwork__canvas {
        width: min(100%, clamp(12rem, 90vw, calc(100dvh - 7rem)));
        max-height: min(clamp(12rem, 68dvh, 90vw), calc(100dvh - 7rem));
    }

    .booklet-page__backdrop-img {
        opacity: 0.38;
        filter: blur(12px) saturate(1.1);
    }
}

@media (max-width: 480px) {
    .booklet-page {
        padding: clamp(0.5rem, 3vw, 0.85rem);
        gap: 0.85rem;
    }

    .booklet-page:has(.artwork.has-image) .artwork__canvas {
        width: min(100%, clamp(11rem, 92vw, calc(100dvh - 6.5rem)));
        max-height: min(clamp(11rem, 58dvh, 92vw), calc(100dvh - 6.5rem));
    }
}

@media (max-height: 640px) and (orientation: landscape) {
    .booklet-page:has(.artwork.has-image) {
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
        min-height: auto;
    }

    .booklet-page:has(.artwork.has-image) .booklet-page__visual {
        position: sticky;
        height: calc(100dvh - 5rem);
        padding: 0.25rem 0;
    }

    .booklet-page:has(.artwork.has-image) .artwork__canvas {
        width: min(100%, calc(100dvh - 5.5rem));
        max-height: calc(100dvh - 5.5rem);
    }
}
