/*
OCEAN Study Design 頁面樣式
*/

body {
    background-color: #f8f9fb;
    font-family: system-ui, sans-serif;
}

/*
搜尋框
*/

.search-box {
    background-color: #f1f0ef;
    border-radius: 2rem;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
}

.search-box input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 1.1rem;
    outline: none;
}

/*
========================================
標籤分區外層
========================================
*/

.tag-section {
    max-width: 850px;
    margin: 0 auto 18px auto;
}

/*
========================================
標籤分區標題
========================================
*/

.tag-section-title {
    color: #1d3659;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

/*
========================================
分類標籤與熱搜標籤
========================================
*/

.category-tag-container,
.hot-keyword-container {
    margin-top: 0;
}

/*
Study Design 文章詳細頁外層
*/

.study-show-wrapper {
    max-width: 1100px;
    margin: 60px auto 40px auto;
    padding: 0 20px;
}

/*
文章詳細頁標題區
*/

.study-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.study-header-left {
    max-width: 80%;
}

/*
文章詳細頁標題
只套用在詳細頁標題區
避免影響列表頁標題
*/

.study-header .study-title {
    font-size: 28px;
    font-weight: 700;
    color: #1d3659;
    line-height: 1.3;
    margin-bottom: 6px;
}

/*
文章詳細頁標籤
只套用在詳細頁標題區
避免影響列表頁標籤
*/

.study-header .study-tags {
    font-size: 14px;
    color: #6c7a89;
    margin-bottom: 18px;
}

/*
文章詳細頁右上角操作按鈕
*/

.study-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn img {
    width: 18px;
    height: 18px;
    display: block;
    transition: transform 0.2s;
}

.action-btn:hover {
    background-color: #e8eefc;
}

.action-btn:hover img {
    transform: scale(1.1);
}

/*
標籤區
*/

.tag-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 0.6rem;
    padding: 1rem;
    max-width: 750px;
    margin: 0 auto;
}

.tag {
    background-color: #f1f0ef;
    padding: 0.6rem 1rem;
    border-radius: 1.5rem;
    font-size: 0.95rem;
    color: #333333;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.tag:hover {
    background-color: #e1e1e1;
    color: #1d3659;
    text-decoration: none;
}

.tag.active {
    background-color: #dbe4ff;
    color: #3b5bdb;
}

/*
文章區原本卡片模式關閉
*/

.study-article-wrapper {
    max-width: 846px;
    margin: 0 auto 40px auto;
    padding: 0;
}

.study-article-grid {
    display: none;
}

.study-article-card {
    display: none;
}

/*
橫向文章列表外層
*/

.study-list-wrapper {
    width: 100%;
}

/*
每一筆文章區塊
說明
一 使用橫向排列
二 左側可顯示封面圖
三 右側顯示標題 標籤 摘要 作者 日期與 Read more
四 使用最小高度讓列表穩定
*/

.study-list-item {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    min-height: 220px;
    background: #ebeefb;
    padding: 14px 20px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

/*
左側圖片區
*/

.study-image {
    width: 268px;
    height: 158px;
    flex: 0 0 268px;
    border: 1px solid #666666;
    background-color: #ffffff;
    overflow: hidden;
}

.study-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/*
沒有圖片時
*/

.study-list-item.no-image {
    padding-left: 34px;
}

/*
文章右側內容區
說明
一 右側內容吃滿剩餘寬度
二 使用 flex column 控制上下排列
三 作者 日期 Read more 會穩定靠下
*/

.study-content {
    flex: 1;
    min-width: 0;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/*
列表頁文章標題
*/

.study-list-item .study-title {
    font-size: 20px;
    font-weight: 700;
    color: #00306b;
    line-height: 1.35;
    margin-bottom: 6px;
}

/*
列表頁文章標籤
說明
一 移除原本過大的 margin bottom
二 避免摘要 作者與 Read more 被往下推太多
*/

.study-list-item .study-tags {
    font-size: 14px;
    color: #777777;
    line-height: 1.4;
    margin-bottom: 14px;
}

/*
文章摘要外層
說明
一 對應圖片中右側橘框的摘要位置
二 不使用固定最小高度
三 沒有摘要時不會撐開版面
四 超出範圍時隱藏
*/

.study-summary-wrap {
    width: 100%;
    max-width: 540px;
    max-height: 78px;
    margin-top: 18px;
    margin-bottom: 18px;
    overflow: hidden;
}

/*
文章摘要文字
*/

.study-summary {
    color: #1d3659;
    font-size: 16px;
    line-height: 1.75;
    word-break: break-word;
    overflow: hidden;
}

/*
作者區塊
說明
一 使用 margin top auto
二 讓作者 日期 Read more 穩定靠近卡片下方
*/

.study-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    margin-bottom: 6px;
}

/*
作者頭像
*/

.author-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #001f3f;
    background-color: #ffffff;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/*
作者文字
*/

.author-text {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-size: 14px;
    font-weight: 700;
    color: #002b66;
}

.author-org {
    font-size: 10px;
    color: #002b66;
}

/*
日期
*/

.study-date {
    font-size: 11px;
    color: #002b66;
    margin-top: 4px;
}

/*
Read more 外層
*/

.study-read-more-wrap {
    margin-top: 6px;
}

/*
Read more 連結樣式
說明
一 使用主題藍色
二 移除底線
三 保留明顯可點擊感
*/

.study-link {
    display: inline-flex;
    align-items: center;
    color: #456be6;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}

.study-link:hover {
    color: #1d3659;
    text-decoration: none;
}

/*
========================================
摘要後方 Read more
========================================
*/

.study-link-inline {
    display: inline;
    margin-left: 8px;
    white-space: nowrap;
}

/*
========================================
摘要後方 Read more
說明
一 Read more 放在摘要外層下面
二 避免被摘要區 overflow hidden 裁掉
三 保持靠近摘要文字
========================================
*/

.study-read-more-after-summary {
    margin-top: 4px;
    margin-bottom: 12px;
}



/*
文章詳細頁內容區
*/

.study-show-content {
    background-color: #ebeefb;
    border-radius: 10px;
    padding: 24px;
    margin-top: 24px;
    line-height: 1.8;
    color: #001f3f;
}

.study-show-content img {
    max-width: 100%;
    height: auto;
}

/*
隱藏舊 Read more 與摘要
*/

.study-article-summary,
.study-article-link {
    display: none;
}

/*
空資料提示
*/

.study-empty-message {
    text-align: center;
    color: #777777;
    padding: 3rem 0;
}

/*
文章列表分頁區
*/

.study-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

/*
Bootstrap 分頁外層
*/

.study-pagination-wrapper nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

/*
Bootstrap 分頁列表
*/

.study-pagination-wrapper .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/*
分頁按鈕
*/

.study-pagination-wrapper .page-link {
    min-width: 42px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #d5dce8;
    border-radius: 8px;
    color: #31517d;
    background-color: #ffffff;
    font-size: 15px;
    line-height: 40px;
    text-align: center;
}

/*
目前頁分頁按鈕
*/

.study-pagination-wrapper .page-item.active .page-link {
    border-color: #456be6;
    background-color: #456be6;
    color: #ffffff;
}

/*
停用分頁按鈕
*/

.study-pagination-wrapper .page-item.disabled .page-link {
    color: #aab4c3;
    background-color: #f2f4f8;
}

/*
RWD
*/

@media (max-width: 992px) {

    .study-list-item {
        flex-direction: column;
        min-height: auto;
    }

    .study-image {
        width: 100%;
        height: auto;
        flex: none;
    }

    .study-image img {
        height: auto;
    }

    .study-content {
        min-height: auto;
    }

    .study-summary-wrap {
        max-width: 100%;
        max-height: none;
    }

    .study-author {
        margin-top: 16px;
    }

    .study-header {
        flex-direction: column;
        gap: 12px;
    }

    .study-header-left {
        max-width: 100%;
    }
}

@media (max-width: 576px) {

    .study-list-item {
        padding: 14px 16px;
    }

    .study-list-item .study-title {
        font-size: 16px;
    }

    .study-header .study-title {
        font-size: 22px;
    }

    .study-summary {
        font-size: 14px;
    }
}