/* Coloring shares the compact, blended masthead used across Tumblethorn. */
/* The scene reaches the viewport edges; catalog and navigation retain their readable width. */
.coloring-page .page-shell {
    --coloring-inset: clamp(1rem, 3vw, 2rem);
    max-width: none;
    padding-top: 0;
}
.coloring-page .section-stack,
.coloring-page .tumblethorn-footer { max-width: 1496px; margin-inline: auto; }
.coloring-page .top-nav.site-nav {
    position: absolute;
    top: 1rem;
    left: max(var(--coloring-inset), calc((100% - 1496px) / 2));
    right: max(var(--coloring-inset), calc((100% - 1496px) / 2));
    margin: 0;
}
.coloring-page .hero-page { margin: 0 calc(-1 * var(--coloring-inset)) 0.75rem; }
.coloring-page .hero-showcase-coloring {
    --coloring-bottom-fade: clamp(6rem, 12vw, 11rem);
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: clamp(30rem, 40vw, 37rem);
    padding: 10rem max(calc(var(--coloring-inset) + 4vw), calc((100% - 1392px) / 2)) 2.5rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
/* Fade only the artwork and its wash, keeping text and controls fully opaque. */
.coloring-page .hero-showcase-coloring::before,
.coloring-page .hero-showcase-coloring::after {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--coloring-bottom-fade)), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - var(--coloring-bottom-fade)), transparent 100%);
}
.coloring-page .hero-showcase-coloring::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: #eaf7ff;
}
.coloring-page .hero-showcase-coloring::before {
    content: "";
    display: block;
    inset: 0;
    opacity: 1;
    border-radius: 0;
    z-index: -1;
    background: linear-gradient(90deg, #eaf7ff 0%, #eaf7fff5 24%, #eaf7ffc4 36%, #eaf7ff4d 50%, transparent 64%);
}
.coloring-page .hero-showcase-coloring .hero-copy {
    width: 43%;
    max-width: 29rem;
    padding: 0;
    margin: 0;
    align-items: flex-start;
    text-align: left;
    transform: none;
}
.coloring-page .hero-showcase-coloring .hero-title {
    margin: 0;
    font-size: clamp(3.4rem, 6.8vw, 6.4rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    color: #6726b7;
    width: fit-content;
    max-width: 100%;
    background: linear-gradient(100deg, #c72575 0%, #b75b00 24%, #13844b 45%, #087caf 65%, #7122d2 84%, #c72575 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}
.coloring-page .hero-showcase-coloring .hero-subtitle {
    margin: 1rem 0 0;
    max-width: 25ch;
    color: #283e72;
    font-size: clamp(1.1rem, 1.7vw, 1.4rem);
    line-height: 1.5;
}
.coloring-page .hero-showcase-coloring .hero-actions { width: auto; margin: 1.5rem 0 0; }
.coloring-page .hero-showcase-coloring .hero-actions .hero-primary-cta:nth-child(1) {
    color: #fff;
    background: linear-gradient(180deg, #9545df, #6421b5);
    border: 1px solid #ffffffc9;
    box-shadow: 0 4px 10px #6523be30;
}
@media (min-width: 721px) and (max-width: 1180px) {
    .coloring-page .hero-showcase-coloring { min-height: 28rem; padding-top: 7rem; }
}
@media (max-width: 720px) {
    .coloring-page .hero-showcase-coloring {
        min-height: 0;
        padding: calc(9rem + 66.667vw) 1.25rem 1.5rem;
        border-radius: 0;
        --coloring-bottom-fade: 5rem;
    }
    .coloring-page .hero-showcase-coloring::before {
        background: linear-gradient(180deg, #eaf7ff 0 9rem, transparent 11rem, transparent calc(9rem + 48vw), #eaf7ff calc(9rem + 66.667vw));
    }
    .coloring-page .hero-showcase-coloring .hero-copy { width: 100%; max-width: none; }
    .coloring-page .hero-showcase-coloring .hero-title { font-size: clamp(3rem, 11.5vw, 4.5rem); }
    .coloring-page .hero-showcase-coloring .hero-subtitle { font-size: 1.1rem; margin-top: 0.6rem; }
    .coloring-page .hero-showcase-coloring .hero-actions { margin-top: 1rem; }
}


/* Approved Emma-and-Tumble pencil scene, softly blended beneath the navigation. */
.coloring-page .hero-showcase-coloring .hero-art-coloring { position: absolute; inset: 0; height: 100%; z-index: -2; pointer-events: none; mask-image: linear-gradient(#000 calc(100% - var(--coloring-bottom-fade)), transparent); -webkit-mask-image: linear-gradient(#000 calc(100% - var(--coloring-bottom-fade)), transparent); }
.coloring-page .hero-showcase-coloring::after { z-index: -3; }
.coloring-page .hero-art-coloring .hero-art-coloring-scene {
    top: 0;
    right: 0;
    bottom: auto;
    height: 100%;
    width: auto;
    max-width: none;
    object-fit: contain;
    transform: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%);
    mask-image: linear-gradient(90deg, transparent, #000 22%);
}
/* At tablet widths, keep Tumble beside the copy instead of underneath it. */
@media (min-width: 721px) and (max-width: 1180px) {
    .coloring-page .hero-art-coloring .hero-art-coloring-scene {
        top: auto;
        bottom: 0;
        width: min(64%, 40rem);
        height: auto;
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%), linear-gradient(180deg, transparent, #000 16%);
        mask-image: linear-gradient(90deg, transparent, #000 16%), linear-gradient(180deg, transparent, #000 16%);
        mask-composite: intersect;
    }
}
/* Scope these styles to the browsing panels, preserving the working full-screen studio. */
.coloring-page .coloring-content { position: relative; gap: 1.25rem; padding-bottom: 1.25rem; }
.coloring-page :is(#free-pages, #full-library) { min-width: 0; padding: clamp(1.25rem, 3vw, 2.5rem); border: 1px solid #ffffffdc; border-radius: 1.75rem; background: #fffffff2; box-shadow: 0 5px 18px #335e8b0b; scroll-margin-top: 1rem; }
.coloring-page :is(#free-pages, #full-library) > .section-head { margin: 0 0 1.25rem; }
.coloring-page :is(#free-pages, #full-library) > .section-head .section-header { margin: 0; color: #6726b7; font-size: clamp(1.7rem, 3vw, 2.8rem); line-height: 1.2; text-shadow: none; }
.coloring-page :is(#free-pages, #full-library) > .section-head .section-subtitle { margin: 0.6rem 0 0; color: #283e72; font-size: 1.05rem; line-height: 1.45; font-weight: 700; }
.coloring-page .coloring-pages-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.coloring-page .coloring-page-card { min-width: 0; padding: 0.65rem; border: 1px solid #e7dff3; border-radius: 1.2rem; background: #fff; box-shadow: 0 3px 8px #283e7214; }
.coloring-page .coloring-page-card:nth-child(3n + 1) { background: linear-gradient(#fff, #fff0f7); }
.coloring-page .coloring-page-card:nth-child(3n + 2) { background: linear-gradient(#fff, #edf9ff); }
.coloring-page .coloring-page-card:nth-child(3n) { background: linear-gradient(#fff, #f3eeff); }
.coloring-page .coloring-page-card.is-selected { border-color: #8b45ce; box-shadow: 0 0 0 2px #8b45ce33; }
.coloring-page .coloring-sheet-preview { aspect-ratio: 2 / 3; padding: 0; background: #fff; }
.coloring-page .coloring-page-card-landscape .coloring-sheet-preview { aspect-ratio: 3 / 2; }
.coloring-page .coloring-sheet-preview img { width: 100%; height: 100%; object-fit: contain; border-radius: 0.65rem; box-shadow: none; }
.coloring-page .coloring-page-card .book-content { display: flex; flex-direction: column; align-items: stretch; gap: 0.65rem; padding: 0.8rem 0 0; margin-top: 0.5rem; border-top: 1px solid #e9e3f2; text-align: center; }
.coloring-page .coloring-page-card .book-title { margin: 0; color: #6726b7; font-size: 1.05rem; line-height: 1.35; }
.coloring-page :is(#free-pages, #full-library) .book-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 2.9rem; margin-top: auto; padding: 0.6rem 0.75rem; border: 1px solid #9250cf; border-radius: 999px; background: linear-gradient(#9545df, #6421b5); color: #fff; box-shadow: 0 3px 6px #6523be26; font: 800 0.95rem/1.3 var(--font-ui); text-decoration: none; transform: none; }
.coloring-page :is(#free-pages, #full-library) .book-btn:hover { filter: brightness(1.05); }
.coloring-page :is(#free-pages, #full-library) .book-btn:focus-visible, .coloring-library-track:focus-visible { outline: 3px solid #6726b7; outline-offset: 3px; }
.coloring-library-panel { --activity-color: #6726b7; }
.coloring-library-track { --visible-books: 4; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--visible-books) - 1) * 1rem) / var(--visible-books)); gap: 1rem; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: #bea4dd transparent; padding: 0.25rem 0.25rem 0.75rem; }
.coloring-page #full-library .coloring-library-track .library-card { display: flex; flex-direction: column; min-width: 0; padding: 0.65rem; border: 1px solid #e7dff3; border-radius: 1.1rem; background: #fefcff; box-shadow: 0 3px 8px #283e7210; scroll-snap-align: start; transform: none; }
.coloring-page #full-library .coloring-library-track .book-image-container { padding: 0; width: 100%; aspect-ratio: 3 / 4; border-radius: 0.65rem; background: transparent; }
.coloring-page #full-library .coloring-library-track .book-image { display: block; width: 100%; height: 100%; object-fit: contain; box-shadow: none; border-radius: 0.65rem; }
.coloring-page #full-library .coloring-library-track .book-content { flex: 1; display: flex; flex-direction: column; gap: 0.7rem; align-items: stretch; padding: 0.8rem 0 0; text-align: center; }
.coloring-page #full-library .coloring-library-track .book-title { margin: 0; color: #6726b7; font-size: 0.95rem; line-height: 1.4; }
.coloring-page #full-library .coloring-library-track .book-subtitle { white-space: normal; overflow: visible; text-overflow: clip; margin: 0 0 0.3rem; color: #283e72; font-size: 0.9rem; line-height: 1.5; }
.coloring-library-panel .home-shelf-arrow { top: 26%; }
.coloring-family-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; padding: 1.6rem 1.5rem; background: linear-gradient(110deg, #fff5fa, #f5f8ff); }
.coloring-family-intro, .coloring-family-point { display: grid; grid-template-columns: 3.3rem minmax(0, 1fr); gap: 0.7rem; align-items: start; min-width: 0; }
.coloring-family-panel > * + * { padding-left: 1rem; border-left: 1px solid #d9def0; }
.coloring-family-panel img { width: 100%; height: 5rem; object-fit: contain; }
.coloring-family-panel h2, .coloring-family-panel h3 { color: #6523be; font-size: 1.05rem; line-height: 1.3; }
.coloring-family-panel h2 { color: #c72665; }
.coloring-family-panel p { margin-top: 0.55rem; color: #283e72; font-size: 0.9rem; line-height: 1.5; }
.coloring-family-panel a { display: inline-flex; gap: 0.4rem; align-items: center; min-height: 2.75rem; color: #c72665; font-weight: 800; font-size: 0.85rem; text-decoration: none; }
.coloring-family-panel a:hover { text-decoration: underline; }

.coloring-family-panel { min-width: 0; border: 1px solid #ffffffdc; border-radius: 1.75rem; box-shadow: 0 5px 18px #335e8b0b; }
.coloring-family-panel h2, .coloring-family-panel h3, .coloring-family-panel p { margin: 0; }
.coloring-family-panel p { margin-top: 0.55rem; }
.coloring-family-book-icon { display: block; width: 100%; height: 5rem; background: #7122d2; mask: url('../images/nav-icons/books.png') center / contain no-repeat; -webkit-mask: url('../images/nav-icons/books.png') center / contain no-repeat; }


@media (max-width: 1000px) {
    .coloring-family-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .coloring-family-panel > :nth-child(3) { border-left: 0; padding-left: 0; }
    .coloring-library-track { --visible-books: 3; }
}
@media (max-width: 720px) {
    .coloring-page .hero-showcase-coloring .hero-art-coloring { top: 9rem; bottom: auto; height: 66.667vw; min-height: 0; }
    .coloring-page .hero-art-coloring .hero-art-coloring-scene {
        right: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .coloring-page .hero-showcase-coloring .hero-art-coloring { mask-image: linear-gradient(#000 70%, transparent); -webkit-mask-image: linear-gradient(#000 70%, transparent); }
    .coloring-page .coloring-pages-grid { grid-template-columns: minmax(0, 1fr); max-width: 24rem; margin-inline: auto; }
    .coloring-library-track { --visible-books: 2; gap: 0.75rem; grid-auto-columns: calc((100% - 0.75rem) / 2); }
    .coloring-page #full-library .coloring-library-track .book-btn { font-size: 0.8rem; padding-inline: 0.4rem; }
    .coloring-page :is(#free-pages, #full-library) { padding: 1.25rem; }
    .coloring-family-panel { padding: 1.25rem; }
}
@media (max-width: 480px) {
    .coloring-family-panel { grid-template-columns: minmax(0, 1fr); }
    .coloring-family-panel > * + *, .coloring-family-panel > :nth-child(3) { border-left: 0; padding: 1rem 0 0; border-top: 1px solid #d9def0; }
    .coloring-family-panel img { height: 4.5rem; }
}

/* Clearly identify the printed book chosen from Home. */
.coloring-page .library-card:target, .coloring-page .library-card:focus-visible { outline: 3px solid #7122d2; outline-offset: -3px; }
.coloring-page .library-card { scroll-margin: 1rem; }

@media (forced-colors: active) {
    .coloring-page .hero-showcase-coloring .hero-title {
        background: none;
        -webkit-text-fill-color: CanvasText;
        color: CanvasText;
    }
}

.coloring-page .easy-picture-label {
    display: block; color: #28634f; font-size: .85rem; font-weight: 800;
}
.coloring-page .coloring-page-card-easy { background: linear-gradient(#fff, #edf9f2); }
