/* Masterskills | Footer Standard V4.4 – Continuous Copyright Background
   Scope: opt-in body.ms-footer-standard. Load after page-specific CSS.
   Existing header, hero, Zalo and page-specific styles are not redefined.
   Existing pages without opt-in retain their legacy CSS.
*/
body.ms-footer-standard {
  --ms-footer-brand: #2e4d67;
  --ms-footer-background: linear-gradient(118deg, #082d4c, #104971);
  --ms-footer-dark: #203b50;
  --ms-footer-gold: #f8dfa6;
  --ms-footer-text: #e3eaf0;
  --ms-footer-muted: #c4d1db;
  --ms-footer-divider: rgba(255,255,255,.18);
  --ms-footer-frame: var(--ms-hero-box-width, min(calc(100% - 40px),1320px));
  --ms-sticky-mobile-height: 76px;
  --ms-footer-sticky-fallback: 34px;
}
/* The copyright band is the sole sticky spacer on opted-in pages.
   Neutralize legacy course body padding (28px) only when both components exist. */
body.ms-footer-standard:has(> .site-footer .ms-footer-copyright-bar):has(> .cd-inhouse-sticky) {
  padding-bottom: 0;
}
/* Reserve the actual ticker height when existing main.js measures it.
   CSS fallback also works without JavaScript. */
body.ms-footer-standard:has(> .cd-inhouse-sticky) .site-footer .ms-footer-copyright-bar {
  padding-bottom: var(--ms-sticky-measured-height, calc(var(--ms-footer-sticky-fallback) + env(safe-area-inset-bottom,0px)));
}
body.ms-footer-standard .site-footer {
  background: var(--ms-footer-background);
  color: var(--ms-footer-text);
  margin: 0;
  padding: 36px 0 0;
  font-family: Tahoma, Arial, sans-serif;
  text-align: left;
}
body.ms-footer-standard .site-footer .footer-grid,
body.ms-footer-standard .site-footer .footer-bottom {
  box-sizing: border-box;
  width: var(--ms-footer-frame);
  max-width: 1320px;
  margin-inline: auto;
  min-width: 0;
}
body.ms-footer-standard .site-footer .footer-grid {
  display: grid;
  grid-template-columns: minmax(0,26fr) repeat(4,minmax(0,18.5fr));
  align-items: start;
  gap: 24px;
  padding: 0 0 28px;
}
body.ms-footer-standard .site-footer .footer-grid > * { min-width: 0; }
body.ms-footer-standard .site-footer .footer-grid nav { display: block; }
body.ms-footer-standard .site-footer .footer-grid h3 {
  margin: 0 0 16px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
/* Keep heading text and underline aligned across the navigation columns. */
body.ms-footer-standard .site-footer .footer-grid nav h3 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: calc(1.4em + 12px);
}
body.ms-footer-standard .site-footer .footer-grid nav h3::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin-top: auto;
  flex: 0 0 2px;
  background: var(--ms-footer-gold);
}
body.ms-footer-standard .site-footer .footer-grid a {
  display: block;
  color: var(--ms-footer-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 5px;
  transition: color 150ms ease;
  overflow-wrap: anywhere;
}
body.ms-footer-standard .site-footer .footer-grid a:hover,
body.ms-footer-standard .site-footer .footer-grid a:focus-visible,
body.ms-footer-standard .site-footer .footer-grid a[aria-current="page"] {
  color: var(--ms-footer-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.ms-footer-standard .site-footer a:focus-visible,
body.ms-footer-standard .cd-inhouse-sticky a:focus-visible {
  outline: 2px solid var(--ms-footer-gold);
  outline-offset: 2px;
}
body.ms-footer-standard .site-footer .footer-brand p {
  margin: 0 0 10px;
  max-width: none;
  color: var(--ms-footer-text);
  text-align: left;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
body.ms-footer-standard .site-footer .ms-footer-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
body.ms-footer-standard .site-footer .ms-footer-identity > div { min-width: 0; }
body.ms-footer-standard .site-footer .ms-footer-logo {
  display: block;
  flex: 0 0 52px;
  float: none;
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  margin: 0;
}
body.ms-footer-standard .site-footer .ms-footer-name {
  display: block;
  color: #fff;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 700;
}
body.ms-footer-standard .site-footer .ms-footer-tagline {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ms-footer-muted);
}
body.ms-footer-standard .site-footer .ms-footer-contact {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ms-footer-divider);
}
body.ms-footer-standard .site-footer .ms-footer-contact h3 {
  color: var(--ms-footer-gold);
  font-size: 12px;
  margin-bottom: 8px;
}
body.ms-footer-standard .site-footer .ms-footer-address strong { color: #fff; font-weight: 600; }
body.ms-footer-standard .site-footer .ms-footer-address,
body.ms-footer-standard .site-footer .ms-footer-contact a {
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  align-items: start;
  gap: 6px;
}
body.ms-footer-standard .site-footer .ms-footer-contact-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 18px;
  height: 18px;
  font-size: 15px;
  line-height: 1;
  color: var(--ms-footer-gold);
}
body.ms-footer-standard .site-footer .ms-footer-contact-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}
body.ms-footer-standard .site-footer .ms-footer-gallery {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 6px;
  margin-top: 16px;
  width: 100%;
  max-width: 360px;
}
body.ms-footer-standard .site-footer .ms-footer-gallery a { min-width: 0; margin: 0; }
body.ms-footer-standard .site-footer .ms-footer-gallery img {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--ms-footer-divider);
  border-radius: 2px;
  filter: none;
}
/* Copyright: transparent to reveal the continuous footer gradient. */
body.ms-footer-standard .site-footer .ms-footer-copyright-bar {
  background: transparent;
  border-top: 1px solid var(--ms-footer-divider);
}
body.ms-footer-standard .site-footer .footer-bottom {
  display: block;
  padding: 20px 0 16px;
  margin-block: 0;
  border: 0;
  text-align: center;
  color: var(--ms-footer-muted);
}
body.ms-footer-standard .site-footer .footer-bottom p {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ms-footer-muted);
  text-align: center;
  overflow-wrap: anywhere;
}
body.ms-footer-standard .site-footer .footer-bottom .footer-academy-name { color: #fff; font-weight: 600; font-size: 13px; }
body.ms-footer-standard .site-footer .footer-legal-details span { display: block; }
body.ms-footer-standard .site-footer .footer-bottom .footer-copyright {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 0;
}
body.ms-footer-standard .site-footer .footer-bottom a { color: var(--ms-footer-text); }
/* Fixed ticker: one flat surface, no yellow fill, preserve source link. */
body.ms-footer-standard .cd-inhouse-sticky {
  box-sizing: border-box;
  position: fixed;
  inset: auto 0 0;
  z-index: 998;
  display: grid;
  place-items: center;
  min-height: 34px;
  margin: 0;
  padding: 6px max(12px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));
  background: var(--ms-footer-brand);
  border-top: 1px solid var(--ms-footer-divider);
  color: #fff;
}
body.ms-footer-standard .cd-inhouse-sticky a {
  display: block;
  box-sizing: border-box;
  max-width: 1320px;
  width: 100%;
  padding: 0;
  background: transparent;
  color: #fff;
  font: 400 14px/1.4 Tahoma,Arial,sans-serif;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
body.ms-footer-standard .cd-inhouse-sticky a strong { color: var(--ms-footer-gold); font: inherit; font-weight: 700; }
body.ms-footer-standard .cd-inhouse-sticky a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
body.ms-footer-standard .cd-inhouse-sticky .ms-sticky-full-copy { display: inline; }
body.ms-footer-standard .cd-inhouse-sticky .ms-sticky-mobile-copy { display: none; }
/* Reserve a second title line when columns are narrow, keeping the rules aligned. */
@media (min-width: 768px) and (max-width: 1250px) {
  body.ms-footer-standard .site-footer .footer-grid nav h3 { min-height: calc(2.8em + 12px); }
}
@media (min-width: 768px) and (max-width: 1050px) {
  body.ms-footer-standard { --ms-footer-sticky-fallback: 54px; }
}
/* Tablet: retain readable columns instead of squeezing five narrow tracks. */
@media (max-width: 1050px) {
  body.ms-footer-standard .site-footer .footer-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 22px; }
  body.ms-footer-standard .site-footer .footer-brand { grid-column: 1 / -1; max-width: 680px; }
}
@media (max-width: 767px) {
  body.ms-footer-standard { --ms-footer-sticky-fallback: 50px; }
  body.ms-footer-standard:has(#site-header.ms-legacy-header):has(> .cd-inhouse-sticky) {
    --ms-sticky-mobile-height: 76px; /* existing Zalo offset fallback only */
  }
  body.ms-footer-standard .site-footer { padding-top: 28px; }
  body.ms-footer-standard .site-footer .footer-grid,
  body.ms-footer-standard .site-footer .footer-bottom { width: min(calc(100% - 28px),1320px); }
  body.ms-footer-standard .site-footer .footer-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 16px; padding-bottom: 26px; }
  body.ms-footer-standard .site-footer .footer-grid h3 { font-size: 13px; margin-bottom: 12px; }
  body.ms-footer-standard .site-footer .footer-grid nav h3 { min-height: calc(2.8em + 12px); }
  body.ms-footer-standard .site-footer .footer-grid a { font-size: 13px; margin-bottom: 5px; }
  body.ms-footer-standard .site-footer .ms-footer-gallery { max-width: 360px; }
  body.ms-footer-standard .site-footer .footer-bottom p { font-size: 11.5px; }
  body.ms-footer-standard .site-footer .footer-bottom .footer-academy-name { font-size: 12px; }
  body.ms-footer-standard .cd-inhouse-sticky { min-height: 0; padding-block: 5px calc(5px + env(safe-area-inset-bottom,0px)); }
  body.ms-footer-standard .cd-inhouse-sticky a { font-size: 11px; line-height: 1.35; font-weight: 600; }
  body.ms-footer-standard .cd-inhouse-sticky .ms-sticky-full-copy { display: none; }
  body.ms-footer-standard .cd-inhouse-sticky .ms-sticky-mobile-copy,
  body.ms-footer-standard .cd-inhouse-sticky .ms-sticky-mobile-copy > span,
  body.ms-footer-standard .cd-inhouse-sticky .ms-sticky-mobile-copy > strong { display: block; }
}
@media (max-width: 300px) {
  body.ms-footer-standard { --ms-footer-sticky-fallback: 65px; }
  body.ms-footer-standard .site-footer .footer-grid { grid-template-columns: minmax(0,1fr); }
  body.ms-footer-standard .site-footer .footer-grid nav h3 { min-height: calc(1.4em + 12px); }
}
@media print {
  body.ms-footer-standard:has(> .cd-inhouse-sticky) .site-footer .ms-footer-copyright-bar { padding-bottom: 0; }
  body.ms-footer-standard .cd-inhouse-sticky { display: none !important; }
}
