/*
Theme Name: ThanhWeb
Theme URI: https://thanhweb.net/
Author: Nguyễn Nhật Thanh
Author URI: https://thanhweb.net/
Description: Giao diện WordPress cao cấp chuẩn SEO cho Thanhweb.net, font chữ không chân thuần tiếng Việt Be Vietnam Pro & Plus Jakarta Sans, giao diện sáng tối Dark/Light mode, hiệu ứng ánh sáng quét qua Nav Bar, mây trôi ban ngày và sao băng ban đêm.
Version: 2.8.0
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: thanhweb-theme
Tags: dark-mode, light-mode, custom-background, one-column, custom-colors, custom-menu, featured-images, flexible-header, theme-options, translation-ready
*/

/* Core Global Tokens */
:root {
  --tw-gold: #d4af37;
  --tw-gold-accent: #f4d06f;
  --tw-gold-deep: #9c7a24;
  --tw-bg: #0b0a08;
  --tw-bg-alt: #12100c;
  --tw-bg-soft: #16130d;
  --tw-card-bg: rgba(22, 19, 13, 0.85);
  --tw-card-border: rgba(212, 175, 55, 0.18);
  --tw-text: #f5efe0;
  --tw-text-dim: #b8ad94;
  --tw-heading: #ffffff;
  --tw-nav-bg: rgba(22, 19, 13, 0.85);
  --tw-nav-inner: rgba(22, 19, 13, 0.9);
  --tw-nav-border: rgba(244, 208, 111, 0.2);
  --tw-quote-bg: rgba(22, 19, 13, 0.9);
  color-scheme: dark;
}

html.light {
  --tw-gold: #b45309;
  --tw-gold-accent: #d97706;
  --tw-gold-deep: #78350f;
  --tw-bg: #f8f9fb;
  --tw-bg-alt: #ffffff;
  --tw-bg-soft: #f1f5f9;
  --tw-card-bg: #ffffff;
  --tw-card-border: rgba(0, 0, 0, 0.08);
  --tw-text: #374151;
  --tw-text-dim: #4b5563;
  --tw-heading: #0f172a;
  --tw-nav-bg: rgba(255, 255, 255, 0.9);
  --tw-nav-inner: rgba(241, 245, 249, 0.95);
  --tw-nav-border: rgba(0, 0, 0, 0.08);
  --tw-quote-bg: #f8fafc;
  color-scheme: light;
}

html {
  scroll-behavior: smooth;
  margin-top: 0 !important;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  background-color: var(--tw-bg);
  color: var(--tw-text);
  font-family: 'Be Vietnam Pro', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  overflow-x: clip;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, button, input, textarea, select, a {
  font-family: 'Be Vietnam Pro', 'Plus Jakarta Sans', sans-serif;
}

/* NAVBAR LIQUID GLASS & LIGHT BEAM SWIPE */
#tw-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

@media screen and (min-width: 783px) {
  body.admin-bar #tw-header {
    top: 32px;
  }
}
@media screen and (max-width: 782px) {
  body.admin-bar #tw-header {
    top: 46px;
  }
}

.liquid-glass {
  background: var(--tw-nav-bg);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-bottom: 1px solid var(--tw-nav-border);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}
html.light .liquid-glass {
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.06);
}

.liquid-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(244, 208, 111, 0.05) 30%,
    rgba(244, 208, 111, 0.28) 50%,
    rgba(244, 208, 111, 0.05) 70%,
    transparent 100%
  );
  transform: skewX(-25deg);
  animation: navShimmerSwipe 5.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 1;
}

html.light .liquid-glass::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 30%,
    rgba(217, 119, 6, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 70%,
    transparent 100%
  );
}

@keyframes navShimmerSwipe {
  0% { left: -150%; }
  35% { left: 200%; }
  100% { left: 200%; }
}

/* NAVBAR CAPSULE SHIMMER */
.nav-capsule-container {
  position: relative;
  overflow: hidden;
}
.nav-capsule-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(244, 208, 111, 0.22), transparent);
  transform: skewX(-20deg);
  animation: capsuleShimmer 4.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

@keyframes capsuleShimmer {
  0% { left: -150%; }
  40% { left: 200%; }
  100% { left: 200%; }
}

/* NAVBAR CAPSULE LINKS & HOVER */
.tw-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tw-text-dim);
  border-radius: 9999px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
  z-index: 2;
}

.tw-nav-link:hover {
  color: var(--tw-gold-accent) !important;
  background-color: rgba(244, 208, 111, 0.15) !important;
  border-color: rgba(244, 208, 111, 0.35) !important;
  box-shadow: 0 0 14px rgba(244, 208, 111, 0.2) !important;
  transform: translateY(-1px);
}
html.light .tw-nav-link:hover {
  color: #b45309 !important;
  background-color: rgba(217, 119, 6, 0.1) !important;
  border-color: rgba(217, 119, 6, 0.25) !important;
}

.tw-nav-link.active-nav {
  color: var(--tw-gold-accent) !important;
  background-color: rgba(212, 175, 55, 0.18) !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
  font-weight: 600 !important;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2) !important;
}
html.light .tw-nav-link.active-nav {
  color: #92400e !important;
  background-color: rgba(217, 119, 6, 0.14) !important;
  border-color: rgba(217, 119, 6, 0.3) !important;
}

/* CARDS */
.tw-card {
  background: var(--tw-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--tw-card-border);
  border-radius: 1.25rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tw-card:hover {
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: 0 16px 40px -8px rgba(212, 175, 55, 0.2);
  transform: translateY(-4px);
}

html.light .tw-card {
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
html.light .tw-card:hover {
  border-color: rgba(217, 119, 6, 0.35);
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.09);
}

/* ARTICLE TYPOGRAPHY & HEADINGS STYLING (SINGLE POST & BLOG) */
.tw-article-content {
  color: var(--tw-text);
  line-height: 1.8;
  font-size: 0.95rem;
}

.tw-article-content h1,
article .tw-article-content h1 {
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--tw-heading) !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.85rem !important;
  letter-spacing: -0.01em;
  scroll-margin-top: 110px;
}

.tw-article-content h2,
article .tw-article-content h2 {
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--tw-heading) !important;
  margin-top: 1.6rem !important;
  margin-bottom: 0.75rem !important;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--tw-card-border);
  letter-spacing: -0.01em;
  scroll-margin-top: 110px;
}

.tw-article-content h3,
article .tw-article-content h3 {
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: var(--tw-heading) !important;
  margin-top: 1.4rem !important;
  margin-bottom: 0.65rem !important;
  scroll-margin-top: 110px;
}

.tw-article-content h4,
article .tw-article-content h4 {
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  color: var(--tw-heading) !important;
  margin-top: 1.25rem !important;
  margin-bottom: 0.5rem !important;
  scroll-margin-top: 110px;
}

.tw-article-content h5,
article .tw-article-content h5 {
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: var(--tw-heading) !important;
  margin-top: 1.1rem !important;
  margin-bottom: 0.5rem !important;
  scroll-margin-top: 110px;
}

.tw-article-content h6,
article .tw-article-content h6 {
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  color: var(--tw-text-dim) !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
  scroll-margin-top: 110px;
}

.tw-article-content p {
  margin-bottom: 1.25rem;
  color: var(--tw-text);
  line-height: 1.8;
}

.tw-article-content strong,
.tw-article-content b {
  color: var(--tw-heading);
  font-weight: 700;
}

.tw-article-content a {
  color: var(--tw-gold-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s ease;
}
.tw-article-content a:hover {
  color: var(--tw-gold);
}

.tw-article-content ul {
  list-style-type: disc;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  space-y: 0.5rem;
}

.tw-article-content ol {
  list-style-type: decimal;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  space-y: 0.5rem;
}

.tw-article-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.tw-article-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--tw-gold);
  background: var(--tw-quote-bg);
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  color: var(--tw-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tw-article-content img {
  border-radius: 1rem;
  margin: 1.5rem auto;
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--tw-card-border);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
}

.tw-article-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.875rem;
  overflow-x: auto;
  display: block;
}

.tw-article-content th {
  background: var(--tw-bg-soft);
  color: var(--tw-heading);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border: 1px solid var(--tw-card-border);
  text-align: left;
}

.tw-article-content td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--tw-card-border);
  color: var(--tw-text);
}

.tw-article-content code {
  background: rgba(212, 175, 55, 0.12);
  color: var(--tw-gold-accent);
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  font-family: monospace;
  font-size: 0.85em;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.tw-article-content pre {
  background: #0b0f19;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 1rem;
  overflow-x: auto;
  border: 1px solid var(--tw-card-border);
  margin: 1.5rem 0;
}
.tw-article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
}

/* TOC STICKY */
.toc-sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 110px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
}

.toc-link {
  display: block;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  color: var(--tw-text-dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
}

.toc-link:hover, .toc-link.active {
  color: var(--tw-gold-accent) !important;
  border-left-color: var(--tw-gold) !important;
  background: rgba(212, 175, 55, 0.1) !important;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* FLOATING CONTACT BUTTONS */
.tw-floating-contact-container {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}

.tw-float-btn-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tw-float-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.tw-float-btn:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.tw-btn-zalo {
  background: linear-gradient(135deg, #0084ff 0%, #0056cc 100%);
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.45);
}

.tw-btn-messenger {
  background: linear-gradient(135deg, #00C6FF 0%, #0078FF 50%, #A824FF 100%);
  box-shadow: 0 8px 20px rgba(168, 36, 255, 0.4);
}

.tw-btn-top {
  width: 44px;
  height: 44px;
  background: var(--tw-card-bg);
  border: 1px solid var(--tw-card-border);
  color: var(--tw-gold-accent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.tw-btn-top:hover {
  background: var(--tw-gold);
  color: #0b0a08;
}

.tw-radar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  animation: radarPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: 1;
}

.tw-radar-blue {
  background: rgba(0, 132, 255, 0.35);
}

.tw-radar-messenger {
  background: rgba(168, 36, 255, 0.35);
  animation-delay: 0.75s;
}

@keyframes radarPulse {
  0% { transform: scale(0.9); opacity: 0.9; }
  70% { transform: scale(1.65); opacity: 0; }
  100% { transform: scale(1.65); opacity: 0; }
}

.tw-float-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  padding: 5px 10px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform: translateX(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.tw-float-btn-wrap:hover .tw-float-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* DAYTIME CLOUDS PARALLAX DRIFTING */
@keyframes driftLeftToRight {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120vw); }
}

.cloud-drift-1 { animation: driftLeftToRight 50s linear infinite; }
.cloud-drift-2 { animation: driftLeftToRight 38s linear infinite; animation-delay: -18s; }
.cloud-drift-3 { animation: driftLeftToRight 65s linear infinite; animation-delay: -35s; }
.cloud-drift-4 { animation: driftLeftToRight 42s linear infinite; animation-delay: -10s; }
.cloud-drift-5 { animation: driftLeftToRight 55s linear infinite; animation-delay: -28s; }

/* SUN ROTATION */
@keyframes sunGlow {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.88; }
  50% { transform: scale(1.05) rotate(180deg); opacity: 1; }
}
.animate-sun {
  animation: sunGlow 20s ease-in-out infinite;
}
