/* =========================================================
   SAMRAMBA KERALAM 2030
   YOUR ENTREPRENEURIAL LIBRARY
   LIBRARY-ONLY STYLESHEET
   ---------------------------------------------------------
   This stylesheet is intentionally isolated from style.css.
   All Library selectors use the .library-* namespace so the
   landing page CSS remains untouched.
========================================================= */


/* =========================================================
   01. LIBRARY DESIGN TOKENS
========================================================= */

:root {
    --library-navy: #0B1F3A;
    --library-navy-dark: #07182D;
    --library-navy-soft: #102943;

    --library-green: #16A34A;
    --library-green-dark: #0A8754;
    --library-green-soft: #EAF7EF;

    --library-white: #FFFFFF;
    --library-bg: #F7F9FC;
    --library-bg-soft: #F1F5F9;

    --library-text: #0F172A;
    --library-text-soft: #475569;
    --library-text-muted: #64748B;

    --library-border: #E2E8F0;
    --library-border-soft: #EDF1F5;

    --library-radius-sm: 10px;
    --library-radius-md: 14px;
    --library-radius-lg: 18px;
    --library-radius-xl: 24px;

    --library-shadow-sm:
        0 4px 14px rgba(15, 23, 42, 0.06);

    --library-shadow-md:
        0 10px 30px rgba(15, 23, 42, 0.08);

    --library-shadow-lg:
        0 20px 50px rgba(15, 23, 42, 0.12);

    --library-sidebar-width: 250px;
    --library-topbar-height: 76px;
    --library-content-max: 1320px;

    --library-transition:
    850ms cubic-bezier(.2, .8, .2, 1);
}


/* =========================================================
   02. LIBRARY FOUNDATION
========================================================= */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
}

.library-app,
.library-app * {
    box-sizing: border-box;
}

.library-app {
    min-height: 100vh;
    width: 100%;
    display: flex;

    font-family: "Inter", sans-serif;

    color: var(--library-text);
    background: var(--library-bg);

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.library-app button,
.library-app input,
.library-app a {
    -webkit-tap-highlight-color: transparent;
}

.library-app button {
    font: inherit;
}

.library-app a {
    color: inherit;
}

.library-app img {
    display: block;
    max-width: 100%;
}


/* =========================================================
   03. SIDEBAR
   ---------------------------------------------------------
   Desktop:
   fixed-width visible navigation.

   Mobile:
   sidebar becomes an off-canvas panel and is opened by
   the hamburger button.
========================================================= */

.library-sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    width: var(--library-sidebar-width);
    height: 100vh;

    z-index: 1000;

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            180deg,
            var(--library-navy-dark) 0%,
            var(--library-navy) 100%
        );

    color: var(--library-white);

    border-right: 1px solid rgba(255, 255, 255, 0.06);

    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: thin;

    transition:
        transform var(--library-transition),
        box-shadow var(--library-transition);
}

.library-sidebar::-webkit-scrollbar {
    width: 4px;
}

.library-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}


/* =========================================================
   04. SIDEBAR BRAND
========================================================= */

.library-sidebar-brand {
    min-height: 88px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 18px 14px;
     background: #FFFFFF;
     border-bottom: 1px solid #E2E8F0;
}

.library-brand-link {
    display: inline-flex;
    align-items: center;

    text-decoration: none;
}

.library-brand-logo {
    width: 164px;
    height: auto;
}

.library-sidebar-close {
    display: none;

    width: 38px;
    height: 38px;

    align-items: center;
    justify-content: center;

    padding: 0;

     border: 1px solid #E2E8F0;
    border-radius: 10px;

    background: #F8FAFC;
    color: #0B1F3A;

    cursor: pointer;
}

.library-sidebar-close svg {
    width: 19px;
    height: 19px;
    stroke: #0B1F3A;
}


/* =========================================================
   05. SIDEBAR NAVIGATION
========================================================= */

.library-nav {
    padding: 22px 12px 28px;
}

.library-nav-group + .library-nav-group {
    margin-top: 28px;
}

.library-nav-label {
    display: block;

    margin:
        0 10px 9px;

    font-family: "Inter", sans-serif;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;

    letter-spacing: 0.12em;
    text-transform: uppercase;

    color:
        rgba(255, 255, 255, 0.45);
}

.library-nav-item {
    position: relative;

    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;
    gap: 12px;

    margin: 2px 0;
    padding: 9px 11px;

    border: 0;
    border-radius: 10px;

    background: transparent;
    color: rgba(255, 255, 255, 0.78);

    font-size: 12px;
    font-weight: 500;

    text-decoration: none;
    text-align: left;

    cursor: pointer;

    transition:
        background var(--library-transition),
        color var(--library-transition),
        transform var(--library-transition);
}

.library-nav-item svg {
    width: 17px;
    height: 17px;

    flex: 0 0 17px;

    stroke-width: 1.8;
}

.library-nav-item span:not(.library-toggle) {
    min-width: 0;
}

.library-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--library-white);
}

.library-nav-item:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

.library-nav-item.is-active {
    background:
        linear-gradient(
            90deg,
            rgba(22, 163, 74, 0.24),
            rgba(22, 163, 74, 0.08)
        );

    color: #7BE0A1;
}

.library-nav-item.is-active::before {
    content: "";

    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;

    width: 3px;

    border-radius: 0 4px 4px 0;

    background: var(--library-green);
}

.library-nav-button {
    appearance: none;
}


/* =========================================================
   06. DND TOGGLE
========================================================= */

.library-nav-button .library-toggle {
    margin-left: auto;
}

.library-toggle {
    position: relative;

    width: 32px;
    height: 18px;

    flex: 0 0 32px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.18);

    transition:
        background var(--library-transition);
}

.library-toggle-knob {
    position: absolute;

    top: 3px;
    left: 3px;

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: var(--library-white);

    transition:
        transform var(--library-transition);
}

.library-nav-button.is-on .library-toggle {
    background: var(--library-green);
}

.library-nav-button.is-on .library-toggle-knob {
    transform: translateX(14px);
}


/* =========================================================
   07. SIDEBAR BACKDROP
========================================================= */

.library-sidebar-backdrop {
    position: fixed;
    inset: 0;

    z-index: 990;

    background: rgba(7, 24, 45, 0.48);

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity var(--library-transition),
        visibility var(--library-transition);

    backdrop-filter: blur(2px);
}

.library-app.sidebar-open .library-sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* =========================================================
   08. MAIN AREA
========================================================= */

.library-main {
    width: calc(100% - var(--library-sidebar-width));
    min-height: 100vh;

    margin-left: var(--library-sidebar-width);

    background: var(--library-bg);
}


/* =========================================================
   09. TOP BAR
========================================================= */

.library-topbar {
    position: sticky;
    top: 0;

    z-index: 900;

    min-height: var(--library-topbar-height);

    display: flex;
    align-items: center;
    gap: 18px;

    padding: 14px 28px;

    background:
        rgba(255, 255, 255, 0.94);

    border-bottom:
        1px solid var(--library-border);

    backdrop-filter: blur(16px);
}

.library-menu-button {
    display: none;

    width: 42px;
    height: 42px;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid var(--library-border);
    border-radius: 11px;

    background: var(--library-white);
    color: var(--library-navy);

    cursor: pointer;
}

.library-menu-button svg {
    width: 20px;
    height: 20px;
}

.library-mobile-title {
    display: none;

    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 700;

    letter-spacing: -0.01em;
    color: var(--library-navy);

    white-space: nowrap;
}


/* =========================================================
   10. SEARCH
========================================================= */

.library-search {
    position: relative;

    width: min(560px, 100%);
    margin: 0 auto;

    display: flex;
    align-items: center;
}

.library-search > svg {
    position: absolute;
    left: 16px;

    width: 17px;
    height: 17px;

    color: var(--library-text-muted);

    pointer-events: none;
}

.library-search input {
    width: 100%;
    height: 44px;

    padding:
        0 18px 0 46px;

    border:
        1px solid var(--library-border);

    border-radius: 999px;

    outline: none;

    background: var(--library-bg-soft);
    color: var(--library-text);

    font-family: "Inter", sans-serif;
    font-size: 12px;

    transition:
        border-color var(--library-transition),
        background var(--library-transition),
        box-shadow var(--library-transition);
}

.library-search input::placeholder {
    color: var(--library-text-muted);
}

.library-search input:focus {
    border-color:
        rgba(22, 163, 74, 0.55);

    background: var(--library-white);

    box-shadow:
        0 0 0 4px rgba(22, 163, 74, 0.08);
}


/* =========================================================
   11. PROFILE
========================================================= */

.library-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.library-profile-button {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid var(--library-border);
    border-radius: 50%;

    background: var(--library-white);
    color: var(--library-navy);

    cursor: pointer;

    transition:
        transform var(--library-transition),
        box-shadow var(--library-transition);
}

.library-profile-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--library-shadow-sm);
}

.library-profile-button svg {
    width: 19px;
    height: 19px;
}


/* =========================================================
   12. CONTENT WRAPPER
========================================================= */

.library-content {
    width: min(
        calc(100% - 56px),
        var(--library-content-max)
    );

    margin: 0 auto;

    padding:
        28px 0 70px;
}

/* =========================================================
   EXPLORE LIBRARY
   Match the main Library content alignment
========================================================= */

#explore-library {
    width: min(
        calc(100% - 56px),
        var(--library-content-max)
    );

    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   13. DYNAMIC BANNER
   ---------------------------------------------------------
   This is intentionally a single reusable banner stage.
   library.js will change its content.
========================================================= */

.library-banner {
    position: relative;

    height: auto;
        min-height: 0;
        aspect-ratio: 5 / 1;

    display: flex;
    align-items: stretch;

    overflow: hidden;

    border-radius: var(--library-radius-lg);

    background:
        linear-gradient(
            105deg,
            var(--library-navy-dark) 0%,
            var(--library-navy) 54%,
            #163A58 100%
        );

    box-shadow: var(--library-shadow-md);

    color: var(--library-white);
}



/* =========================================================
   DESKTOP MULTI-BANNER LAYOUT
   Desktop only — tablet and mobile remain unchanged
========================================================= */

@media (min-width: 1101px) {

    
/* =========================================================
   DESKTOP TEXT BANNER CARDS
   Restores the original imageless banner styling
========================================================= */

.library-banner-desktop-card.is-text-card {
    display: flex;
    align-items: stretch;
    position: relative;
    background: linear-gradient(
        105deg,
        var(--library-navy-dark) 0%,
        var(--library-navy) 54%,
        #163A58 100%
    );
    color: var(--library-white);
}

.library-banner-desktop-card.is-text-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(7, 24, 45, 0.06),
        rgba(7, 24, 45, 0.16)
    );
    pointer-events: none;
}

.library-banner-desktop-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 24px;
}

.library-banner-desktop-eyebrow {
    position: relative;
    top: -15px;
    display: block;
    margin-bottom: 7px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: #7BE0A1;
}

.library-banner-desktop-title {
    position: relative;
    top: -15px;
    max-width: 100%;
    margin: 0 0 9px;
    font-family: "Poppins", sans-serif;
    font-size: clamp(15px, 1.45vw, 21px);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -0.025em;
    color: var(--library-white);
}

.library-banner-desktop-text {
    position: relative;
    top: -15px;
    max-width: 100%;
    margin: 0 0 13px;
    font-size: 10px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.74);
}

.library-banner-desktop-action {
    position: relative;
    top: 20px;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--library-green);
    color: var(--library-white);
    font-size: 9px;
    font-weight: 600;
    text-decoration: none;
    transition:
        transform var(--library-transition),
        background var(--library-transition),
        box-shadow var(--library-transition);
}

.library-banner-desktop-action:hover {
    transform: translateY(-1px);
    background: var(--library-green-dark);
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.24);
}



    .library-banner.is-desktop-multi-banner {
        display: block;
        position: relative;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 5 / 1;
        overflow: hidden;
        background: transparent;
        box-shadow: none;
    }

    .library-banner.is-desktop-multi-banner::after,
    .library-banner.is-desktop-multi-banner > .library-banner-content,
    .library-banner.is-desktop-multi-banner > .library-banner-visual,
    .library-banner.is-desktop-multi-banner > .library-banner-controls {
        display: none !important;
    }

    .library-banner-desktop {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

   .library-banner-desktop-viewport {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

    .library-banner-desktop-track {
        display: flex;
        align-items: stretch;
        gap: 16px;
        width: 100%;
        height: 100%;
        will-change: transform;
    }

    .library-banner-desktop-card {
        position: relative;
        flex: 0 0 42.55%;
        min-width: 0;
        height: 100%;
        overflow: hidden;
        border-radius: var(--library-radius-lg);
        background: #E9EEF3;
        box-shadow: var(--library-shadow-md);
    }

    .library-banner-desktop-card img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border-radius: inherit;
        user-select: none;
        -webkit-user-drag: none;
    }

    /* Navigation arrows */

    .library-banner-desktop-arrow {
        position: absolute;
        z-index: 4;
        top: 50%;
        display: grid;
        place-items: center;
        width: 24px;
        height: 24px;
        padding: 0;
        border: 1px solid rgba(255,255,255,.72);
        border-radius: 50%;
        background: rgba(11,31,58,.68);
        color: #FFFFFF;
        cursor: pointer;
        opacity: 0;
        transform: translateY(-50%);
        transition: opacity .2s ease, background .2s ease;
    }

    .library-banner-desktop:hover .library-banner-desktop-arrow,
    .library-banner-desktop:focus-within .library-banner-desktop-arrow {
        opacity: 1;
    }

    .library-banner-desktop-arrow:hover {
        background: rgba(11,31,58,.9);
    }

    .library-banner-desktop-arrow svg {
        width: 14px;
        height: 14px;
    }

    .library-banner-desktop-arrow.is-previous {
        left: 10px;
    }

    .library-banner-desktop-arrow.is-next {
        right: 10px;
    }

    /* Navigation dots */

.library-banner-desktop-dots {
    position: relative;
    z-index: 5;

    flex: 0 0 14px;
    align-self: center;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    width: max-content;
    margin: 6;
    padding: 3px 8px;

    border-radius: 999px;
    background: rgba(7,24,45,.42);
}

    .library-banner-desktop-dot {
        width: 6px;
        height: 6px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: rgba(255,255,255,.58);
        cursor: pointer;
        transition: width .2s ease, background .2s ease;
    }

    .library-banner-desktop-dot.is-active {
        width: 18px;
        background: #FFFFFF;
    }
}

@media (prefers-reduced-motion: reduce) {
    .library-banner-desktop-track,
    .library-banner-desktop-arrow,
    .library-banner-desktop-dot {
        transition: none !important;
    }
}



/* =========================================================
   IMAGE-ONLY LIBRARY BANNER
   Supports image banners alongside existing text banners
========================================================= */



.library-banner.is-image-banner .library-banner-content {
    display: none;
}

.library-banner.is-image-banner .library-banner-visual {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    background: none;
    z-index: 1;
}

.library-banner.is-image-banner .library-banner-visual::before,
.library-banner.is-image-banner .library-banner-visual::after {
    display: none;
}

.library-banner-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: left;
    border-radius: inherit;
}

/* Keep carousel navigation visible on image banners */
.library-banner.is-image-banner .library-banner-controls {
    z-index: 5;
}

/* Image banner action button */
.library-banner-image-action {
    position: absolute;
    left: 22px;
    bottom: 17px;
    gap: 7px;
    transform: none;
    z-index: 6;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    min-height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: 9px;

    background: var(--library-green);
    color: #FFFFFF;

    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;

    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

.library-banner-image-action:hover {
    background: var(--library-green-dark);
    transform: translateY(-1px);
}


.library-banner::after {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(7, 24, 45, 0.06),
            rgba(7, 24, 45, 0.16)
        );

    pointer-events: none;
}

.library-banner-content {
    position: relative;

    z-index: 3;

    width: min(66%, 720px);

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 30px 36px 34px;
}

.library-banner-eyebrow {
    display: block;

    margin-bottom: 9px;

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 0.13em;
    text-transform: uppercase;

    color: #7BE0A1;
}

.library-banner h1 {
    max-width: 640px;

    margin: 0 0 10px;

    font-family: "Poppins", sans-serif;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.12;

    letter-spacing: -0.025em;

    color: var(--library-white);
}

.library-banner p {
    max-width: 550px;

    margin: 0 0 20px;

    font-size: 12px;
    line-height: 1.65;

    color: rgba(255, 255, 255, 0.74);
}

.library-banner-action {
    width: fit-content;

    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 32px;

    padding: 0 13px;

    border-radius: 9px;

    background: var(--library-green);
    color: var(--library-white);

    font-size: 11px;
    font-weight: 600;

    text-decoration: none;

    transition:
        transform var(--library-transition),
        background var(--library-transition),
        box-shadow var(--library-transition);
}

.library-banner-action:hover {
    transform: translateY(-1px);

    background: var(--library-green-dark);

    box-shadow:
        0 8px 20px rgba(22, 163, 74, 0.24);
}

.library-banner-action svg {
    width: 14px;
    height: 14px;
}

.library-banner-visual {
    position: absolute;
    z-index: 1;

    top: 0;
    right: 0;
    bottom: 0;

    width: 48%;

    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(255, 255, 255, 0.11),
            transparent 55%
        ),
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.04)
        );

    opacity: 0.9;
}

.library-banner-visual::before,
.library-banner-visual::after {
    content: "";

    position: absolute;

    border-radius: 50%;

    border: 1px solid rgba(255, 255, 255, 0.07);
}

.library-banner-visual::before {
    width: 270px;
    height: 270px;

    right: 8%;
    top: 50%;

    transform: translateY(-50%);
}

.library-banner-visual::after {
    width: 170px;
    height: 170px;

    right: 17%;
    top: 50%;

    transform: translateY(-50%);
}

.library-banner-controls {
    position: absolute;

    z-index: 5;

    right: 20px;
    bottom: 17px;

    display: flex;
    align-items: center;
    gap: 6px;
}

.library-banner-dot {
    width: 6px;
    height: 6px;

    padding: 0;

    border: 0;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.35);

    cursor: pointer;

    transition:
        width var(--library-transition),
        background var(--library-transition);
}

.library-banner-dot.is-active {
    width: 18px;
    background: var(--library-green);
}


/* =========================================================
   14. LIBRARY SECTIONS
========================================================= */

.library-section {
    margin-top: 42px;
}

.library-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 18px;
}

.library-section-eyebrow {
    display: block;

    margin-bottom: 5px;

    font-size: 8px;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;

    color: var(--library-green);
}

.library-section-heading h2 {
    margin: 0;

    font-family: "Poppins", sans-serif;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;

    letter-spacing: -0.02em;

    color: var(--library-navy);
}

.library-view-all {
    flex: 0 0 auto;

    font-size: 11px;
    font-weight: 600;

    color: var(--library-green-dark);

    text-decoration: none;
}

.library-view-all:hover {
    text-decoration: underline;
}

.library-section-note {
    color: var(--library-text-muted);

    font-size: 10px;
}


/* =========================================================
   15. BOOK GRIDS
   ---------------------------------------------------------
   Desktop:
   compact premium cards.

   The actual books will be rendered by library.js.
========================================================= */

.library-book-grid {
    display: grid;

    grid-template-columns:
        repeat(6, minmax(0, 1fr));

    gap: 24px 20px;
}

/* =========================================================
   HOME BOOK ROWS
   ---------------------------------------------------------
   Only Popular, New Releases and Recommended use a
   single horizontal row.
========================================================= */

#popular-books .library-book-grid,
#new-releases .library-book-grid,
#recommended .library-book-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;

    gap: 24px 20px;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

#popular-books .library-book-grid::-webkit-scrollbar,
#new-releases .library-book-grid::-webkit-scrollbar,
#recommended .library-book-grid::-webkit-scrollbar {
    display: none;
}

#popular-books .library-book-card,
#new-releases .library-book-card,
#recommended .library-book-card {
    flex: 0 0 155px;
    width: 155px;
}


.library-book-card {
    min-width: 0;

    display: flex;
    flex-direction: column;

    cursor: pointer;

    text-decoration: none;

    border-radius: var(--library-radius-sm);

    outline: none;
}

.library-book-card:focus-visible {
    box-shadow:
        0 0 0 3px rgba(22, 163, 74, 0.2);
}

.library-book-cover {
    position: relative;

    width: 100%;

    aspect-ratio: 0.75;

    overflow: hidden;

    border-radius: 9px;

    background: var(--library-bg-soft);

    box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.12);

    transition:
        transform var(--library-transition),
        box-shadow var(--library-transition);
}

.library-book-card:hover .library-book-cover {
    transform: translateY(-4px);

    box-shadow:
        0 15px 30px rgba(15, 23, 42, 0.16);
}

.library-book-cover img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.library-book-lock {
    position: absolute;

    top: 8px;
    right: 8px;

    width: 23px;
    height: 23px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
        rgba(7, 24, 45, 0.78);

    color: var(--library-white);

    backdrop-filter: blur(5px);
}

.library-book-lock svg {
    width: 12px;
    height: 12px;
}

.library-book-info {
    min-width: 0;

    padding-top: 10px;
}

.library-book-title {
    display: -webkit-box;

    overflow: hidden;

    margin: 0 0 4px;

    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;

    color: var(--library-text);

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.library-book-author {
    overflow: hidden;

    margin: 0;

    font-size: 10px;
    line-height: 1.4;

    color: var(--library-text-muted);

    white-space: nowrap;
    text-overflow: ellipsis;
}

/* =========================================================
   READING HISTORY / PROGRESS PAGE TEXT
========================================================= */

.library-history-meta,
.library-reading-progress-meta {
    font-size: 10px;
    line-height: 1.3;
}

.library-book-info .library-book-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.library-book-info .library-book-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.library-book-info .library-book-action {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--library-navy);
    cursor: pointer;
}

.library-book-info .library-book-action svg {
    width: 13px;
    height: 13px;
}

.library-book-info .library-book-action.is-active {
     color: #e11d72;
}

.library-book-info .library-bookmark-button.is-active {
    color: var(--library-navy);
}

.library-book-info .library-book-action.is-active svg {
    fill: currentColor;
}

/* =========================================================
   PERSONAL LIBRARY — DESKTOP / TABLET BREATHING SPACE
========================================================= */

#libraryPersonalView {
    width: calc(100% - 40px);
    margin-left: auto;
    margin-right: auto;
}


@media (max-width: 767px) {

    .library-book-info .library-book-author {
        gap: 4px;
    }

    .library-book-info .library-book-action {
        width: 18px;
        height: 18px;
    }

    .library-book-info .library-book-action svg {
        width: 11px;
        height: 11px;
    }

}


/* =========================================================
   NOTES & HIGHLIGHTS
========================================================= */

.library-personal-view {
    display: none;
}

.library-personal-view.is-active {
    display: block;
}

.library-notes-view {
    display: none;
}

.library-notes-view.is-active {
    display: block;
}

.library-notes-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 18px;
}

.library-note-card {
    padding: 18px;

    border:
        1px solid var(--library-border);

    border-radius:
        var(--library-radius-md);

    background:
        var(--library-white);

    box-shadow:
        var(--library-shadow-sm);
}

.library-note-card-type {
    margin-bottom: 8px;

    color:
        var(--library-green);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.library-note-card-content {
    color:
        var(--library-text);

    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 767px) {

    .library-notes-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .library-note-card {
        padding: 14px;
    }

    .library-note-card-content {
        font-size: 11px;
    }

}


/* =========================================================
   16. CONTINUE READING
========================================================= */

.library-continue-section {
    display: none;
}

.library-continue-section.has-content {
    display: block;
}

.library-continue-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 16px;
}

.library-continue-card {
    display: flex;
    align-items: center;
    gap: 15px;

    min-height: 120px;

    padding: 14px;

    border:
        1px solid var(--library-border);

    border-radius: var(--library-radius-md);

    background: var(--library-white);

    box-shadow: var(--library-shadow-sm);
}

.library-continue-cover {
    width: 62px;
    height: 88px;

    flex: 0 0 62px;

    overflow: hidden;

    border-radius: 6px;

    background: var(--library-bg-soft);
}

.library-continue-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-continue-info {
    min-width: 0;
}

.library-continue-title {
    margin: 0 0 5px;

    font-family: "Poppins", sans-serif;
    font-size: 12px;
    line-height: 1.35;
}

.library-continue-meta {
    margin: 0 0 10px;

    color: var(--library-text-muted);

    font-size: 10px;
}

.library-progress {
    width: 100%;
    height: 4px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--library-border);
}

.library-progress-value {
    width: 0;
    height: 100%;

    border-radius: inherit;

    background: var(--library-green);
}


/* =========================================================
   17. CATEGORY SCROLLER
   ---------------------------------------------------------
   Desktop:
   horizontal category row.

   Mobile:
   exactly three cards fit within the viewport and the
   track becomes horizontally swipeable.
========================================================= */

.library-category-scroller {
    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;

    scroll-behavior: smooth;

    -webkit-overflow-scrolling: touch;
}

.library-category-scroller::-webkit-scrollbar {
    display: none;
}

.library-category-track {
    display: grid;

    grid-template-columns:
        repeat(12, minmax(125px, 1fr));

    gap: 12px;

    min-width: max-content;
}

.library-category-card {
    position: relative;

    min-height: 126px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    padding: 18px 12px;

    overflow: hidden;

    border-radius: var(--library-radius-md);

    background:
        linear-gradient(
            145deg,
            var(--library-navy),
            #163A58
        );

    color: var(--library-white);

    text-align: center;

    cursor: pointer;

    transition:
        transform var(--library-transition),
        box-shadow var(--library-transition);
}

.library-category-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--library-shadow-md);
}

.library-category-icon {
    position: absolute;

    top: 18px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background:
        rgba(255, 255, 255, 0.1);

    color: #7BE0A1;
}

.library-category-icon svg {
    width: 20px;
    height: 20px;
}

.library-category-name {
    position: relative;
    z-index: 2;

    max-width: 110px;

    font-family: "Poppins", sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}


/* =========================================================
   18. BOOK MODAL
========================================================= */

.library-book-modal[hidden] {
    display: none;
}

.library-book-modal {
    position: fixed;
    inset: 0;

    z-index: 2000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 22px;
}

.library-book-modal-backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(7, 24, 45, 0.62);

    backdrop-filter: blur(7px);
}

.library-book-modal-panel {
    position: relative;
    z-index: 2;

    width: min(760px, 100%);

    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 34px;

    padding: 32px;

    border-radius: var(--library-radius-xl);

    background: var(--library-white);

    box-shadow: var(--library-shadow-lg);
}

.library-book-modal-close {
    position: absolute;

    top: 14px;
    right: 14px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border:
        1px solid var(--library-border);

    border-radius: 50%;

    background: var(--library-white);
    color: var(--library-navy);

    cursor: pointer;
}

.library-book-modal-close svg {
    width: 17px;
    height: 17px;
}

.library-book-modal-cover {
    width: 100%;
    aspect-ratio: 0.665;

    overflow: hidden;

    border-radius: 9px;

    background: var(--library-bg-soft);
}

.library-book-modal-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-book-modal-content {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding-right: 25px;
}

.library-book-modal-eyebrow {
    margin-bottom: 9px;

    color: var(--library-green);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.library-book-modal-content h2 {
    margin: 0 0 7px;

    font-family: "Poppins", sans-serif;
    font-size: 26px;
    line-height: 1.2;

    color: var(--library-navy);
}

.library-book-modal-content p {
    margin: 0;

    color: var(--library-text-muted);

    font-size: 12px;
}

.library-book-modal-action {
    margin-top: 24px;
}


/* =========================================================
   19. DND MODE
========================================================= */

.library-app.is-dnd .library-topbar {
    box-shadow: none;
}

.library-app.is-dnd .library-banner-controls,
.library-app.is-dnd .library-view-all {
    opacity: 0.55;
}

.library-app.is-dnd .library-sidebar {
    opacity: 0.96;
}


/* =========================================================
   20. BODY LOCK WHEN SIDEBAR / MODAL IS OPEN
========================================================= */

body.library-sidebar-is-open,
body.library-modal-is-open {
    overflow: hidden;
}




/* =========================================================
   21. LARGE DESKTOP
========================================================= */

@media (min-width: 1400px) {

    .library-content {
        width: min(
            calc(100% - 72px),
            1380px
        );
    }

        #explore-library {
        width: min(
            calc(100% - 72px),
            1380px
        );
    }

    .library-book-grid {
        grid-template-columns:
            repeat(7, minmax(0, 1fr));
    }

    #popular-books .library-book-card,
    #new-releases .library-book-card,
    #recommended .library-book-card {
        flex-basis: 155px;
        width: 155px;
    }

}


/* =========================================================
   22. TABLET
========================================================= */

@media (max-width: 1100px) {

    :root {
        --library-sidebar-width: 226px;
    }

    .library-topbar {
        padding-left: 22px;
        padding-right: 22px;
    }

    .library-content {
        width: calc(100% - 40px);
    }

        #explore-library {
        width: calc(100% - 40px);
    }

    .library-book-grid {
        grid-template-columns:
            repeat(5, minmax(0, 1fr));

        gap: 22px 18px;
    }

    #popular-books .library-book-grid,
    #new-releases .library-book-grid,
    #recommended .library-book-grid {
        gap: 22px 18px;
    }

    #popular-books .library-book-card,
    #new-releases .library-book-card,
    #recommended .library-book-card {
        flex-basis: calc((100% - 72px) / 5);
        width: calc((100% - 72px) / 5);
    }

    .library-category-track {
        grid-template-columns:
            repeat(12, 118px);
    }

}


/* =========================================================
   23. NORMAL PHONE
   ---------------------------------------------------------
   Sidebar is NOT permanently visible.
   Hamburger opens it as an animated off-canvas panel.
========================================================= */

@media (max-width: 900px) {

    .library-sidebar {
        width: min(310px, 86vw);

        transform: translateX(-102%);

        box-shadow:
            12px 0 40px rgba(7, 24, 45, 0.2);
    }

    .library-app.sidebar-open .library-sidebar {
        transform: translateX(0);
    }

    .library-sidebar-close {
        display: flex;
    }

    .library-sidebar-brand {
    min-height: 88px;
    padding: 12px 14px;
    gap: 10px;
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
}

.library-brand-link {
    min-width: 0;
    flex: 1 1 auto;
}

.library-brand-logo {
    width: 164px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.library-sidebar-close {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    background: #F8FAFC;
    color: #0B1F3A;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
}

.library-sidebar-close svg {
    stroke: #0B1F3A;
}


    .library-main {
        width: 100%;
        margin-left: 0;
    }

    .library-topbar {
        min-height: 64px;

        gap: 12px;

        padding:
            10px 18px;
    }

    .library-menu-button {
        display: flex;
        flex: 0 0 42px;
    }

    .library-mobile-title {
        display: block;
    }

    .library-search {
        max-width: none;
        margin-left: auto;
        margin-right: 0;
    }

    .library-profile-button {
        width: 40px;
        height: 40px;
    }

    .library-content {
        width: calc(100% - 32px);

        padding-top: 22px;
    }

    .library-banner {
        height: auto;
        min-height: 0;
        aspect-ratio: 2.4 / 1;
    }

    .library-banner-content {
        width: 76%;
        padding: 28px 26px 30px;
    }

    .library-banner h1 {
        font-size: 28px;
    }

    .library-banner-visual {
        width: 48%;
    }

    .library-book-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        gap: 22px 14px;
    }

}


/* =========================================================
   24. PHONE
========================================================= */

@media (max-width: 767px) {

    .library-topbar {
        position: sticky;

        min-height: 60px;

        padding:
            9px clamp(8px, 3.6vw, 14px);
    }

    .library-menu-button {
        width: 40px;
        height: 40px;
    }

    .library-mobile-title {
        font-size: 11px;
    }

    .library-profile-button {
        width: 38px;
        height: 38px;
    }

    .library-search {
    order: 3;

    position: relative;

    flex: 1 1 auto;

    min-width: 0;

    width: auto;

    margin: 0;

    opacity: 1;

    pointer-events: auto;

    transform: none;
}

.library-search input {
    height: 40px;

    padding:
        0 12px 0 38px;

    font-size: 10px;
}

.library-search > svg {
    left: 12px;

    width: 15px;
    height: 15px;
}

    /*
     * The search bar remains part of the top-bar skeleton.
     * library.js can add .search-expanded when the mobile
     * search icon is implemented.
     */
    .library-topbar.search-expanded {
        padding-bottom: 58px;
    }

    .library-topbar.search-expanded .library-search {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .library-content {
    width: calc(100% - 20px);

    padding-top: 18px;
    padding-bottom: 12px;
}

#explore-library {
    width: calc(100% - 20px);
    margin-left: auto;
    margin-right: auto;
}

 .library-banner {
    width: calc(100% + clamp(8px, 2.05vw, 16px));

    margin-left:
        calc(
            -1 * clamp(4px, 1.025vw, 8px)
        );

    height: auto;
    min-height: 0;
    aspect-ratio: 2.4 / 1;
    border-radius: 16px;
}


.library-banner-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}



  .library-banner-content {
    position: relative;
    align-self: stretch;
    width: 100%;
    height: 100%;

    justify-content: flex-start;

    padding: 15px 18px 62px;
}

    .library-banner-eyebrow {
        font-size: 8px;
    }

    .library-banner h1 {
        max-width: 330px;

        margin-bottom: 8px;

        font-size: 24px;
        line-height: 1.16;
    }

   .library-banner p {
    max-width: 300px;
    margin-bottom: 0;

    font-size: 11px;
    line-height: 1.55;
}

    .library-banner-action {
    position: absolute;
    left: 18px;
    bottom: 16px;

    margin: 0;

    min-height: 32px;
    padding: 0 11px;

    font-size: 10px;
    font-weight: 500;
}

.library-banner-image-action {
    position: absolute;
    left: 18px;
    bottom: 16px;
    gap: 7px;
    transform: none;
    z-index: 6;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    min-height: 32px;
    padding: 0 11px;
    border: none;
    border-radius: 9px;

    background: var(--library-green);
    color: #FFFFFF;

    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;

    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

    .library-banner-visual {
        width: 62%;

        opacity: 0.48;
    }

    .library-banner-controls {
        right: 14px;
        bottom: 12px;
    }

    .library-section {
    margin-top: 32px;
   }

    .library-section-heading {
        align-items: center;

        margin-bottom: 14px;
    }

    .library-section-eyebrow {
    font-size: clamp(6px, 1.8vw, 7px);
}

.library-section-heading h2 {
    font-size: clamp(15px, 4vw, 18px);
}

    .library-view-all {
        font-size: 10px;
    }

    .library-section-note {
        display: none;
    }

    /*
     * Mobile book grid:
     * exactly three books across.
     */
    .library-book-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 20px 10px;
    }


    /* =========================================================
   MOBILE PERSONAL LIBRARY VIEWS
   Match the main Library page content width
========================================================= */

#libraryPersonalView {
    width: calc(100% - 20px);
    margin-left: auto;
    margin-right: auto;
}


    /*
     * Home book rows:
     * horizontal scrolling on phone.
     * Three books visible at a time.
     */
   #popular-books .library-book-grid:not(.is-view-all),
#new-releases .library-book-grid:not(.is-view-all),
#recommended .library-book-grid:not(.is-view-all) {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;

    gap: 20px 10px;

    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

    #popular-books .library-book-grid.is-view-all {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    flex-wrap: unset;
    overflow-x: visible;
    overflow-y: visible;

    gap: 20px 10px;

    scroll-snap-type: none;
}

#new-releases .library-book-grid.is-view-all {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex-wrap: unset;
    overflow-x: visible;
    overflow-y: visible;
    gap: 20px 10px;
    scroll-snap-type: none;
}

#recommended .library-book-grid.is-view-all {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex-wrap: unset;
    overflow-x: visible;
    overflow-y: visible;
    gap: 20px 10px;
    scroll-snap-type: none;
}

    #popular-books .library-book-grid::-webkit-scrollbar,
    #new-releases .library-book-grid::-webkit-scrollbar,
    #recommended .library-book-grid::-webkit-scrollbar {
        display: none;
    }

#popular-books .library-book-card,
#new-releases .library-book-card,
#recommended .library-book-card {
    flex: 0 0 calc((100% - 20px) / 3);
    width: calc((100% - 20px) / 3);

    scroll-snap-align: start;
}

#popular-books .library-book-grid.is-view-all .library-book-card,
#new-releases .library-book-grid.is-view-all .library-book-card,
#recommended .library-book-grid.is-view-all .library-book-card {
    flex: 0 0 auto;
    width: 100%;
    scroll-snap-align: none;
}

    .library-book-cover {
        border-radius: 7px;
    }

    .library-book-lock {
        top: 6px;
        right: 6px;

        width: 20px;
        height: 20px;
    }

    .library-book-lock svg {
        width: 10px;
        height: 10px;
    }

    .library-book-info {
        padding-top: 8px;
    }

  .library-book-title {
    margin-bottom: 3px;

    font-size: clamp(8px, 2.2vw, 10px);
    line-height: 1.3;
}

.library-book-author {
    font-size: clamp(7px, 1.9vw, 8.5px);
}

/* =========================================================
   READING HISTORY / PROGRESS PAGE TEXT
========================================================= */

.library-history-meta,
.library-reading-progress-meta {
    font-size: 10px;
    line-height: 1.3;
}

    /*
     * Three category cards visible at a time.
     * Width is calculated from the available viewport so
     * three cards are visible with consistent gaps.
     */
    .library-category-track {
        display: flex;
        gap: 10px;

        min-width: max-content;
    }

    .library-category-card {
        width:
            calc(
                (100vw - 28px - 20px) / 3
            );

        min-width:
            calc(
                (100vw - 28px - 20px) / 3
            );

        min-height: 112px;

        padding: 15px 8px;
    }

    .library-category-icon {
        top: 14px;

        width: 34px;
        height: 34px;
    }

    .library-category-icon svg {
        width: 18px;
        height: 18px;
    }

    .library-category-name {
        max-width: 88px;

        font-size: 9px;
    }

    .library-continue-grid {
        grid-template-columns: 1fr;
    }

    .library-continue-card {
        min-height: 104px;
    }

    .library-book-modal {
        align-items: flex-end;

        padding: 0;
    }

    .library-book-modal-panel {
        width: 100%;

        grid-template-columns: 100px minmax(0, 1fr);
        gap: 18px;

        padding: 24px 20px 28px;

        border-radius:
            22px 22px 0 0;
    }

    .library-book-modal-cover {
        width: 100px;
    }

    .library-book-modal-content {
        padding-right: 12px;
    }

    .library-book-modal-content h2 {
        font-size: 19px;
    }

}


/* =========================================================
   25. SMALL PHONE
========================================================= */

@media (max-width: 420px) {

    .library-topbar {
    gap: clamp(6px, 2vw, 8px);

    padding-left: clamp(8px, 3.6vw, 14px);
    padding-right: clamp(8px, 3.6vw, 14px);
}

    .library-menu-button {
        width: 38px;
        height: 38px;
    }

    .library-mobile-title {
        font-size: 10px;
    }

    .library-profile-button {
        width: 36px;
        height: 36px;
    }

   .library-content {
    width: calc(100% - 18px);

    padding-top: 14px;
}

   .library-banner {
    width: calc(100% + clamp(8px, 2.05vw, 16px));
    margin-left: calc(-1 * clamp(4px, 1.025vw, 8px));

    height: auto;
    min-height: 0;
    aspect-ratio: 2.3 / 1;

    border-radius: 14px;
}

    
.library-banner-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}



    .library-banner-content {
    position: relative;
    align-self: stretch;
    width: 100%;
    height: 100%;

    justify-content: flex-start;

    padding: 14px 17px 58px;
}

   .library-banner-eyebrow {
    margin-bottom: 3px;

    font-size: clamp(5px, 1.7vw, 6px);
}

.library-banner h1 {
    max-width: 270px;
    font-size: clamp(15px, 5.1vw, 16px);
}

.library-banner p {
    max-width: 255px;
    margin-bottom: 0;

    font-size: clamp(8px, 2.5vw, 9px);
}

.library-banner-action {
    position: absolute;
    left: 17px;
    bottom: 12px;

    margin: 0;

    min-height: 30px;

    font-size: clamp(7px, 2.3vw, 8px);
}

.library-banner-image-action {
    position: absolute;
    left: 17px;
    bottom: 12px;
    gap: 7px;
    transform: none;
    z-index: 6;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    min-height: 30px;
    padding: 0 11px;
    border: none;
    border-radius: 9px;

    background: var(--library-green);
    color: #FFFFFF;

    font-size: clamp(7px, 2.3vw, 8px);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;

    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, transform 0.2s ease;
}

    .library-section {
        margin-top: 28px;
    }

     .library-section-eyebrow {
    font-size: clamp(5px, 1.5vw, 6px);
}

    .library-section-heading h2 {
        font-size: clamp(12px, 3.1vw, 14px);
    }

    /*
     * Keep exactly three book cards across even on
     * compact phones.
     */

    .library-book-grid {
        gap: 20px 9px;
    }

 .library-book-title {
    font-size: clamp(8px, 2.2vw, 10px);
}

.library-book-author {
    font-size: clamp(7px, 1.9vw, 8.5px);
}

    /*
     * Exactly three category cards remain visible.
     */
    .library-category-card {
        width:
            calc(
                (100vw - 22px - 20px) / 3
            );

        min-width:
            calc(
                (100vw - 22px - 20px) / 3
            );

        min-height: 90px;
    }

    .library-category-name {
        max-width: 76px;

        font-size: 8px;
    }

    .library-sidebar {
        width: min(292px, 88vw);
    }

    .library-sidebar-brand {
        min-height: 78px;

        padding:
            10px 12px;
    }

    .library-brand-logo {
        width: 145px;
    }

    .library-nav {
        padding:
            18px 10px 24px;
    }

    .library-nav-group + .library-nav-group {
        margin-top: 23px;
    }

    .library-nav-item {
        min-height: 40px;

        gap: 10px;

        padding:
            8px 10px;

        font-size: 11px;
    }

    .library-nav-item svg {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    .library-book-modal-panel {
        grid-template-columns: 86px minmax(0, 1fr);

        gap: 15px;

        padding:
            22px 15px 24px;
    }

    .library-book-modal-cover {
        width: 86px;
    }

    .library-book-modal-content h2 {
        font-size: 17px;
    }

        #popular-books .library-book-grid,
    #new-releases .library-book-grid,
    #recommended .library-book-grid {
        gap: 20px 9px;
    }

    #popular-books .library-book-card,
    #new-releases .library-book-card,
    #recommended .library-book-card {
        flex-basis: calc((100% - 18px) / 3);
        width: calc((100% - 18px) / 3);
    }

}



/* =========================================================
   26. REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .library-app *,
    .library-app *::before,
    .library-app *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

}


.library-book-cover-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
    

/* PROFILE LOCATION */
.library-sidebar-profile {
    display: none;
}

@media (max-width: 900px) {
    .library-topbar-actions {
        display: none;
    }

    .library-sidebar-profile {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px;
        color: var(--library-white);
    }
}

/* =========================================================
   HOME ↔ LIBRARY PAGE TRANSITION
========================================================= */

body.library-page-transition {
    opacity: 0;
    transform: translateX(24px);
    transition:
        opacity 850ms cubic-bezier(.2, .8, .2, 1),
        transform 850ms cubic-bezier(.2, .8, .2, 1);
}

body.library-page-ready {
    opacity: 1;
    transform: none;
}





/* =========================================================
   END — LIBRARY.CSS
========================================================= */
