/**
 * Accessibility colour fixes (customer feedback 10/2026)
 *
 * Text:     Black #000000
 * Headings: Navy  #003150 (R0 G49 B80)
 * Links:    Teal  #00759A (R0 G117 B154), underlined in body copy
 *
 * Loaded after the Flatsome Customizer CSS (wp_head priority 120), so
 * selectors mirror the Customizer ones instead of relying on !important.
 */

:root {
  --aav-text: #000000;
  --aav-heading: #003150;
  --aav-link: #00759a;
  --fs-experimental-link-color: var(--aav-link);
  --fs-experimental-link-color-hover: var(--aav-heading);
}

/* ---------- Body text ---------- */
body {
  color: var(--aav-text);
}

.from_the_blog_excerpt,
.bai-dau-tien-dm .from_the_blog_excerpt,
.page-id-287 .noidung,
.c132,
.c8132 td {
  color: var(--aav-text);
}

/* Tables (Flatsome default td is #666) */
td,
th,
.noidung table td,
.chinhlai td,
.tablepress td,
.tablepress th,
.tablepress thead th {
  color: var(--aav-text);
}

.key-date-table.tablepress tbody tr td,
.Alumni_Groups td {
  color: var(--aav-text) !important;
}

.Alumni-Groups-table tr td {
  color: var(--aav-text);
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6,
.heading-font,
.tieude36,
.tieude40,
.post-title a,
.cac-bai-kieu-row .post-title a,
.bai-dau-tien-dm .post-title a,
.page-template-page-blank h2,
.page-template-page-blank .noidung h1,
.page-template-page-blank .noidung h3,
.page-id-438 h3 {
  color: var(--aav-heading);
}

.page-template-page-blank h2 {
  border-bottom-color: var(--aav-heading);
}

/* ---------- Links ---------- */
/* :where() keeps state rules at minimum specificity so menus,
   buttons and other component styles always win */
a,
:where(a:not(.button)):visited,
:where(a:not(.button)):active,
.mota16 a,
.xemtatca a,
.support-table.tablepress tbody tr td a {
  color: var(--aav-link);
}

.Alumni-Groups-table tr td a {
  color: var(--aav-link) !important;
}

:where(a:not(.button)):hover,
:where(a:not(.button)):focus {
  color: var(--aav-heading);
}

/* ---------- Header dropdown menu: one consistent style ---------- */
.header-nav .nav-dropdown a,
.header-nav .nav-dropdown a:visited {
  color: var(--aav-text);
}

.header-nav .nav-dropdown li:hover > a,
.header-nav .nav-dropdown li.active > a,
.header-nav .nav-dropdown li.current-menu-item > a {
  color: var(--aav-heading);
}

/* Customizer sets a:visited to teal, which also hit filled buttons */
a.button.primary:not(.is-link):not(.is-outline):not(.is-underline):visited,
a.button.primary:not(.is-link):not(.is-outline):not(.is-underline):active {
  color: #fff;
}

/* Underline links inside body copy and tables */
:is(p, td, th, dd, blockquote, figcaption) a:not(.button):not(.nav a):not(.rank-math-breadcrumb a),
:is(.entry-content, .noidung, .text) :is(ul, ol) li a:not(.button):not(.nav a),
.xemtatca a,
.mota16 a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Breadcrumbs: no underline, underline on hover/focus only */
.rank-math-breadcrumb a {
  text-decoration: none;
}

.rank-math-breadcrumb a:hover,
.rank-math-breadcrumb a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* "Read more" links on post lists (not the filled button variant) */
.post-item .button.is-link:not(.bai-dau-tien-dm .button) {
  color: var(--aav-link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-item .button.is-link:not(.bai-dau-tien-dm .button):hover {
  color: var(--aav-heading);
}

/* Keep white links on dark sections (Flatsome .dark sets currentColor) */
.dark a,
.dark a:visited {
  color: currentColor;
}

/* Visible keyboard focus */
a:focus-visible {
  outline: 2px solid var(--aav-link);
  outline-offset: 2px;
}

/* Breadcrumb menu groups without a page (e.g. "Học bổng", "Hỗ trợ chuẩn bị du học"):
   plain grey text, so only real links are Teal and only the current page is black */
.rank-math-breadcrumb span.last:not(:last-child) {
  color: #5a6470;
}

/* ---------- Every text link in the page content is underlined ----------
   Replaces the position-based list above (p, td, li...) which missed links in
   headings, <strong>, "Xem thêm" blocks, notes, dark boxes, etc. */
#main a[href]:not([href="#"]):not(.button):not(.plain):not(.aav-share__btn) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Exceptions: navigation, whole-card links, toggles and icon links */
#main :is(.nav, .post-title, .box-image, .accordion-title, .tieude-home1 .tieude36, .social-icons, .listmsha, .banner-link, .rank-math-breadcrumb) a,
#main a[href]:has(> img:only-child) {
  text-decoration: none;
}

/* Breadcrumbs: underline on hover/focus only (by request) */
#main .rank-math-breadcrumb a:is(:hover, :focus-visible) {
  text-decoration: underline;
}
