:root {
  /* Shared space scale: use these steps for section rhythm and component insets. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 80px;
  --space-10: 96px;
  --space-11: 96px;
  --space-gutter: 64px;
  --space-section-compact: var(--space-8);
  --space-section-default: var(--space-10);
  --space-section-feature: var(--space-11);
  /* Shared type scale: page-specific display faces may opt into a custom size. */
  --size-caption: 10px;
  --size-label: 11px;
  --size-body-sm: 12px;
  --size-body: 14px;
  --size-body-lg: 16px;
  --size-title-sm: 24px;
  --size-title-md: 32px;
  --size-title-lg: 48px;
  --size-display: 68px;
  --leading-tight: .96;
  --leading-heading: 1.12;
  --leading-body: 1.7;
  --page: min(1320px, calc(100vw - (var(--space-gutter) * 2)));
  --shell: min(1320px, calc(100vw - (var(--space-gutter) * 2)));
}

.page-section,
main > section:not(.opening) {
  max-width: none;
}

.opening-inner {
  width: var(--page);
  max-width: none;
}

/* Homepage: one deliberate rhythm from the hero through the final callout. */
.page-thomas-home .brand-story {
  margin-top: var(--space-section-feature);
}

.page-thomas-home .development-path,
.page-thomas-home .ecosystem {
  padding-top: var(--space-section-feature);
  padding-bottom: var(--space-section-feature);
}

.page-thomas-home .capability,
.page-thomas-home .investment,
.page-thomas-home .featured-projects,
.page-thomas-home .news {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

.page-thomas-home .callout {
  padding-top: var(--space-section-compact);
  padding-bottom: var(--space-section-compact);
}

/* Subpages use the homepage's default section interval unless a component
   explicitly needs a compact break. */
.page-bandan .overview-copy {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

.page-bandan .pipeline,
.page-bandan .products,
.page-bandan .plasma-copy,
.page-bandan .vision-media,
.page-bandan .vision-copy,
.page-bandan .partnership {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

.page-bandan .technology-quote {
  padding-top: var(--space-section-compact);
  padding-bottom: var(--space-section-compact);
}

/* Real estate: measured spacing around immersive media and project sections. */
.page-batdongsan .philosophy-media,
.page-batdongsan .philosophy-copy,
.page-batdongsan .segments,
.page-batdongsan .projects,
.page-batdongsan .capability,
.page-batdongsan .contact {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

/* Minerals: consistent pacing through the industrial value chain. */
.page-khoangsan .overview-copy,
.page-khoangsan .pillars,
.page-khoangsan .processing,
.page-khoangsan .products,
.page-khoangsan .partnership {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

/* Petroleum: equal breathing room for pillars, projects, safety and contact. */
.page-xangdau .overview-copy,
.page-xangdau .core-pillars,
.page-xangdau .featured-projects,
.page-xangdau .safety,
.page-xangdau .partnership {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

/* AI and media follow the same default rhythm as the homepage sections. */
.page-aitruyenthong .strategy,
.page-aitruyenthong .ai-content,
.page-aitruyenthong .media-section,
.page-aitruyenthong .applications,
.page-aitruyenthong .contact {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

/* The about page uses its own legacy .section class; bring it into the same
   responsive spacing scale as the homepage and sector subpages. */
.page-gioithieu main > .section {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

/* Legacy ecosystem detail routes share the same default interval as the
   homepage while leaving the full-bleed hero untouched. */
body.page-ecosystem .sector-overview,
body.page-ecosystem .sector-navigation,
body[data-sector-slug] .sector-overview,
body[data-sector-slug] .sector-navigation {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

/* M&A: restrained, boardroom-like rhythm across each strategic module. */
.page-muasapnhap .overview-copy,
.page-muasapnhap .strategies,
.page-muasapnhap .governance-top,
.page-muasapnhap .target-sectors,
.page-muasapnhap .investment-portal {
  padding-top: var(--space-section-default);
  padding-bottom: var(--space-section-default);
}

@media (max-width: 1024px) {
  :root {
    --space-gutter: 32px;
    --space-section-compact: var(--space-7);
    --space-section-default: var(--space-9);
    --space-section-feature: var(--space-10);
    --size-display: 56px;
    --size-title-lg: 44px;
    --page: min(960px, calc(100vw - (var(--space-gutter) * 2)));
    --shell: min(960px, calc(100vw - (var(--space-gutter) * 2)));
  }
}

/* Align the shared wordmark with the homepage's gold "Discovery Group" axis. */
@media (min-width: 981px) {
  body.page-thomas-home > .site-topbar,
  body.dg-shared-shell > .site-topbar {
    padding-left: calc(var(--space-gutter) + 50px) !important;
  }

  body.page-thomas-home > .site-topbar .primary-nav,
  body.dg-shared-shell > .site-topbar .primary-nav {
    left: calc(var(--space-gutter) + 240px) !important;
  }
}

@media (min-width: 621px) and (max-width: 980px) {
  body.page-thomas-home > .site-topbar,
  body.dg-shared-shell > .site-topbar {
    padding-left: var(--space-gutter) !important;
  }
}

@media (max-width: 620px) {
  :root {
    --space-gutter: 24px;
    --space-section-compact: var(--space-7);
    --space-section-default: var(--space-8);
    --space-section-feature: var(--space-8);
    --size-caption: 12px;
    --size-label: 12px;
    --size-body-sm: 12px;
    --size-body: 13px;
    --size-body-lg: 16px;
    --size-title-sm: 20px;
    --size-title-md: 30px;
    --size-title-lg: 36px;
    --size-display: 36px;
    --page: calc(100vw - (var(--space-gutter) * 2));
    --shell: calc(100vw - (var(--space-gutter) * 2));
  }
}

/* Mobile rhythm and reading floor: keep the same 24px frame on every route. */
@media (max-width: 620px) {
  :root {
    --space-section-compact: 48px;
    --space-section-default: 64px;
    --space-section-feature: 64px;
    --page: calc(100vw - 48px);
    --shell: calc(100vw - 48px);
  }

  main > section:not(:first-child) {
    width: calc(100% - 48px) !important;
    max-width: none !important;
  }

  main > section + section {
    margin-top: 0 !important;
  }

  body.page-thomas-home > .site-topbar,
  body.dg-shared-shell > .site-topbar {
    padding-left: 49px !important;
  }

  .splash-sector-row article::after,
  .brand-story-extra-inner::before,
  .investment-sector-name::after,
  .organization-company-list li::before,
  .footer-contact-list span::before,
  .site-footer .footer-contact-list span::before {
    font-size: 11px !important;
  }

}

/* Subpages use a 25% tighter vertical rhythm than the homepage. */
body.dg-shared-shell {
  --space-section-compact: 48px;
  --space-section-default: 72px;
  --space-section-feature: 72px;
}

@media (min-width: 981px) {
  body.dg-shared-shell main > section:not(:first-child) {
    margin-block-start: 80px !important;
  }
}

@media (min-width: 621px) and (max-width: 1024px) {
  body.dg-shared-shell {
    --space-section-compact: 36px;
    --space-section-default: 60px;
    --space-section-feature: 72px;
  }
}

/* Keep section separation intentional when the responsive rhythm tightens. */
@media (min-width: 621px) and (max-width: 980px) {
  body.dg-shared-shell main > section:not(:first-child) {
    margin-block-start: 64px !important;
  }
}

@media (max-width: 620px) {
  body.dg-shared-shell {
    --space-section-compact: 36px;
    --space-section-default: 48px;
    --space-section-feature: 48px;
  }

  body.dg-shared-shell main > section:not(:first-child) {
    margin-top: 40px !important;
    margin-block-start: 40px !important;
  }
}

/* Unified subpage mobile type hierarchy and compact rhythm. */
@media (max-width: 620px) {
  body:not(.page-thomas-home) main > section:first-child h1,
  body:not(.page-thomas-home) main > section:first-child h1 *,
  body.page-ecosystem .sector-hero h1,
  body.page-ecosystem .sector-hero h1 *,
  body[data-sector-slug] .sector-hero h1,
  body[data-sector-slug] .sector-hero h1 * {
    font-size: 36px !important;
    line-height: 1.12 !important;
  }

  body:not(.page-thomas-home) main > section:not(:first-child) h2:not(.sr-only),
  body:not(.page-thomas-home) main > section:not(:first-child) h2:not(.sr-only) *,
  body.page-ecosystem :is(.sector-overview, .sector-navigation) h2,
  body.page-ecosystem :is(.sector-overview, .sector-navigation) h2 *,
  body[data-sector-slug] :is(.sector-overview, .sector-navigation) h2,
  body[data-sector-slug] :is(.sector-overview, .sector-navigation) h2 * {
    font-size: 30px !important;
    line-height: 1.25 !important;
  }

  body:not(.page-thomas-home) main h3,
  body:not(.page-thomas-home) main h3 *,
  body.page-ecosystem main h3,
  body.page-ecosystem main h3 *,
  body[data-sector-slug] main h3,
  body[data-sector-slug] main h3 * {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  body:not(.page-thomas-home) :is(.eyebrow, .section-label, [class*="label"], figcaption, small),
  body.page-ecosystem :is(.eyebrow, [class*="label"], figcaption, small),
  body[data-sector-slug] :is(.eyebrow, [class*="label"], figcaption, small) {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  body:not(.page-thomas-home) [class*="card"] h3,
  body:not(.page-thomas-home) [class*="card"] h3 *,
  body:not(.page-thomas-home) [class*="card"] strong {
    font-size: 20px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
  }

  body:not(.page-thomas-home) [class*="card"] p,
  body.page-ecosystem :is(.sector-pillars, .sector-links) p,
  body[data-sector-slug] :is(.sector-pillars, .sector-links) p {
    line-height: 1.6 !important;
  }

  .culture-values-section .culture-value-card {
    min-height: 88px !important;
    padding: 18px 20px !important;
  }
}

/* About and legacy ecosystem banners also inherit the all-white banner rule. */
:is(
  body.page-gioithieu main > .hero .hero-copy,
  body.page-ecosystem main > .sector-hero .sector-hero-copy,
  body[data-sector-slug] main > .sector-hero .sector-hero-copy
),
:is(
  body.page-gioithieu main > .hero .hero-copy,
  body.page-ecosystem main > .sector-hero .sector-hero-copy,
  body[data-sector-slug] main > .sector-hero .sector-hero-copy
) :is(.eyebrow, .section-label, h1, h1 *, .hero-slogan, .sector-lead) {
  color: #fff !important;
  text-shadow: 0 2px 18px rgba(3, 14, 28, .68) !important;
}

html body.page-gioithieu main > section.hero .hero-copy :is(.section-label, #hero-title, #hero-title *, .hero-slogan),
html body.page-ecosystem main > section.sector-hero .sector-hero-copy :is(.eyebrow, h1, h1 *, .sector-lead),
html body[data-sector-slug] main > section.sector-hero .sector-hero-copy :is(.eyebrow, h1, h1 *, .sector-lead) {
  color: #fff !important;
  text-shadow: 0 2px 18px rgba(3, 14, 28, .68) !important;
}

@media (max-width: 620px) {
  html body.page-gioithieu main > section.hero #hero-title,
  html body.page-gioithieu main > section.hero #hero-title *,
  html body.page-ecosystem main > section.sector-hero h1,
  html body.page-ecosystem main > section.sector-hero h1 *,
  html body[data-sector-slug] main > section.sector-hero h1,
  html body[data-sector-slug] main > section.sector-hero h1 * {
    font-size: 36px !important;
    line-height: 1.12 !important;
  }

  html body.page-gioithieu main > section.hero .hero-slogan,
  html body.page-ecosystem main > section.sector-hero .sector-lead,
  html body[data-sector-slug] main > section.sector-hero .sector-lead {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }
}

/* Header locale controls and site search. */
.site-topbar .language button,
.site-topbar .mobile-language button[data-lang] {
  width: 24px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  line-height: 1;
  filter: saturate(.78);
  opacity: .7;
  transition: opacity .2s ease, filter .2s ease, border-color .2s ease, background-color .2s ease, transform .2s ease;
}

.site-topbar .language,
.site-topbar .mobile-language {
  gap: 8px !important;
}

.site-topbar .language button img,
.site-topbar .mobile-language button[data-lang] img {
  width: 22px;
  height: 15px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(30, 31, 29, .16);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(20, 24, 22, .08);
}

.site-topbar .language button:hover,
.site-topbar .language button:focus-visible,
.site-topbar .language button.is-active,
.site-topbar .mobile-language button[data-lang]:hover,
.site-topbar .mobile-language button[data-lang]:focus-visible,
.site-topbar .mobile-language button[data-lang].is-active {
  background: rgba(183, 149, 82, .12);
  border-color: rgba(183, 149, 82, .38);
  filter: saturate(1);
  opacity: 1;
  transform: translateY(-1px);
}

.site-topbar .language button:focus-visible,
.site-topbar .mobile-language button[data-lang]:focus-visible {
  outline: 2px solid rgba(183, 149, 82, .55);
  outline-offset: 2px;
}

.site-topbar .search-link {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.site-topbar .search-link > span {
  position: relative;
  width: 24px;
  height: 24px;
  display: block;
}

.site-topbar .search-link > span::before {
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
}

.site-topbar .search-link > span::after {
  left: 14px;
  top: 14px;
}

@media (min-width: 981px) {
  body.page-thomas-home > .site-topbar .topbar-tools a,
  body.dg-shared-shell > .site-topbar .topbar-tools a {
    font-size: 8.05px !important;
  }

  body.page-thomas-home > .site-topbar > .language,
  body.dg-shared-shell > .site-topbar > .language {
    position: absolute !important;
    right: calc(clamp(132px, 10.2vw, 146px) + 59px) !important;
    top: 50% !important;
    bottom: auto !important;
    z-index: 4;
    transform: translateY(-50%) !important;
  }

  .site-topbar > .header-search-link {
    position: absolute !important;
    right: clamp(132px, 10.2vw, 146px) !important;
    left: auto !important;
    top: 50% !important;
    bottom: auto !important;
    z-index: 4 !important;
    transform: translateY(-50%) !important;
  }
}

@media (min-width: 1200px) {
  body.page-thomas-home > .site-topbar > .primary-nav,
  body.dg-shared-shell > .site-topbar > .primary-nav {
    right: calc(clamp(245px, 18vw, 270px) + 27px) !important;
  }
}

@media (min-width: 981px) and (max-width: 1199px) {
  body.page-thomas-home > .site-topbar > .primary-nav,
  body.dg-shared-shell > .site-topbar > .primary-nav {
    right: calc(clamp(310px, 23vw, 340px) + 27px) !important;
  }
}

@media (max-width: 980px) {
  .site-topbar > .header-search-link { display: none; }
  .site-topbar .mobile-language {
    display: flex !important;
    align-items: center;
    gap: 8px !important;
  }
  .site-topbar .mobile-language .mobile-search-link {
    position: relative;
    display: grid;
    margin-left: 8px;
  }
}

/* Keep the translation engine functional without exposing its utility UI. */
#dg-google-translate {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body > iframe.skiptranslate,
body > .skiptranslate,
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
.goog-te-balloon-frame,
.VIpgJd-yAWNEb-L7lbkb,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
#goog-gt-tt {
  display: none !important;
}

html.translated-ltr body,
html.translated-rtl body,
html body {
  top: 0 !important;
}

/* Keep the locale marks visually clean; the active state uses opacity only. */
.site-topbar .language,
.site-topbar .mobile-language {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.site-topbar .language button,
.site-topbar .mobile-language button[data-lang],
.site-topbar .language button:hover,
.site-topbar .language button:focus-visible,
.site-topbar .language button.is-active,
.site-topbar .mobile-language button[data-lang]:hover,
.site-topbar .mobile-language button[data-lang]:focus-visible,
.site-topbar .mobile-language button[data-lang].is-active {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.dg-search-open { overflow: hidden !important; }
.dg-search-dialog[hidden] { display: none !important; }
.dg-search-dialog {
  position: fixed;
  z-index: 2500;
  inset: 0;
  display: grid;
  place-items: start center;
  padding: max(80px, 10vh) 24px 32px;
  font-family: "Plus Jakarta Sans", sans-serif;
}
.dg-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 23, 22, .58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.dg-search-panel {
  position: relative;
  width: min(780px, 100%);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: clamp(28px, 4vw, 48px);
  color: #20231f;
  background: #fffdf8;
  border: 1px solid rgba(183, 149, 82, .58);
  box-shadow: 0 34px 90px rgba(13, 20, 18, .28);
}
.dg-search-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.dg-search-heading span { color: #9a741f; font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.dg-search-heading h2 { margin: 8px 0 0; font-family: "Montserrat", sans-serif; font-size: clamp(28px, 4vw, 44px); font-weight: 500; line-height: 1.08; }
.dg-search-heading > button { width: 42px; height: 42px; flex: 0 0 42px; color: #7b5b21; background: transparent; border: 1px solid rgba(183, 149, 82, .55); font-size: 26px; line-height: 1; cursor: pointer; }
.dg-search-form { height: 58px; margin-top: 30px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid #b79552; }
.dg-search-form > span { position: relative; width: 25px; height: 25px; }
.dg-search-form > span::before { content: ""; position: absolute; left: 1px; top: 1px; width: 13px; height: 13px; border: 1.5px solid #76551d; border-radius: 50%; }
.dg-search-form > span::after { content: ""; position: absolute; left: 14px; top: 15px; width: 8px; height: 1.5px; background: #76551d; transform: rotate(45deg); transform-origin: left center; }
.dg-search-form input { min-width: 0; height: 100%; padding: 0 12px; color: #252722; background: transparent; border: 0; outline: 0; font: 14px "Plus Jakarta Sans", sans-serif; }
.dg-search-form button { height: 40px; padding: 0 18px; color: #fff; background: #a77d2d; border: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.dg-search-status { margin: 20px 0 8px; color: #7a776f; font-size: 11.5px; }
.dg-search-results { display: grid; }
.dg-search-results a { min-height: 54px; padding: 12px 2px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 24px; align-items: center; gap: 10px; color: #30322e; border-top: 1px solid rgba(183, 149, 82, .22); text-decoration: none; transition: color .2s ease, padding-left .2s ease; }
.dg-search-results a > span { color: #b28a43; font-size: 11.5px; }
.dg-search-results a > strong { font-size: 13px; font-weight: 500; }
.dg-search-results a > i { color: #a77d2d; font-size: 16px; font-style: normal; text-align: right; }
.dg-search-results a:hover,
.dg-search-results a:focus-visible { padding-left: 8px; color: #8a641f; outline: 0; }

@media (max-width: 620px) {
  .dg-search-dialog { padding: 76px 14px 20px; }
  .dg-search-panel { max-height: calc(100dvh - 96px); padding: 24px 20px 28px; }
  .dg-search-heading h2 { font-size: 28px; }
  .dg-search-form { grid-template-columns: 34px minmax(0, 1fr); }
  .dg-search-form button { display: none; }
}

/* Footer labels use sentence case instead of all caps. */
.footer-contact-list span,
.site-footer .footer-contact-list span {
  letter-spacing: .02em !important;
  text-transform: none !important;
}

.site-footer .footer-contact-list-headquarters p {
  grid-template-columns: minmax(108px, .9fr) minmax(0, 1.1fr) !important;
}

.site-footer .footer-contact-list-headquarters a[href^="tel:"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: .015em;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .site-footer .footer-contact-list-headquarters p {
    grid-template-columns: minmax(112px, .9fr) minmax(0, 1.1fr) !important;
  }
}

@media (min-width: 981px) {
  [data-dg-before-type-floor]::before,
  [data-dg-after-type-floor]::after {
    font-size: 11.5px !important;
  }
}

/* Use the semiconductor overview title as the shared subpage heading rhythm. */
@media (min-width: 821px) {
  body.dg-shared-shell main > section:not(:first-child) h2:not(.sr-only),
  body.dg-shared-shell main > section:not(:first-child) h2:not(.sr-only) * {
    line-height: 1.8 !important;
  }
}

@media (max-width: 820px) {
  body.dg-shared-shell main > section:not(:first-child) h2:not(.sr-only),
  body.dg-shared-shell main > section:not(:first-child) h2:not(.sr-only) * {
    line-height: 2 !important;
  }
}
