/* =========================================================
   THELOI TECH MAGAZINE - REFINED GLOBAL & PAGE STYLING
   ========================================================= */

/* 1. NỀN KỸ THUẬT HIỆN ĐẠI, NỔI BẬT VÀ GIÀU MÀU SẮC (VIBRANT TECH AMBIENT CANVAS) */
body {
  background-color: #eaf0f8 !important;
  background-image: 
    /* Vầng sáng Sapphire Blue công nghệ góc trên trái */
    radial-gradient(ellipse 950px 550px at 0% -5%, rgba(11, 99, 206, 0.28) 0%, transparent 68%),
    /* Vầng sáng Electric Cyan/Sky góc trên phải */
    radial-gradient(ellipse 850px 520px at 100% -5%, rgba(14, 165, 233, 0.26) 0%, transparent 64%),
    /* Vầng sáng tím chàm công nghệ giữa trang */
    radial-gradient(ellipse 750px 480px at 50% 30%, rgba(99, 102, 241, 0.16) 0%, transparent 62%),
    /* Vầng sáng xanh lơ góc dưới phải */
    radial-gradient(ellipse 850px 550px at 95% 80%, rgba(56, 189, 248, 0.20) 0%, transparent 65%),
    /* Vầng sáng xanh đậm góc dưới trái */
    radial-gradient(ellipse 800px 500px at 5% 75%, rgba(37, 99, 235, 0.20) 0%, transparent 62%),
    /* Lưới kỹ thuật Blueprint kẻ mảnh 48px */
    linear-gradient(to right, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.14) 1px, transparent 1px),
    /* Ma trận chấm kỹ thuật 24px */
    radial-gradient(rgba(100, 116, 139, 0.40) 1.25px, transparent 1.25px) !important;
  background-size: 
    100% 100%, 
    100% 100%, 
    100% 100%, 
    100% 100%, 
    100% 100%, 
    48px 48px, 
    48px 48px, 
    24px 24px !important;
  background-attachment: fixed !important;
  min-height: 100vh;
  color: #1e293b;
}

/* Đường chỉ sáng công nghệ chạy dọc đỉnh trang */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0b63ce 0%, #38bdf8 50%, #818cf8 100%);
  z-index: 9999;
  pointer-events: none;
}

/* 2. SỬA LỖI DRAWER & NÚT HAMBURGER HIỂN THỊ TRÊN DESKTOP */
@media (min-width: 1024px) {
  button[data-drawer-toggle],
  button[aria-controls="tl-drawer"],
  .tl-button-muted[data-drawer-toggle],
  #tl-drawer,
  .tl-drawer,
  .lg\:hidden {
    display: none !important;
  }
}
@media (max-width: 1023px) {
  button[data-drawer-toggle] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* 3. SỬA LỖI THẺ <a> VÀ NÚT BẤM (BUTTONS) TOÀN CỤC */
.tl-content a:not([class]) {
  color: #0b63ce;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tl-content a[class] {
  text-decoration: none !important;
}

/* Nút chính (.tl-button) - Chữ trắng rõ ràng, không bị chìm */
.tl-content a.tl-button,
.tl-content .tl-button,
.tl-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 42px !important;
  padding: 0 18px !important;
  border-radius: 10px !important;
  background-color: #0b63ce !important;
  color: #ffffff !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 4px rgba(11, 99, 206, 0.2), 0 1px 2px rgba(11, 99, 206, 0.1) !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.tl-content a.tl-button *,
.tl-content .tl-button *,
.tl-button * {
  color: #ffffff !important;
}
.tl-content a.tl-button:hover,
.tl-content .tl-button:hover,
.tl-button:hover {
  background-color: #0955b2 !important;
  color: #ffffff !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 14px rgba(11, 99, 206, 0.25) !important;
}

/* Nút phụ (.tl-button-muted) - không làm ảnh hưởng nút drawer trên desktop */
.tl-content a.tl-button-muted,
.tl-content .tl-button-muted,
a.tl-button-muted,
button.tl-button-muted:not([data-drawer-toggle]) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 42px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
  border: 1px solid #d0d7e2 !important;
  background-color: #ffffff !important;
  color: #334155 !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: all 0.18s ease !important;
}
.tl-content a.tl-button-muted:hover,
.tl-content .tl-button-muted:hover,
a.tl-button-muted:hover,
button.tl-button-muted:not([data-drawer-toggle]):hover {
  background-color: #f1f5f9 !important;
  color: #0b63ce !important;
  border-color: #0b63ce !important;
  transform: translateY(-1px) !important;
}

/* 4. SỬA TRIỆT ĐỂ LỖI 2 DẤU XỔ VÀ TỐI ƯU SIDEBAR TRÁI */
details summary::-webkit-details-marker,
details summary::marker {
  display: none !important;
}
details summary {
  list-style: none !important;
}

.tl-chevron {
  display: inline-block !important;
  width: 7px !important;
  height: 7px !important;
  border-right: 2px solid currentColor !important;
  border-bottom: 2px solid currentColor !important;
  font-size: 0 !important;
  line-height: 0 !important;
  transform: rotate(45deg) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
  color: #64748b !important;
}
.tl-nav-link:hover .tl-chevron {
  color: #0b63ce !important;
}
.tl-side-group[open] > summary .tl-chevron,
.tl-menu-item[open] > summary .tl-chevron {
  transform: rotate(225deg) !important;
  color: #0b63ce !important;
}

.tl-left-static {
  scrollbar-width: none;
}
.tl-left-static::-webkit-scrollbar {
  display: none;
}
.tl-sidebar-card {
  background: #ffffff !important;
  border: 1px solid rgba(190, 212, 239, 0.85) !important;
  border-radius: 16px !important;
  padding: 16px 12px !important;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04) !important;
}

.tl-nav-link {
  display: flex !important;
  align-items: center !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #334155 !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}
.tl-nav-link:hover {
  background-color: #f1f5f9 !important;
  color: #0b63ce !important;
}
.tl-nav-link-active,
.tl-nav-link[aria-current="page"] {
  background-color: #eaf2ff !important;
  color: #0b63ce !important;
  font-weight: 700 !important;
}

.tl-nav-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 6px !important;
  background-color: #f8fafc !important;
  margin-right: 8px !important;
  flex-shrink: 0 !important;
}
.tl-nav-link:hover .tl-nav-icon,
.tl-nav-link-active .tl-nav-icon {
  background-color: #eaf2ff !important;
  color: #0b63ce !important;
}

.tl-side-children {
  padding-left: 28px !important;
  padding-top: 2px !important;
  padding-bottom: 4px !important;
}
.tl-side-link {
  display: block !important;
  padding: 4px 8px !important;
  font-size: 12.5px !important;
  color: #64748b !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}
.tl-side-link:hover {
  color: #0b63ce !important;
  background-color: #f1f5f9 !important;
}
.tl-side-link-active {
  color: #0b63ce !important;
  font-weight: 700 !important;
  background-color: #eaf2ff !important;
}

/* 5. TIÊU ĐỀ KHỐI NỘI DUNG (SECTION HEADERS) */
.tl-section-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 18px !important;
  margin-bottom: 16px !important;
  background: #ffffff !important;
  border: 1px solid rgba(190, 212, 239, 0.85) !important;
  border-left: 4px solid #0b63ce !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04) !important;
}
.tl-section-title {
  font-size: 16.5px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em !important;
  margin: 0 !important;
}
.tl-card .tl-section-head {
  background: transparent !important;
  border: none !important;
  border-left: 3px solid #0b63ce !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 0 12px !important;
  margin-bottom: 12px !important;
}

/* 5.1. BADGE & CHIP STYLING */
.tl-badge {
  display: inline-flex !important;
  align-items: center !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  background-color: #eaf2ff !important;
  color: #0b63ce !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  line-height: 1.3 !important;
  transition: all 0.15s ease !important;
}
.tl-badge:hover {
  background-color: #0b63ce !important;
  color: #ffffff !important;
}

.tl-topic-chip {
  display: inline-flex !important;
  align-items: center !important;
  padding: 6px 12px !important;
  border-radius: 8px !important;
  border: 1px solid #d0d7e2 !important;
  background-color: #ffffff !important;
  color: #334155 !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
}
.tl-topic-chip:hover {
  background-color: #f1f5f9 !important;
  color: #0b63ce !important;
  border-color: #0b63ce !important;
}
.tl-topic-chip-active {
  background-color: #eaf2ff !important;
  color: #0b63ce !important;
  border-color: #0b63ce !important;
  font-weight: 700 !important;
}

/* 6. CARD TỔNG THỂ & CARD BÀI VIẾT (POST CARDS) */
.tl-card {
  border: 1px solid rgba(190, 212, 239, 0.85) !important;
  border-radius: 16px !important;
  background-color: #ffffff !important;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04) !important;
}

.tl-post-card {
  border: 1px solid rgba(190, 212, 239, 0.85) !important;
  border-radius: 14px !important;
  background-color: #ffffff !important;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.tl-post-card:hover {
  transform: translateY(-3px) !important;
  border-color: #0b63ce !important;
  box-shadow: 0 12px 28px -4px rgba(11, 99, 206, 0.18), 0 6px 12px -2px rgba(11, 99, 206, 0.08) !important;
}

/* Badge chuyên mục nổi trên ảnh thumbnail */
.tl-card-cat-badge {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 10 !important;
  padding: 3px 9px !important;
  border-radius: 6px !important;
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(4px) !important;
  color: #0b63ce !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
  text-decoration: none !important;
  line-height: 1.3 !important;
  transition: all 0.15s ease !important;
}
.tl-card-cat-badge:hover {
  background-color: #0b63ce !important;
  color: #ffffff !important;
}

/* Placeholder khi bài viết không có ảnh thumbnail */
.tl-card-placeholder {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0369a1 100%) !important;
  position: relative !important;
  overflow: hidden !important;
}
.tl-card-placeholder::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px) !important;
  background-size: 14px 14px !important;
  opacity: 0.6 !important;
}

/* 7. BỐ CỤC DÀNH CHO TRANG ĐƠN (PAGE LAYOUT - ABOUT & CONTACT) */
.tl-page-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 24px !important;
}
@media (min-width: 1024px) {
  .tl-page-layout {
    grid-template-columns: 240px minmax(0, 1fr) !important;
  }
}

.tl-custom-page-container {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Wrapper chung cho trang */
.tl-page-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

/* Profile Hero Block */
.tl-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #bed4ef;
  background: linear-gradient(135deg, #ffffff 0%, #f1f7ff 100%);
  text-align: center;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08);
}
@media (min-width: 640px) {
  .tl-profile-hero {
    flex-direction: row;
    text-align: left;
    gap: 24px;
    padding: 28px;
  }
}
.tl-profile-avatar {
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(11, 99, 206, 0.15);
  border: 3px solid #ffffff;
}
.tl-profile-info {
  flex: 1;
  min-width: 0;
}
.tl-kicker-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  background-color: #eaf2ff;
  color: #0b63ce;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.tl-profile-name {
  margin: 0 0 6px !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  line-height: 1.25 !important;
}
.tl-profile-handle {
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
}
.tl-profile-role {
  margin: 0 0 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #0b63ce !important;
}
.tl-profile-motto {
  margin: 0 0 12px !important;
  font-size: 13px !important;
  font-style: italic !important;
  color: #475467 !important;
}
.tl-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 639px) {
  .tl-tag-group {
    justify-content: center;
  }
}
.tl-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background-color: #eaf2ff;
  color: #0b63ce;
  font-size: 12px;
  font-weight: 600;
}

/* Sections & Box Cards */
.tl-section-block {
  margin-bottom: 20px;
}
.tl-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}
.tl-block-title svg {
  width: 20px;
  height: 20px;
  color: #0b63ce;
  flex-shrink: 0;
}

.tl-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 640px) {
  .tl-grid-2 {
    grid-template-columns: 1fr;
  }
}

.tl-box-card {
  border: 1px solid rgba(190, 212, 239, 0.85);
  border-radius: 14px;
  background-color: #ffffff;
  padding: 18px 20px;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08);
}
.tl-box-card h3 {
  margin: 0 0 6px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.tl-box-card p {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: #64748b !important;
}
.tl-box-card .tl-card-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #0b63ce;
  margin-bottom: 4px;
}
.tl-box-card .tl-card-value {
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
}

/* Interactive Contact Cards */
.tl-contact-interactive {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(190, 212, 239, 0.85);
  border-radius: 14px;
  background-color: #ffffff;
  text-decoration: none !important;
  color: inherit !important;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08);
  transition: all 0.2s ease;
}
.tl-contact-interactive:hover {
  transform: translateY(-2px);
  border-color: #0b63ce;
  box-shadow: 0 8px 24px rgba(11, 99, 206, 0.16);
}
.tl-contact-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.tl-contact-meta {
  flex: 1;
  min-width: 0;
}
.tl-contact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tl-contact-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tl-contact-action {
  font-size: 12px;
  font-weight: 700;
  color: #0b63ce;
}
.tl-contact-title {
  margin: 4px 0 2px !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.tl-contact-desc {
  margin: 0 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  color: #64748b !important;
}

/* Social & Link Cards */
.tl-social-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border: 1px solid rgba(190, 212, 239, 0.85);
  border-radius: 14px;
  background-color: #ffffff;
  text-decoration: none !important;
  color: inherit !important;
  transition: all 0.18s ease;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08);
}
.tl-social-card:hover {
  border-color: #0b63ce;
  background-color: #f8fbff;
  transform: translateY(-1px);
}
.tl-social-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tl-social-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}
.tl-social-info h3 {
  margin: 0 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.tl-social-info p {
  margin: 2px 0 0 !important;
  font-size: 12px !important;
  color: #64748b !important;
}
.tl-social-arrow {
  font-size: 12px;
  font-weight: 700;
  color: #0b63ce;
}

/* Project Items */
.tl-project-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border: 1px solid rgba(190, 212, 239, 0.85);
  border-radius: 14px;
  background-color: #ffffff;
  margin-bottom: 10px;
  box-shadow: 0 4px 16px -2px rgba(11, 99, 206, 0.08);
}
@media (min-width: 640px) {
  .tl-project-item {
    flex-direction: row;
    align-items: center;
  }
}
.tl-project-item h3 {
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-project-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background-color: #eaf2ff;
  color: #0b63ce;
  font-size: 11px;
  font-weight: 600;
}
.tl-project-item p {
  margin: 4px 0 0 !important;
  font-size: 13px !important;
  color: #64748b !important;
}
.tl-project-link {
  font-size: 13px;
  font-weight: 700;
  color: #0b63ce !important;
  white-space: nowrap;
}

/* Call to action footer */
.tl-cta-footer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 16px;
  border: 1px solid #bed4ef;
  background-color: #f1f7ff;
  margin-top: 10px;
}
@media (min-width: 640px) {
  .tl-cta-footer {
    flex-direction: row;
    text-align: left;
  }
}
.tl-cta-footer h3 {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
}
.tl-cta-footer p {
  margin: 4px 0 0 !important;
  font-size: 13px !important;
  color: #475467 !important;
}
.tl-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
