@font-face {
    font-family: 'Painting Oswald';
    src: url('Oswald-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}
.art-lightbox .painting-stage {
    position: absolute;
    inset: 40px 58px;
    display: grid;
    align-items: safe center;
    justify-items: center;
    overflow: auto;
    container-type: size;
}
.art-lightbox .painting-stage[hidden],
.art-lightbox > img[hidden] { display: none; }
.painting-sheet {
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    width: min(100%, 177.7778cqh);
    aspect-ratio: 16 / 9;
    container-type: inline-size;
    background: white;
    color: #876b2e;
    text-align: center;
    font: 700 1rem/1.16 'Painting Oswald', sans-serif;
    user-select: text;
    -webkit-user-select: text;
}
.painting-paper {
    position: absolute;
    z-index: -1;
    left: 0;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--painting-paper) center / 100% auto no-repeat;
    pointer-events: none;
}
.painting-paper-top { top: 0; clip-path: inset(0 0 49.95%); }
.painting-paper-bottom { bottom: 0; clip-path: inset(50% 0 0); }
.painting-paper i { position: absolute; background: white; }
.painting-sheet .painting-heading, .painting-sheet .painting-words {
    position: absolute;
    margin: 0;
    padding: 0;
    left: 15.7%;
    width: 68.6%;
    color: inherit;
    font-family: inherit;
    font-weight: inherit;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.painting-sheet .painting-heading { top: var(--head-y); background: transparent; white-space: normal; }
.painting-heading h2 {
    margin: 0;
    color: inherit;
    font: inherit;
    font-size: var(--head-size);
    line-height: 1.04;
    letter-spacing: normal;
    white-space: pre-line;
}
.painting-heading span { display: block; font-size: 2.95cqw; line-height: 1.12; }
.painting-sheet .painting-words {
    top: var(--body-y);
    font-size: var(--body-size);
    line-height: 1.18;
}
@media (max-width: 740px), (max-height: 460px) {
    .art-lightbox:has(.painting-stage:not([hidden])) {
        width: 96vw;
        max-width: 96vw;
        padding: 0;
    }
    .art-lightbox .painting-stage {
        inset: 48px 4px 56px;
        display: block;
    }
    .art-lightbox:has(.painting-stage:not([hidden])) :is(.gallery-prev, .gallery-next) {
        top: auto;
        bottom: 5px;
    }
    .painting-sheet {
        width: 100%;
        min-height: 100%;
        aspect-ratio: auto;
        padding: max(40px, 11%) 16% max(45px, 11%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 1.2rem;
        background: linear-gradient(to right, #faf8f5 14.6%, #b99f84 14.7% 15%, #fff 15.1% 85%, #b99f84 85.1% 85.4%, #faf8f5 85.5%);
    }
    .painting-paper-top { clip-path: inset(0 0 56%); mask-image: linear-gradient(to bottom, black 39%, transparent 44%); }
    .painting-paper-bottom { clip-path: inset(42% 0 0); mask-image: linear-gradient(to bottom, transparent 42%, black 47%); }
    .painting-sheet .painting-heading, .painting-sheet .painting-words {
        position: static;
        width: auto;
    }
    .painting-heading h2 { font-size: clamp(22px, 6cqw, 32px); line-height: 1.1; }
    .painting-heading span { font-size: 20px; }
    .painting-sheet .painting-words { font-size: 17px; line-height: 1.3; }
}
