/* =========================================================
   WISETL LIBRARY
   ========================================================= */

.wisetl-library-page {

    min-height: 70vh;

    padding:
        calc(var(--header-height) + 55px)
        24px
        100px;

}

.wisetl-library-container {

    width: 100%;

    max-width: 1080px;

    margin: 0 auto;

}


/* =========================================================
   LIBRARY HEADER
   ========================================================= */

.wisetl-library-header {

    margin-bottom: 34px;

}

.wisetl-library-header h1 {

    margin: 0 0 8px;

    font-size: clamp(2rem, 4vw, 2.7rem);

    line-height: 1.15;

    letter-spacing: -0.02em;

}

.wisetl-library-header p {

    margin: 0;

    max-width: 650px;

    color: var(--text-soft);

    font-size: 0.98rem;

}


/* =========================================================
   LIBRARY TABS
   ========================================================= */

.wisetl-library-tabs {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 4px;

    width: 100%;

    max-width: 520px;

    padding: 4px;

    margin-bottom: 32px;

    background: var(--surface-color);

    border: 1px solid var(--border-color);

    border-radius: 13px;

}

.wisetl-library-tab {

    position: relative;

    min-height: 44px;

    padding: 9px 16px;

    border: none;

    border-radius: 9px;

    background: transparent;

    color: var(--text-soft);

    font-family: inherit;

    font-size: 0.9rem;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;

}

.wisetl-library-tab::after {

    display: none;

}

.wisetl-library-tab:hover {

    color: var(--text-color);

}

.wisetl-library-tab.active {

    background: var(--gold-primary);

    color: #111;

    box-shadow:
        0 4px 12px rgba(176,138,52,0.18);

}


/* =========================================================
   PANELS
   ========================================================= */

.wisetl-library-panel {

    display: none;

}

.wisetl-library-panel.active {

    display: block;

}


/* =========================================================
   LIBRARY LIST
   ========================================================= */

.wisetl-library-list {

    display: flex;

    flex-direction: column;

    gap: 14px;

}


/* =========================================================
   LIBRARY CARD
   ========================================================= */

.wisetl-library-card {

    position: relative;

    display: flex;

    gap: 22px;

    min-height: 160px;

    padding: 18px;

    background: var(--surface-color);

    border: 1px solid var(--border-color);

    border-radius: 16px;

    box-shadow: var(--shadow-soft);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;

}

.wisetl-library-card:hover {

    transform: translateY(-2px);

    border-color:
        rgba(201,164,76,0.35);

    box-shadow: var(--shadow-hover);

}


/* =========================================================
   COVER
   ========================================================= */

.wisetl-library-cover {

    width: 105px;

    height: 157px;

    flex: 0 0 105px;

    display: block;

    overflow: hidden;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            var(--gold-soft),
            var(--surface-color)
        );

}

.wisetl-library-cover img {

    width: 100%;

    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.3s ease;

}

.wisetl-library-card:hover
.wisetl-library-cover img {

    transform: scale(1.035);

}


/* Missing cover */

.wisetl-library-cover-placeholder {

    width: 100%;

    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    color: var(--gold-primary);

    font-size: 2rem;

}


/* =========================================================
   INFORMATION
   ========================================================= */

.wisetl-library-info {

    flex: 1;

    min-width: 0;

    display: flex;

    flex-direction: column;

}


/* =========================================================
   TITLE ROW
   ========================================================= */

.wisetl-library-title-row {

    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 15px;

}

.wisetl-library-title-row h2 {

    margin: 1px 0 5px;

    font-size: 1.18rem;

    line-height: 1.35;

}

.wisetl-library-title-row h2 a {

    color: var(--text-color);

    text-decoration: none;

}

.wisetl-library-title-row h2 a:hover {

    color: var(--gold-primary);

}

.wisetl-library-chapter {

    margin: 0;

    color: var(--text-soft);

    font-size: 0.86rem;

}


/* =========================================================
   THREE DOT BUTTON
   ========================================================= */

.wisetl-library-menu-button {

    width: 34px;

    height: 34px;

    flex-shrink: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;

    border-radius: 8px;

    background: transparent;

    color: var(--text-soft);

    font-size: 1.35rem;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;

}

.wisetl-library-menu-button:hover {

    background: var(--gold-soft);

    color: var(--text-color);

}


/* =========================================================
   PROGRESS
   ========================================================= */

.wisetl-progress-wrapper {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-top: auto;

    padding-top: 20px;

}

.wisetl-progress-bar {

    flex: 1;

    height: 6px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--border-color);

}

.wisetl-progress-fill {

    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #b08a34,
            var(--gold-primary)
        );

    transition: width 0.3s ease;

}

.wisetl-progress-wrapper > span {

    min-width: 38px;

    color: var(--text-soft);

    font-size: 0.8rem;

    font-weight: 600;

    text-align: right;

}


/* =========================================================
   CONTINUE BUTTON
   ========================================================= */

.wisetl-continue-button {

    align-self: flex-start;

    margin-top: 14px;

    padding: 8px 14px;

    border: 1px solid
        rgba(201,164,76,0.35);

    border-radius: 9px;

    background: transparent;

    color: var(--gold-primary) !important;

    font-size: 0.84rem;

    font-weight: 600;

    text-decoration: none;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;

}

.wisetl-continue-button:hover {

    background: var(--gold-primary);

    color: #111 !important;

    transform: translateY(-1px);

}


/* =========================================================
   CARD MENU
   ========================================================= */

.wisetl-library-menu {

    position: absolute;

    top: 58px;

    right: 18px;

    z-index: 30;

    display: none;

    width: 200px;

    padding: 5px;

    border: 1px solid var(--border-color);

    border-radius: 11px;

    background: var(--surface-color);

    box-shadow: var(--shadow-hover);

}

.wisetl-library-menu.open {

    display: flex;

    flex-direction: column;

}

.wisetl-library-menu button,
.wisetl-library-menu a {

    display: block;

    width: 100%;

    padding: 10px 11px;

    border: none;

    border-radius: 7px;

    background: transparent;

    color: var(--text-color);

    font-family: inherit;

    font-size: 0.84rem;

    text-align: left;

    text-decoration: none;

    cursor: pointer;

}

.wisetl-library-menu button:hover,
.wisetl-library-menu a:hover {

    background: var(--gold-soft);

    color: var(--text-color);

}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.wisetl-library-empty {

    padding: 75px 25px;

    border:
        1px dashed
        rgba(201,164,76,0.3);

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            rgba(201,164,76,0.025),
            transparent
        );

    text-align: center;

}

.wisetl-library-empty h2 {

    margin: 0 0 8px;

    font-size: 1.35rem;

}

.wisetl-library-empty p {

    max-width: 430px;

    margin: 0 auto 22px;

    color: var(--text-soft);

    font-size: 0.92rem;

}

.wisetl-library-empty-button {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 10px 18px;

    border-radius: 10px;

    background: var(--gold-primary);

    color: #111 !important;

    font-size: 0.9rem;

    font-weight: 600;

    text-decoration: none;

}


/* =========================================================
   DARK MODE
   ========================================================= */

body.dark-mode
.wisetl-library-card {

    background: #181818;

    border-color: #2a2a2a;

}

body.dark-mode
.wisetl-library-tabs {

    background: #181818;

    border-color: #2a2a2a;

}

body.dark-mode
.wisetl-library-empty {

    border-color: rgba(201,164,76,0.25);

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .wisetl-library-page {

        padding:
            calc(var(--header-height) + 32px)
            14px
            70px;

    }


    .wisetl-library-header {

        margin-bottom: 25px;

    }


    .wisetl-library-header h1 {

        font-size: 1.9rem;

    }


    .wisetl-library-header p {

        font-size: 0.9rem;

    }


    .wisetl-library-tabs {

        max-width: none;

        margin-bottom: 22px;

    }


    .wisetl-library-tab {

        padding:
            9px 8px;

        font-size: 0.78rem;

    }


    .wisetl-library-card {

        gap: 14px;

        min-height: 135px;

        padding: 13px;

        border-radius: 14px;

    }


    .wisetl-library-cover {

        width: 76px;

        height: 114px;

        flex-basis: 76px;

        border-radius: 8px;

    }


    .wisetl-library-title-row {

        gap: 7px;

    }


    .wisetl-library-title-row h2 {

        font-size: 0.98rem;

        line-height: 1.35;

    }


    .wisetl-library-chapter {

        font-size: 0.76rem;

    }


    .wisetl-progress-wrapper {

        gap: 8px;

        padding-top: 12px;

    }


    .wisetl-progress-bar {

        height: 5px;

    }


    .wisetl-progress-wrapper > span {

        font-size: 0.73rem;

    }


    .wisetl-continue-button {

        margin-top: 10px;

        padding: 7px 10px;

        font-size: 0.76rem;

    }


    .wisetl-library-menu {

        top: 48px;

        right: 13px;

        width: 185px;

    }

}

/* =========================================================
   LIBRARY ASTRA OVERRIDE
   ========================================================= */

body.page-template-page-library
#primary {

    width: 100%;

    margin: 0;

}

body.page-template-page-library
.ast-container {

    max-width: 100%;

    padding-left: 0;

    padding-right: 0;

}

body.page-template-page-library
.ast-article-single {

    padding: 0;

}

body.page-template-page-library
.entry-content {

    margin: 0;

}


/* =========================================================
   LIBRARY NAVBAR ACTIVE STATE
   ========================================================= */

body.page-template-page-library .menu-item-library > a {
    color: var(--red-accent) !important;
}

body.page-template-page-library .menu-item-library > a::after {
    width: 100% !important;
    background: var(--red-accent) !important;
}

/* =========================================================
   LIBRARY MENU FONT
   ========================================================= */

.wisetl-library-menu,
.wisetl-library-menu button,
.wisetl-library-menu a {

    font-family: inherit;

}

.wisetl-library-menu button,
.wisetl-library-menu a {

    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.4;

}


