/*
Theme Name: Astra Child - Tonghoinn
Theme URI: https://tonghoinn.sphoton.com
Description: Child theme of Astra for tonghoinn.sphoton.com - Magazine layout for archive pages
Author: Tonghoinn
Author URI: https://tonghoinn.sphoton.com
Template: astra
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-child-tonghoinn
*/

/* ============================================
   ARCHIVE / MAGAZINE LAYOUT
   ============================================ */

/* Archive page wrapper */
.thn-archive-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.thn-archive-main {
    flex: 1;
    min-width: 0;
}

.thn-archive-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Archive page title */
.thn-archive-title {
    font-size: 24px;
    font-weight: 700;
    color: #228504;
    border-left: 4px solid #228504;
    padding-left: 12px;
    margin: 0 0 25px 0;
    line-height: 1.3;
}

/* ============================================
   HERO POST (first post - large)
   ============================================ */

.thn-hero-post {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.thn-hero-post .thn-post-thumb {
    width: 55%;
    flex-shrink: 0;
    overflow: hidden;
}

.thn-hero-post .thn-post-thumb a {
    display: block;
    overflow: hidden;
}

.thn-hero-post .thn-post-thumb img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.thn-hero-post .thn-post-thumb a:hover img {
    transform: scale(1.04);
}

.thn-hero-post .thn-post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.thn-hero-post .thn-post-cat {
    display: inline-block;
    background: #228504;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 3px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.thn-hero-post .thn-post-cat:hover {
    background: #1a6503;
}

.thn-hero-post .thn-post-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0;
}

.thn-hero-post .thn-post-title a {
    color: #222;
    text-decoration: none;
}

.thn-hero-post .thn-post-title a:hover {
    color: #228504;
}

.thn-hero-post .thn-post-excerpt {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thn-hero-post .thn-post-meta {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
}

.thn-hero-post .thn-post-meta span {
    margin-right: 12px;
}

.thn-read-more {
    display: none;
}

/* ============================================
   SECTION HEADING
   ============================================ */

.thn-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0 18px 0;
    border-bottom: 2px solid #228504;
    padding-bottom: 8px;
}

.thn-section-heading h2 {
    font-size: 18px;
    font-weight: 700;
    color: #228504;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thn-section-heading a.thn-view-all {
    font-size: 12px;
    color: #228504;
    text-decoration: none;
    font-weight: 600;
}

.thn-section-heading a.thn-view-all:hover {
    text-decoration: underline;
}

/* ============================================
   POST GRID (remaining posts)
   ============================================ */

.thn-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.thn-post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    transition: transform 0.2s, box-shadow 0.2s;
}

.thn-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.thn-post-card .thn-post-thumb {
    overflow: hidden;
}

.thn-post-card .thn-post-thumb a {
    display: block;
}

.thn-post-card .thn-post-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.thn-post-card:hover .thn-post-thumb img {
    transform: scale(1.05);
}

.thn-post-card .thn-post-content {
    padding: 14px;
}

.thn-post-card .thn-post-cat {
    display: inline-block;
    color: #228504;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.thn-post-card .thn-post-cat:hover {
    text-decoration: underline;
}

.thn-post-card .thn-post-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thn-post-card .thn-post-title a {
    color: #222;
    text-decoration: none;
}

.thn-post-card .thn-post-title a:hover {
    color: #228504;
}

.thn-post-card .thn-post-meta {
    font-size: 14px;
    color: #999;
    margin-top: 8px;
}

/* No thumbnail fallback */
.thn-no-thumb {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #e8f5e3, #c8e6c0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thn-no-thumb span {
    font-size: 36px;
}

.thn-hero-no-thumb {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #e8f5e3, #c8e6c0);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thn-hero-no-thumb span {
    font-size: 60px;
}

/* ============================================
   PAGINATION
   ============================================ */

.thn-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.thn-pagination a,
.thn-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
}

.thn-pagination a:hover {
    border-color: #228504;
    color: #228504;
    background: #f0faf0;
}

.thn-pagination .current {
    background: #228504;
    border-color: #228504;
    color: #fff;
    font-weight: 700;
}

.thn-pagination .dots {
    border: none;
    color: #999;
    min-width: auto;
    padding: 0 4px;
}

/* ============================================
   SIDEBAR
   ============================================ */

.thn-archive-sidebar .thn-sidebar-widget {
    background: #fff;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.thn-archive-sidebar .thn-widget-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #228504;
    margin: -18px -18px 16px -18px;
    padding: 10px 18px;
    border-radius: 8px 8px 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar recent posts */
.thn-sidebar-posts .thn-sidebar-post {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.thn-sidebar-posts .thn-sidebar-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.thn-sidebar-posts .thn-sidebar-post img {
    width: 70px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.thn-sidebar-posts .thn-sidebar-post-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: #222;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thn-sidebar-posts .thn-sidebar-post-title:hover {
    color: #228504;
}

.thn-sidebar-posts .thn-sidebar-post-date {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* Sidebar categories */
.thn-sidebar-cats a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #444;
    font-size: 16px;
    transition: color 0.2s;
}

.thn-sidebar-cats a:last-child {
    border-bottom: none;
}

.thn-sidebar-cats a:hover {
    color: #228504;
}

.thn-sidebar-cats .thn-cat-count {
    background: #f0f0f0;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    color: #888;
}

.single .entry-content img.alignleft {
    float: left !important;
    margin: 0 20px 15px 0 !important;
    clear: none !important;
}

.single .entry-content .wp-block-image.alignleft {
    float: left !important;
    margin: 0 20px 15px 0 !important;
    clear: none !important;
}

.single .entry-content {
    overflow: hidden;
}

/* Căn đều nội dung bài viết */
.single-post .tpgb-entry-content p {
    text-align: justify !important;
    text-justify: inter-word;
}

/* Giữ caption ảnh căn giữa */
.single-post .tpgb-entry-content p.has-text-align-center {
    text-align: center !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
    .thn-archive-wrap {
        flex-direction: column;
    }
    .thn-archive-sidebar {
        width: 100%;
    }
    .thn-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
	.thn-archive-title {
    font-size: 20px;
	}
	.thn-hero-post .thn-post-cat {
    font-size: 16px;
	}
	.thn-hero-post .thn-post-title {
    font-size: 16px;
	}
	.thn-hero-post .thn-post-excerpt {
    font-size: 14px;
	}
	.thn-post-card .thn-post-meta {
    font-size: 12px;
	}
	.thn-section-heading h2 {
    font-size: 16px;
	}
	.thn-post-card .thn-post-cat {
    font-size: 14px;
	}
	.thn-post-card .thn-post-title {
    font-size: 16px;
	}
	.thn-post-card .thn-post-meta {
    font-size: 12px;
	}
	.thn-archive-sidebar .thn-widget-title {
    font-size: 16px;
	}
	.thn-sidebar-cats a {
    font-size: 14px;
	}
}

@media (max-width: 600px) {
    .thn-hero-post {
        flex-direction: column;
    }
    .thn-hero-post .thn-post-thumb {
        width: 100%;
    }
    .thn-hero-post .thn-post-content {
        padding: 15px;
    }
    .thn-posts-grid {
        grid-template-columns: 1fr;
    }
}

/////////////////////////////////////////////////////////////////
/* =========================================
   MEMBERS ARCHIVE & DIRECTORY
========================================= */

/* Full Width Canvas for Hoi Vien Archive (like Ve Chung Toi) */
.post-type-archive-hoi-vien #content,
.post-type-archive-hoi-vien.ast-page-builder-template .site-content,
.post-type-archive-hoi-vien.ast-page-builder-template #content > .ast-container,
.post-type-archive-hoi-vien #content > .ast-container {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.post-type-archive-hoi-vien #primary,
.post-type-archive-hoi-vien.ast-page-builder-template .site-content #primary {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.thn-members-archive {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: transparent;
}

/* =========================================
   HERO HEADER (FULL WIDTH IMAGE BANNER)
   Đồng bộ phong cách trang trọng với các trang khác (vd: /ve-chung-toi/)
========================================= */

.thn-members-hero {
    position: relative;
    width: 100%;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center 35%;
    background-repeat: no-repeat;
    padding: 90px 20px 85px;
    text-align: center;
    overflow: hidden;
    border-bottom: 4px solid #228504;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* Lớp phủ màu xanh nông nghiệp trang trọng đồng bộ toàn website */
.thn-members-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 46, 47, 0.60) 0%, rgba(4, 46, 47, 0.80) 100%);
    z-index: 1;
}

.thn-members-hero .thn-container {
    position: relative;
    z-index: 2;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.thn-members-hero .thn-section-label {
    display: inline-block;
    color: #86efac;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(134, 239, 172, 0.4);
    backdrop-filter: blur(8px);
    padding: 6px 20px;
    border-radius: 9999px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.thn-members-hero .thn-members-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 44px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.thn-members-hero .thn-members-description {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 18px;
    line-height: 1.65;
    color: #f1f5f9;
    max-width: 780px;
    margin: 0 auto;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
    font-weight: 400;
}

/* =========================================
   MEMBERS CONTENT SECTION (SEPARATED FROM HERO)
========================================= */

.thn-members-content {
    width: 100%;
    background-color: #f8fafc;
    padding-top: 10px;
    padding-bottom: 60px;
}

.thn-members-content .thn-container {
    width: min(1240px, calc(100% - 32px));
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   LAYOUT: SIDEBAR + MAIN
========================================= */

.thn-members-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 36px 0 60px;
}

/* =========================================
   LEFT SIDEBAR
========================================= */

.thn-members-sidebar {
    width: 290px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    z-index: 20;
}

.thn-sidebar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 18px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.thn-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.thn-sidebar-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.thn-sidebar-heading svg {
    color: #228504;
}

.thn-sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 4px;
}

.thn-sidebar-close:hover {
    color: #ef4444;
}

.thn-filter-item {
    margin-bottom: 16px;
}

.thn-filter-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.thn-filter-item select,
.thn-filter-item input[type="search"] {
    width: 100% !important;
    height: 42px !important;
    padding: 0 12px !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

.thn-filter-item select:focus,
.thn-filter-item input[type="search"]:focus {
    background: #ffffff !important;
    border-color: #228504 !important;
    box-shadow: 0 0 0 3px rgba(34, 133, 4, 0.15) !important;
}

/* Ô tìm kiếm có icon */
.thn-input-icon-wrap {
    position: relative;
    width: 100%;
}

.thn-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.thn-filter-search-box input[type="search"] {
    padding-left: 36px !important;
}

/* Nút Xóa bộ lọc */
.thn-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 42px;
    margin-top: 20px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.thn-reset-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* =========================================
   RIGHT MAIN CONTENT
========================================= */

.thn-members-main {
    flex: 1;
    min-width: 0;
}

.thn-members-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.thn-mobile-filter-trigger {
    display: none;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    background: #228504;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.thn-mobile-filter-trigger:hover {
    background: #1a6603;
}

.thn-members-count {
    font-size: 14px;
    color: #64748b;
}

.thn-members-count strong {
    color: #0f172a;
    font-weight: 700;
}

.thn-members-grid-wrap {
    position: relative;
    min-height: 300px;
}

/* Loading Indicator */
.thn-loading-indicator {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(2px);
    z-index: 15;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 16px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

.thn-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #e2e8f0;
    border-top-color: #228504;
    border-radius: 50%;
    animation: thn-spin 0.75s linear infinite;
}

@keyframes thn-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   GRID & MEMBER CARD (CIRCULAR AVATAR)
========================================= */

.thn-members-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
    transition: opacity 0.25s ease;
}

.thn-members-grid.is-loading {
    opacity: 0.5;
    pointer-events: none;
}

.thn-members-grid .thn-member-card {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.thn-members-grid .thn-member-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 12px 28px rgba(34, 133, 4, 0.12) !important;
    border-color: #86efac !important;
}

.thn-members-grid .thn-member-card-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 24px 18px 20px !important;
    text-align: center !important;
    color: inherit !important;
    text-decoration: none !important;
}

/* 1. Khung Avatar Tròn */
.thn-member-avatar-wrap {
    width: 130px !important;
    height: 130px !important;
    margin: 0 auto 16px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #e8f5e9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.thn-member-avatar {
    width: 130px !important;
    height: 130px !important;
    max-width: 130px !important;
    max-height: 130px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 3px solid #e8f5e9 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
    display: block !important;
    overflow: hidden !important;
    font-size: 0 !important;
    color: transparent !important;
    transition: transform 0.3s ease, border-color 0.3s ease !important;
}

.thn-members-grid .thn-member-card:hover .thn-member-avatar {
    border-color: #228504 !important;
    transform: scale(1.04) !important;
}

/* Placeholder Avatar Vector */
.thn-member-avatar-placeholder {
    width: 130px !important;
    height: 130px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border: 3px solid #e8f5e9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #16a34a !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
    transition: transform 0.3s ease, border-color 0.3s ease !important;
}

.thn-members-grid .thn-member-card:hover .thn-member-avatar-placeholder {
    border-color: #228504 !important;
    transform: scale(1.04) !important;
}

/* 2. Khối thông tin */
.thn-member-info {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Chức vụ (Badge) */
.thn-member-badge {
    display: inline-block !important;
    max-width: 100% !important;
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 3px 12px !important;
    border-radius: 9999px !important;
    margin-bottom: 10px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    line-height: 1.5 !important;
}

/* Họ tên */
.thn-member-name {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.35 !important;
    transition: color 0.2s ease !important;
    text-align: center !important;
}

.thn-members-grid .thn-member-card:hover .thn-member-name {
    color: #228504 !important;
}

/* Mô tả ngắn */
.thn-member-excerpt {
    width: 100% !important;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    font-weight: 400 !important;
    text-align: center !important;
}

.thn-member-excerpt p {
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
    overflow: hidden !important;
}

/* =========================================
   PAGINATION
========================================= */

.thn-members-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 40px;
}

.thn-page-button {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.thn-page-button:hover {
    border-color: #228504;
    color: #228504;
    background: #f0fdf4;
}

.thn-page-button.is-current {
    background: #228504 !important;
    color: #ffffff !important;
    border-color: #228504 !important;
    box-shadow: 0 4px 10px rgba(34, 133, 4, 0.25) !important;
}

.thn-page-dots {
    padding: 0 6px;
    color: #94a3b8;
    font-weight: 700;
}

/* =========================================
   EMPTY STATE & ERROR
========================================= */

.thn-members-empty {
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    margin: 20px 0;
}

.thn-empty-icon {
    font-size: 44px;
    margin-bottom: 12px;
}

.thn-members-empty h2 {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.thn-members-empty p {
    font-size: 14.5px;
    color: #64748b;
    margin: 0;
}

.thn-members-error {
    text-align: center;
    padding: 50px 20px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
}

/* =========================================
   RESPONSIVE BREAKPOINTS
========================================= */

/* Dưới 1150px: Grid chuyển 2 cột */
@media (max-width: 1150px) {
    .thn-members-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Dưới 992px: Chuyển Sidebar thành Drawer trượt ra */
@media (max-width: 992px) {
    .thn-members-layout {
        flex-direction: column;
        gap: 20px;
        padding-top: 24px;
    }

    .thn-members-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        z-index: 99999;
        background: #ffffff;
        overflow-y: auto;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
    }

    .thn-members-sidebar.is-open {
        left: 0;
    }

    .thn-sidebar-card {
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 24px 20px 80px;
        min-height: 100vh;
    }

    .thn-sidebar-close {
        display: block;
    }

    .thn-mobile-filter-trigger {
        display: inline-flex;
    }

    /* Backdrop che mờ khi mở filter trên mobile */
    body.thn-sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(2px);
        z-index: 99998;
    }
}

/* Dưới 640px: Grid chuyển 1 cột */
@media (max-width: 640px) {
    .thn-members-hero {
        padding: 55px 16px 48px;
    }

    .thn-members-hero .thn-members-title {
        font-size: 26px;
    }

    .thn-members-hero .thn-members-description {
        font-size: 14.5px;
    }

    .thn-members-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .thn-members-grid .thn-member-card-link {
        padding: 20px 14px 18px !important;
    }

    .thn-member-avatar-wrap,
    .thn-member-avatar,
    .thn-member-avatar-placeholder {
        width: 110px !important;
        height: 110px !important;
    }
}

/* =============================================================
   MEMBER PROFILE DETAIL PAGE (single-hoi-vien.php)
   Layout Executive Profile: 2 Columns Asymmetric
============================================================= */

.single-hoi-vien #primary,
.single-hoi-vien.ast-page-builder-template .site-content #primary {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.single-hoi-vien #content,
.single-hoi-vien.ast-page-builder-template .site-content,
.single-hoi-vien.ast-page-builder-template #content > .ast-container,
.single-hoi-vien #content > .ast-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.thn-member-profile-wrap {
    width: 100%;
    min-height: 100vh;
    background-color: #f8fafc;
}

/* 1. TOPBAR & BREADCRUMB */
.thn-profile-topbar {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 0;
}

.thn-profile-topbar .thn-container {
    width: min(1240px, calc(100% - 32px));
    max-width: 1240px;
    margin: 0 auto;
}

.thn-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.thn-profile-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #64748b;
    flex-wrap: wrap;
}

.thn-breadcrumb-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.thn-breadcrumb-link:hover {
    color: #228504;
}

.thn-breadcrumb-separator {
    color: #cbd5e1;
    font-size: 12px;
}

.thn-breadcrumb-current {
    color: #0f172a;
    font-weight: 600;
}

.thn-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.thn-back-btn:hover {
    background: #e8f5e9;
    color: #1b6603;
    border-color: #a7f3d0;
    transform: translateX(-2px);
}

/* 2. PROFILE BODY & 2-COLUMN LAYOUT */
.thn-profile-body {
    width: 100%;
    padding: 36px 0 70px;
}

.thn-profile-body .thn-container {
    width: min(1240px, calc(100% - 32px));
    max-width: 1240px;
    margin: 0 auto;
}

.thn-profile-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* CỘT TRÁI: SIDEBAR */
.thn-profile-sidebar {
    width: 340px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
}

.thn-profile-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 32px 24px 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
    text-align: center;
}

.thn-profile-avatar-wrap {
    width: 170px;
    height: 170px;
    margin: 0 auto 20px;
    position: relative;
    border-radius: 50% !important;
    overflow: hidden !important;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thn-profile-avatar {
    width: 170px !important;
    height: 170px !important;
    max-width: 170px !important;
    max-height: 170px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 4px solid #e8f5e9 !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1) !important;
    display: block !important;
    overflow: hidden !important;
    font-size: 0 !important;
    color: transparent !important;
    transition: transform 0.3s ease, border-color 0.3s ease !important;
}

.thn-profile-avatar-wrap:hover .thn-profile-avatar {
    transform: scale(1.03);
    border-color: #228504 !important;
}

.thn-profile-avatar-placeholder {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 4px solid #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16a34a;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin: 0 auto;
}

.thn-profile-card-name {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
    line-height: 1.35;
}

.thn-profile-card-badge {
    display: inline-block;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 9999px;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.5;
}

.thn-profile-meta-block {
    text-align: left;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
    margin-bottom: 24px;
}

.thn-meta-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin: 0 0 14px 0;
}

.thn-meta-list {
    margin: 0;
    padding: 0;
}

.thn-meta-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #f1f5f9;
}

.thn-meta-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.thn-meta-row dt {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
}

.thn-meta-row dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.45;
}

.thn-highlight-text {
    color: #228504 !important;
}

.thn-sidebar-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.thn-sidebar-back-btn:hover {
    background: #228504;
    color: #ffffff;
    border-color: #228504;
    box-shadow: 0 4px 12px rgba(34, 133, 4, 0.25);
}

/* CỘT PHẢI: NỘI DUNG CHI TIẾT */
.thn-profile-content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header Card */
.thn-profile-intro-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 32px 36px 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.thn-profile-org-label {
    display: inline-block;
    color: #228504;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.thn-profile-main-title {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    margin: 0 0 16px 0;
}

.thn-profile-lead-excerpt {
    font-size: 16px;
    line-height: 1.65;
    color: #334155;
    background: #f8fafc;
    border-left: 4px solid #228504;
    padding: 14px 20px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 20px;
    font-style: normal;
}

.thn-profile-lead-excerpt p {
    margin: 0;
}

.thn-profile-tags-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.thn-tag-pill {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.thn-tag-dept {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.thn-tag-sector {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.thn-tag-region {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Detail Content Card */
.thn-profile-detail-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 36px 36px 40px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.thn-detail-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

.thn-detail-section-title svg {
    color: #228504;
}

.thn-profile-text-content {
    font-size: 15.5px;
    line-height: 1.8;
    color: #334155;
}

.thn-profile-text-content p {
    margin-bottom: 1.5em;
}

.thn-profile-text-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
}

.thn-profile-text-content ul,
.thn-profile-text-content ol {
    margin: 0 0 1.5em 1.5em;
}

.thn-profile-text-content li {
    margin-bottom: 0.5em;
}

/* Empty Notice */
.thn-profile-empty-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    color: #64748b;
    font-size: 14.5px;
}

.thn-notice-icon {
    color: #0284c7;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.thn-notice-body p {
    margin: 0;
}

/* Related Members Section */
.thn-related-members-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 30px 36px 32px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.thn-related-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.thn-related-title svg {
    color: #228504;
}

.thn-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.thn-related-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}

.thn-related-card:hover {
    background: #ffffff;
    border-color: #86efac;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 133, 4, 0.08);
}

.thn-related-avatar-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50% !important;
    overflow: hidden !important;
    position: relative;
    background: #e8f5e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thn-related-avatar {
    width: 52px !important;
    height: 52px !important;
    max-width: 52px !important;
    max-height: 52px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #e8f5e9 !important;
    display: block !important;
    overflow: hidden !important;
    font-size: 0 !important;
    color: transparent !important;
}

.thn-related-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thn-related-info {
    flex: 1;
    min-width: 0;
}

.thn-related-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #047857;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thn-related-name {
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.thn-related-card:hover .thn-related-name {
    color: #228504;
}

/* RESPONSIVE PROFILE BREAKPOINTS */
@media (max-width: 992px) {
    .thn-profile-layout {
        flex-direction: column;
        gap: 24px;
    }

    .thn-profile-sidebar {
        width: 100%;
        position: static;
    }

    .thn-profile-card {
        padding: 28px 20px;
    }

    .thn-related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .thn-topbar-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .thn-back-btn {
        width: 100%;
        justify-content: center;
    }

    .thn-profile-intro-card,
    .thn-profile-detail-card,
    .thn-related-members-section {
        padding: 24px 18px;
    }

    .thn-profile-main-title {
        font-size: 24px;
    }

    .thn-profile-avatar-wrap,
    .thn-profile-avatar,
    .thn-profile-avatar-placeholder {
        width: 140px !important;
        height: 140px !important;
    }
}

