/* 
   Milan Fashion Campus Inspired Theme
   - Primary Red:  #E74C3C
   - Deep Black:   #151515
   - Light Gray:   #F9F9F9
   - Pure White:   #FFFFFF
*/

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Quicksand:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #e74c3c !important;
  --fs-color-primary: #e74c3c !important;
  --fs-color-secondary: #151515 !important;
  --fs-color-success: #2ecc71 !important;
  --fs-color-alert: #e74c3c !important;
  --fs-experimental-link-color: #e74c3c !important;
  --fs-experimental-link-color-hover: #363636 !important;

  /* Custom Variables */
  --tqt-red: #e74c3c;
  --tqt-black: #151515;
  --tqt-white: #ffffff;
  --tqt-gray-light: #f9f9f9;
  --tqt-bg-alt: #f9f9f9;

  /* Typography - Updated to All Sans-Serif as requested */
  --tqt-font-heading: "Inter", sans-serif;
  --tqt-font-body: "Quicksand", sans-serif;

  /* Category Backgrounds */
  --tqt-bg-thoi-trang: #ffd2cf;
  --tqt-bg-sang-tao: #fcebc7;
  --tqt-bg-rap: #bdf0d8;
  --tqt-bg-cat-may: #e0d4ef;
  --tqt-bg-san-xuat: #d1e4ff;
}

/* Category Background Classes */
.tqt-bg-thoi-trang {
  background-color: var(--tqt-bg-thoi-trang) !important;
}

.tqt-bg-sang-tao {
  background-color: var(--tqt-bg-sang-tao) !important;
}

.tqt-bg-rap {
  background-color: var(--tqt-bg-rap) !important;
}

.tqt-bg-cat-may {
  background-color: var(--tqt-bg-cat-may) !important;
}

.tqt-bg-san-xuat {
  background-color: var(--tqt-bg-san-xuat) !important;
}

/* Curriculum Section Backgrounds when Accordion is Active */
.curriculum-section {
  transition:
    background-color 0.4s ease,
    padding 0.4s ease,
    margin 0.4s ease;
  border-radius: 12px;
}

/* Use category background for curriculum-section at all times */
body.tqt-category-thoi-trang .curriculum-section {
  background-color: var(--tqt-bg-thoi-trang) !important;
  padding: 30px !important;
  margin-left: -30px !important;
  margin-right: -30px !important;
}

body.tqt-category-sang-tao .curriculum-section {
  background-color: var(--tqt-bg-sang-tao) !important;
  padding: 30px !important;
  margin-left: -30px !important;
  margin-right: -30px !important;
}

body.tqt-category-rap .curriculum-section {
  background-color: var(--tqt-bg-rap) !important;
  padding: 30px !important;
  margin-left: -30px !important;
  margin-right: -30px !important;
}

body.tqt-category-cat-may .curriculum-section {
  background-color: var(--tqt-bg-cat-may) !important;
  padding: 30px !important;
  margin-left: -30px !important;
  margin-right: -30px !important;
}

body.tqt-category-san-xuat .curriculum-section {
  background-color: var(--tqt-bg-san-xuat) !important;
  padding: 30px !important;
  margin-left: -30px !important;
  margin-right: -30px !important;
}

/* ĐỒNG BỘ NỀN NỘI DUNG ĐÀO TẠO (Glassmorphism) */
.accordion-content,
.curriculum-content-inner,
.course-curriculum .accordion-inner {
  background-color: rgba(255, 255, 255, 0.8) !important;
  /* backdrop-filter: blur(10px); */
  /* -webkit-backdrop-filter: blur(10px); */
  border-radius: 0 0 12px 12px;
  padding: 5px 25px 25px !important; /* Minimal top padding 5px */
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-top: -1px;
}

/* Đảm bảo tiêu đề accordion cũng có độ mờ nhẹ để tiệp màu */
.accordion-header {
  background-color: transparent !important;
  padding: 15px 25px 5px !important; /* Minimal bottom padding 5px, top 15px */
  transition: background-color 0.3s ease;
}

/* Visibility Logic for Accordion */
.accordion-content,
.curriculum-content-inner,
.course-curriculum .accordion-inner {
  display: none !important; /* Mặc định ẩn nội dung */
}

.accordion-content.active,
.curriculum-content-inner.active,
.course-curriculum .accordion-inner.active {
  display: block !important; /* Hiện nội dung khi active */
}

/* Hiệu ứng xoay mũi tên khi mở */
.accordion-header .tqt-caret,
.accordion-header i {
  transition: transform 0.3s ease;
}

.accordion-header.active .tqt-caret,
.accordion-header.active i {
  transform: rotate(180deg);
}

@media (hover: hover) {
  .accordion-header:hover {
    background-color: rgba(255, 255, 255, 0.6) !important;
  }
}

/* Mobile adjustments to avoid horizontal scroll if section is too wide */
@media (max-width: 767px) {
  .curriculum-section {
    margin-left: -15px !important;
    margin-right: -15px !important;
    padding: 20px 15px !important;
    border-radius: 0 !important;
  }
}

/* Center Course Thumbnails */
.course-intro-section img {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Color active accordion item with white transparent background */
.accordion-item:has(.accordion-header.active),
.accordion-header.active {
  background: rgba(255, 255, 255, 0.4) !important;
  border: none !important;
}

.accordion-item:has(.accordion-header.active) .accordion-content {
  background: transparent !important;
}

.curriculum-section:has(.accordion-header.active)
  .accordion-item:not(:has(.accordion-header.active)) {
  background: transparent !important;
  border: none !important;
}

.curriculum-section:has(.accordion-header.active)
  .accordion-header:not(.active),
.curriculum-section.is-active-section .accordion-header:not(.active) {
  background: transparent !important;
}

/* CUSTOM MODERN SCROLLBAR */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--tqt-gray-light);
}

::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 10px;
  border: 2px solid var(--tqt-gray-light);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tqt-red);
}

/* GLOBAL FONT OVERRIDE */
html,
body,
p,
div,
span,
li,
a,
input,
textarea,
button,
strong,
em {
  font-family: var(--tqt-font-body) !important;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.entry-title,
.widget-title,
.section-title-main,
.post-title,
.box-text h4 {
  font-family: var(--tqt-font-heading) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
}

/* Override Flatsome Header & Top Bar */
.header-main,
.header-wrapper,
#header {
  background-color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
}

.top-bar {
  background-color: var(--tqt-black) !important;
}

.header-nav-main > li > a {
  color: var(--tqt-black) !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
}

.header-nav-main > li > a:hover,
.header-nav-main > li.active > a,
.header-nav-main > li.current > a {
  color: var(--tqt-red) !important;
}

/* Buttons */
.button.primary,
.is-outline.primary,
.btn-primary,
button[type="submit"] {
  background-color: var(--tqt-red) !important;
  border-color: var(--tqt-red) !important;
  color: #fff !important;
  border-radius: 4px !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
}

.button.primary:hover {
  background-color: #363636 !important;
  border-color: #363636 !important;
}

/* Links & Widgets */
a {
  color: var(--tqt-red);
}

a:hover {
  color: #363636;
}

.widget-title {
  color: var(--tqt-black) !important;
  border-bottom: 3px solid var(--tqt-red) !important;
  font-family: var(--tqt-font-heading) !important;
  padding-bottom: 10px !important;
  margin-bottom: 15px !important;
}

/* Archive & Post Colors */
.category-page-title {
  background-color: var(--tqt-black) !important;
  color: #ffffff !important;
}

.post-item .box-text {
  background-color: #fff !important;
}

/* Footer Overrides for all pages */
#footer,
.footer-wrapper {
  background-color: var(--tqt-black) !important;
  color: #ffffff !important;
}

#footer a {
  color: #ffffff !important;
  opacity: 0.8 !important;
}

#footer a:hover {
  color: var(--tqt-red) !important;
  opacity: 1 !important;
}

/* Deep Overrides for Flatsome Sub-pages */
[id^="section_"],
[id^="row_"],
.section,
.footer-wrapper,
.absolute-footer {
  background-color: transparent !important;
}

/* Standardizing Global Backgrounds (Kill pink gradients from child theme) */
body.wp-theme-flatsome,
body.wp-theme-flatsome #wrapper,
body.wp-theme-flatsome .page-header-wrapper,
body.wp-theme-flatsome .page-title,
body.wp-theme-flatsome .title-breadcrumbs {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

body.wp-theme-flatsome {
  background-color: #ffffff !important;
}

#wrapper {
  background-color: #ffffff !important;
}

/* SEO & Cleanup: Remove Redundant H1s from Title Bar on specific pages */
.blog-single .page-title h1.entry-title,
.post-template-default .page-title h1.entry-title {
  font-size: 1.2rem !important;
  opacity: 0.8 !important;
  text-transform: none !important;
}

/* Sidebar Image Injection Styling */
.tqt-sidebar-promo {
  margin-bottom: 2.5rem;
  border: 1px solid #eeeeee;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: none !important;
}

/* Page Title / Breadcrumb Refinement: Milan Minimalist (Single Line Left) */
/* Standardizing Course Page Header & Title (Resolving pink background artifacts) */
.page-header-wrapper,
.page-title,
#page-header-219167017 {
  background-color: #ffffff !important;
  background-image: none !important;
  /* Prevent legacy background images */
  position: relative;
  z-index: 10;
}

body.tqt-has-shared-header,
#wrapper {
  background-color: #ffffff !important;
}

.page-title {
  padding: 10px 0 !important;
  border-bottom: 1px solid #f0f0f0 !important;
}

/* Nuclear Override: Kill pink gradients and artifacts from child theme */
body.wp-theme-flatsome,
body.wp-theme-flatsome #wrapper,
body.wp-theme-flatsome #main,
body.wp-theme-flatsome .page-header-wrapper,
body.wp-theme-flatsome .page-title,
body.wp-theme-flatsome .title-breadcrumbs {
  background: #ffffff !important;
  /* Shorthand to kill gradients */
  background-image: none !important;
  background-color: #ffffff !important;
}

/* Hide legacy background artifacts from old HTML structures */
.page-title-bg,
.title-overlay,
.title-bg {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Neutralize pink header borders and backgrounds from Flatsome/Child theme */
body.wp-theme-flatsome .header-main,
body.wp-theme-flatsome .stuck .header-main,
body.wp-theme-flatsome .header.show-on-scroll .header-main {
  border-bottom: 1px solid #f0f0f0 !important;
  background: rgba(255, 255, 255, 0.98) !important;
}

.page-title-bg,
.title-overlay {
  display: none !important;
}

/* Align breadcrumb to the left in 1 line */
.page-header-wrapper .page-title-inner,
.page-title .page-title-inner,
#page-header-219167017 .page-title-inner {
  min-height: auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

/* Hide the big redundant H1 in the header bar */
.page-title h1.entry-title {
  display: none !important;
}

/* Style the minimalist breadcrumb line */
.page-title-sub,
.rank-math-breadcrumb,
.breadcrumb,
.rank-math-breadcrumb p {
  font-family: var(--tqt-font-body) !important;
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  color: #888888 !important;
  opacity: 1 !important;
  margin: 0 !important;
}

.rank-math-breadcrumb a {
  color: #999999 !important;
  text-decoration: none !important;
}

.rank-math-breadcrumb a:hover {
  color: var(--tqt-red) !important;
}

.rank-math-breadcrumb .separator {
  margin: 0 10px !important;
  color: #cccccc !important;
}

/* Make the last item (current page) bold to act as a title */
.rank-math-breadcrumb span.last,
.breadcrumb .current,
.rank-math-breadcrumb span:last-child {
  font-weight: 700 !important;
  color: var(--tqt-black) !important;
}

/* Custom Width Overrides to fill whitespace - Forced for desktop */
@media (min-width: 901px) {
  html body #wrapper .container,
  html body #wrapper .row,
  html body #wrapper .page-wrapper,
  html body #wrapper .blog-wrapper,
  html body #wrapper #main,
  #wrapper .page-title-inner.container {
    max-width: 1700px !important;
    width: 96% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Học viện thời trang Quốc Thảo: Minimalist Course Cards (Ngành đào tạo) */
.post-item .from_the_blog_excerpt,
.post-item .is-divider {
  display: none !important;
}

.post-item .post-meta {
  display: block !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  opacity: 0.7 !important;
  margin-bottom: 0.2rem !important;
}

.post-item .box-text {
  padding: 15px 20px !important;
  background-color: transparent !important;
}

.post-item .post-title {
  font-family: var(--tqt-font-heading) !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: var(--tqt-black) !important;
  text-transform: none !important;
  margin-top: 0.5rem !important;
  line-height: 1.4 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* Allow 2 lines for title if needed, but clean */
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.post-item .box-image {
  overflow: hidden !important;
}

/* Card Ratio & Hover restoration */
/* Card Ratio & Hover restoration */
.post-item .box-image,
.news-card .news-img {
  border-radius: 0 !important;
  /* Let parent card clip the top corners */
  overflow: hidden !important;
  aspect-ratio: 3 / 2 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.category-tin-tuc .post-item .box-image .image-cover {
  padding-top: 0 !important;
  height: 100% !important;
}

.post-item .box-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Ensure hover animations are active */
.post-item,
.news-card {
  transition: transform 0.3s ease !important;
}

/* --- FL-ICONS RESTORATION (Standardizing Icons) --- */
@font-face {
  font-family: "fl-icons";
  src:
    url("/wp-content/themes/flatsome/assets/css/icons/fl-icons6107.woff2")
      format("woff2"),
    url("/wp-content/themes/flatsome/assets/css/icons/fl-icons6107.woff")
      format("woff"),
    url("/wp-content/themes/flatsome/assets/css/icons/fl-icons6107.ttf")
      format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

[class^="icon-"],
[class*=" icon-"],
.links li:before {
  font-family: "fl-icons" !important;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: inline-block;
}

/* Icon Mappings from SVG Source */
.icon-envelop:before {
  content: "\e003";
}

.icon-twitter:before {
  content: "\e001";
}

.icon-facebook:before {
  content: "\e002";
}

.icon-whatsapp:before {
  content: "\e907";
}

.icon-pinterest:before {
  content: "\e010";
}

.icon-instagram:before {
  content: "\e00e";
}

.icon-linkedin:before {
  content: "\e016";
}

.icon-google-plus:before {
  content: "\e905";
}

.icon-heart:before {
  content: "\e000";
}

.icon-search:before {
  content: "\e012";
}

.icon-menu:before {
  content: "\e800";
}

/* Social Share Button Coloring & Layout (High Specificity Overrides) */
.social-icons.share-icons a.icon.button {
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  margin: 4px !important;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
  border: none !important;
  box-shadow: none !important;
}

.tqt-btn-submit {
  background: var(--tqt-red) !important;
  color: white !important;
  border: none !important;
  padding: 16px 50px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  border-radius: 50px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  text-transform: uppercase !important;
  letter-spacing: 1.5px !important;
  box-shadow: none !important;
}

.tqt-btn-submit:hover {
  background: var(--secondary-dark) !important;

  box-shadow: none !important;
}

.social-icons.share-icons a.icon.button:hover {
  box-shadow: none !important;
}

.social-icons.share-icons a.icon.button i {
  font-size: 18px !important;
  color: #fff !important;
  margin: 0 !important;
}

/* --- INDIVIDUAL BRAND COLORS (Ultimate Specificity Overrides) --- */
html body .social-icons a.facebook,
html body .share-icons a.facebook,
html body .social-icons a[class*="facebook"] {
  background-color: #3b5998 !important;
  background: #3b5998 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

html body .social-icons a.twitter,
html body .share-icons a.twitter,
html body .social-icons a[class*="twitter"] {
  background-color: #1da1f2 !important;
  background: #1da1f2 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

html body .social-icons a.email,
html body .share-icons a.email,
html body .social-icons a.envelop,
html body .social-icons a[class*="email"] {
  background-color: #ea4335 !important;
  background: #ea4335 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

html body .social-icons a.whatsapp,
html body .share-icons a.whatsapp,
html body .social-icons a[class*="whatsapp"] {
  background-color: #25d366 !important;
  background: #25d366 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

html body .social-icons a.pinterest,
html body .share-icons a.pinterest,
html body .social-icons a[class*="pinterest"] {
  background-color: #bd081c !important;
  background: #bd081c !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

html body .social-icons a.linkedin,
html body .share-icons a.linkedin,
html body .social-icons a[class*="linkedin"] {
  background-color: #0077b5 !important;
  background: #0077b5 !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

html body .social-icons a.instagram,
html body .share-icons a.instagram,
html body .social-icons a[class*="instagram"] {
  background-color: #e4405f !important;
  background: #e4405f !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

html body .social-icons a.messenger,
html body .share-icons a.messenger,
html body .social-icons a[class*="messenger"] {
  background-color: #0084ff !important;
  background: #0084ff !important;
  opacity: 1 !important;
  filter: none !important;
  box-shadow: none !important;
}

/* Force icons to be white and centered */
html body .social-icons a i,
html body .share-icons a i {
  color: #fff !important;
  opacity: 1 !important;
  filter: none !important;
  transform: translateY(1.5px) !important;
  /* Move down slightly to center vertically */
  display: inline-block !important;
}

/* Disable any competing theme backgrounds */
html body .social-icons a,
html body .share-icons a {
  background-image: none !important;
  transition: transform 0.2s ease !important;
}
/* --- UTILITY CLASSES FOR CLEAN ARTICLES --- */
.premium-article-header {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.premium-article-header .overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(58px);
}

.premium-article-header .content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.highlight-box {
  background: #ffffff;
  border: 1px solid #eeeeee;
  padding: 25px;
  border-radius: 20px;
  border-left: 5px solid var(--primary-color);
  margin: 30px 0;
}

.highlight-box h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.article-thumb-container {
  text-align: center;
  margin-bottom: 30px;
}

.article-thumb {
  border-radius: 15px;
  box-shadow: none !important;
  max-width: 100%;
  height: auto;
  transition: transform 0.3s;
}

.check-list,
.bullet-list {
  padding-left: 20px !important;
  list-style: none !important;
}

.check-list li,
.bullet-list li {
  margin-bottom: 10px;
  position: relative;
  padding-left: 25px;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
}

.bullet-list li::before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.recent-posts-list {
  list-style: none;
  padding: 0;
}

.recent-posts-list li {
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
}

.recent-posts-list li a {
  color: #333;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.recent-posts-list li a:hover {
  color: var(--primary-color);
}

/* --- REFINED EZ-TOC STYLING --- */
#ez-toc-container {
  background: #fdfdfd;
  border: 1px solid #aaa;
  border-radius: 4px;
  padding: 10px 15px;
  margin: 15px 0;
  display: inline-block;
  min-width: 260px;
  max-width: 100%;
  box-shadow: none;
}

.ez-toc-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #333 !important;
  margin: 0 0 5px 0 !important;
  display: block !important;
}

#ez-toc-container input[type="checkbox"] {
  display: none !important;
}

.ez-toc-cssicon-toggle-label {
  cursor: pointer;
  padding: 0;
  border-radius: 0;
  background: transparent;
  transition: opacity 0.2s;
  height: auto;
  display: block;
  margin: 5px 0 10px 0;
}

.ez-toc-cssicon-toggle-label:hover {
  opacity: 0.7;
}

.ez-toc-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

#ez-toc-container input[type="checkbox"]:checked ~ nav {
  display: none;
}

.ez-toc-list li,
.ez-toc-list ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.ez-toc-list li {
  font-size: 13px;
  line-height: 1 !important;
}

.ez-toc-list li:before {
  content: none !important;
}

.ez-toc-list a {
  color: #444 !important;
  text-decoration: none;
  transition: all 0.2s;
  display: block;
  padding: 2px 0 !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.ez-toc-list a:hover {
  color: var(--primary-color) !important;
  text-decoration: underline;
}

.ez-toc-list ul {
  margin-left: 15px !important;
}

/* --- COMPACT ARTICLE CONTENT --- */
.entry-content {
  line-height: 1.5 !important;
}

.entry-content p {
  margin-bottom: 8px !important;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: 12px !important;
  margin-bottom: 5px !important;
}

.premium-article-header {
  min-height: 40px !important;
}

.page-title-inner {
  min-height: 40px !important;
}

.article-inner {
  padding-top: 30px !important;
}

@media (max-width: 767px) {
  #ez-toc-container {
    padding: 15px;
    width: 100%;
  }
}

/* --- FIX ANCHOR SCROLL OFFSET (Sticky Header Fix) --- */
:target::before {
  content: "";
  display: block;
  height: 110px;
  /* Fixed header height + buffer */
  margin: -110px 0 0;
}

/* Modern approach for elements with IDs */
[id] {
  scroll-margin-top: 110px;
}

.ez-toc-section {
  scroll-margin-top: 110px;
  display: block;
}

/* Hide Table of Contents - User requested to hide "Nội dung chính" section on course pages */
#ez-toc-container {
  display: none !important;
}

/* --- News & Related Content --- */
.related-title {
  font-weight: 700;
  font-size: 25px;
  line-height: 1.5;
  color: var(--tqt-red);
  margin-top: 40px;
  margin-bottom: 20px;
}

/* --- Lightbox & Zoom Enhancements --- */
a.image-lightbox,
a.lightbox,
.image-lightbox img,
.lightbox:not(body) img {
  cursor: zoom-in;
}

.image-lightbox,
.lightbox {
  display: block;
  overflow: hidden;
}

.image-lightbox img,
.lightbox img {
  transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* --- Magnific Popup (Lightbox) Stylizing --- */
.mfp-bg {
  background: rgba(0, 0, 0, 0.92) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  opacity: 0.95 !important;
}

.mfp-wrap {
  z-index: 9999999 !important;
}

/* --- TQT Custom Lightbox (Fallback) --- */
#tqt-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: zoom-out;
}

#tqt-lightbox-overlay.active {
  opacity: 1;
}

.tqt-lightbox-img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: default;
}

#tqt-lightbox-overlay.active .tqt-lightbox-img {
  transform: scale(1);
}

.tqt-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 50px;
  font-weight: 200;
  cursor: pointer;
  line-height: 1;
  z-index: 10000000;
  transition: transform 0.2s ease;
}

.tqt-lightbox-close:hover {
  transform: scale(1.2);
  color: var(--tqt-red);
}

.mfp-content {
  cursor: zoom-out;
}

.mfp-image-holder .mfp-close,
.mfp-iframe-holder .mfp-close {
  color: #fff !important;
  right: -10px;
  top: -40px;
  font-family: var(--tqt-font-heading);
  font-weight: 300;
  font-size: 40px;
}

img.mfp-img {
  border-radius: 4px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  padding: 0 !important;
}

.mfp-content {
  animation: tqtLightboxFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes tqtLightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Registration Form Alignment */
.tqt-registration-wrapper {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.related-list li {
  list-style: none;
  margin-bottom: 25px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 25px;
}

.related-list li:last-child {
  border-bottom: none;
}

.related-item-card {
  display: flex;
  gap: 20px;
  align-items: center;
  text-decoration: none !important;
  transition: transform 0.3s ease;
}

.related-item-card:hover {
  transform: translateX(10px);
}

.related-thumb {
  width: 180px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-info {
  flex-grow: 1;
}

.related-item-title {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
  color: #333;
  margin: 0;
  transition: color 0.3s;
}

.related-item-card:hover .related-item-title {
  color: var(--tqt-red);
}

@media (max-width: 600px) {
  .related-thumb {
    width: 120px;
    height: 70px;
  }
  .related-item-title {
    font-size: 1rem;
  }
}

/* Sidebar Banner Adjustment */
.widget_custom_html .textwidget img {
  margin-top: 20px !important;
}

/* Sidebar Recent Posts Widget */
.widget.flatsome_recent_posts {
  background: #f8f9fa !important;
  padding: 25px 20px !important;
  border-radius: 8px;
  margin-bottom: 30px;
}

.widget.flatsome_recent_posts .widget-title {
  display: block;
  font-weight: 700;
  font-size: 20px !important;
  text-align: center;
  color: var(--tqt-red) !important;
  margin-bottom: 20px !important;
  border-bottom: none !important;
}

.widget.flatsome_recent_posts .widget-title span {
  border-bottom: 2px solid var(--tqt-red);
  padding-bottom: 5px;
}

.recent-blog-posts a {
  color: #333 !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  transition: color 0.3s !important;
}

.recent-blog-posts a:hover {
  color: var(--tqt-red) !important;
}

.recent-blog-posts .badge-inner {
  border-radius: 4px !important;
}

/* ============================================================
   TRAINING DIRECTORY SHARED UI COMPONENTS
   Standardizing Course & Category pages
   ============================================================ */

/* 1. Course Highlights (Pills) */
.course-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin: 25px 0;
}

.highlight-item {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s ease;
  border: 1px solid #eee;
}

.highlight-item:hover {
  border-color: var(--tqt-red);
}

.highlight-item i {
  font-size: 24px;
  color: var(--tqt-red);
  margin-bottom: 10px;
}

.highlight-item strong {
  display: block;
  font-size: 14px;
  color: #777;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.highlight-item span {
  font-weight: 700;
  color: #333;
}

/* 2. TQT Accordion (Curriculum) */
.tqt-accordion {
  margin: 20px 0;
}

.accordion-item {
  margin-bottom: 5px;
  border-radius: 8px;
  overflow: hidden;
  border: none !important;
}

.accordion-header {
  width: 100%;
  padding: 12px 10px 6px 10px;
  background: transparent !important;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer !important;
  font-weight: 700;
  color: #333;
  transition: all 0.3s ease;
  /* Mobile & Touch Fixes */
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
  outline: none !important;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-modify: read-only !important;
}

.accordion-header * {
  pointer-events: none !important;
  /* Ensure the click event is always handled by the header itself */
  user-select: none !important;
  -webkit-user-select: none !important;
}

.accordion-header:hover {
  color: var(--tqt-red);
}

.accordion-header.active {
  background: transparent !important;
  color: #000 !important;
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #fff;
  padding: 0 20px;
}

.accordion-content.active {
  max-height: 1000px;
  padding: 0px 20px 20px 20px;
  border-top: none !important;
  color: #000;
}

/* 3. Gallery & Image Grids */
.article-image-grid,
.compact-gallery {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
  margin: 25px 0 !important;
}

@media (min-width: 768px) {
  .article-image-grid,
  .compact-gallery {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
  }
}

.article-image-grid img,
.compact-gallery img {
  width: 100% !important;
  height: auto !important;
  border-radius: 12px !important;
  transition: transform 0.3s ease !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* 4. Category Course Sections (Sliders) */
.course-section {
  position: relative;
  margin: 40px auto;
  max-width: 1600px;
  padding: 0 15px;
}

.course-section-title {
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
  padding-left: 15px;
  margin-bottom: 25px;
}

.course-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 80%;
  background: var(--tqt-red);
  border-radius: 2px;
}

.course-section-viewport {
  overflow: hidden;
  border-radius: 12px;
}

.course-section-track {
  display: flex !important;
  gap: 20px;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.course-card .col-inner {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee !important;
  background: #fff !important;
  transition: all 0.3s ease;
  height: 100%;
}

.course-card .col-inner:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1) !important;
  border-color: var(--tqt-red) !important;
}

.course-card .post-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

/* 5. Course Search */
.course-search-container {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 25px;
  padding: 8px 20px;
  margin-bottom: 30px;
  border: 1px solid #eee;
  max-width: 400px;
}

.course-search-input {
  border: none !important;
  background: transparent !important;
  outline: none !important;
  padding: 5px 10px !important;
  width: 100% !important;
  font-size: 15px !important;
  box-shadow: none !important;
}

/* 6. Global Image Modal */
.mfp-bg {
  backdrop-filter: blur(10px);
}

/* 7. Course Slider Navigation */
.course-section .btn-prev,
.course-section .btn-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border: 2px solid #ddd;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  color: #555;
  font-size: 16px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.course-section .btn-prev i,
.course-section .btn-next i {
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-section .btn-prev:hover,
.course-section .btn-next:hover:not(:disabled) {
  background: #e8491d;
  border-color: #e8491d;
  color: #fff;
  box-shadow: 0 4px 12px rgba(232, 73, 29, 0.3);
}

.course-section .btn-prev:disabled,
.course-section .btn-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.course-section .btn-prev {
  left: -20px;
}

.course-section .btn-next {
  right: -32px;
}

@media (max-width: 600px) {
  .course-section .btn-prev {
    left: 0px;
  }

  .course-section .btn-next {
    right: 0px;
  }
}

.tqt-close-modal {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}

/* --- AUTO-SYNC LATEST NEWS SECTION --- */
.tqt-latest-news-auto-update {
  width: 100%;
  margin: 40px 0;
  clear: both;
}

.tqt-latest-news-section {
  padding: 35px;
  background: #ffffff;
  border: 1px solid #eeeeee;
  border-radius: 12px;
}

.tqt-latest-news-section h2 {
  font-size: 1.6rem;
  margin-bottom: 30px;
  text-align: center;
  color: var(--tqt-black);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.tqt-latest-news-section h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--tqt-red);
  margin: 12px auto 0;
}

.tqt-news-auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.tqt-news-auto-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  border: 1px solid #f0f0f0;
}

.tqt-news-auto-card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
  border-color: #eee;
}

.tqt-news-auto-card .card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f5f5f5;
  display: block;
}

.tqt-news-auto-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.tqt-news-auto-card .card-info {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.tqt-news-auto-card .card-info h4 {
  font-size: 1.05rem;
  margin: 0 0 12px 0;
  line-height: 1.45;
  color: var(--tqt-black);
}

.tqt-news-auto-card .card-info h4 a {
  color: inherit;
  text-decoration: none;
}

.tqt-news-auto-card .card-info h4 a:hover {
  color: var(--tqt-red);
}

.tqt-news-auto-card .card-info .card-date {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tqt-news-auto-card .read-more {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--tqt-red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tqt-news-auto-card .read-more:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .tqt-latest-news-section {
    padding: 20px 15px;
  }

  .tqt-news-auto-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tqt-latest-news-section h2 {
    font-size: 1.6rem;
  }
}

/* Mobile & Tablet Category Backgrounds */
@media (max-width: 1366px) {
  body.mobile-bg-thoi-trang #wrapper,
  body.mobile-bg-thoi-trang #main,
  body.mobile-bg-thoi-trang #content {
    background-color: var(--tqt-bg-thoi-trang) !important;
  }

  body.mobile-bg-sang-tao #wrapper,
  body.mobile-bg-sang-tao #main,
  body.mobile-bg-sang-tao #content {
    background-color: var(--tqt-bg-sang-tao) !important;
  }

  body.mobile-bg-rap #wrapper,
  body.mobile-bg-rap #main,
  body.mobile-bg-rap #content {
    background-color: var(--tqt-bg-rap) !important;
  }

  body.mobile-bg-cat-may #wrapper,
  body.mobile-bg-cat-may #main,
  body.mobile-bg-cat-may #content {
    background-color: var(--tqt-bg-cat-may) !important;
  }

  body.mobile-bg-san-xuat #wrapper,
  body.mobile-bg-san-xuat #main,
  body.mobile-bg-san-xuat #content {
    background-color: var(--tqt-bg-san-xuat) !important;
  }
}

/* TQT Image Grid System */
.tqt-image-grid {
  display: grid !important;
  gap: 15px !important;
  margin: 30px 0 !important;
  width: 100% !important;
  max-width: none !important;
  clear: both !important;
}
.tqt-grid-1 {
  grid-template-columns: 1fr !important;
}
.tqt-grid-2 {
  grid-template-columns: repeat(2, 1fr) !important;
}
.tqt-grid-3 {
  grid-template-columns: repeat(3, 1fr) !important;
}

.tqt-image-grid-item {
  width: 100%;
  min-width: 0;
}
.tqt-image-grid-item img {
  width: 100% !important;
  height: auto !important;
  border-radius: 12px !important;
  aspect-ratio: 1/1 !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
}

@media (max-width: 768px) {
  .tqt-image-grid {
    width: 100% !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Sync legacy galleries with new grid */
.entry-content .row.row-small {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
}

.entry-content .row.row-small > .col {
  padding: 7.5px !important;
}

.entry-content .row.row-small img {
  width: 100% !important;
  height: auto !important;
  border-radius: 12px !important;
  aspect-ratio: 1/1 !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
}

/* Disable hover jumping effects on images globally */
img:hover,
.image-zoom:hover,
.img-hover:hover,
.badge-inner:hover,
.col-inner:hover,
.box-image:hover,
.recent-blog-posts-li:hover .badge-inner,
.image-lightbox:hover,
.image-lightbox:hover img {
  transform: none !important;
}

/* Disable all image zooming on hover globally */
img:hover,
.image-zoom:hover img,
.img-hover:hover img,
.box-image:hover img,
.article-image-grid img:hover,
.compact-gallery img:hover,
.course-card .box-image:hover img,
.post-item .box-image:hover img,
.tqt-image-grid-item img:hover,
.entry-content .row.row-small img:hover {
  transform: none !important;
}

.article-image-grid img:hover,
.compact-gallery img:hover,
.entry-content .row.row-small img:hover,
.tqt-image-grid-item img:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08) !important;
  z-index: auto !important;
}

/* Center all standalone images inside articles (including those with inline styles) */
.facebook-content p img,
.entry-content p img,
.facebook-content > img,
.entry-content > img,
.facebook-content > a > img,
.entry-content > a > img {
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
}
