/* === 作者資訊區塊 === */
.author-box-container {
margin: 40px 0;
padding: 30px;
background: #fafafa;
border-radius: 8px;
border: 1px solid #eee;
}
.ab-header {
display: flex;
justify-content: space-between;
align-items: flex-end; /* Align tabs to bottom */
border-bottom: 2px solid #e5e5e5;
margin-bottom: 25px;
/* padding-bottom: 10px; Removed to align tabs with border */
flex-wrap: wrap;
gap: 15px;
}
.ab-tabs { 
display: flex; 
gap: 20px; 
margin-bottom: -2px; /* Overlap active line with border */
}
.ab-tab-btn {
background: none; 
border: none; 
font-size: 1rem; 
font-weight: 600;
color: #333; 
cursor: pointer; position: relative; padding: 0 0 15px 0;
}
.ab-tab-btn.active { color: #e91e63; }
.ab-tab-btn .post-count {
background: #e91e63;
color: #fff;
font-size: 12px;
padding: 2px 8px;
border-radius: 12px;
margin-left: 5px;
vertical-align: middle;
transition: all 0.3s ease;
font-weight: normal;
}
.ab-tab-btn.active::after {
content: ''; position: absolute; bottom: 0px; left: 0; width: 100%;
height: 3px; background: #e91e63; z-index: 1;
}
.ab-actions { 
display: flex; 
align-items: center; 
gap: 15px; 
padding-bottom: 15px; /* Align with tab text baseline */
}

/* 視圖切換按鈕 */
.ab-view-toggle {
display: none; /* 預設隱藏，切換到最近文章頁籤時由 JS 顯示 */
gap: 4px; 
background: #fff; 
padding: 3px; 
border: 1px solid #ddd; 
border-radius: 4px; 
transition: opacity 0.3s ease;
}
.ab-view-btn {
background: none; border: none; padding: 4px 6px; cursor: pointer; color: #999; display: flex;
}
.ab-view-btn.active { background: #e91e63; color: #fff; border-radius: 3px; }

/* 文章一覽表連結 - 按鈕風格 */
.ab-view-all { 
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
font-size: 14px;
font-weight: 500;
color: #666;
text-decoration: none;
background: #f5f5f5;
border: 1px solid #e0e0e0;
border-radius: 4px;
transition: all 0.2s ease;
}
.ab-view-all svg {
width: 16px;
height: 16px;
transition: transform 0.2s ease;
}
.ab-view-all:hover { 
color: #e91e63;
background: #fff;
border-color: #e91e63;
}
.ab-view-all:hover svg {
transform: translateX(2px);
}

/* Tab 內容 */
.ab-content { display: none; animation: fadeIn 0.5s; }
.ab-content.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* 作者內容 - 採用 author.php 風格 */
.ab-author-wrap { 
display: grid;
grid-template-columns: 96px minmax(0, 1fr);
grid-template-rows: auto;
gap: 0 20px; /* 增加欄位間距 */
grid-template-areas: 
"avatar content"
"avatar social";
background: #fff;
padding: 22px 24px;
border: 1px solid #e6edf3;
border-radius: 18px;
}
.ab-avatar { 
grid-area: avatar;
padding: 0;
display: flex;
align-items: flex-start; /* 圖片靠上 */
justify-content: flex-start;
}
.ab-avatar a {
pointer-events: none; /* 禁用頭像連結 */
cursor: default;
}
.ab-avatar picture,
.ab-avatar a,
.ab-avatar img {
display: block;
line-height: 0;
}
.ab-avatar picture,
.ab-avatar a {
width: 96px;
max-width: 96px;
}
.ab-avatar img { 
width: 96px;
height: 96px;
max-width: 96px;
aspect-ratio: 1;
object-fit: cover;
border: none;
}
.author-avatar-shape-circle .ab-avatar img,
.ab-avatar--circle img {
border-radius: 50%;
}
.author-avatar-shape-square .ab-avatar img,
.ab-avatar--square img {
border-radius: 0;
}
.ab-info {
grid-area: content;
min-width: 0;
padding: 0;
background: transparent;
word-break: normal;
overflow-wrap: anywhere;
}
.ab-name { 
margin: 0 0 10px;
font-size: 1.25rem;
font-weight: 900;
letter-spacing: 0;
line-height: 1.4;
text-align: left;
display: block;
}
.author-post-count {
background: #e91e63;
color: #fff;
font-size: 12px;
padding: 2px 8px;
border-radius: 12px;
font-weight: normal;
margin-left: 10px;
display: inline-block;
}
.ab-bio { 
margin: 0;
color: #666; 
line-height: 1.8;
text-align: left;
}

.ab-bio p { 
font-size: 1rem;
margin: 0;
}

/* 作者社群按鈕區域 */
.ab-social-area {
grid-area: social;
display: grid;
gap: 10px;
padding: 14px 0 0;
opacity: 1;
align-content: start;
justify-items: start;
text-align: left;
}

.ab-social-text-links {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin: 0;
}

.ab-social-area--align-left {
justify-items: start;
text-align: left;
}

.ab-social-area--align-center {
justify-items: center;
text-align: center;
}

.ab-social-area--align-right {
justify-items: end;
text-align: right;
}

.ab-social-area--align-left .ab-social-text-links,
.ab-social-area--align-left .ab-social-links,
.ab-social-area--align-left .ab-social-icons {
justify-content: flex-start;
}

.ab-social-area--align-center .ab-social-text-links,
.ab-social-area--align-center .ab-social-links,
.ab-social-area--align-center .ab-social-icons {
justify-content: center;
}

.ab-social-area--align-right .ab-social-text-links,
.ab-social-area--align-right .ab-social-links,
.ab-social-area--align-right .ab-social-icons {
justify-content: flex-end;
}

/* Author footer links alignment by device: 2026-06-15 */
@media (min-width: 1025px) {
    .ab-social-area.ab-social-align-desktop-left {
        justify-items: start;
        text-align: left;
    }

    .ab-social-area.ab-social-align-desktop-center {
        justify-items: center;
        text-align: center;
    }

    .ab-social-area.ab-social-align-desktop-right {
        justify-items: end;
        text-align: right;
    }

    .ab-social-area.ab-social-align-desktop-left :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: flex-start;
    }

    .ab-social-area.ab-social-align-desktop-center :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: center;
    }

    .ab-social-area.ab-social-align-desktop-right :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: flex-end;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .ab-social-area.ab-social-align-tablet-left {
        justify-items: start;
        text-align: left;
    }

    .ab-social-area.ab-social-align-tablet-center {
        justify-items: center;
        text-align: center;
    }

    .ab-social-area.ab-social-align-tablet-right {
        justify-items: end;
        text-align: right;
    }

    .ab-social-area.ab-social-align-tablet-left :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: flex-start;
    }

    .ab-social-area.ab-social-align-tablet-center :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: center;
    }

    .ab-social-area.ab-social-align-tablet-right :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .ab-social-area.ab-social-align-mobile-left {
        justify-items: start;
        text-align: left;
    }

    .ab-social-area.ab-social-align-mobile-center {
        justify-items: center;
        text-align: center;
    }

    .ab-social-area.ab-social-align-mobile-right {
        justify-items: end;
        text-align: right;
    }

    .ab-social-area.ab-social-align-mobile-left :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: flex-start;
    }

    .ab-social-area.ab-social-align-mobile-center :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: center;
    }

    .ab-social-area.ab-social-align-mobile-right :is(.ab-social-text-links, .ab-social-links, .ab-social-icons) {
        justify-content: flex-end;
    }
}

.ab-social-text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-height: auto;
}

.ab-social-text-link:hover {
    color: #e91e63;
    background: #fff;
    border-color: #e91e63;
    text-decoration: none;
}

.ab-social-text-icon {
    font-size: 12px;
}

/* 作者社群按鈕 */
.ab-social-links {
display: flex;
gap: 8px;
margin: 0;
flex-wrap: wrap;
}
.ab-social-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 16px; /* pill shape */
color: #fff !important;
text-decoration: none !important; /* 移除底線 */
border: 1px solid transparent;
transition: all 0.2s ease;
}
.ab-social-btn i {
font-size: 14px;
color: #fff !important;
}
.ab-social-facebook {
background-color: #1877f2;
border-color: #1877f2;
}
.ab-social-twitter {
background-color: #000;
border-color: #000;
}
.ab-social-instagram {
background-color: #e4405f;
border-color: #e4405f;
}
.ab-social-linkedin {
background-color: #0a66c2;
border-color: #0a66c2;
}
.ab-social-youtube {
background-color: #f00;
border-color: #f00;
}
.ab-social-website {
background-color: #666;
border-color: #666;
}
.ab-social-btn:hover {
transform: translateY(-2px);
opacity: 0.9;
text-decoration: none !important; /* hover 時也不要底線 */
}

/* 移除所有 author box 內連結的底線 */
.author-box-container a {
text-decoration: none;
}
.author-box-container a:hover {
text-decoration: none !important;
}

/* 文章列表 (預設清單) */
.ab-posts-list { display: flex; flex-direction: column; gap: 20px; }
.ab-posts-list.view-list .ab-post-item { flex-direction: row; align-items: flex-start; }
.ab-post-item {
display: flex;
align-items: center;
gap: 20px;
background: #fff;
padding: 15px;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
transition: transform 0.2s ease, box-shadow 0.2s ease;
border: 1px solid #eee;
}
.ab-post-item:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.ab-post-item[data-clickable="true"] {
cursor: pointer;
}
.ab-post-item[data-clickable="true"]:hover {
border-color: #e91e63;
}
.ab-thumb img { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; }
.ab-post-info { flex: 1; }
.ab-meta { font-size: 12px; color: #999; margin-bottom: 5px; }
.ab-post-date { color: #e91e63; }
.ab-post-title { margin: 0 0 5px; font-size: 16px; }
.ab-post-title a { text-decoration: none; color: #333; }
.ab-excerpt { font-size: 13px; color: #777; margin: 0; line-height: 1.5; }

/* 文章列表 (網格模式) */
.ab-posts-list.view-grid {
display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
}
.ab-posts-list.view-grid .ab-post-item { flex-direction: column; gap: 10px; }
.ab-posts-list.view-grid .ab-thumb img { width: 100%; height: 140px; }

/* 閱讀更多按鈕 */
.ab-view-more-container {
text-align: center;
margin-top: 20px;
grid-column: 1 / -1; /* Ensure it spans full width in grid */
}
.ab-view-more-btn {
display: inline-block;
padding: 8px 25px;
background: #fff;
color: #666;
border: 1px solid #ddd;
border-radius: 20px;
text-decoration: none;
font-size: 14px;
transition: all 0.3s ease;
}
.ab-view-more-btn:hover {
background: #e91e63;
color: #fff;
border-color: #e91e63;
}

/* === 社群互動區塊 === */
.social-box-wrapper { margin: 40px 0; }
.social-box-container {
display: flex; gap: 20px; padding: 25px; background: #4a4a4a;
color: #fff; border-radius: 8px; align-items: center;
}
.sb-image img { width: 250px; border-radius: 6px; display: block; }
.sb-content { flex: 1; text-align: center; }
.sb-title { font-size: 22px; margin: 0 0 5px; color: #fff; }
.sb-subtitle { margin: 0 0 20px; opacity: 0.9; }
.sb-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sb-btn {
display: inline-flex; justify-content: center; align-items: center;
padding: 10px 25px; border-radius: 4px; text-decoration: none; color: #fff;
font-weight: bold; min-width: 200px; transition: transform 0.2s;
}
.sb-btn:hover { transform: translateY(-2px); color: #fff; }
.sb-share-btn.facebook, .sb-follow-btn.facebook { background: #1877f2; }
.sb-share-btn.line { background: #00c300; }
.sb-share-btn.twitter { background: #1da1f2; }
.sb-follow-btn.google_news_follow { background: #4285f4; }

/* GN 橫幅 */
.gn-banner {
margin-top: 20px; background: #e8f0fe; padding: 15px; border-radius: 6px;
text-align: center; border: 1px solid #d2e3fc;
}
.gn-banner a { text-decoration: none; color: #1967d2; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.gn-icon { width: 24px; height: 24px; }

@media (max-width: 768px) {
.author-box-container {
    padding: 15px; /* Slightly reduced padding */
    margin: 25px 0;
}

/* Header Stacking & Centering */
.ab-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 0;
    border-bottom: none; /* Mobile header doesn't need a full border-bottom here if tabs have it */
}

.ab-tabs {
    width: 100%;
    justify-content: center; 
    border-bottom: 2px solid #e5e5e5;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.ab-tab-btn {
    font-size: 0.95rem;
    padding: 0 5px 12px 5px;
}

.ab-actions {
    width: 100%;
    justify-content: center; 
    gap: 10px;
    padding-bottom: 0;
    flex-wrap: wrap;
}

.ab-view-all {
    width: auto; /* Don't force full width if not needed */
    min-width: 140px;
    justify-content: center;
    margin-top: 0;
}

/* Author Info Stacking & Centering */
.ab-author-wrap {
    grid-template-columns: 1fr;
    grid-template-areas: 
        "avatar"
        "content"
        "social";
    text-align: center;
    padding: 20px 15px;
    gap: 15px 0;
    border-radius: 12px;
}

.ab-avatar {
padding: 0;
justify-content: center; /* 圖片置中 */
}

.ab-avatar img {
width: 88px;
height: 88px;
max-width: 88px;
margin: 0 auto;
}

.ab-avatar picture,
.ab-avatar a {
width: 88px;
max-width: 88px;
}

.ab-info {
padding: 0;
}

.ab-name {
text-align: center;
margin-bottom: 12px;
}

.ab-bio {
text-align: center;
margin-bottom: 0;
}

.ab-social-area {
justify-items: center;
text-align: center;
padding-top: 8px;
}

.ab-social-text-links,
.ab-social-links {
    justify-content: center; 
    gap: 8px;
}

.ab-social-text-link {
    font-size: 0.85rem; /* Smaller text for mobile buttons */
    padding: 5px 10px;
}

.ab-social-icons {
justify-content: center;
}

.ab-social-area--align-left {
justify-items: start;
text-align: left;
}

.ab-social-area--align-center {
justify-items: center;
text-align: center;
}

.ab-social-area--align-right {
justify-items: end;
text-align: right;
}

.ab-social-area--align-left .ab-social-text-links,
.ab-social-area--align-left .ab-social-links,
.ab-social-area--align-left .ab-social-icons {
justify-content: flex-start;
}

.ab-social-area--align-center .ab-social-text-links,
.ab-social-area--align-center .ab-social-links,
.ab-social-area--align-center .ab-social-icons {
justify-content: center;
}

.ab-social-area--align-right .ab-social-text-links,
.ab-social-area--align-right .ab-social-links,
.ab-social-area--align-right .ab-social-icons {
justify-content: flex-end;
}

/* Post List - Keep horizontal but ensure it fits */
.ab-posts-list.view-list .ab-post-item {
flex-direction: row;
align-items: center;
}

.ab-post-item {
flex-direction: row;
align-items: center;
}

.ab-thumb img {
    width: 100px;
    height: 70px;
    margin-bottom: 0;
    margin-right: 15px;
    object-fit: cover; /* Added for better image display */
}

/* Mobile specific post item refinements */
@media (max-width: 480px) {
    .ab-post-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .ab-thumb img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Social Box RWD */
@media (max-width: 768px) {
    .social-box-container {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .sb-image img {
        width: 100%;
        max-width: 300px;
        margin-bottom: 15px;
    }
    .sb-title {
        font-size: 1.2rem;
    }
    .sb-btn {
        width: 100%;
        min-width: 0;
    }
}

.ab-post-info {
width: auto;
flex: 1;
}

/* Social Box RWD (Legacy support) */
.social-box-container { flex-direction: column; }
.sb-image img { width: 100%; }
}

/* Author text alignment by device: 2026-06-14 */
@media (min-width: 1025px) {
    .ab-author-wrap.ab-text-align-desktop-left .ab-info,
    .ab-author-wrap.ab-text-align-desktop-left .ab-name,
    .ab-author-wrap.ab-text-align-desktop-left .ab-bio {
        text-align: left;
    }

    .ab-author-wrap.ab-text-align-desktop-center .ab-info,
    .ab-author-wrap.ab-text-align-desktop-center .ab-name,
    .ab-author-wrap.ab-text-align-desktop-center .ab-bio {
        text-align: center;
    }

    .ab-author-wrap.ab-text-align-desktop-right .ab-info,
    .ab-author-wrap.ab-text-align-desktop-right .ab-name,
    .ab-author-wrap.ab-text-align-desktop-right .ab-bio {
        text-align: right;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .ab-author-wrap.ab-text-align-tablet-left .ab-info,
    .ab-author-wrap.ab-text-align-tablet-left .ab-name,
    .ab-author-wrap.ab-text-align-tablet-left .ab-bio {
        text-align: left;
    }

    .ab-author-wrap.ab-text-align-tablet-center .ab-info,
    .ab-author-wrap.ab-text-align-tablet-center .ab-name,
    .ab-author-wrap.ab-text-align-tablet-center .ab-bio {
        text-align: center;
    }

    .ab-author-wrap.ab-text-align-tablet-right .ab-info,
    .ab-author-wrap.ab-text-align-tablet-right .ab-name,
    .ab-author-wrap.ab-text-align-tablet-right .ab-bio {
        text-align: right;
    }
}

@media (max-width: 768px) {
    .ab-author-wrap.ab-text-align-mobile-left .ab-info,
    .ab-author-wrap.ab-text-align-mobile-left .ab-name,
    .ab-author-wrap.ab-text-align-mobile-left .ab-bio {
        text-align: left;
    }

    .ab-author-wrap.ab-text-align-mobile-center .ab-info,
    .ab-author-wrap.ab-text-align-mobile-center .ab-name,
    .ab-author-wrap.ab-text-align-mobile-center .ab-bio {
        text-align: center;
    }

    .ab-author-wrap.ab-text-align-mobile-right .ab-info,
    .ab-author-wrap.ab-text-align-mobile-right .ab-name,
    .ab-author-wrap.ab-text-align-mobile-right .ab-bio {
        text-align: right;
    }
}

/* Author text alignment authority pass: 2026-06-14 */
@media (min-width: 1025px) {
    .ab-author-wrap.ab-text-align-desktop-left,
    .ab-author-wrap.ab-text-align-desktop-left .ab-info,
    .ab-author-wrap.ab-text-align-desktop-left .ab-info > *,
    .ab-author-wrap.ab-text-align-desktop-left .ab-bio p {
        text-align: left;
    }

    .ab-author-wrap.ab-text-align-desktop-center,
    .ab-author-wrap.ab-text-align-desktop-center .ab-info,
    .ab-author-wrap.ab-text-align-desktop-center .ab-info > *,
    .ab-author-wrap.ab-text-align-desktop-center .ab-bio p {
        text-align: center;
    }

    .ab-author-wrap.ab-text-align-desktop-right,
    .ab-author-wrap.ab-text-align-desktop-right .ab-info,
    .ab-author-wrap.ab-text-align-desktop-right .ab-info > *,
    .ab-author-wrap.ab-text-align-desktop-right .ab-bio p {
        text-align: right;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .ab-author-wrap.ab-text-align-tablet-left,
    .ab-author-wrap.ab-text-align-tablet-left .ab-info,
    .ab-author-wrap.ab-text-align-tablet-left .ab-info > *,
    .ab-author-wrap.ab-text-align-tablet-left .ab-bio p {
        text-align: left;
    }

    .ab-author-wrap.ab-text-align-tablet-center,
    .ab-author-wrap.ab-text-align-tablet-center .ab-info,
    .ab-author-wrap.ab-text-align-tablet-center .ab-info > *,
    .ab-author-wrap.ab-text-align-tablet-center .ab-bio p {
        text-align: center;
    }

    .ab-author-wrap.ab-text-align-tablet-right,
    .ab-author-wrap.ab-text-align-tablet-right .ab-info,
    .ab-author-wrap.ab-text-align-tablet-right .ab-info > *,
    .ab-author-wrap.ab-text-align-tablet-right .ab-bio p {
        text-align: right;
    }
}

@media (max-width: 768px) {
    .ab-author-wrap.ab-text-align-mobile-left,
    .ab-author-wrap.ab-text-align-mobile-left .ab-info,
    .ab-author-wrap.ab-text-align-mobile-left .ab-info > *,
    .ab-author-wrap.ab-text-align-mobile-left .ab-bio p {
        text-align: left;
    }

    .ab-author-wrap.ab-text-align-mobile-center,
    .ab-author-wrap.ab-text-align-mobile-center .ab-info,
    .ab-author-wrap.ab-text-align-mobile-center .ab-info > *,
    .ab-author-wrap.ab-text-align-mobile-center .ab-bio p {
        text-align: center;
    }

    .ab-author-wrap.ab-text-align-mobile-right,
    .ab-author-wrap.ab-text-align-mobile-right .ab-info,
    .ab-author-wrap.ab-text-align-mobile-right .ab-info > *,
    .ab-author-wrap.ab-text-align-mobile-right .ab-bio p {
        text-align: right;
    }
}
