/* =========================================
   探書櫃檯：單篇文章
   基準：舊版 discover_book1.html
========================================= */


/* =========================================
   整體背景
========================================= */

.article-page {
    min-height: calc(100vh - 72px);

    padding:
        14px
        0
        80px;

    background-color: var(--bg-lightbrown);
}


/* =========================================
   文章＋側欄
========================================= */

.article-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 760px)
        300px;

    justify-content: space-between;
    align-items: start;

    gap: clamp(40px, 5vw, 64px);

    width: min(
        1200px,
        calc(100% - 64px)
    );

    margin: 0 auto;
}


/* =========================================
   左側文章卡片
========================================= */

.article-container {
    width: 100%;

    padding: clamp(
        36px,
        5vw,
        64px
    );

    background-color:
        var(--bg-card-lightbrown);

    border:
        1px solid
        rgba(106, 93, 81, 0.12);
}


/* =========================================
   文章標題區
========================================= */

.article-header {
    margin-bottom:
        clamp(36px, 5vw, 56px);
}


.article-meta {
    display: flex;
    align-items: center;

    gap: 14px;

    margin-bottom: 24px;

    color: rgba(106, 93, 81, 0.68);

    font-size: 0.82rem;
    letter-spacing: 0.08em;
}


.article-category {
    display: inline-flex;
    align-items: center;

    padding: 0;

    color: var(--selected-darkgreen);

    font-weight: 400;
    letter-spacing: 0.12em;
}


.article-title-wrap {
    position: relative;
}


.article-title {
    margin: 0;

    color: var(--title-darkbrown);

    font-size:
        clamp(1.75rem, 3.6vw, 2.45rem);

    line-height: 1.65;
    letter-spacing: 0.08em;

    font-weight: 400;
}


/* =========================================
   文章主圖
========================================= */

.article-hero {
    margin:
        0
        0
        clamp(44px, 6vw, 72px);
}


.article-hero img {
    display: block;

    width: 100%;
    height: auto;

    /*
       舊版原本沒有固定比例；
       這是目前已確認保留的新調整。
    */
    aspect-ratio: 16 / 9;

    object-fit: cover;
}


/* =========================================
   文章正文
========================================= */

.article-content {
    color: var(--text-darkbrown);

    font-size:
        clamp(1rem, 1.15vw, 1.06rem);

    line-height: 2.15;
    letter-spacing: 0.04em;
}


.article-content p {
    margin: 0 0 1.8em;

    text-indent: 2em;
}


/* =========================================
   右側：延伸探書
========================================= */

.aside-container {
    position: sticky;

    top: 110px;

    width: 100%;

    padding: 8px 0 0;
}


/* 延伸探書標題 */

.aside-heading {
    display: block;

    margin-bottom: 28px;
}


.aside-heading h2 {
    margin: 0;

    color: var(--title-darkbrown);

    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.12em;
}


/* =========================================
   延伸書籍
========================================= */

.related-book-list {
    display: grid;

    grid-template-columns: 1fr;

    gap: 22px;
}


.related-book-card {
    display: block;

    width: 100%;

    overflow: visible;

    background-color: transparent;

    color: var(--text-darkbrown);

    text-decoration: none;

    box-shadow: none;
}


.related-book-cover {
    width: 100%;
    height: auto;

    aspect-ratio: 4 / 3;

    overflow: hidden;

    background-color: transparent;
}


.related-book-cover img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    filter: brightness(0.98);

    transition:
        filter 0.35s ease;
}


.related-book-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;

    gap: 8px;

    padding: 5px 0 0;
}


.related-book-title {
    margin: 0;

    color: var(--title-darkbrown);

    font-size: 0.9rem;
    line-height: 1.65;
    letter-spacing: 0.06em;

    font-weight: 400;
    text-align: center;

    transition:
        color 0.35s ease;
}

/* =========================================
   延伸探書 Hover
========================================= */

@media (hover: hover) and (pointer: fine) {

    .related-book-card:hover .related-book-cover img {
        filter: brightness(1.06) contrast(1.03);
    }

    .related-book-card:hover .related-book-title {
        color: var(--selected-darkgreen);
    }

}

/* =========================================
   850px 以下
========================================= */

@media (max-width: 850px) {

    /*
       舊版是上下排列。
       唯一修改：
       外背景與文章卡片只留下很窄間距。
    */

    .article-page {
        padding:
            8px
            0
            80px;
    }


    .article-layout {
        display: block;

        width: min(
            760px,
            calc(100% - 32px)
        );

        max-width: none;
    }


    .article-container {
        padding: 32px 22px;
    }


    .article-meta {
        flex-wrap: wrap;

        gap: 8px;

        margin-bottom: 20px;

        font-size: 0.8rem;
    }


    .article-title {
        font-size:
            clamp(1.55rem, 7vw, 2rem);

        line-height: 1.65;
    }


    .article-content {
        font-size: 1rem;

        line-height: 2.05;
    }


    /*
       手機／平板側欄回到一般文流，
       排在文章卡片下面。
    */

    .aside-container {
        position: static;

        margin-top: 56px;

        padding: 0;
    }


    .related-book-list {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 24px 18px;
    }


    .related-book-info {
        padding: 10px 20px 20px;
    }


    .related-book-title {
        font-size: 0.9rem;

        line-height: 1.4;
    }

}


/* =========================================
   400px 以下
========================================= */

@media (max-width: 400px) {

    .related-book-list {
        gap: 20px 12px;
    }


    .related-book-title {
        font-size: 0.7rem;

        line-height: 1.3;
    }

}


/* =========================================
   360px 以下
   TaleInn 320px 壓力測試保護
========================================= */

@media (max-width: 360px) {

    .article-layout {
        width: calc(100% - 16px);
    }


    .article-container {
        padding:
            28px
            16px
            36px;
    }

}