/* v1.3.4 - Adjust Category Font Size */
/* Root wrapper (unchanged layout) */
#post-categories-grid.post-categories-grid {
  margin: 0 auto;
  position: relative;
  max-width: var(--wp--style--global--content-size, 1200px);
}


/* ================= Header, Search ================= */
.grid-header { text-align: center; margin-bottom: 24px; }
/* Removed custom font sizing for titles to inherit from theme */
.grid-title { margin: 0 0 12px 0; letter-spacing: -0.03em; }
.grid-subtitle { margin: 0; max-width: 680px; margin-left: auto; margin-right: auto; }

#post-categories-grid .search-container { max-width: 600px; margin: 0 auto 40px auto; position: relative; z-index: 100000; }
#post-categories-grid .search-box {
  position: relative; background: #ffffff; border-radius: 12px;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,0.25), 0 10px 10px -6px rgba(0,0,0,0.08);
  border: 2px solid #48c6ef; transition: all 0.25s ease;
}
#post-categories-grid .search-box:focus-within {
  border-color: #6f86d6;
  box-shadow: 0 14px 30px -10px rgba(111,134,214,0.35);
}
#post-categories-grid #global-search {
  width: 100%; padding: 16px 50px 16px 20px; border: none; border-radius: 12px;
  color: #0b1220; background: transparent; outline: none;
}
#post-categories-grid #global-search::placeholder { color: #6b7280; }
#post-categories-grid .search-clear {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: none; background: #48c6ef; color: #ffffff;
  border-radius: 50%; font-size: 18px; cursor: pointer; display: none;
  align-items: center; justify-content: center; transition: background-color 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(72,198,239,0.35); z-index: 1;
}
#post-categories-grid .search-clear:hover { background: #6f86d6; transform: translateY(-50%) scale(1.1); box-shadow: 0 4px 12px rgba(111,134,214,0.45); }
#post-categories-grid .search-clear.show { display: flex; }

#post-categories-grid .search-results {
  position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15), 0 10px 10px -5px rgba(0,0,0,0.06);
  border: 1px solid #e6f0fa; max-height: 400px; overflow-y: auto; z-index: 100001; margin-top: 8px; display: none;
}
#post-categories-grid .search-results.show { display: block; }
#post-categories-grid .search-result-item { padding: 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background-color 0.2s ease; }
#post-categories-grid .search-result-item:hover { background: #f0f9ff; }
#post-categories-grid .search-result-item:last-child { border-bottom: none; }
#post-categories-grid .search-result-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#post-categories-grid .search-result-category {
  background: linear-gradient(135deg, #48c6ef, #6f86d6);
  color: #ffffff; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
#post-categories-grid .search-result-date { color: #6b7280; font-size: 14px; }
#post-categories-grid .search-result-title { font-weight: 700; color: #0b1220; margin-bottom: 8px; line-height: 1.4; }
#post-categories-grid .search-result-excerpt { color: #374151; font-size: 14px; line-height: 1.55; margin-bottom: 0; }
#post-categories-grid .search-no-results { padding: 32px; text-align: center; color: #6b7280; }

/* ================= Main Layout, Sidebar & Content ================= */
.grid-main-layout { display: flex; gap: 32px; align-items: flex-start; }

.grid-sidebar {
  flex: 0 0 260px; position: sticky; top: 20px;
  background: linear-gradient(160deg, #48c6ef 0%, #6f86d6 100%);
  border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); padding: 16px;
  box-shadow: 0 12px 28px -10px rgba(0,0,0,0.35);
}
.sidebar-title {
  color: #ffffff; margin: 0 0 12px 0;
  padding-bottom: 12px; border-bottom: 2px solid rgba(255,255,255,0.35);
}
.category-navigation { display: flex; flex-direction: column; gap: 6px; }

/* === EDIT: Changed font-size for category links === */
.category-link {
  display: flex; align-items: center; gap: 12px; padding: 12px;

  border-radius: 10px; color: #0b1220; text-decoration: none;
  font-size: 13px; /* Bạn có thể thay đổi giá trị này, ví dụ 12px, 1rem... */
  font-weight: 700;
  transition: all 0.2s ease-in-out; 
	background: linear-gradient(135deg, #48c6ef, #6f86d6); 
  box-shadow: 0 6px 14px rgba(0,0,0,0.1);
}
.category-link:hover { background: linear-gradient(135deg, #48c6ef, #6f86d6); color: #f5f5f5; }
.category-link.active {
  background: #47a8d8; /*linear-gradient(135deg, #48c6ef, #6f86d6)*/;
  color: #ffffff; box-shadow: 0 12px 28px -8px rgba(0,0,0,0.45);
  transform: translateX(4px);
}
.cat-icon { font-size: 18px; }
.cat-name { flex-grow: 1; font-size: 16px;}
.cat-count { background: rgba(255,255,255,0.7); color: #0b1220; font-size: 11px; padding: 3px 8px; border-radius: 20px; font-weight: 800; }
.category-link.active .cat-count {   background: linear-gradient(135deg, #48c6ef, #6f86d6); /*background: rgba(255,255,255,0.25); */ color: #ffffff; }

.grid-main-content {
  flex: 1; min-width: 0;
  background: linear-gradient(135deg, #48c6ef, #6f86d6);
  border-radius: 16px; padding: 2px;
}

.grid-content {
  background:#ffffff; border-radius:16px; box-shadow:0 18px 32px -10px rgba(32,62,120,0.35);
  border:1px solid #e6f0fa; overflow:hidden;
}
.tab-header {
  display:flex; justify-content:space-between; align-items:center; padding:16px 20px;
  border-bottom:2px solid #e6f0fa;
  background: linear-gradient(135deg, #48c6ef, #6f86d6);
}
.tab-title { display:flex; align-items:center; gap:10px; color:#ffffff; margin:0; }
.tab-title-icon { font-size:1.6rem; }
.tab-info { text-align:right; color:#ffffff; }
.page-info { margin-bottom:2px; color:#ffffff; text-shadow: 0 1px 0 rgba(0,0,0,0.25); }
.posts-info { font-size:13px; color: rgba(255,255,255,0.92); }
.current-page,.total-pages,.total-posts { color:#ffffff; font-weight:900; }

#posts-grid.posts-grid { display:grid !important; grid-template-columns:repeat(3,1fr) !important; gap:24px !important; padding:14px !important; }

.post-card {
  background:#ffffff;
  border:1px solid #a4dff9;
  border-radius:12px; overflow:hidden; cursor:pointer; transition:.25s; position:relative;
  box-shadow: 0 10px 22px rgba(43,76,126,0.18);
  display: flex;
  flex-direction: column;
  height: 100%;
}
.post-card:hover {
  background:#fff;
  border-color:#6f86d6;
  box-shadow:0 20px 36px rgba(43,76,126,.28);
  transform:translateY(-4px);
}
.post-card::before {
  content: none;
}

.post-image { position:relative; height:108px; overflow:hidden; }
.post-image img { display:block; width:100%; height:100%; object-fit:cover; transition:transform .25s; }
.post-card:hover .post-image img { transform:scale(1.05); }
.post-date { position:absolute; top:6px; right:6px; background:rgba(20,30,48,.85); color:#fff; padding:3px 6px; border-radius:4px; font-size:11px; font-weight:700; }

.post-content { 
  padding:20px;
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
}

/* Let post title and excerpt inherit font styles from the theme */
.post-title { 
  margin:0 0 8px 0; 
	font-size: 16px;
}
.post-excerpt { 
  margin:0; 
  margin-top: auto; 
 font-size: 14px !important;
 
}

/* ================= Pagination ================= */
.pagination-wrapper { padding:14px 16px; background:#f1f5ff; border-top:1px solid #e6f0fa; }
.pagination { display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; }
.pagination-btn {
  display:flex; align-items:center; gap:8px; padding:6px 12px; background:#ffffff; border:1px solid #d6e6ff; border-radius:8px; color:#0b1220; cursor:pointer; transition:.2s;
}
.pagination-btn:hover:not(:disabled){ background:#eef5ff; border-color:#a4dff9; color:#084e96; }
.pagination-btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-icon { font-size:15px; font-weight:bold; }
.pagination-numbers { display:flex; align-items:center; gap:6px; background:rgba(255,255,255,.85); padding:6px 10px; border-radius:8px; border:1px solid #d6e6ff; }
.pagination-number { width:32px; height:32px; border:1px solid #d6e6ff; border-radius:8px; background:#fff; color:#0b5b8c; font-weight:900; cursor:pointer; transition:.2s; display:flex; align-items:center; justify-content:center; }
.pagination-number.active {
  background: linear-gradient(135deg, #48c6ef, #6f86d6);
  color:#ffffff; border-color:#6f86d6; box-shadow:0 6px 10px -2px rgba(111,134,214,.35);
}
.pagination-jump { display:flex; align-items:center; gap:6px; font-size:13px; color:#0b1220; background:rgba(255,255,255,.9); padding:6px 10px; border-radius:8px; border:1px solid #d6e6ff; }
.jump-input { width:56px; padding:4px 6px; border:1px solid #6f86d6; border-radius:4px; text-align:center; font-weight:800; color:#0b1220; }
.jump-btn { background: linear-gradient(135deg, #48c6ef, #6f86d6); color:#ffffff; padding:4px 10px; border:none; border-radius:4px; font-weight:900; cursor:pointer; }
.jump-btn:hover{ filter: brightness(1.05); }

/* ================= Loading Overlay ================= */
.loading-overlay { position:absolute; inset:0; background:rgba(255,255,255,.9); display:none; align-items:center; justify-content:center; flex-direction:column; z-index:10; backdrop-filter:blur(4px); }
.loading-overlay.show { display:flex; }
.loading-spinner { width:36px; height:36px; border:4px solid #d6e6ff; border-top:4px solid #48c6ef; border-radius:50%; animation:spin 1s linear infinite; margin-bottom:12px; }
@keyframes spin { 0%{transform:rotate(0)} 100%{transform:rotate(360deg)} }
.loading-overlay p { color:#0b1220; font-weight:700; margin:0; }

/* ================= Modal ================= */
#modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: none; align-items: center; justify-content: center; z-index: 999999; padding: 20px; backdrop-filter: blur(8px); }
#modal-overlay.show { display: flex !important; }


#modal-content { 
  background:#ffffff; 
    border-radius:20px; 
    max-width:900px; 
    width:100%; 
    max-height:90vh; 
    /* overflow:hidden; */ /* Xóa hoặc vô hiệu hóa dòng này */
    overflow-y: auto; /* Thêm dòng này */
    box-shadow:0 25px 50px -12px rgba(0,0,0,.5); 
    animation:modalSlideIn .35s cubic-bezier(.34,1.56,.64,1); 
    position:relative; 
    display:flex; 
    flex-direction:column; 
}





@keyframes modalSlideIn { from{opacity:0; transform:scale(.9) translateY(-30px);} to{opacity:1; transform:scale(1) translateY(0);} }
.modal-header { display:flex; justify-content:space-between; align-items:flex-start; padding:20px; border-bottom:2px solid #e6f0fa; background: linear-gradient(135deg, #48c6ef, #6f86d6); /*flex-shrink:0; */ }
.modal-header h2 { color:#ffffff; margin:0; padding-right:28px; line-height:1.3; text-shadow:0 1px 0 rgba(0,0,0,0.25); /*font-size: 90%;*/ }
.modal-close { width:40px; height:40px; background:#ffffff; color:#0b1220; border:none; border-radius:50%; font-size:22px; cursor:pointer; transition:.3s; flex-shrink:0; display:flex; align-items:center; justify-content:center; box-shadow:0 4px 12px rgba(0,0,0,.2); }
.modal-close:hover { background:#f1f5ff; transform:scale(1.07); }
.modal-body { /*overflow-y:auto;*/ }
.modal-meta { display:grid; grid-template-columns:1fr; gap:12px; padding:16px 20px; background:#f1f5ff; border-bottom:1px solid #e6f0fa; font-size:13px; }
.modal-meta-row { display:flex; align-items:center; gap:8px; color:#0b1220; }
.modal-meta-label { font-weight:900; color:#0b1220; min-width:120px; }
.modal-meta-row a { color:#6f86d6; text-decoration:none; font-weight:900; }
.modal-image { padding:20px; padding-bottom:0; }
.modal-image img { width:100%; height:300px; object-fit:cover; border-radius:12px; box-shadow:0 10px 25px -5px rgba(0,0,0,.12); }
.modal-content-text { padding: 25px 50px;
 margin-left: 50px;
    margin-right: 50px;
font-size: 100%;
}
.modal-content-text .modal-full-content {
  /* Inherits styles from theme */
}

.modal-full-content h2, .modal-full-content h3, .modal-full-content h4, .modal-full-content h5, .modal-full-content h6 { font-size: 95%; font-weight: 900; }

/* Sticky Footer and Buttons */
.modal-footer { padding: 12px 20px; background: #f1f5ff; border-top: 2px solid #e6f0fa; 
	
	
	/*flex-shrink: 0; */
	  position: sticky;
  bottom: 0;
	
	
	
	box-shadow: 0 -5px 15px -5px rgba(0,0,0,0.05); z-index: 10; display: flex; justify-content: flex-end; gap: 10px; }
.modal-action-btn { display: inline-block; padding: 12px 20px; border: none; border-radius: 10px; text-decoration: none; color: #ffffff; font-size: 15px; margin-left: 0; cursor: pointer; transition: all 0.2s ease; text-align: center; }
.modal-action-btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 6px 16px rgba(0,0,0,0.18); }
.review-link-btn,
.original-post-btn,
.product-btn {
    background: linear-gradient(135deg, #48c6ef, #6f86d6);
    color:#ffffff;
}

/* ================= Breakpoints ================= */
@media (max-width: 1200px) {
    #posts-grid.posts-grid { grid-template-columns:repeat(2,1fr) !important; }
}
@media (max-width: 960px) {
    .grid-main-layout { flex-direction: column; gap: 24px; }
    .grid-sidebar { position: static; width: 100%; flex: auto; }
}
@media (min-width: 481px) and (max-width: 768px) {
    .modal-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .modal-footer .product-btn { grid-column: 1 / -1; }
}
@media (max-width: 768px) { 
    #post-categories-grid.post-categories-grid { padding: 12px; } 
    #posts-grid.posts-grid { grid-template-columns: repeat(2,1fr) !important; gap:16px !important; padding:14px !important; } 
    .post-image { height: 130px; } 
}
@media (max-width: 480px) { 
    #posts-grid.posts-grid { grid-template-columns: 1fr !important; gap:14px !important; } 
    .post-image { height: 170px; }
    .modal-footer { display: flex; justify-content: center; }
    .modal-footer .review-link-btn, .modal-footer .original-post-btn { display: none; }
}

@media (max-width: 768px) {
  .modal-content-text {
    padding: 10px 15px;   /* giảm padding tổng thể */
    margin-left: 10px;    /* căn lề nhỏ hơn */
    margin-right: 10px;
  }
}

/*###################*/


.pcg-background { background: #f5f5f5; width: 100%; padding: 50px 0; }



/* ================= Pagination Number Styling ================= */
#modal-overlay.pre-show {
    display: flex;
    opacity: 0;
    pointer-events: none;
}

.pagination {
    gap: 8px;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-number {
    width: 36px;
    height: 36px;
    border: 1px solid #d6e6ff;
    border-radius: 8px;
    background: #fff;
    color: #0b5b8c;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pagination-number:hover {
    background: #eef5ff;
    border-color: #6f86d6;
}

.pagination-number.active {
    background: linear-gradient(135deg, #48c6ef, #6f86d6);
    color: #ffffff;
    border-color: #6f86d6;
    box-shadow: 0 6px 10px -2px rgba(111, 134, 214, 0.45);
    cursor: default;
}

.pagination-ellipsis {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-weight: 700;
}

.pagination-btn {
    padding: 0 12px;
    height: 36px;
    min-width: 36px;
    justify-content: center;
    font-size: 16px;
}


/*Ưu đãi button*/
.buy-link-btn {
    background: linear-gradient(135deg, #FF4B2B 0%, #FF416C 100%);
    color: #FFFFFF !important; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.25);
    order: -1;
    transform: scale(1.0);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.buy-link-btn:hover {
	color: #FFFF00 !important;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 65, 108, 0.4);
    filter: brightness(1.1);
}

.fb-link-btn {
    background-color: #1877F2;
    color: #ffffff !important;
    order: 0;
}
.fb-link-btn:hover {
    background-color: #166FE5;
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.3);
}

/* Nút "Bài viết gốc" */
.full-post-link-btn {
  background-color: #283e51; /* xanh than đậm */
  color: #ffffff !important;
  order: 99;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.25s ease;
}

.full-post-link-btn:hover {
  background-color: #485563; /* sáng hơn nhẹ khi hover */
  box-shadow: 0 8px 20px rgba(72,198,239,0.35);
  transform: translateY(-2px);
}


.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 480px) { 
    .modal-footer {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
		
    }

    .modal-footer .review-link-btn, 
    .modal-footer .product-btn, /*thêm 2 nút mới*/
	.modal-footer .fb-link-btn,
	.full-post-link-btn { 
        display: none; 
    }

	
	
	
	
	
    .modal-footer .buy-link-btn
    /*.modal-footer .fb-link-btn */{
        display: block !important;
        width: 100%;
        text-align: center;
    }
}

/*hide featured image*/
@media (max-width: 480px) { 
.modal-image {
	display:none;
}
}

/*hide button shortcode ultimate*/
.su-button-center {
	display:none;
}


}