/* =========================================================
   CODELAB
   MEMBER LIBRARY — FASE 4
========================================================= */


/* =========================================================
   GLOBAL HELPERS
========================================================= */

.sr-only {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}


/* =========================================================
   DASHBOARD LIBRARY
========================================================= */

.dashboard-library {
    padding:
        clamp(85px, 11vw, 160px)
        0;

    background: #ffffff;
}


.library-heading {
    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 40px;

    margin-bottom: 55px;
}


.library-heading h2 {
    margin: 0;

    font-size:
        clamp(2.8rem, 5vw, 5.2rem);

    line-height: 0.94;

    font-weight: 500;

    letter-spacing: -0.055em;
}


.member-card-meta {
    margin-top: 20px;

    color: var(--text-soft);

    font-size: 0.72rem;
}


/* =========================================================
   LIBRARY HERO
========================================================= */

.library-hero {
    padding:
        clamp(100px, 12vw, 180px)
        0 80px;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #f7fafa
        );

    border-bottom:
        1px solid var(--border);
}


.library-hero h1 {
    max-width: 1050px;

    margin-bottom: 32px;

    font-size:
        clamp(4rem, 8vw, 9rem);

    line-height: 0.84;

    font-weight: 500;

    letter-spacing: -0.07em;
}


.library-hero p {
    max-width: 680px;

    margin: 0;

    color: var(--text-soft);

    font-size: 1.05rem;
}


/* =========================================================
   LIBRARY CONTROLS
========================================================= */

.library-controls {
    position: relative;

    padding: 35px 0;

    border-bottom:
        1px solid var(--border);

    background: #ffffff;
}


.library-search-form {
    display: grid;

    grid-template-columns:
        minmax(260px, 1fr)
        minmax(220px, 300px)
        auto
        auto;

    align-items: center;

    gap: 15px;
}


.library-search input,
.library-category-select select {
    width: 100%;

    height: 52px;

    padding:
        0 16px;

    border:
        1px solid var(--border);

    outline: none;

    background: #ffffff;

    color: var(--text);
}


.library-search input:focus,
.library-category-select select:focus {
    border-color:
        var(--petrol);
}


.clear-filters {
    color:
        var(--text-soft);

    font-size: 0.75rem;

    font-weight: 600;
}


/* =========================================================
   LIBRARY
========================================================= */

.library-section {
    padding:
        clamp(70px, 9vw, 130px)
        0;
}


.library-result-header {
    margin-bottom: 30px;

    padding-bottom: 16px;

    border-bottom:
        1px solid var(--border);

    color: var(--text-soft);

    font-size: 0.7rem;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


.library-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap:
        clamp(24px, 3vw, 40px);
}


/* =========================================================
   CONTENT CARD
========================================================= */

.content-card {
    min-width: 0;
}


.content-card > a {
    display: block;

    height: 100%;
}


.content-card-image {
    position: relative;

    aspect-ratio: 4 / 3;

    overflow: hidden;

    background:
        var(--background-soft);
}


.content-card-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 500ms ease;
}


.content-card:hover
.content-card-image img {
    transform:
        scale(1.035);
}


.content-placeholder {
    width: 100%;
    height: 100%;

    display: grid;

    place-items: center;

    background:
        linear-gradient(
            135deg,
            #f4fafa 0%,
            #e5f1f0 55%,
            #dbecea 100%
        );
}


.content-placeholder span {
    color: var(--petrol);

    font-size:
        clamp(1.3rem, 3vw, 2.5rem);

    font-weight: 500;

    letter-spacing: -0.04em;
}


.featured-badge {
    position: absolute;

    top: 18px;
    left: 18px;

    padding:
        7px 10px;

    background: #ffffff;

    color: var(--petrol);

    font-size: 0.62rem;

    font-weight: 700;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


.content-card-body {
    padding:
        25px 0 10px;
}


.content-category {
    display: block;

    margin-bottom: 13px;

    color: var(--cyan);

    font-size: 0.65rem;

    font-weight: 700;

    letter-spacing: 0.12em;

    text-transform: uppercase;
}


.content-card-body h2,
.content-card-body h3 {
    margin-bottom: 15px;

    color: var(--text);

    font-size:
        clamp(1.5rem, 2.3vw, 2rem);

    line-height: 1.03;

    font-weight: 500;

    letter-spacing: -0.04em;
}


.content-card-body p {
    margin-bottom: 25px;

    color: var(--text-soft);
}


.content-card-body strong {
    color: var(--petrol);

    font-size: 0.74rem;

    font-weight: 700;
}


.content-card-footer {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 20px;

    padding-top: 18px;

    border-top:
        1px solid var(--border);
}


.content-card-footer span {
    color: var(--text-soft);

    font-size: 0.66rem;
}


/* =========================================================
   EMPTY
========================================================= */

.library-empty {
    padding:
        clamp(55px, 8vw, 100px);

    background:
        var(--background-soft);
}


.library-empty > span {
    color: var(--cyan);

    font-size: 0.66rem;

    font-weight: 700;

    letter-spacing: 0.15em;
}


.library-empty h2,
.library-empty h3 {
    max-width: 750px;

    margin:
        25px 0 18px;

    font-size:
        clamp(2.5rem, 5vw, 5rem);

    line-height: 0.95;

    font-weight: 500;

    letter-spacing: -0.055em;
}


.library-empty p {
    max-width: 500px;

    margin-bottom: 30px;

    color: var(--text-soft);
}


/* =========================================================
   ARTICLE HERO
========================================================= */

.article-hero {
    padding:
        clamp(85px, 11vw, 160px)
        0 70px;
}


.article-hero-inner {
    max-width: 1150px;
}


.article-back {
    display: inline-flex;

    margin-bottom: 70px;

    color: var(--text-soft);

    font-size: 0.73rem;

    font-weight: 600;
}


.article-hero h1 {
    max-width: 1100px;

    margin:
        20px 0 32px;

    font-size:
        clamp(3.6rem, 7vw, 8rem);

    line-height: 0.88;

    font-weight: 500;

    letter-spacing: -0.065em;
}


.article-lead {
    max-width: 780px;

    margin-bottom: 35px;

    color: var(--text-soft);

    font-size:
        clamp(1.05rem, 1.8vw, 1.3rem);

    line-height: 1.6;
}


.article-meta {
    display: flex;

    gap: 28px;

    color: var(--text-soft);

    font-size: 0.68rem;

    letter-spacing: 0.06em;

    text-transform: uppercase;
}


/* =========================================================
   ARTICLE COVER
========================================================= */

.article-cover {
    padding-bottom:
        clamp(70px, 10vw, 140px);
}


.article-cover img {
    width: 100%;

    max-height: 780px;

    object-fit: cover;
}


/* =========================================================
   ARTICLE BODY
========================================================= */

.article-section {
    padding:
        clamp(80px, 10vw, 150px)
        0;

    border-top:
        1px solid var(--border);
}


.article-layout {
    display: grid;

    grid-template-columns:
        minmax(140px, 0.28fr)
        minmax(0, 1fr);

    gap:
        clamp(50px, 8vw, 130px);
}


.article-content {
    max-width: 820px;
}


.article-content > p {
    margin-bottom: 30px;

    color:
        #263e44;

    font-size:
        clamp(1.03rem, 1.4vw, 1.14rem);

    line-height: 1.85;
}


.article-content > p:first-child {
    font-size:
        clamp(1.15rem, 1.7vw, 1.35rem);

    color: var(--text);
}


/* =========================================================
   DOWNLOAD
========================================================= */

.article-download {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;

    margin-top: 70px;

    padding:
        32px;

    background:
        var(--background-soft);

    border:
        1px solid var(--border);
}


.article-download span {
    display: block;

    margin-bottom: 8px;

    color: var(--cyan);

    font-size: 0.62rem;

    font-weight: 700;

    letter-spacing: 0.14em;
}


.article-download h3 {
    margin: 0;

    font-size: 1.3rem;

    font-weight: 500;
}


/* =========================================================
   RELATED CONTENT
========================================================= */

.related-section {
    padding:
        clamp(80px, 10vw, 140px)
        0;

    background:
        var(--background-soft);
}


.related-heading {
    margin-bottom: 50px;
}


.related-heading h2 {
    margin: 0;

    font-size:
        clamp(2.7rem, 5vw, 5rem);

    line-height: 0.95;

    font-weight: 500;

    letter-spacing: -0.05em;
}


.related-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    border-top:
        1px solid var(--border);
}


.related-card {
    min-height: 330px;

    display: flex;

    flex-direction: column;

    padding: 32px;

    border-left:
        1px solid var(--border);

    border-bottom:
        1px solid var(--border);
}


.related-card:last-child {
    border-right:
        1px solid var(--border);
}


.related-card > span {
    margin-bottom: 60px;

    color: var(--cyan);

    font-size: 0.64rem;

    font-weight: 700;

    letter-spacing: 0.12em;
}


.related-card h3 {
    margin-bottom: 14px;

    font-size: 1.45rem;

    font-weight: 500;

    line-height: 1.05;
}


.related-card p {
    color: var(--text-soft);
}


.related-card a {
    margin-top: auto;

    color: var(--petrol);

    font-size: 0.73rem;

    font-weight: 700;
}


/* =========================================================
   404
========================================================= */

.library-404 {
    min-height: 65vh;

    display: flex;

    align-items: center;

    padding:
        90px 0;
}


.library-404 h1 {
    max-width: 850px;

    margin-bottom: 25px;

    font-size:
        clamp(3rem, 7vw, 7rem);

    line-height: 0.9;

    font-weight: 500;

    letter-spacing: -0.06em;
}


.library-404 p {
    margin-bottom: 30px;

    color: var(--text-soft);
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1000px) {

    .library-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .library-search-form {
        grid-template-columns:
            1fr 250px;

    }


    .library-search-form
    .button {
        width: 100%;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 820px) {

    .library-heading {
        align-items:
            flex-start;

        flex-direction:
            column;
    }


    .library-search-form {
        grid-template-columns: 1fr;
    }


    .library-search input,
    .library-category-select select,
    .library-search-form .button {
        width: 100%;
    }


    .library-grid {
        grid-template-columns: 1fr;
    }


    .article-back {
        margin-bottom: 50px;
    }


    .article-layout {
        display: block;
    }


    .article-side {
        margin-bottom: 50px;
    }


    .article-download {
        align-items:
            flex-start;

        flex-direction:
            column;
    }


    .article-download .button {
        width: 100%;
    }


    .related-grid {
        display: block;
    }


    .related-card {
        min-height: 280px;

        border-right:
            1px solid var(--border);

        border-top: 0;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .library-hero {
        padding:
            75px 0 60px;
    }


    .library-hero h1 {
        font-size:
            clamp(3.5rem, 17vw, 5rem);
    }


    .content-card-body {
        padding-top: 20px;
    }


    .article-hero {
        padding:
            70px 0 55px;
    }


    .article-hero h1 {
        font-size:
            clamp(3.1rem, 15vw, 4.8rem);
    }


    .article-meta {
        flex-direction: column;

        gap: 6px;
    }


    .article-download {
        padding: 24px;
    }

}