/*
 * TBAY — mobile-all-pages-fix.css
 *
 * Scope: responsive layout only. This file does not replace or remove
 * the existing page content or desktop artwork.
 *
 * Coverage:
 *   - Tổng quan hero image restoration + mobile layout
 *   - Dịch vụ cards: 2 columns on mobile
 *   - Du học/country cards: 2 columns on mobile where appropriate
 *   - Overview destination cards: 2 columns on mobile
 *   - Site footer compaction on mobile
 *   - Mobile navigation isolation so submenu text cannot overlap siblings
 */

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* =========================================================
   1) TỔNG QUAN — RESTORE THEME BANNER IMAGE
   The PHP template provides --overview-hero-image inline on
   .overview-news-style-hero. Use that value as the actual background.
   ========================================================= */
body[data-current-route^="/tong-quan/"] .overview-news-style-hero {
  position: relative !important;
  overflow: hidden !important;
  width: 100% !important;
  min-height: 500px !important;
  height: 500px !important;
  max-height: 500px !important;
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  isolation: isolate !important;
  background-color: #123e5c !important;
  background-image: var(--overview-hero-image) !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: center center !important;
}

body[data-current-route^="/tong-quan/"] .overview-news-style-hero::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background:
    linear-gradient(180deg, rgba(4, 28, 46, 0.28), rgba(4, 28, 46, 0.62)),
    linear-gradient(
      90deg,
      rgba(7, 42, 64, 0.48),
      rgba(7, 42, 64, 0.12),
      rgba(7, 42, 64, 0.4)
    ) !important;
}

body[data-current-route^="/tong-quan/"] .overview-news-style-hero > .container {
  position: relative !important;
  z-index: 1 !important;
  width: min(1080px, calc(100% - 48px)) !important;
  max-width: 1080px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

body[data-current-route^="/tong-quan/"] .overview-news-style-hero .eyebrow {
  margin: 0 0 10px !important;
  padding: 0 !important;
  color: #8de5db !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 900 !important;
  letter-spacing: 0.1em !important;
}

body[data-current-route^="/tong-quan/"] .overview-news-style-hero h1 {
  margin: 0 !important;
  max-width: 100% !important;
  color: #fff !important;
  font-size: clamp(2.35rem, 4.2vw, 3.75rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.035em !important;
  text-align: left !important;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.34) !important;
}

body[data-current-route^="/tong-quan/"]
  .overview-news-style-hero
  > .container
  > p:last-child {
  max-width: 760px !important;
  margin: 14px 0 0 !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 1rem !important;
  line-height: 1.7 !important;
  text-align: left !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.24) !important;
}

/* =========================================================
   2) DỊCH VỤ — 2 CARDS PER ROW ON MOBILE
   ========================================================= */
@media (max-width: 820px) {
  body[data-current-route^="/dich-vu/"] .service-card-grid-v54,
  body[data-current-route^="/dich-vu/"] .service-feature-grid-v55,
  body[data-current-route="/trang-chu"] .visa-service-grid-rich,
  body[data-current-route="/trang-chu"] .tbay-service-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  /* Keep service hero image visible and usable at tablet/mobile sizes. */
  body[data-current-route^="/dich-vu/"] .service-page-v54 .service-hero-v54 {
    height: 440px !important;
    min-height: 440px !important;
    max-height: 440px !important;
  }

  body[data-current-route^="/dich-vu/"]
    .service-page-v54
    .service-hero-media-v54
    img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

@media (max-width: 560px) {
  body[data-current-route^="/dich-vu/"] .service-card-grid-v54,
  body[data-current-route^="/dich-vu/"] .service-feature-grid-v55,
  body[data-current-route="/trang-chu"] .visa-service-grid-rich,
  body[data-current-route="/trang-chu"] .tbay-service-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body[data-current-route^="/dich-vu/"] .service-card-v54,
  body[data-current-route^="/dich-vu/"] .service-feature-card-v55 {
    min-width: 0 !important;
    padding: 15px !important;
  }

  body[data-current-route^="/dich-vu/"] .service-card-v54 h3,
  body[data-current-route^="/dich-vu/"] .service-feature-card-v55 h3 {
    font-size: 0.96rem !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere !important;
  }

  body[data-current-route^="/dich-vu/"] .service-card-v54 p,
  body[data-current-route^="/dich-vu/"] .service-feature-card-v55 p {
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere !important;
  }
}

/* =========================================================
   3) DU HỌC — 2 COUNTRY CARDS PER ROW ON MOBILE
   Applies to home destinations, country indexes and overview cards.
   ========================================================= */
@media (max-width: 820px) {
  body[data-current-route="/trang-chu"] .home-destination-grid,
  body[data-current-route="/trang-chu"] .country-grid-home,
  body[data-current-route^="/du-hoc/"] .country-grid,
  body[data-current-route^="/du-hoc/"] .country-grid-full,
  body[data-current-route^="/tong-quan/"] .intro-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body[data-current-route="/trang-chu"]
    .home-destination-grid
    .destination-card,
  body[data-current-route^="/du-hoc/"] .country-grid .country-card,
  body[data-current-route^="/du-hoc/"] .country-grid-full .country-card,
  body[data-current-route^="/tong-quan/"]
    .intro-review-grid
    .intro-review-card {
    min-width: 0 !important;
  }
}

@media (max-width: 560px) {
  body[data-current-route="/trang-chu"] .home-destination-grid,
  body[data-current-route="/trang-chu"] .country-grid-home,
  body[data-current-route^="/du-hoc/"] .country-grid,
  body[data-current-route^="/du-hoc/"] .country-grid-full,
  body[data-current-route^="/tong-quan/"] .intro-review-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body[data-current-route="/trang-chu"]
    .home-destination-grid
    .country-card
    img,
  body[data-current-route="/trang-chu"]
    .home-destination-grid
    .destination-card
    > a
    > img {
    height: 150px !important;
  }

  body[data-current-route^="/du-hoc/"] .country-grid .country-card img,
  body[data-current-route^="/du-hoc/"] .country-grid-full .country-card img {
    height: 150px !important;
  }

  body[data-current-route^="/du-hoc/"] .country-grid .country-card-body,
  body[data-current-route^="/du-hoc/"] .country-grid-full .country-card-body {
    padding: 12px !important;
  }

  body[data-current-route^="/du-hoc/"] .country-grid .country-card-body h2,
  body[data-current-route^="/du-hoc/"] .country-grid .country-card-body h3,
  body[data-current-route^="/du-hoc/"] .country-grid-full .country-card-body h2,
  body[data-current-route^="/du-hoc/"]
    .country-grid-full
    .country-card-body
    h3 {
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
  }

  body[data-current-route^="/du-hoc/"] .country-grid .country-card-body p,
  body[data-current-route^="/du-hoc/"] .country-grid-full .country-card-body p {
    font-size: 0.78rem !important;
    line-height: 1.5 !important;
  }
}

/* =========================================================
   4) TỔNG QUAN — 2-COLUMN PHOTO CARDS ON MOBILE
   ========================================================= */
@media (max-width: 560px) {
  body[data-current-route^="/tong-quan/"] .intro-review-image {
    min-height: 0 !important;
    height: auto !important;
  }

  body[data-current-route^="/tong-quan/"] .intro-review-image img {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
    object-fit: cover !important;
  }

  body[data-current-route^="/tong-quan/"] .intro-review-content {
    padding: 11px !important;
  }

  body[data-current-route^="/tong-quan/"] .intro-review-content h3 {
    font-size: 0.94rem !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere !important;
  }

  body[data-current-route^="/tong-quan/"] .intro-review-content p {
    font-size: 0.78rem !important;
    line-height: 1.45 !important;
  }
}

/* =========================================================
   5) MOBILE NAVIGATION — isolate each dropdown
   ========================================================= */
@media (max-width: 860px) {
  #primary-navigation {
    overflow-x: hidden !important;
  }

  #primary-navigation > ul,
  #primary-navigation > ul > li,
  #primary-navigation .has-dropdown {
    width: 100% !important;
    min-width: 0 !important;
  }

  #primary-navigation > ul > li > a,
  #primary-navigation > ul > li > .dropdown-toggle,
  #primary-navigation .dropdown-menu a {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  #primary-navigation .dropdown-menu {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 2px 0 8px 0 !important;
    padding: 2px 0 2px 10px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }
}

/* =========================================================
   6) FOOTER — COMPACT MOBILE LAYOUT
   ========================================================= */
@media (max-width: 700px) {
  body .site-footer-v49 {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  body .site-footer-v49 > .container.footer-main-v49,
  body .site-footer-v49 > .container.footer-bottom-v49 {
    width: calc(100% - 28px) !important;
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .site-footer-v49 .footer-main-v49 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px 18px !important;
  }

  .site-footer-v49 .footer-brand-v49,
  .site-footer-v49 .footer-contact-v49 {
    grid-column: 1 / -1 !important;
  }

  .site-footer-v49 h2 {
    font-size: 0.95rem !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
  }

  .site-footer-v49 p,
  .site-footer-v49 li,
  .site-footer-v49 a,
  .site-footer-v49 address,
  .site-footer-v49 strong,
  .site-footer-v49 span {
    overflow-wrap: anywhere !important;
  }

  .site-footer-v49 > .container.footer-bottom-v49 {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    padding-top: 14px !important;
    padding-bottom: 72px !important;
  }
}

@media (max-width: 420px) {
  .site-footer-v49 .footer-main-v49 {
    gap: 16px 12px !important;
  }
}

/* =========================================================
   7) BANNER SIZES — same visual language across mobile pages
   ========================================================= */
@media (max-width: 820px) {
  body[data-current-route^="/tong-quan/"] .overview-news-style-hero {
    min-height: 440px !important;
    height: 440px !important;
    max-height: 440px !important;
  }

  body[data-current-route^="/tong-quan/"]
    .overview-news-style-hero
    > .container {
    width: calc(100% - 32px) !important;
  }

  body[data-current-route^="/tong-quan/"] .overview-news-style-hero h1 {
    font-size: clamp(2rem, 7vw, 3rem) !important;
    line-height: 1.08 !important;
  }

  body[data-current-route^="/tong-quan/"]
    .overview-news-style-hero
    > .container
    > p:last-child {
    font-size: 0.92rem !important;
  }
}

@media (max-width: 520px) {
  body[data-current-route^="/tong-quan/"] .overview-news-style-hero {
    min-height: 400px !important;
    height: 400px !important;
    max-height: 400px !important;
  }

  body[data-current-route^="/tong-quan/"]
    .overview-news-style-hero
    > .container {
    width: calc(100% - 24px) !important;
  }

  body[data-current-route^="/tong-quan/"] .overview-news-style-hero h1 {
    font-size: clamp(1.65rem, 7.5vw, 2.2rem) !important;
  }

  body[data-current-route^="/tong-quan/"]
    .overview-news-style-hero
    > .container
    > p:last-child {
    font-size: 0.84rem !important;
    line-height: 1.55 !important;
  }
}

/* =========================================================
   SHARED FULL-WIDTH HERO — dịch vụ, tin tức, hình ảnh, liên hệ
   Matches the Overview banner: image behind copy + navy overlay.
   ========================================================= */
.page-hero.overview-news-style-hero {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  height: 500px !important;
  min-height: 500px !important;
  max-height: 500px !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: #123e5c !important;
  background-image: var(--overview-hero-image) !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: center center !important;
}
.page-hero.overview-news-style-hero::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none !important;
  background: linear-gradient(180deg, rgba(4,28,46,.28), rgba(4,28,46,.62)),
    linear-gradient(90deg, rgba(7,42,64,.58), rgba(7,42,64,.16), rgba(7,42,64,.38)) !important;
}
.page-hero.overview-news-style-hero > .container {
  position: relative !important;
  z-index: 1 !important;
  width: min(1080px, calc(100% - 48px)) !important;
  max-width: 1080px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}
.page-hero.overview-news-style-hero .eyebrow {
  margin: 0 0 10px !important;
  padding: 0 !important;
  color: #8de5db !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-weight: 900 !important;
  letter-spacing: .1em !important;
}
.page-hero.overview-news-style-hero h1 {
  max-width: 100% !important;
  margin: 0 !important;
  color: #fff !important;
  font-size: clamp(2.35rem, 4.2vw, 3.75rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -.035em !important;
  text-align: left !important;
  text-shadow: 0 3px 18px rgba(0,0,0,.34) !important;
}
.page-hero.overview-news-style-hero > .container > p:last-of-type {
  max-width: 760px !important;
  margin: 14px 0 0 !important;
  color: rgba(255,255,255,.9) !important;
  font-size: 1rem !important;
  line-height: 1.7 !important;
  text-align: left !important;
  text-shadow: 0 2px 12px rgba(0,0,0,.24) !important;
}
/* Remove the old split-photo layout; the same topic-matched image is now the hero background. */
.service-unified-hero .service-hero-copy-v54,
.contact-unified-hero .contact-hero-grid-v32,
.contact-unified-hero figure { display: block !important; }
.service-unified-hero .service-hero-copy-v54 { width: 100% !important; max-width: 760px !important; margin: 0 !important; padding: 0 !important; }
.service-unified-hero .service-hero-lead-v54 { color: rgba(255,255,255,.9) !important; }
.service-unified-hero .btn { margin-top: 20px !important; }
.contact-unified-hero .contact-hero-points { display: flex !important; flex-wrap: wrap !important; gap: 12px 22px !important; margin-top: 22px !important; color: #fff !important; }
.contact-unified-hero .contact-hero-points span { color: #fff !important; }
@media (max-width: 820px) {
  .page-hero.overview-news-style-hero { height: 440px !important; min-height: 440px !important; max-height: 440px !important; }
  .page-hero.overview-news-style-hero > .container { width: calc(100% - 32px) !important; }
  .page-hero.overview-news-style-hero h1 { font-size: clamp(2rem, 7vw, 3rem) !important; }
  .page-hero.overview-news-style-hero > .container > p:last-of-type { font-size: .92rem !important; }
}
@media (max-width: 520px) {
  .page-hero.overview-news-style-hero { height: 400px !important; min-height: 400px !important; max-height: 400px !important; }
  .page-hero.overview-news-style-hero > .container { width: calc(100% - 24px) !important; }
  .page-hero.overview-news-style-hero h1 { font-size: clamp(1.65rem, 7.5vw, 2.2rem) !important; }
  .page-hero.overview-news-style-hero > .container > p:last-of-type { font-size: .84rem !important; line-height: 1.55 !important; }
  .contact-unified-hero .contact-hero-points { gap: 8px 14px !important; font-size: .82rem !important; }
}

