/* =========================================================
   DIVILEN BOOKS
========================================================= */

:root {
    --books-bg: #f4efe7;
    --books-surface: #f8f4ed;

    --books-text: #171614;
    --books-muted: #625e57;

    --books-blue: #7892ad;
    --books-blue-dark: #587494;

    --books-border: rgba(29, 25, 20, 0.14);
    --books-dark: #101316;
}


/* =========================================================
   PAGE
========================================================= */

.books-page {
    width: 100%;
    min-height: 100vh;
    background: var(--books-bg);
    color: var(--books-text);
}


/* =========================================================
   HERO
========================================================= */

.books-hero {
    position: relative;

    width: 100%;
    height: 500px;

    overflow: hidden;

    background:
        url("/static/assets/books-vww.png")
        center right / cover
        no-repeat;
}


.books-hero-overlay {
    position: absolute;
    inset: 0;

    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            rgba(244, 239, 231, 0.98) 0%,
            rgba(244, 239, 231, 0.93) 23%,
            rgba(244, 239, 231, 0.72) 38%,
            rgba(244, 239, 231, 0.24) 58%,
            rgba(244, 239, 231, 0.02) 78%
        );
}


.books-hero-inner {
    position: relative;

    z-index: 2;

    width: min(calc(100% - 108px), 1680px);
    height: 100%;

    margin: 0 auto;

    display: flex;
    align-items: center;
}


.books-hero-content {
    width: 100%;
    max-width: 610px;
}


.books-eyebrow {
    margin: 0 0 18px;

    color: var(--books-blue-dark);

    font-family: Arial, Helvetica, sans-serif;

    font-size: 11px;
    font-weight: 700;
    line-height: 1;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.books-hero-content h1 {
    margin: 0;

    color: var(--books-text);

    font-family:
        "Bodoni MT",
        Didot,
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(64px, 6.5vw, 100px);
    font-weight: 400;
    line-height: 0.9;

    letter-spacing: -0.045em;
}


.books-hero-line {
    display: block;

    width: 58px;
    height: 1px;

    margin: 27px 0 22px;

    background: var(--books-blue);
}


.books-hero-description {
    max-width: 440px;

    margin: 0;

    color: #34312d;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
}


/* =========================================================
   LIBRARY
========================================================= */

.books-library {
    width: 100%;

    padding: 44px 0 82px;

    background: var(--books-bg);
}


.books-library-inner {
    width: min(calc(100% - 108px), 1680px);

    margin: 0 auto;
}


/* =========================================================
   HEADING
========================================================= */

.books-library-heading {
    margin-bottom: 18px;
}


.books-library-heading h2 {
    margin: 0;

    color: var(--books-text);

    font-family: Arial, Helvetica, sans-serif;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: 0.14em;
    text-transform: uppercase;
}


/* =========================================================
   TOOLBAR
========================================================= */

.books-toolbar {
    width: 100%;

    margin-bottom: 26px;

    display: grid;

    grid-template-columns:
        minmax(300px, 1fr)
        auto
        230px;

    align-items: center;

    gap: 20px;
}


/* =========================================================
   SEARCH
========================================================= */

.books-search {
    height: 48px;

    padding: 0 16px;

    display: flex;
    align-items: center;

    gap: 12px;

    background: transparent;

    border: 1px solid var(--books-border);

    cursor: text;

    transition:
        border-color 180ms ease,
        background 180ms ease;
}


.books-search:focus-within {
    border-color: var(--books-blue);
    background: rgba(255, 255, 255, 0.22);
}


.books-search svg {
    width: 17px;
    height: 17px;

    flex: 0 0 auto;

    fill: none;
    stroke: var(--books-muted);

    stroke-width: 1.5;
    stroke-linecap: round;
}


.books-search input {
    width: 100%;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--books-text);

    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}


.books-search input::placeholder {
    color: #8a857d;
}


/* =========================================================
   FILTERS
========================================================= */

.books-filters {
    display: flex;
    align-items: center;

    gap: 7px;
}


.books-filter {
    min-height: 40px;

    padding: 0 18px;

    border: 1px solid var(--books-border);

    background: transparent;

    color: var(--books-text);

    font-family: Arial, Helvetica, sans-serif;

    font-size: 10px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease;
}


.books-filter:hover {
    border-color: rgba(120, 146, 173, 0.65);
}


.books-filter.is-active {
    border-color: var(--books-blue);
    background: var(--books-blue);
    color: #ffffff;
}


/* =========================================================
   SORT
========================================================= */

.books-sort {
    position: relative;
    width: 230px;
}


.books-sort-button {
    width: 100%;
    height: 48px;

    padding: 0 15px;

    display: flex;
    align-items: center;

    gap: 6px;

    border: 1px solid var(--books-border);

    background: transparent;

    color: var(--books-text);

    font-family: Arial, Helvetica, sans-serif;

    cursor: pointer;

    transition:
        border-color 180ms ease,
        background 180ms ease;
}


.books-sort-button:hover {
    border-color: rgba(120, 146, 173, 0.65);
}


.books-sort.is-open .books-sort-button {
    border-color: var(--books-blue);
    background: rgba(255, 255, 255, 0.22);
}


.books-sort-label {
    color: var(--books-muted);

    font-size: 10px;
    font-weight: 400;
}


.books-sort-button strong {
    color: var(--books-text);

    font-size: 10px;
    font-weight: 600;
}


.books-sort-button svg {
    width: 14px;
    height: 14px;

    margin-left: auto;

    fill: none;
    stroke: var(--books-text);

    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;

    transition: transform 180ms ease;
}


.books-sort.is-open .books-sort-button svg {
    transform: rotate(180deg);
}


.books-sort-menu {
    position: absolute;

    z-index: 30;

    top: calc(100% + 6px);
    left: 0;
    right: 0;

    padding: 5px;

    background: var(--books-surface);

    border: 1px solid var(--books-border);

    box-shadow:
        0 12px 30px rgba(29, 25, 20, 0.10);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-5px);

    transition:
        opacity 160ms ease,
        visibility 160ms ease,
        transform 160ms ease;
}


.books-sort.is-open .books-sort-menu {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


.books-sort-option {
    width: 100%;

    padding: 10px 11px;

    display: block;

    border: 0;

    background: transparent;

    color: var(--books-text);

    font-family: Arial, Helvetica, sans-serif;

    font-size: 10px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;

    transition:
        background 150ms ease,
        color 150ms ease;
}


.books-sort-option:hover {
    background: rgba(120, 146, 173, 0.10);
}


.books-sort-option.is-active {
    background: rgba(120, 146, 173, 0.14);

    color: var(--books-blue-dark);

    font-weight: 700;
}


/* =========================================================
   BOOK GRID
========================================================= */

.books-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 18px;
}


/* =========================================================
   BOOK CARD
========================================================= */

.book-library-card {
    min-width: 0;

    display: block;

    color: inherit;

    text-decoration: none;
}


.book-library-cover {
    position: relative;

    height: 445px;

    overflow: hidden;

    background: var(--books-dark);

    border: 1px solid var(--books-border);
    border-radius: 3px;

    transition:
        transform 220ms ease,
        border-color 220ms ease;
}


.book-library-card:hover .book-library-cover {
    transform: translateY(-3px);

    border-color: rgba(120, 146, 173, 0.72);
}


.book-library-cover > img {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
    object-position: center;

    transition:
        transform 0.7s cubic-bezier(.2, .7, .2, 1);
}


.book-library-card:hover .book-library-cover > img {
    transform: scale(1.025);
}


.book-cover-placeholder {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            145deg,
            #303438,
            #121518
        );
}


.book-cover-gradient {
    position: absolute;
    inset: 0;

    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            to bottom,
            rgba(8, 10, 12, 0.00) 25%,
            rgba(8, 10, 12, 0.05) 42%,
            rgba(8, 10, 12, 0.52) 66%,
            rgba(8, 10, 12, 0.94) 100%
        );
}


/* =========================================================
   CARD CONTENT
========================================================= */

.book-library-content {
    position: absolute;

    z-index: 2;

    left: 18px;
    right: 18px;
    bottom: 16px;

    color: #ffffff;
}


.book-library-content h3 {
    margin: 0;

    color: #ffffff;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 19px;
    font-weight: 700;

    line-height: 1.12;

    letter-spacing: -0.015em;
}


/* =========================================================
   BOOK TYPE
========================================================= */

.book-type-row {
    margin-top: 10px;
}


.book-type {
    width: fit-content;

    min-height: 21px;

    padding: 0 8px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    background: rgba(120, 146, 173, 0.94);

    color: #ffffff;

    font-family: Arial, Helvetica, sans-serif;

    font-size: 7px;
    font-weight: 700;

    line-height: 1;

    letter-spacing: 0.09em;
    text-transform: uppercase;

    border-radius: 999px;
}


/* =========================================================
   CARD BOTTOM
========================================================= */

.book-card-bottom {
    margin-top: 11px;

    display: flex;

    align-items: center;
    justify-content: flex-end;
}


.book-card-arrow {
    color: #9bb3ca;

    font-size: 14px;
    line-height: 1;

    transition: transform 180ms ease;
}


.book-library-card:hover .book-card-arrow {
    transform: translate(2px, -2px);
}


/* =========================================================
   EMPTY STATE
========================================================= */

.books-empty,
.books-no-results {
    grid-column: 1 / -1;

    min-height: 180px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-top: 1px solid var(--books-border);
    border-bottom: 1px solid var(--books-border);
}


.books-empty p,
.books-no-results p {
    margin: 0;

    color: var(--books-muted);

    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}


.books-no-results[hidden] {
    display: none;
}


/* =========================================================
   PAGINATION
========================================================= */

.books-pagination {
    margin-top: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 5px;
}


.books-page-number,
.books-page-arrow {
    min-width: 34px;
    height: 34px;

    padding: 0 8px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    border: 1px solid transparent;

    color: var(--books-muted);

    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px;

    text-decoration: none;

    transition:
        border-color 160ms ease,
        color 160ms ease,
        background 160ms ease;
}


.books-page-number:hover,
.books-page-arrow:hover {
    color: var(--books-text);

    border-color: var(--books-border);
}


.books-page-number.is-active {
    background: var(--books-blue);

    border-color: var(--books-blue);

    color: #ffffff;
}


/* =========================================================
   DESKTOP / SMALL LAPTOP
========================================================= */

@media (max-width: 1250px) {

    .books-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .book-library-cover {
        height: 430px;
    }

    .books-toolbar {
        grid-template-columns:
            1fr
            auto;
    }

    .books-sort {
        grid-column: 1 / -1;

        width: 230px;

        justify-self: end;
    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .books-hero {
        height: 420px;
    }

    .books-hero-inner,
    .books-library-inner {
        width: calc(100% - 48px);
    }

    .books-hero-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(244, 239, 231, 0.95) 0%,
                rgba(244, 239, 231, 0.82) 48%,
                rgba(244, 239, 231, 0.22) 100%
            );
    }

    .books-toolbar {
        grid-template-columns: 1fr;
    }

    .books-filters {
        order: 2;
    }

    .books-sort {
        grid-column: auto;

        width: 100%;

        order: 3;

        justify-self: stretch;
    }

    .books-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .book-library-cover {
        height: 440px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 620px) {

    .books-hero {
        height: 430px;

        background-position: 67% center;
    }

    .books-hero-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(244, 239, 231, 0.95) 0%,
                rgba(244, 239, 231, 0.82) 68%,
                rgba(244, 239, 231, 0.28) 100%
            );
    }

    .books-hero-inner,
    .books-library-inner {
        width: calc(100% - 32px);
    }

    .books-hero-content h1 {
        font-size: clamp(52px, 17vw, 72px);
    }

    .books-hero-description {
        max-width: 300px;

        font-size: 13px;
    }

    .books-library {
        padding-top: 32px;
    }

    .books-toolbar {
        gap: 12px;

        margin-bottom: 22px;
    }

    .books-filters {
        width: 100%;

        overflow-x: auto;

        padding-bottom: 2px;
    }

    .books-filter {
        flex: 0 0 auto;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-library-cover {
        height: 470px;
    }

}