/* ======================================================
   COMPLETE GUIDES HERO
====================================================== */
.guides-library-hero {
    position: relative;
    isolation: isolate;
    min-height: 390px;
    padding:
        58px var(--page-padding, 24px) 55px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);

      position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    padding: 128px var(--side-padding) 120px;
    overflow: hidden;
    box-sizing: border-box;
}

/* ======================================================
   BACKGROUND GLOW
====================================================== */
.guides-library-hero::before,
.guides-library-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

/* LEFT GLOW */
.guides-library-hero::before {
    width: 650px;
    height: 580px;
    left: -280px;
    top: -250px;
    background:
        color-mix(in srgb,
            var(--primary) 17%,
            transparent);
    filter: blur(120px);
    opacity: .9;
}

/* RIGHT GLOW */
.guides-library-hero::after {
    width: 650px;
    height: 580px;
    right: -280px;
    top: -240px;
    background:
        color-mix(in srgb,
            var(--primary) 17%,
            transparent);
    filter: blur(120px);
    opacity: .9;
}

/* ======================================================
   CONTAINER
====================================================== */
.guides-library-hero__container {
    position: relative;
    width: min(100%,
            var(--container, 1100px));
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ======================================================
   BREADCRUMB
====================================================== */
.guides-library-hero__breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 9px;
    color: var(--text-secondary);
    font-size: 7px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.guides-library-hero__breadcrumb a {
    color: inherit;
    text-decoration: none;
    transition:
        color .2s var(--ease);
}

.guides-library-hero__breadcrumb a:hover {
    color: var(--primary);
}

.guides-library-hero__breadcrumb>span:last-child {
    color: var(--text);
}

/* ======================================================
   EYEBROW
====================================================== */
.guides-library-hero__eyebrow {
    display: block;
    margin-bottom: 17px;
    color: var(--primary);
    font-size: 8px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .29em;
    text-transform: uppercase;
}

/* ======================================================
   TITLE
====================================================== */
.guides-library-hero__title {
    max-width: 930px;
    margin: 0;
    color: var(--text);
    font-size:
        clamp(48px,
            5.15vw,
            68px);
    line-height: .99;
    font-weight: 800;
    letter-spacing: -.055em;
}

.guides-library-hero__title>span {
    display: block;
}

/* ======================================================
   DESCRIPTION
====================================================== */
.guides-library-hero__description {
    max-width: 650px;
    margin:
        20px auto 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.55;
    font-weight: 400;
}

/* ======================================================
   SEARCH
====================================================== */
.guides-library-search {
    width: min(100%, 585px);
    min-height: 47px;
    margin-top: 27px;
    padding:
        5px 6px 5px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border:
        1px solid color-mix(in srgb,
            var(--border) 75%,
            transparent);
    border-radius: 13px;
    background:
        color-mix(in srgb,
            var(--surface) 94%,
            transparent);
    box-shadow:
        0 12px 26px color-mix(in srgb,
            var(--primary) 11%,
            transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition:
        border-color .25s var(--ease),
        box-shadow .25s var(--ease);
}

.guides-library-search:focus-within {
    border-color:
        color-mix(in srgb,
            var(--primary) 30%,
            var(--border));
    box-shadow:
        0 14px 30px color-mix(in srgb,
            var(--primary) 16%,
            transparent);
}

/* ======================================================
   SEARCH FIELD
====================================================== */
.guides-library-search__field {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guides-library-search__icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: var(--text-secondary);
    opacity: .8;
}

.guides-library-search__field input {
    width: 100%;
    min-width: 0;
    height: 35px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 11px;
}

.guides-library-search__field input::placeholder {
    color: var(--text-secondary);
    opacity: .7;
}

/* ======================================================
   SEARCH BUTTON
====================================================== */
.guides-library-search__button {
    min-width: 70px;
    height: 35px;
    padding:
        0 17px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    outline: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 7px 16px color-mix(in srgb,
            var(--primary) 32%,
            transparent);
    transition:
        transform .25s var(--ease),
        box-shadow .25s var(--ease),
        filter .25s var(--ease);
}

.guides-library-search__button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 9px 21px color-mix(in srgb,
            var(--primary) 38%,
            transparent);
}

.guides-library-search__button:active {
    transform: translateY(0);
}

/* ======================================================
   DARK MODE
====================================================== */

html[data-theme="dark"] .guides-library-hero::before,
html[data-theme="dark"] .guides-library-hero::after {
    opacity: .38;
}


html[data-theme="dark"] .guides-library-search {
    background:
        color-mix(in srgb,
            var(--surface) 90%,
            transparent);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, .24);
}

/* ======================================================
   RTL
====================================================== */

html[dir="rtl"] .guides-library-hero__breadcrumb,
html[dir="rtl"] .guides-library-hero__eyebrow {
    letter-spacing: .05em;
}


html[dir="rtl"] .guides-library-hero__title {
    letter-spacing: -.02em;
}


html[dir="rtl"] .guides-library-search {
    padding:
        5px 16px 5px 6px;
}


html[dir="rtl"] .guides-library-search__field input {
    text-align: right;
}

/* ======================================================
   TABLET
====================================================== */
@media (max-width: 900px) {
    .guides-library-hero {
        min-height: 380px;
    }

    .guides-library-hero__title {
        max-width: 760px;
        font-size:
            clamp(45px,
                7vw,
                60px);
    }
}

/* ======================================================
   MOBILE
====================================================== */
@media (max-width: 600px) {
    .guides-library-hero {
        min-height: auto;
        padding:
            128px var(--page-padding, 18px) 60px;
    }

    .guides-library-hero::before {
        width: 430px;
        height: 430px;
        left: -270px;
        top: -150px;
        filter: blur(85px);
    }

    .guides-library-hero::after {
        width: 430px;
        height: 430px;
        right: -270px;
        top: -140px;
        filter: blur(85px);
    }

    .guides-library-hero__breadcrumb {
        gap: 7px;
        margin-bottom: 10px;
        font-size: 6px;
        letter-spacing: .14em;
    }

    .guides-library-hero__eyebrow {
        margin-bottom: 16px;
        font-size: 7px;
    }

    .guides-library-hero__title {
        max-width: 520px;
        font-size:
            clamp(38px,
                11vw,
                49px);
        line-height: 1.02;
    }

    .guides-library-hero__description {
        max-width: 460px;
        margin-top: 18px;
        font-size: 13px;
        line-height: 1.6;
    }

    .guides-library-search {
        width: 100%;
        margin-top: 24px;
        padding:
            5px 5px 5px 13px;
        border-radius: 12px;
    }

    html[dir="rtl"] .guides-library-search {
        padding:
            5px 13px 5px 5px;
    }

    .guides-library-search__field {
        gap: 8px;
    }

    .guides-library-search__field input {
        font-size: 10px;
    }

    .guides-library-search__button {
        min-width: 67px;
        padding-inline: 13px;
        font-size: 9px;
    }
}

/* ======================================================
   VERY SMALL MOBILE
====================================================== */
@media (max-width: 380px) {
    .guides-library-hero__title {
        font-size: 36px;
    }

    .guides-library-search__icon {
        display: none;
    }
}

/* ======================================================
   REDUCED MOTION
====================================================== */
@media (prefers-reduced-motion: reduce) {

    .guides-library-search,
    .guides-library-search__button,
    .guides-library-hero__breadcrumb a {
        transition: none;
    }
}

/* ======================================================
   COMPLETE GUIDES CATALOG
====================================================== */
.guides-catalog {
    position: relative;
    isolation: isolate;
    padding:
        20px var(--page-padding, 24px) 90px;
    background: var(--bg);
    color: var(--text);
}

/* subtle glow */
.guides-catalog::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 700px;
    height: 500px;
    top: -180px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    background:
        color-mix(in srgb,
            var(--primary) 5%,
            transparent);
    filter: blur(120px);
    pointer-events: none;
}

/* ======================================================
   CONTAINER
====================================================== */
.guides-catalog__container {
    width: min(100%,
            var(--container, 1100px));
    margin-inline: auto;
}

/* ======================================================
   FILTERS
====================================================== */
.guides-catalog__filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 58px;
}

.guides-filter {
    min-height: 32px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: 8px;
    line-height: 1;
    font-weight: 550;
    cursor: pointer;
    box-shadow:
        0 5px 14px rgba(0, 0, 0, .035);
    transition:
        background .25s var(--ease),
        color .25s var(--ease),
        border-color .25s var(--ease),
        transform .25s var(--ease),
        box-shadow .25s var(--ease);
}

.guides-filter small {
    color: inherit;
    font-size: 6px;
    opacity: .65;
}

.guides-filter:hover {
    color: var(--primary);
    border-color:
        color-mix(in srgb,
            var(--primary) 25%,
            var(--border));
    transform: translateY(-1px);
}

.guides-filter.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow:
        0 7px 18px color-mix(in srgb,
            var(--primary) 30%,
            transparent);
}

/* ======================================================
   TOOLBAR
====================================================== */
.guides-catalog__toolbar {
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* ======================================================
   RESULT COUNT
====================================================== */
.guides-catalog__count {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
    font-size: 7px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .22em;
    text-transform: uppercase;
}

.guides-catalog__count small {
    font-size: 6px;
    letter-spacing: .08em;
    opacity: .65;
}

/* ======================================================
   SORT
====================================================== */
.guides-catalog__sort {
    display: flex;
    align-items: center;
    gap: 9px;
}

.guides-catalog__sort label {
    color: var(--text-secondary);
    font-size: 6px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.guides-catalog__select {
    position: relative;
}

.guides-catalog__select select {
    width: 115px;
    height: 31px;
    padding:
        0 30px 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface);
    color: var(--text-secondary);
    font: inherit;
    font-size: 8px;
    cursor: pointer;
}

.guides-catalog__select svg {
    position: absolute;
    width: 12px;
    height: 12px;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* ======================================================
   GRID
====================================================== */
.guides-catalog__grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap:
        25px 16px;
}

/* ======================================================
   GUIDE CARD
====================================================== */
.guides-library-card {
    position: relative;
    min-width: 0;
    min-height: 205px;
    padding:
        25px 25px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    border:
        1px solid color-mix(in srgb,
            var(--border) 80%,
            transparent);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow:
        0 13px 27px rgba(0, 0, 0, .055);
    transition:
        transform .3s var(--ease),
        border-color .3s var(--ease),
        box-shadow .3s var(--ease);
}

.guides-library-card:hover {
    transform: translateY(-5px);
    border-color:
        color-mix(in srgb,
            var(--primary) 23%,
            var(--border));
    box-shadow:
        0 20px 38px rgba(0, 0, 0, .09);
}

.guides-library-card[hidden] {
    display: none !important;
}

/* subtle hover glow */
.guides-library-card::before {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -90px;
    top: -90px;
    border-radius: 50%;
    background:
        color-mix(in srgb,
            var(--primary) 6%,
            transparent);
    opacity: 0;
    transition:
        opacity .3s var(--ease);
    pointer-events: none;
}

.guides-library-card:hover::before {
    opacity: 1;
}

/* ======================================================
   BADGE
====================================================== */
.guides-library-card__badge {
    min-height: 18px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    border:
        1px solid color-mix(in srgb,
            var(--primary) 22%,
            transparent);
    border-radius: 999px;
    background:
        color-mix(in srgb,
            var(--primary) 7%,
            var(--surface));
    color: var(--primary);
    font-size: 5px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

/* ======================================================
   CARD TITLE
====================================================== */
.guides-library-card h3 {
    margin:
        12px 0 10px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 750;
    letter-spacing: -.025em;
    transition:
        color .25s var(--ease);
}

.guides-library-card:hover h3 {
    color: var(--primary);
}

/* ======================================================
   DESCRIPTION
====================================================== */
.guides-library-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.65;
    font-weight: 400;
}

/* ======================================================
   CHAPTERS
====================================================== */
.guides-library-card__chapters {
    margin-top: auto;
    padding-top: 20px;
    color: var(--text-secondary);
    font-size: 6px;
    line-height: 1;
    font-weight: 650;
    letter-spacing: .18em;
    text-transform: uppercase;
}

/* ======================================================
   LOAD MORE
====================================================== */
.guides-catalog__load {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.guides-catalog__load-button {
    min-width: 125px;
    min-height: 39px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 8px;
    font-weight: 650;
    cursor: pointer;
    box-shadow:
        0 7px 18px rgba(0, 0, 0, .045);
    transition:
        transform .25s var(--ease),
        color .25s var(--ease),
        border-color .25s var(--ease),
        box-shadow .25s var(--ease);
}

.guides-catalog__load-button:hover {
    transform: translateY(-2px);
    color: var(--primary);
    border-color:
        color-mix(in srgb,
            var(--primary) 25%,
            var(--border));
    box-shadow:
        0 11px 24px rgba(0, 0, 0, .075);
}

.guides-catalog__load-button[hidden] {
    display: none;
}

/* ======================================================
   EMPTY STATE
====================================================== */
.guides-library-empty {
    padding:
        55px 20px;
    border:
        1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    text-align: center;
}

.guides-library-empty[hidden] {
    display: none;
}

.guides-library-empty strong {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 17px;
}

.guides-library-empty span {
    color: var(--text-secondary);
    font-size: 11px;
}

/* ======================================================
   DARK MODE
====================================================== */

html[data-theme="dark"] .guides-library-card {
    box-shadow:
        0 13px 30px rgba(0, 0, 0, .22);
}


html[data-theme="dark"] .guides-library-card:hover {
    box-shadow:
        0 20px 42px rgba(0, 0, 0, .32);
}


html[data-theme="dark"] .guides-filter,
html[data-theme="dark"] .guides-catalog__load-button {
    box-shadow:
        0 6px 16px rgba(0, 0, 0, .16);
}

/* ======================================================
   RTL
====================================================== */

html[dir="rtl"] .guides-catalog__count,
html[dir="rtl"] .guides-catalog__sort label,
html[dir="rtl"] .guides-library-card__badge,
html[dir="rtl"] .guides-library-card__chapters {
    letter-spacing: .04em;
}


html[dir="rtl"] .guides-library-card {
    align-items: flex-start;
    text-align: right;
}


html[dir="rtl"] .guides-library-card h3 {
    letter-spacing: -.01em;
}


html[dir="rtl"] .guides-catalog__select select {
    padding:
        0 12px 0 30px;
}


html[dir="rtl"] .guides-catalog__select svg {
    right: auto;
    left: 10px;
}

/* ======================================================
   TABLET
====================================================== */
@media (max-width: 900px) {
    .guides-catalog__grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .guides-library-card {
        min-height: 210px;
    }
}

/* ======================================================
   MOBILE
====================================================== */
@media (max-width: 600px) {
    .guides-catalog {
        padding:
            18px var(--page-padding, 18px) 65px;
    }

    /* horizontal filter scroll */
    .guides-catalog__filters {
        margin-inline:
            calc(var(--page-padding, 18px) * -1);
        margin-bottom: 38px;
        padding-inline:
            var(--page-padding, 18px);
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 7px;
        scrollbar-width: none;
    }

    .guides-catalog__filters::-webkit-scrollbar {
        display: none;
    }

    .guides-filter {
        flex: 0 0 auto;
        min-height: 35px;
        font-size: 9px;
    }

    /* toolbar */
    .guides-catalog__toolbar {
        margin-bottom: 20px;
    }

    .guides-catalog__sort label {
        display: none;
    }

    .guides-catalog__select select {
        width: 105px;
        font-size: 8px;
    }

    /* grid */
    .guides-catalog__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .guides-library-card {
        min-height: 195px;
        padding:
            22px 20px 20px;
        border-radius: 17px;
    }

    .guides-library-card__badge {
        min-height: 19px;
        padding-inline: 9px;
        font-size: 6px;
    }

    .guides-library-card h3 {
        font-size: 14px;
    }

    .guides-library-card p {
        font-size: 11px;
    }

    .guides-library-card__chapters {
        font-size: 6px;
    }

    .guides-catalog__load-button {
        min-width: 140px;
        min-height: 41px;
        font-size: 9px;
    }
}

/* ======================================================
   REDUCED MOTION
====================================================== */
@media (prefers-reduced-motion: reduce) {

    .guides-filter,
    .guides-library-card,
    .guides-library-card::before,
    .guides-library-card h3,
    .guides-catalog__load-button {
        transition: none;
    }
}
