/* Shared refinements. Page styles retain the original EACC visual identity. */
html { scroll-padding-top: 100px; }
body.eacc-design[data-shared-layout] :is(a,button,input,select,textarea):focus-visible {
  outline: 3px solid #f5a623 !important;
  outline-offset: 4px !important;
}
body.eacc-design[data-shared-layout] [id] { scroll-margin-top: 100px; }
body.eacc-design[data-shared-layout] .page-content { min-height: 50vh; }
/* The master layout wraps source sections. Keep their dark-surface copy light
   without relying on legacy `main > section` selectors or recoloring white cards. */
body.eacc-design[data-shared-layout] .page-source > .hero > .container > p,
body.eacc-design[data-shared-layout] .page-source > .hero > .container > h2 {
  color: #fff;
}
body.eacc-design[data-shared-layout][data-page-group="language-detail"] .cta-box :is(h2,p),
body.eacc-design[data-shared-layout][data-page-group="exam-prep"] :is(.ielts-cta-card,.oet-cta-card,.pte-cta-card) :is(h2,p),
body.eacc-design[data-shared-layout] .faq-side > :is(h3,p) {
  color: #fff;
}
body.eacc-design[data-shared-layout] .page-content:has(#mindspaceForm) .form-head > :is(h2,p) {
  color: #fff;
}
body.eacc-design[data-shared-layout] .placement-hero .placement-kicker {
  color: #ffd54f;
}
/* Shared inner-page hero background, matching Who We Are. Keep MindSpace's
   specialist background and the homepage's live slideshow independent. */
body.eacc-design[data-shared-layout]:not(.layout-home):not(.layout-wellbeing):not(:has(#mindspaceForm)) .page-content :is(.hero,.page-hero,.course-hero,.contact-hero,.legal-hero,.testing-hero,.placement-hero,.summer-hero,.recruitment-hero) {
  background-color: #0d1457 !important;
  background-image: linear-gradient(135deg, rgba(13,20,87,.94) 0%, rgba(26,35,126,.82) 50%, rgba(13,20,87,.90) 100%), url('/assets/images/home-hero3.png') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}
body.eacc-design[data-shared-layout]:not(.layout-home):not(.layout-wellbeing):not(:has(#mindspaceForm)) .page-content :is(.hero,.page-hero,.course-hero,.contact-hero,.legal-hero,.testing-hero,.placement-hero,.summer-hero,.recruitment-hero)::before {
  background: none !important;
}
body.eacc-design[data-shared-layout] .page-content :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  min-height: 48px;
  max-width: 100%;
}
body.eacc-design[data-shared-layout] .page-content .field { min-width: 0; }
body.eacc-design[data-shared-layout] .form-feedback[hidden] { display: none !important; }

/* Homepage overview: three visible cards share a centered row and button baseline. */
body.eacc-design[data-shared-layout] #home-overview .featured-banner-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch;
  gap: 28px !important;
  width: 100%;
  max-width: 1120px;
  margin-inline: auto !important;
}
body.eacc-design[data-shared-layout] #home-overview .featured-banner-grid > .feature-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  height: 100%;
  min-width: 0;
}
body.eacc-design[data-shared-layout] #home-overview .feature-card-media {
  height: 210px;
  min-height: 210px;
  aspect-ratio: auto;
  flex: 0 0 210px;
}
body.eacc-design[data-shared-layout] #home-overview .feature-card > h3 {
  min-height: 2.8em;
  margin-bottom: 16px;
}
body.eacc-design[data-shared-layout] #home-overview .feature-card > p {
  flex: 1 0 auto;
  margin-bottom: 20px;
}
body.eacc-design[data-shared-layout] #home-overview .service-card-link { margin-top: auto !important; }
@media (min-width: 901px) {
  /* Arabic retains its existing fourth card, so use two balanced rows. */
  html[lang="ar"] body.eacc-design[data-shared-layout] #home-overview .featured-banner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 760px;
  }
}
@media (max-width: 900px) {
  body.eacc-design[data-shared-layout] #home-overview .featured-banner-grid {
    grid-template-columns: 1fr !important;
    max-width: 420px;
    gap: 24px !important;
  }
  body.eacc-design[data-shared-layout] #home-overview .feature-card > h3 { min-height: 0; }
}

/* Keep the original transparent/dark header and its scrolled treatment. */
body.eacc-design[data-shared-layout] .site-header .dropdown { display: flex; align-items: center; position: relative; gap: 2px; }
body.eacc-design[data-shared-layout] .site-header .dropdown > a i,
body.eacc-design[data-shared-layout] .site-header .dropdown > a::after { display: none !important; }
body.eacc-design[data-shared-layout] .nav-submenu-toggle {
  flex: 0 0 22px; width: 22px; height: 36px; padding: 0;
  display: inline-grid; place-items: center; border: 0; border-radius: 6px;
  background: transparent; color: #fff; cursor: pointer;
}
body.eacc-design[data-shared-layout] .site-header.scrolled .nav-submenu-toggle { color: #0d1457; }
body.eacc-design[data-shared-layout] .nav-submenu-toggle svg { transition: transform .2s ease; }
body.eacc-design[data-shared-layout] .nav-submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
body.eacc-design[data-shared-layout] .dropdown.open > .dropdown-menu { opacity: 1 !important; visibility: visible !important; transform: translateY(0) !important; }
body.eacc-design[data-shared-layout] .site-header .mobile-toggle { display: none !important; }

/* Restore the original photographic slideshow, including mobile. */
body.eacc-design[data-shared-layout] .hero:has(.hero-slider) { background: #0d1457 !important; }
body.eacc-design[data-shared-layout] .hero-slider { display: block !important; }
body.eacc-design[data-shared-layout] .hero-slider .slide { display: block !important; opacity: 0 !important; transition: opacity 1.2s ease !important; }
body.eacc-design[data-shared-layout] .hero-slider .slide.active { opacity: 1 !important; }
body.eacc-design[data-shared-layout] .hero-controls { display: flex !important; gap: 4px; bottom: 18px; }
body.eacc-design[data-shared-layout] .hero-controls .hero-dot {
  display: grid; place-items: center; width: 28px !important; height: 28px !important;
  padding: 0 !important; border: 0; border-radius: 50%; background: transparent !important; cursor: pointer;
}
body.eacc-design[data-shared-layout] .hero-controls .hero-dot::before { content: ''; display: block; width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.65); }
body.eacc-design[data-shared-layout] .hero-controls .hero-dot.active::before { background: #f5a623; }

@media (max-width: 1199px) {
  body.eacc-design[data-shared-layout] .site-header .navbar { height: 78px !important; }
  body.eacc-design[data-shared-layout] .site-header .mobile-toggle {
    display: flex !important; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px !important; padding: 0 !important; width: 44px !important; height: 44px !important;
  }
  body.eacc-design[data-shared-layout] .site-header .mobile-toggle-line { width: 20px !important; height: 2px !important; flex: 0 0 2px; margin: 0 !important; }
  body.eacc-design[data-shared-layout] .site-header .nav-links {
    position: fixed !important; top: 84px !important; inset-inline: 16px !important;
    width: calc(100% - 32px) !important; height: auto !important; max-height: calc(100dvh - 100px) !important;
    flex-direction: column !important; align-items: stretch !important; gap: 0 !important;
    padding: 16px !important; overflow-y: auto !important; overflow-x: hidden !important;
    background: #fff !important; border: 1px solid #e4e7f0 !important; border-radius: 20px !important;
    box-shadow: 0 18px 50px rgba(13,20,87,.18) !important; transform: none !important;
  }
  body.eacc-design[data-shared-layout].navigation-ready .site-header .nav-links:not(.active) { display: none !important; }
  body.eacc-design[data-shared-layout] .site-header .nav-links.active { display: flex !important; }
  body.eacc-design[data-shared-layout] .site-header .nav-links::before { display: none !important; }
  body.eacc-design[data-shared-layout] .site-header .nav-links > a,
  body.eacc-design[data-shared-layout] .site-header .dropdown > a { color: #0d1457 !important; padding: 14px 10px !important; min-height: 48px; white-space: normal; }
  body.eacc-design[data-shared-layout] .site-header .dropdown { display: grid !important; grid-template-columns: minmax(0,1fr) 44px; gap: 0; }
  body.eacc-design[data-shared-layout] .nav-submenu-toggle { width: 44px; min-height: 44px; color: #0d1457 !important; }
  body.eacc-design[data-shared-layout] .site-header .dropdown-menu {
    display: none !important; position: static !important; grid-column: 1/-1;
    width: 100% !important; min-width: 0 !important; margin: 0 0 12px !important;
    padding: 4px 10px !important; background: #f5f6fc !important; border: 0 !important;
    border-radius: 12px !important; box-shadow: none !important;
  }
  body.eacc-design[data-shared-layout] .site-header .dropdown.open > .dropdown-menu { display: block !important; }
  body.eacc-design[data-shared-layout] .site-header .dropdown-menu a { color: #0d1457 !important; white-space: normal; }
  body.eacc-design[data-shared-layout] .site-header .nav-cta-group { width: 100%; }
  body.eacc-design[data-shared-layout] .site-header .nav-lms { color: #0d1457 !important; }
}
@media (max-width: 480px) {
  body.eacc-design[data-shared-layout] .page-content :is(.form-grid,form .grid) { grid-template-columns: 1fr !important; }
  body.eacc-design[data-shared-layout] .page-content .field.full { grid-column: 1/-1; }
}
@media (prefers-reduced-motion: reduce) {
  body.eacc-design[data-shared-layout] .hero-slider .slide { transition: none !important; }
}

/* Homepage rhythm: preserve each section's background, imagery, and typography. */
body.eacc-design[data-shared-layout].layout-home .page-source > section:not(.hero) {
  padding-block: clamp(64px, 5vw, 92px) !important;
}
body.eacc-design[data-shared-layout].layout-home .section-title {
  max-width: 880px;
  margin-inline: auto;
  margin-bottom: 36px !important;
}
body.eacc-design[data-shared-layout].layout-home .section-title > p {
  max-width: 72ch;
  margin-inline: auto;
}
body.eacc-design[data-shared-layout].layout-home .positioning-line {
  max-width: 1060px;
  margin-inline: auto !important;
  text-align: center;
  text-wrap: balance;
}
body.eacc-design[data-shared-layout].layout-home .post-feature-trust-summary {
  max-width: 1120px;
  margin-inline: auto !important;
  margin-top: 32px !important;
  line-height: 1.8;
}
body.eacc-design[data-shared-layout].layout-home :is(.approved-service-grid,.features-grid,.story-grid) {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto !important;
  gap: 24px !important;
  align-items: stretch;
}
body.eacc-design[data-shared-layout].layout-home :is(.approved-service-grid,.story-grid) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
body.eacc-design[data-shared-layout].layout-home :is(.approved-service-grid,.story-grid) > .feature-card {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
body.eacc-design[data-shared-layout].layout-home .approved-service-grid .feature-card-media {
  height: 210px;
  min-height: 210px;
  flex: 0 0 210px;
  aspect-ratio: auto;
}
body.eacc-design[data-shared-layout].layout-home .approved-service-grid .feature-card > h3 { min-height: 2.8em; }
body.eacc-design[data-shared-layout].layout-home .approved-service-grid .feature-card > p { flex: 1 0 auto; }
body.eacc-design[data-shared-layout].layout-home .approved-service-grid .service-card-link { margin-top: auto !important; }

/* Shared rows align titles and descriptions without truncating longer wording. */
@supports (grid-template-rows: subgrid) {
  body.eacc-design[data-shared-layout].layout-home .approved-service-grid > .feature-card {
    display: grid !important;
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: 18px;
  }
  body.eacc-design[data-shared-layout].layout-home .approved-service-grid .feature-card-media { margin-bottom: 0 !important; }
  body.eacc-design[data-shared-layout].layout-home .approved-service-grid .feature-card > :is(h3,p) { min-height: 0; margin-block: 0 !important; }
}
body.eacc-design[data-shared-layout].layout-home #about .features-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
body.eacc-design[data-shared-layout].layout-home #about .feature-card { height: 100%; }
body.eacc-design[data-shared-layout].layout-home #about .feature-media {
  width: 148px !important;
  height: 148px !important;
  flex: 0 0 148px;
  margin: 0 auto 22px !important;
}
body.eacc-design[data-shared-layout].layout-home #about .feature-media img[src*="mindspace"] { object-fit: contain; }
body.eacc-design[data-shared-layout].layout-home #about .feature-card > h3 { min-height: 2.6em; }
body.eacc-design[data-shared-layout].layout-home .story-grid .feature-card { padding: 28px !important; }
body.eacc-design[data-shared-layout].layout-home .story-grid .feature-card > h3 { min-height: 2.6em; }
body.eacc-design[data-shared-layout].layout-home .story-grid .feature-card > p { margin-bottom: 0; }

body.eacc-design[data-shared-layout].layout-home #partners .partner-logo-grid {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 22px !important;
  max-width: 1120px;
  margin-inline: auto;
}
body.eacc-design[data-shared-layout].layout-home #partners .partner-logo-card {
  flex: 0 1 250px;
  min-height: 220px;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
}
body.eacc-design[data-shared-layout].layout-home #partners .partner-logo-card > img {
  width: 100%;
  height: 76px;
  min-height: 76px;
  max-height: 76px;
  object-fit: contain;
  margin-bottom: 14px;
}
body.eacc-design[data-shared-layout].layout-home #partners .partner-logo-card > small {
  margin-top: auto;
  padding-top: 12px;
  min-height: 3em;
  line-height: 1.5;
}
body.eacc-design[data-shared-layout].layout-home .section-action { margin-top: 32px; text-align: center; }
body.eacc-design[data-shared-layout].layout-home .cta-box {
  max-width: 1120px;
  margin-inline: auto;
  padding: clamp(32px, 5vw, 64px) !important;
}
body.eacc-design[data-shared-layout].layout-home .cta-box > :is(h2,p) { max-width: 76ch; margin-inline: auto; }
body.eacc-design[data-shared-layout].layout-home .cta-box .hero-buttons {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center !important;
  gap: 14px !important;
  margin: 28px auto 0 !important;
  max-width: 100%;
}
body.eacc-design[data-shared-layout].layout-home .cta-box > p:last-child { margin-top: 22px; margin-bottom: 0; }

/* Matching refinements for existing service/course components. */
body.eacc-design[data-shared-layout]:is(.layout-course,.layout-service,.layout-wellbeing) .page-source > section:not(:is(.hero,.course-hero,.page-hero,.mind-hero,.testing-hero,.psych-hero,.placement-hero)) {
  padding-block: clamp(56px, 5vw, 88px) !important;
}
body.eacc-design[data-shared-layout]:is(.layout-course,.layout-service,.layout-wellbeing) :is(.card-grid,.cards-grid,.services-grid,.why-grid,.levels-grid) {
  gap: 24px !important;
  align-items: stretch;
}
body.eacc-design[data-shared-layout]:is(.layout-course,.layout-service,.layout-wellbeing) :is(.card-grid,.cards-grid,.services-grid,.why-grid,.levels-grid) > :is(article,.card) {
  min-width: 0;
  height: 100%;
}
body.eacc-design[data-shared-layout].layout-course .card-grid:has(> :nth-child(4):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  max-width: 960px;
  margin-inline: auto;
}
body.eacc-design[data-shared-layout].layout-course .image-stack > img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
body.eacc-design[data-shared-layout].layout-course .image-stack > img[src*="/partners/"] { object-fit: contain; }

/* Keep the existing form design; standardize its field and action spacing. */
body.eacc-design[data-shared-layout].layout-form .page-source > .hero {
  min-height: 0 !important;
  height: auto !important;
  padding-block: 130px 54px !important;
}
body.eacc-design[data-shared-layout].layout-form .page-source > .form-section { padding-block: 56px !important; }
body.eacc-design[data-shared-layout]:is(.layout-form,.layout-application,.layout-contact) :is(.form-grid,form .grid) {
  gap: 22px !important;
  align-items: start;
}
body.eacc-design[data-shared-layout]:is(.layout-form,.layout-application,.layout-contact) .field > label {
  display: block;
  margin-bottom: 8px;
  line-height: 1.6;
}
body.eacc-design[data-shared-layout].layout-form .form-shell { max-width: 820px; margin-inline: auto; }
body.eacc-design[data-shared-layout].layout-form .form-head { padding: 28px 32px !important; }
body.eacc-design[data-shared-layout].layout-form .form-body { padding: 32px !important; }
body.eacc-design[data-shared-layout].layout-form .form-head > p { margin-bottom: 0; }
body.eacc-design[data-shared-layout].layout-form .form-body .actions { margin-top: 26px; }
body.eacc-design[data-shared-layout].layout-form .form-body button[type="submit"] { min-height: 50px; }
body.eacc-design[data-shared-layout] .site-footer .footer-grid { align-items: start; }

@media (max-width: 1100px) {
  body.eacc-design[data-shared-layout].layout-home :is(.approved-service-grid,#about .features-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 768px) {
  body.eacc-design[data-shared-layout].layout-home .hero .hero-content { display: flex; flex-direction: column; }
  body.eacc-design[data-shared-layout].layout-home .hero-title-block { order: 0; }
  body.eacc-design[data-shared-layout].layout-home .hero .hero-buttons { order: 1; margin: 8px auto 24px !important; }
  body.eacc-design[data-shared-layout].layout-home .hero-overview-summary { order: 2; }
  body.eacc-design[data-shared-layout].layout-home .hero { padding-bottom: 78px !important; }
  body.eacc-design[data-shared-layout].layout-home .page-source > section:not(.hero) { padding-block: 56px !important; }
  body.eacc-design[data-shared-layout].layout-home #partners .partner-logo-card { flex-basis: calc(50% - 11px); max-width: none; min-width: 0; }
  body.eacc-design[data-shared-layout].layout-form :is(.form-head,.form-body) { padding: 24px !important; }
  body.eacc-design[data-shared-layout].layout-form .page-source > .hero { padding-block: 116px 42px !important; }
}
@media (max-width: 600px) {
  body.eacc-design[data-shared-layout].layout-home :is(.approved-service-grid,#about .features-grid,.story-grid) {
    grid-template-columns: 1fr !important;
    max-width: 420px;
  }
  body.eacc-design[data-shared-layout].layout-home #about .feature-card > h3,
  body.eacc-design[data-shared-layout].layout-home .story-grid .feature-card > h3 { min-height: 0; }
  body.eacc-design[data-shared-layout].layout-home .cta-box .hero-buttons > a { width: 100%; max-width: 340px; }
  body.eacc-design[data-shared-layout].layout-home #partners .partner-logo-card { flex-basis: 100%; max-width: 360px; }
  body.eacc-design[data-shared-layout].layout-course .card-grid:has(> :nth-child(4):last-child) { grid-template-columns: 1fr !important; }
}
