/*
Theme Name: Super Markdown Theme
Theme URI: https://example.com/
Author: Antigravity Dev
Author URI: https://example.com/
Description: Theme biến WordPress thành Flat-file CMS siêu nhanh, đọc trực tiếp từ Markdown files.
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: super-markdown-theme
*/

:root {
  --font-primary: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;

  --bg-primary: #0b0f19;
  --bg-secondary: #151d30;
  
  --accent-primary: #6366f1;
  --accent-secondary: #06b6d4;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;

  --border-color: rgba(255, 255, 255, 0.08);
  --radius-md: 16px;
  
  /* Typography Fallbacks */
  --text-base: 1.1rem;
  --h1-size: 2.5rem;
  --h2-size: 1.8rem;
  --h3-size: 1.4rem;
}

html, body {
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  display: flow-root; /* Prevents margin collapsing of child elements which pushed the header down */
}

/* Adjust sticky header position when WordPress Admin Bar is showing */
body.admin-bar header.sticky {
  top: 32px !important;
}
@media screen and (max-width: 782px) {
  body.admin-bar header.sticky {
    top: 46px !important;
  }
}

.container {
  max-width: 1240px; /* Expanded from 800px for a spacious modern desktop layout */
  margin: 0 auto;
  padding: 0 2rem;
}

.main-content-wrapper {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

/* Comment out global header style to avoid conflicts with Crafto template styling
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header, rgba(11, 15, 25, 0.75));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}
*/

.site-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-title:hover {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: scale(1.02);
}

.glass-panel {
  background: var(--bg-glass, rgba(21, 29, 48, 0.7));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
}

.post-title {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  margin-bottom: 1rem;
  margin-top: 0;
  color: var(--text-primary);
}

.post-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

/* Markdown Prose */
.prose h1 { font-size: var(--h1-size); }
.prose h2 { font-size: var(--h2-size); }
.prose h3 { font-size: var(--h3-size); }

.prose h1, .prose h2, .prose h3 {
  font-family: var(--font-display);
  margin-top: 2rem;
  color: var(--text-primary);
}

.prose p {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.5;
}

.prose li {
  line-height: 1.5;
}

.prose pre {
  background: #111827;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

.prose code {
  font-family: monospace;
  color: var(--accent-secondary);
}

.prose a {
  color: var(--accent-primary);
  text-decoration: none;
}

/* Premium Responsive Markdown Table Styling (Taste Skill) */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.2rem 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* Mượt mà trượt quán tính trên iOS/Safari */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.005);
}

.prose th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
  padding: 14px 18px;
  border-bottom: 2px solid var(--border-color);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.prose td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-item {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.post-item h2 a {
  color: var(--text-primary);
  text-decoration: none;
  font-family: var(--font-display);
}

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent-primary);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 1rem;
}

/* Pagination Styling */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-display);
  margin-top: 0; /* Override generic .btn margin */
}

.pagination-btn:hover {
  background: var(--border-color);
  border-color: var(--accent-secondary);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  pointer-events: none;
}

.pagination-dots {
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.1rem;
  padding: 0 6px;
  display: inline-block;
  user-select: none;
}

/* Custom Header & Navigation */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}


.rss-link {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rss-link:hover {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b; /* Keeps it readable orange in both light and dark modes */
  border-color: #f59e0b;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
  transform: translateY(-1px);
}

.rss-link::after {
  display: none !important;
}

/* Dynamic Dark/Light Mode Theme Toggle Button */
.theme-toggle-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  margin-left: 0.5rem;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-secondary);
  border-color: var(--accent-secondary);
  transform: scale(1.08) rotate(15deg);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Icon visibility controls depending on HTML data-theme attribute */
html[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
  animation: theme-icon-scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
html[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

html[data-theme="light"] .theme-toggle-btn .sun-icon {
  display: none;
}
html[data-theme="light"] .theme-toggle-btn .moon-icon {
  display: block;
  animation: theme-icon-scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes theme-icon-scale {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Flat-File Navigation System (Desktop & Mobile Drawer - Taste Skill)
   ========================================================================== */

/* Desktop Menu Layout */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu .menu-item {
  position: relative;
}

/* Dropdown Arrow Indicator */
.dropdown-arrow {
  display: inline-block;
  font-size: 0.65rem;
  margin-left: 4px;
  vertical-align: middle;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.menu-item:hover .dropdown-arrow {
  transform: rotate(180deg);
  color: var(--accent-secondary);
}

/* Sub-menu Dropdown List (Desktop Absolute Panel) */
.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 1000;
  min-width: 210px;
  list-style: none;
  margin: 0;
  padding: 8px !important;
  opacity: 0;
  background: var(--bg-glass, rgba(21, 29, 48, 0.95)) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-menu .menu-item-has-children:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(5px);
}

.nav-menu .sub-menu li {
  width: 100%;
}

.nav-menu .sub-menu li a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-menu .sub-menu li a:hover {
  background: var(--border-color);
  color: var(--text-primary);
  padding-left: 16px;
}

/* Active Menu Item Markers */
.nav-menu .current-menu-item > .nav-link {
  color: var(--text-primary);
}

.nav-menu .current-menu-item > .nav-link::after {
  transform: scaleX(1);
}

/* Mobile Toggle Hamburger Button Styles */
.mobile-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 38px;
  height: 38px;
  padding: 11.5px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10001;
}

.mobile-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-secondary);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, background 0.3s ease;
}

/* Hamburger Morphing Animations (Active/X state) */
.mobile-toggle-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  background: #fff;
}

.mobile-toggle-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-toggle-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  background: #fff;
}

/* Mobile Drawer Sidebar styling (Optimized to prevent horizontal scroll breakout) */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 290px;
  height: 100vh;
  z-index: 10000;
  background: rgba(11, 15, 25, 0.96) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-color);
  border-radius: 0 !important; /* Overriding glass-panel standard radius */
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  padding: 2.5rem 1.8rem;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mobile-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

/* Hide mobile navigation drawer components completely on desktop viewports */
@media (min-width: 1024px) {
  .mobile-drawer, .drawer-overlay {
    display: none !important;
  }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.2rem;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s ease;
}

.drawer-close-btn:hover {
  color: var(--accent-secondary);
}

.drawer-content {
  overflow-y: auto;
  flex: 1;
}

/* Mobile Menu Lists */
.mobile-nav-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-nav-menu .menu-item a {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.25s ease;
}

.mobile-nav-menu .menu-item a:hover {
  color: var(--accent-secondary);
}

.mobile-nav-menu .current-menu-item > a {
  color: var(--accent-secondary);
}

/* Nested level indenting on mobile */
.mobile-sub-menu {
  list-style: none;
  padding-left: 16px;
  margin: 6px 0 10px 0;
  border-left: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-sub-menu a {
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
}

/* Mobile Backdrop Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Rules for Breakpoint (Up to Tablet portrait: 1023px) */
@media (max-width: 1023px) {
  .main-nav {
    display: none !important; /* Hide desktop nav bar */
  }
  
  .mobile-toggle-btn {
    display: flex; /* Show mobile toggle */
  }
}

/* Glassmorphism Live Search - Premium Expandable Design */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#sm-search-input {
  width: 38px; /* Collapsed circle width */
  height: 38px;
  padding: 0 0 0 38px; /* Hide text by pushing it to the right */
  background: var(--bg-glass, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border-color);
  border-radius: 50%; /* Perfect circle when collapsed */
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-radius 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* Clear default search styling overrides */
#sm-search-input::-webkit-search-decoration,
#sm-search-input::-webkit-search-cancel-button,
#sm-search-input::-webkit-search-results-button,
#sm-search-input::-webkit-search-results-decoration {
  display: none;
}

#sm-search-input::placeholder {
  color: transparent;
  transition: color 0.2s ease;
}

/* Expand on focus or if it contains user input */
#sm-search-input:focus,
#sm-search-input:not(:placeholder-shown) {
  width: 240px; /* Expanded width on desktop/tablet */
  border-radius: 20px; /* Oval shape */
  padding: 8px 16px 8px 36px; /* Normal spacing */
  background: var(--bg-glass, rgba(21, 29, 48, 0.95));
  border-color: var(--accent-secondary);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
  cursor: text;
}

#sm-search-input:focus::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 11px; /* Perfectly centered inside the 38px circle button */
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.3s ease;
}

#sm-search-input:focus ~ .search-icon {
  color: var(--accent-secondary);
}

.search-results-dropdown {
  position: absolute;
  top: 110%;
  right: 0;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  background: var(--bg-glass, rgba(15, 23, 42, 0.95)) !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  padding: 10px !important;
  margin-top: 5px;
}

/* Mobile Responsive Optimization for Search Bar */
@media (max-width: 480px) {
  #sm-search-input:focus,
  #sm-search-input:not(:placeholder-shown) {
    width: 170px; /* Space-optimized for small mobile viewports */
  }
  .search-results-dropdown {
    width: 280px; /* Fits nicely on small mobile screens */
  }
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-secondary);
}

.search-result-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.search-result-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-more-results {
  padding: 8px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 4px;
  font-weight: 600;
}

/* Tag Pills */
.tag-pill {
  font-size: 0.75rem;
  background: rgba(0, 94, 255, 0.03);
  padding: 4px 10px;
  border-radius: 20px;
  color: #005eff !important;
  border: 1px solid rgba(0, 94, 255, 0.15);
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.tag-pill:hover {
  background: rgba(0, 94, 255, 0.08);
  border-color: #005eff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 94, 255, 0.15);
}

/* Two-Column Sticky TOC Grid Layout */
.single-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .single-layout-grid {
    grid-template-columns: 1fr 280px;
  }
}

.prose-main-col {
  min-width: 0; /* Prevents grid layout breaking on code blocks */
}

/* Sticky TOC Sidebar (Desktop) */
.sticky-toc-sidebar {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  display: none;
}

@media (min-width: 1024px) {
  .sticky-toc-sidebar {
    display: block;
  }
}

.sticky-toc-box {
  padding: 1.5rem !important;
  margin-bottom: 0 !important;
}

.toc-sidebar-title {
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-sidebar-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-sidebar-list li.toc-level-2 {
  padding-left: 0;
}

.toc-sidebar-list li.toc-level-3 {
  padding-left: 14px;
  border-left: 1px solid var(--border-color);
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: block;
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--accent-primary);
  transform: translateX(4px);
}

.toc-link.active {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Mobile TOC Accordion */
.mobile-toc-wrapper {
  margin-bottom: 2rem !important;
}

@media (min-width: 1024px) {
  .mobile-toc-wrapper {
    display: none !important; /* Hide mobile TOC on desktop to prevent visual clutter */
  }
}

.mobile-toc-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-toc-list li {
  line-height: 1.4;
}

.mobile-toc-list li.toc-level-2 {
  padding-left: 0;
}

.mobile-toc-list li.toc-level-3 {
  padding-left: 15px;
}

.mobile-toc-list a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.mobile-toc-list a:hover {
  color: var(--accent-secondary);
}

/* Accordion FAQ (Details/Summary) Styling */
.faq-item {
  padding: 0 !important;
  overflow: hidden;
  margin-bottom: 1rem !important;
  transition: all 0.3s ease;
}

.faq-question {
  padding: 1.2rem;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  user-select: none;
  outline: none;
  position: relative;
  list-style: none; /* Hide default browser arrow */
  display: flex;
  align-items: center;
}

.faq-question::-webkit-details-marker {
  display: none; /* Hide Chrome default marker */
}

.faq-question::after {
  content: '▼';
  position: absolute;
  right: 1.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.faq-item[open] .faq-question::after {
  transform: rotate(-180deg);
  color: var(--accent-secondary);
}

.faq-item[open] {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.05);
}

.faq-answer {
  padding: 0 1.2rem 1.2rem 1.2rem;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-secondary);
  font-size: 1rem;
}

.faq-answer p:first-child {
  margin-top: 0.8rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Alert Blocks Styling */
.alert-block {
  display: flex;
  gap: 12px;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  align-items: start;
}

.alert-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.alert-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.alert-content p {
  margin: 0;
  color: inherit;
}

.alert-info {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #fde047;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Reading Progress Bar (Giai doan 5 - Tinh hoa Taste Skill CSS-only) */
@keyframes grow-progress {
  from { width: 0%; }
  to { width: 100%; }
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  z-index: 99999;
  animation: grow-progress auto linear;
  animation-timeline: scroll();
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
}

/* Optimized Prose Image (Giai doan 5) */
.optimized-prose-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin: 1.5rem 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: block;
}

.optimized-prose-img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 30px rgba(6, 182, 212, 0.25);
  border-color: var(--accent-secondary);
}

/* ==========================================================================
   Asymmetric Homepage Editorial Grid & Typography Redesign (Taste Skill)
   ========================================================================== */

.index-asymmetric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 4rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .index-asymmetric-grid {
    grid-template-columns: 1.4fr 1fr; /* 60% / 40% asymmetrical visual grid */
  }
}

.featured-post-col {
  min-width: 0;
}

.featured-post-card {
  position: relative;
  background: var(--bg-glass, rgba(21, 29, 48, 0.5));
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05); /* Premium edge refraction */
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.featured-post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.85;
}

.featured-post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.25);
  box-shadow: 0 20px 40px -15px rgba(6, 182, 212, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-secondary);
  background: rgba(6, 182, 212, 0.08);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(6, 182, 212, 0.15);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.featured-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.featured-title a:hover {
  color: var(--accent-secondary) !important;
}

.recent-posts-col {
  min-width: 0;
  padding: 0 0.5rem;
}

.recent-section-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.recent-text-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.recent-text-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 1.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-text-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-item-title {
  margin: 0.5rem 0 0 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  font-family: var(--font-display);
}

.recent-item-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.25s ease;
}

.recent-item-title a:hover {
  color: var(--accent-secondary);
}

.recent-text-item:hover {
  transform: translateX(4px);
}

/* ==========================================================================
   Premium Site Footer Redesign (Taste Skill)
   ========================================================================== */

.site-footer {
  background: var(--bg-footer, rgba(11, 15, 25, 0.95));
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem 0;
  margin-top: 5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-desc {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  max-width: 320px;
}

.footer-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(190, 255, 1, 0.08);
  border: 1px solid rgba(190, 255, 1, 0.15);
  color: var(--accent-secondary);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  width: fit-content;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-secondary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(190, 255, 1, 0.7);
  animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--font-primary);
}

.footer-links a:hover {
  color: var(--accent-secondary);
  transform: translateX(4px);
  display: inline-block;
}

.stats-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.stat-label {
  color: var(--text-muted);
}

.stat-value {
  color: var(--text-primary);
  font-weight: 500;
}

.highlight-value {
  color: var(--accent-secondary);
  font-weight: 600;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  width: 100%;
  text-align: center;
}

/* Remove border of standard page containers and reduce padding */
.glass-panel.standard-page-container {
  border: none !important;
  padding: 2rem 1.5rem !important;
}

/* Z-Index Utility Classes */
.z-index-9 {
  z-index: 9 !important;
}
.z-index-12 {
  z-index: 12 !important;
}

