.home-page {
    --home-purple: #684391;
    --home-purple-dark: #342b60;
    --home-pink: #fa6c6b;
}

.home-container {
    width: 100%;
    padding-inline: 15px;
    margin-inline: auto;
}

@media (min-width: 768px) {
    .home-container {
        max-width: 750px;
    }
}

@media (min-width: 992px) {
    .home-container {
        max-width: 970px;
    }
}

@media (min-width: 1200px) {
    .home-container {
        max-width: 1170px;
    }
}

.home-hero {
    min-height: 400px;
    color: #fff;
    background: #f9f5ff url("../legacy/default_theme/img/new-book.jpg") no-repeat center center;
    background-size: 100% 100%;
}

.home-hero-inner {
    min-height: 400px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 3rem;
    padding-block: 0;
}

.home-hero-content {
    grid-column: 1;
    width: min(100%, 450px);
    justify-self: center;
    text-align: center;
}

.home-hero-kicker {
    margin: 0;
    color: transparent;
    font-size: 50px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1;
}

.home-hero-copy p.home-hero-kicker {
    font-size: 50px;
    margin-top: 15px;
}

.home-hero-copy h1 {
    margin: .6rem 0;
    color: #fff;
    font-size: clamp(1.55rem, 2.5vw, 2.125rem);
    line-height: 1.25;
}

.home-hero-copy > p:last-child {
    margin: .4rem 0 1rem;
    color: #fff;
    font-size: clamp(1.2rem, 2vw, 1.75rem);
    font-weight: 700;
}

.home-search {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 25px auto 30px;
    padding: 0;
}

.home-search label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.home-search-row {
    position: relative;
    display: block;
}

.home-search input {
    width: 100%;
    min-height: 42px;
    padding: 10px 105px 10px 20px;
    border: 0;
    border-radius: 5px;
    background: #fff;
}

.home-search button {
    position: absolute;
    top: 7px;
    right: 7px;
    min-height: 26px;
    padding: .15rem .65rem;
    border: 0;
    border-radius: 3px;
    color: #fff;
    background: linear-gradient(90deg, #573665 0%, #3d2c63 80%, #3c2a64 100%);
    font-weight: 700;
}

.home-gallery-filter button {
    padding: .7rem 1.1rem;
    border: 0;
    border-radius: 2px;
    color: #fff;
    background: var(--home-pink);
    font-weight: 700;
}

.home-search > a {
    display: inline-block;
    float: right;
    clear: both;
    margin: 15px 0 0;
    color: #342b60;
}

.home-advanced-dialog {
    width: min(940px, calc(100% - 2rem));
    max-width: none;
    max-height: calc(100% - 2rem);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 3px;
    color: var(--site-text);
    background: #fff;
    box-shadow: 0 12px 40px rgb(26 19 34 / 35%);
}

.home-advanced-dialog:not([open]) {
    display: none;
}

.home-advanced-dialog::backdrop {
    background: rgb(26 19 34 / 65%);
}

.home-advanced-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1.25rem;
    border-bottom: 1px solid var(--site-border);
}

.home-advanced-dialog .home-advanced-dialog-header h2 {
    margin: 0;
    color: var(--home-purple-dark);
    font-size: 1.25rem;
    text-align: left;
}

.home-advanced-dialog-close {
    border: 0;
    color: var(--site-muted);
    background: transparent;
    font-size: 2rem;
    line-height: 1;
}

.home-advanced-dialog .advanced-search-form {
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
}

.home-section {
    padding-block: 2.5rem;
}

.home-section h2 {
    margin: 0 0 1.25rem;
    color: var(--home-purple-dark);
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    text-align: center;
}

.home-collections {
    background: #fff;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-inline: -15px;
}

.collection-card {
    min-width: 0;
    position: relative;
    overflow: visible;
    background: #fff;
}

.collection-card-main {
    display: flex;
    min-height: 170px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 15px;
    color: #000;
    text-align: center;
    text-decoration: none;
    transition: background-color .5s ease;
}

.collection-card-main:hover {
    color: var(--home-purple-dark);
    background: #eaeaf4;
}

.collection-card:hover,
.collection-card:focus-within {
    background: #eaeaf4;
}

.collection-card-count {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    padding: .1rem;
    color: #fff;
    background: var(--home-pink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    opacity: 0;
    transition: opacity .2s ease;
}

.collection-card:hover .collection-card-count,
.collection-card:focus-within .collection-card-count {
    opacity: 1;
}

.collection-card-label {
    margin-top: .4rem;
    font-size: 1rem;
    font-weight: 700;
}

.collection-card-icon {
    padding-bottom: 15px;
    color: #684391;
}

.collection-card-kind {
    display: none;
}

.collection-card-details {
    --submenu-background: #eaeaf4;
    position: absolute;
    z-index: 5;
    top: 100%;
    left: 0;
    display: none;
    width: 100%;
    padding: 0;
    border-top: 8px solid #fff;
    color: var(--home-purple-dark);
    background: var(--submenu-background);
    font-size: .9rem;
}

.collection-card-details::before {
    position: absolute;
    top: -18px;
    left: calc(50% - 10px);
    width: 0;
    height: 0;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--submenu-background);
    border-left: 10px solid transparent;
    content: "";
}

.collection-card-details[open] {
    display: block;
    box-shadow: 0 4px 10px rgb(32 19 48 / 15%);
}

.collection-card-details summary {
    padding: .65rem .9rem;
    color: var(--home-purple-dark);
    cursor: pointer;
    font-weight: 700;
}

.collection-card-details > summary {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.collection-card-details > summary:focus {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
}

.collection-card-details ul {
    margin: 0;
    padding: .65rem .9rem;
    list-style: none;
}

.collection-card-details li {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .4rem 0;
    border-top: 1px solid #f1edf3;
}

.collection-card-details li a {
    overflow-wrap: anywhere;
}

.collection-card-details li i {
    float: left;
    width: 18px;
    margin-right: 5px;
}

.collection-card-details ul,
.collection-card-details[open] ul {
    display: block;
}

.collection-card-details ul[hidden],
.work-cover-placeholder[hidden] {
    display: none;
}

@media (hover: hover) and (min-width: 761px) {
    .collection-card:hover .collection-card-details,
    .collection-card:focus-within .collection-card-details {
        display: block;
        box-shadow: 0 4px 10px rgb(32 19 48 / 15%);
    }

    .collection-card:hover .collection-card-details > ul,
    .collection-card:focus-within .collection-card-details > ul {
        display: block;
    }
}

.home-gallery-latest,
.home-gallery-popular,
.home-gallery-monthly {
    background: #edf0f7 url("../legacy/default_theme/img/BG.jpg") no-repeat center bottom;
}

.home-gallery-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin: 0 0 1rem;
    padding: 15px 0 0;
    background: #fff;
}

.home-gallery-filter-group {
    display: flex;
    width: 235px;
    align-items: center;
}

.home-gallery-filter label {
    width: 25%;
    padding-right: 15px;
    color: #9571ae;
    font-size: 1rem;
    text-align: right;
}

.home-gallery-filter select {
    width: 75%;
    min-height: 40px;
    padding: .35rem;
    border: 2px solid #d6c3df;
    border-radius: 2px;
    background: #fff;
}

.content-results.gallery-results {
    grid-template-columns: none;
    grid-auto-columns: calc((100% - 4rem) / 5);
    grid-auto-flow: column;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: .3rem .2rem 1rem;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
    scrollbar-color: #9f4ccc #eee8f1;
}

.home-gallery-carousel {
    position: relative;
    padding: 20px 80px;
    background: #fff;
}

.gallery-results .work-card {
    min-width: 0;
    overflow: visible !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff;
    box-shadow: none;
}

.gallery-results .work-card {
    scroll-snap-align: start;
}

.gallery-work-cover {
    display: block;
    min-height: 0;
    background: #fff;
}

.gallery-cover-link {
    position: relative;
    display: block;
    overflow: hidden;
    color: inherit;
}

.gallery-work-cover img {
    width: 100%;
    height: auto;
    object-fit: initial;
}

.gallery-work-cover .work-cover-placeholder {
    min-height: 190px;
}

.gallery-cover-overlay {
    display: none;
}

.book-name.post-title {
    display: block;
    padding: 5px 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-name.post-title a {
    color: inherit;
    text-decoration: none;
}

.book-name.post-title a:hover,
.book-name.post-title a:focus-visible {
    text-decoration: underline;
}

.gallery-work-metadata {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.gallery-work-metrics {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding-bottom: .25rem;
    color: var(--home-purple);
    font-size: .9rem;
}

.gallery-work-metrics .count-download {
    text-align: right;
}

.gallery-work-metrics i {
    padding-right: .4rem;
}

@media (min-width: 992px) {
    .gallery-cover-overlay {
        position: absolute;
        inset: 0;
        display: block;
        background: linear-gradient(180deg, #6e5198 22%, #c691ac 100%);
        opacity: 0;
        transition: opacity .5s ease;
    }

    .gallery-cover-overlay span {
        position: absolute;
        top: calc(50% - 20px);
        left: calc(50% - 50px);
        width: 100px;
        padding: 7px 0;
        border: 1px solid #fff;
        border-radius: 25px;
        color: #fff;
        font-weight: 100;
        text-align: center;
    }

    .gallery-cover-link:hover .gallery-cover-overlay,
    .gallery-cover-link:focus-visible .gallery-cover-overlay {
        opacity: .9;
    }
}

.home-gallery-control {
    position: absolute;
    z-index: 2;
    top: 50%;
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 0;
    border-radius: 0;
    color: transparent;
    background-color: transparent;
    transform: translateY(-50%);
}

.home-gallery-control i {
    visibility: hidden;
}

.home-gallery-control[hidden] {
    display: none;
}

.home-gallery-control:disabled {
    opacity: .45;
}

.home-gallery-previous {
    left: 0;
    background-image: url("../legacy/default_theme/img/prev.png");
}

.home-gallery-next {
    right: 0;
    background-image: url("../legacy/default_theme/img/next.png");
}

.home-gallery-previous:hover:not(:disabled) {
    background-image: url("../legacy/default_theme/img/prev-hover.png");
}

.home-gallery-next:hover:not(:disabled) {
    background-image: url("../legacy/default_theme/img/next-hover.png");
}

.work-card {
    padding: 0 !important;
    border-color: #e8e1ed !important;
    background: #fff;
    box-shadow: 0 4px 14px rgb(48 32 64 / 7%);
}

.work-cover {
    position: relative;
    display: grid;
    min-height: 190px;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(145deg, #eee8f3, #f9f7fb);
}

.work-cover img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: contain;
    background: #fff;
}

.work-cover-placeholder {
    display: grid;
    width: 100%;
    min-height: 190px;
    place-items: center;
    color: #866aa0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .12em;
}

.work-card-body {
    padding: 1rem;
}

.work-card-body h3 {
    display: -webkit-box;
    min-height: 3.2em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.work-card-body p {
    margin: .45rem 0;
    color: #675e6d;
    font-size: .9rem;
}

.work-card-body .work-collection {
    color: var(--home-purple);
}

.work-card-body .work-metrics {
    color: #8b5367;
    font-size: .8rem;
}

@media (hover: none) {
    .collection-card-count {
        opacity: 1;
    }

    .collection-card-details > summary {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .collection-card-details {
        position: relative;
        top: auto;
        left: auto;
        display: block;
        width: auto;
        padding: .65rem .9rem;
        border-top: 1px solid #eee8f1;
        background: #fff;
    }

    .collection-card-details > summary {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .collection-card-details[open] {
        box-shadow: none;
    }

    .collection-card-details[open] > summary {
        display: list-item;
    }
}

@media (max-width: 991px) {
    .home-hero-inner {
        min-height: 400px;
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
        padding-block: 0;
    }

    .home-hero-content {
        grid-column: 1;
    }

    .collection-card-details {
        position: relative;
        top: auto;
        left: auto;
        display: block;
        width: auto;
        padding: .65rem .9rem;
        border-top: 1px solid #eee8f1;
        background: #fff;
    }

    .collection-card-details[open] {
        box-shadow: none;
    }

    .collection-card-details[open] > summary {
        display: list-item;
    }

    .home-section {
        padding-block: 1.75rem;
    }

    .home-gallery-carousel {
        padding-inline: 56px;
    }
}

@media (min-width: 1200px) {
    .home-hero-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1199px) {
    .content-results.gallery-results {
        grid-auto-columns: calc((100% - 2rem) / 3);
    }
}

@media (max-width: 599px) {
    .content-results.gallery-results {
        grid-auto-columns: 100%;
    }
}

@media (max-width: 768px) {
    .collection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-card-count {
        opacity: 1;
    }
}

@media (max-width: 430px) {
    .home-gallery-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .home-gallery-filter-group {
        width: min(100%, 300px);
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .collection-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
