/* Immigration & Visas: match the homepage type scale, CTA system and the
   Tax & Corporate Services hero rhythm without changing CMS page content. */
:is(.identity-directory-page, .identity-country-page, .identity-detail) {
  --identity-display: 48px;
  --identity-section: 34px;
  --identity-title: 22px;
  --identity-lead: 16px;
  --identity-body: 14px;
  --identity-meta: 12px;
}

/* Shared six-level typography hierarchy. */
:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.formation-hero, .country-formation-hero, .service-hero) h1 {
  font-size: var(--identity-display) !important;
  line-height: 1.1 !important;
  letter-spacing: -.035em !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.gb-registration-intro, .section-intro-grid, .country-formation-heading, .country-formation-copy, .service-heading, .service-intro, .page-cta-inner) h2 {
  font-size: var(--identity-section) !important;
  line-height: 1.18 !important;
  letter-spacing: -.025em !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.gb-country-card, .related-grid, .identity-route-directory, .identity-evidence-grid, .country-formation-process, .country-formation-section, .service-section) h3 {
  font-size: var(--identity-title) !important;
  line-height: 1.3 !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.formation-hero-copy, .country-formation-hero-copy, .service-hero-copy) > p:not(.eyebrow):not(.service-label):not(.country-formation-kicker) {
  font-size: var(--identity-lead) !important;
  line-height: 1.75 !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(p, li, td, .identity-longform-copy) {
  font-size: var(--identity-body);
  line-height: 1.75;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.eyebrow, small, .page-breadcrumb, .country-formation-kicker, .service-label, .identity-route-tags span) {
  font-size: var(--identity-meta) !important;
  line-height: 1.5 !important;
}

/* Overview hero: exact Tax & Corporate full-bleed construction. */
.identity-directory-page .formation-hero {
  display: flex;
  position: relative;
  height: 540px;
  min-height: 540px;
  align-items: center;
  overflow: hidden;
  padding: 0;
  background-color: #06264d;
  background-image: url("../images/hero-citizenship-passport-v2.jpg");
  background-position: center 52%;
  background-size: cover;
  color: #fff;
  isolation: isolate;
}

.identity-directory-page .formation-hero::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 1;
  background: linear-gradient(90deg, rgba(5,37,72,.91) 0%, rgba(7,49,88,.78) 46%, rgba(7,51,90,.24) 74%, rgba(7,51,90,.05) 100%);
  mask-image: none;
  pointer-events: none;
}

.identity-directory-page .formation-hero::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
  pointer-events: none;
}

.identity-directory-page .formation-hero > .shell {
  position: relative;
  z-index: 2;
  width: var(--shell);
  height: 433px;
  padding-top: 32px;
  padding-bottom: 44px;
}

body.identity-directory-page main .formation-breadcrumb {
  margin-bottom: 28px;
  color: rgba(255,255,255,.78);
  line-height: 1.65 !important;
}

.identity-directory-page .formation-breadcrumb a { color: #fff; }
.identity-directory-page .formation-hero-grid { position: static; display: block; }
.identity-directory-page .formation-hero-copy { position: relative; z-index: 2; max-width: 780px; }
.identity-directory-page .formation-hero-copy .eyebrow {
  margin-bottom: 24px;
  color: #e4bd72;
  font-size: 11px !important;
  line-height: 1.5 !important;
  letter-spacing: .14em;
}
.identity-directory-page .formation-hero-copy h1 { max-width: 780px; color: #fff; }
body.identity-directory-page main .formation-hero .formation-hero-copy > p:not(.eyebrow) {
  max-width: 650px;
  margin: 20px 0 24px;
  color: #d8e3ee;
  line-height: 1.85 !important;
}

.identity-directory-page .formation-hero-media {
  display: none !important;
}

.identity-directory-page main .formation-hero-copy h1 {
  font-size: var(--identity-display) !important;
  font-weight: 500;
  letter-spacing: -.045em !important;
  line-height: 1.06 !important;
}

.identity-directory-page main .formation-hero-copy h1 span { color: #d9b366; }

.identity-directory-page main .formation-hero-copy h1 > span {
  display: block;
  max-width: 680px;
  margin-top: 8px;
  color: #e3bd71;
  font-family: var(--site-font-serif);
  font-size: var(--identity-title) !important;
  font-weight: 600;
  letter-spacing: -.01em !important;
  line-height: 1.3 !important;
}

/* Both directory mastheads use one canonical title pair. */
body.identity-directory-page main:is(.citizenship-investment-page, .residency-investment-page)
  .formation-hero-copy > h1.identity-hero-statement {
  margin: 0;
  font-family: var(--site-font-serif);
  font-size: var(--site-type-display) !important;
  font-weight: 500;
  letter-spacing: -.035em !important;
  line-height: 1.1 !important;
}

body.identity-directory-page main:is(.citizenship-investment-page, .residency-investment-page)
  .formation-hero-copy > h1.identity-hero-statement > .identity-hero-tagline {
  display: block;
  max-width: 780px;
  margin-top: 0;
  font-family: var(--site-font-serif);
  font-size: var(--site-type-display) !important;
  font-weight: 500;
  letter-spacing: -.035em !important;
  line-height: inherit !important;
}

body.identity-directory-page main.residency-investment-page > .formation-hero {
  background-image: url("../images/hero-residency-lifestyle-v2.jpg");
  background-position: center 50%;
}

body.identity-directory-page main.residency-investment-page > .formation-hero::before {
  background: linear-gradient(90deg, rgba(8,46,80,.88) 0%, rgba(12,66,103,.72) 46%, rgba(14,77,111,.19) 74%, rgba(14,77,111,.03) 100%);
}

/* Overview content typography follows the Tax & Corporate hierarchy. */
.identity-directory-page main
  :is(.gb-registration-intro, .section-intro-grid, .page-cta-inner) h2 {
  font-size: var(--identity-section) !important;
  font-weight: 500;
  letter-spacing: -.03em !important;
  line-height: 1.12 !important;
}

.identity-directory-page main .gb-country-card h3 {
  font-size: var(--identity-title) !important;
  line-height: 1.15 !important;
}

.identity-directory-page main .related-grid h3 {
  font-size: var(--identity-title) !important;
  line-height: 1.18 !important;
}

/* Country and service detail heroes share the same desktop height. */
.identity-country-page .country-formation-hero,
.identity-country-page .country-formation-hero .shell,
.identity-detail .service-hero,
.identity-detail .service-hero .shell {
  height: 540px;
  min-height: 540px;
}

.identity-country-page .country-formation-hero .shell,
.identity-detail .service-hero .shell {
  padding-top: 32px;
  padding-bottom: 44px;
}

.identity-country-page .country-formation-hero-copy,
.identity-detail .service-hero-copy,
.identity-detail .service-hero .shell.service-hero-copy {
  width: min(780px, 68%);
  max-width: 780px;
}

.identity-country-page .country-formation-hero-lead,
.identity-detail .service-hero-copy > p:not(.service-label) {
  max-width: 650px;
  margin-top: 20px;
  color: #d8e3ee;
}

.identity-country-page main .country-formation-hero h1 {
  font-size: var(--identity-display) !important;
  font-weight: 500;
  letter-spacing: -.045em !important;
  line-height: 1.06 !important;
}

.identity-country-page main
  :is(.country-formation-heading, .country-formation-copy) h2 {
  font-size: var(--identity-section) !important;
  font-weight: 500;
  letter-spacing: -.035em !important;
  line-height: 1.12 !important;
}

/* Homepage CTA dimensions and interaction. */
:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.button, .hero-panel-button, .formation-hero .text-link, .country-formation-hero .text-link, .gb-country-card-link) {
  display: inline-flex;
  min-height: 42px;
  width: max-content;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid var(--blue, #0b4c96);
  border-radius: 4px;
  background: var(--blue, #0b4c96);
  box-shadow: 0 10px 24px rgba(11,76,150,.18);
  color: #fff;
  font-size: var(--identity-meta) !important;
  font-weight: 850;
  letter-spacing: .025em;
  line-height: 1.3;
  text-decoration: none;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main .button-light {
  border-color: #fff;
  background: #fff;
  color: var(--navy, #06264d);
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.button, .hero-panel-button, .formation-hero .text-link, .country-formation-hero .text-link, .gb-country-card-link):hover,
:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.button, .hero-panel-button, .formation-hero .text-link, .country-formation-hero .text-link, .gb-country-card-link):focus-visible {
  border-color: var(--navy, #06264d);
  background: var(--navy, #06264d);
  box-shadow: 0 16px 30px rgba(7,45,92,.25);
  color: #fff;
  transform: translateY(-4px);
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main .button-light:hover,
:is(.identity-directory-page, .identity-country-page, .identity-detail) main .button-light:focus-visible {
  border-color: #eaf3fb;
  background: #eaf3fb;
  color: var(--navy, #06264d);
}

.identity-directory-page .gb-country-card-link { margin-top: 20px; }

@media (max-width: 1100px) {
  .identity-directory-page .formation-hero,
  .identity-country-page .country-formation-hero,
  .identity-country-page .country-formation-hero .shell,
  .identity-detail .service-hero,
  .identity-detail .service-hero .shell {
    height: 590px;
    min-height: 590px;
  }
}

@media (max-width: 760px) {
  :is(.identity-directory-page, .identity-country-page, .identity-detail) {
    --identity-display: 36px;
    --identity-section: 28px;
    --identity-title: 20px;
  }

  .identity-directory-page .formation-hero,
  .identity-country-page .country-formation-hero,
  .identity-country-page .country-formation-hero .shell,
  .identity-detail .service-hero,
  .identity-detail .service-hero .shell {
    height: 560px;
    min-height: 560px;
  }

  .identity-directory-page .formation-hero { align-items: flex-end; }
  .identity-directory-page .formation-hero > .shell,
  .identity-country-page .country-formation-hero .shell,
  .identity-detail .service-hero .shell {
    padding-top: 28px;
    padding-bottom: 52px;
  }

  .identity-directory-page .formation-hero > .shell { height: auto; }

  body.identity-directory-page main .formation-breadcrumb { margin-bottom: 28px; }
  .identity-directory-page .formation-hero-copy,
  .identity-country-page .country-formation-hero-copy,
  .identity-detail .service-hero-copy,
  .identity-detail .service-hero .shell.service-hero-copy { width: 100%; }

  :is(.identity-directory-page, .identity-country-page, .identity-detail) main
    :is(.button, .hero-panel-button, .formation-hero .text-link, .country-formation-hero .text-link, .gb-country-card-link) {
    min-height: 40px;
    padding: 8px 16px;
  }

  .identity-directory-page main .formation-hero-copy h1,
  .identity-country-page main .country-formation-hero h1 {
    font-size: var(--identity-display) !important;
  }

  .identity-directory-page main
    :is(.gb-registration-intro, .section-intro-grid, .page-cta-inner) h2,
  .identity-country-page main
    :is(.country-formation-heading, .country-formation-copy) h2 {
    font-size: var(--identity-section) !important;
  }
}

/* Final calibration: use the homepage six-level type scale and the 350px
   Tax & Corporate jurisdiction hero, including every destination page. */
:is(.identity-directory-page, .identity-country-page, .identity-detail) main h1 {
  font-size: var(--identity-display) !important;
  line-height: 1.1 !important;
  letter-spacing: -.035em !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main h2 {
  font-size: var(--identity-section) !important;
  line-height: 1.18 !important;
  letter-spacing: -.025em !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main h3 {
  font-size: var(--identity-title) !important;
  line-height: 1.3 !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.formation-hero-copy, .country-formation-hero-copy, .service-hero-copy) > p:not(.eyebrow):not(.service-label):not(.country-formation-kicker) {
  font-size: var(--identity-lead) !important;
  line-height: 1.75 !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(p, li, td, .identity-longform-copy) {
  font-size: var(--identity-body) !important;
  line-height: 1.75 !important;
}

:is(.identity-directory-page, .identity-country-page, .identity-detail) main
  :is(.eyebrow, small, .page-breadcrumb, .country-formation-kicker, .country-formation-eyebrow, .service-label, .identity-route-detail-label, .identity-route-tags span) {
  font-size: var(--identity-meta) !important;
  line-height: 1.5 !important;
}

.identity-directory-page .formation-hero,
.identity-directory-page .formation-hero > .shell,
.identity-country-page .country-formation-hero,
.identity-country-page .country-formation-hero .shell,
.identity-detail .service-hero,
.identity-detail .service-hero .shell {
  height: 350px;
  min-height: 350px;
}

.identity-directory-page .formation-hero > .shell,
.identity-country-page .country-formation-hero .shell,
.identity-detail .service-hero .shell {
  padding-top: 24px;
  padding-bottom: 28px;
}

/* The requested overview has no supporting description beside its title. */
.identity-directory-page .gb-registration-intro {
  grid-template-columns: minmax(0, 1fr) !important;
}

.identity-directory-page .gb-registration-intro > p:last-child {
  display: none !important;
}

/* Keep the shorter 350px hero comfortable: the original 540px layout used
   large vertical gaps that pushed the breadcrumb and CTAs outside the image. */
body.identity-directory-page main .formation-hero-copy .eyebrow {
  margin-bottom: 18px;
  font-size: var(--identity-meta) !important;
}

body.identity-directory-page main .formation-hero .formation-hero-copy > p:not(.eyebrow) {
  margin-top: 14px;
  margin-bottom: 18px;
}

body.identity-country-page main .country-formation-hero-copy > .country-formation-breadcrumb {
  margin-bottom: 12px;
}

body.identity-country-page main .country-formation-hero-copy > .country-formation-kicker {
  margin-bottom: 10px;
  font-size: var(--identity-meta) !important;
  line-height: 1.5 !important;
}

body.identity-country-page main .country-formation-hero-copy > .country-formation-hero-lead {
  margin-top: 12px;
}

body.identity-country-page main .country-formation-hero-copy > .country-formation-hero-actions {
  margin-top: 16px;
}

@media (max-width: 980px) {
  .identity-directory-page .formation-hero,
  .identity-directory-page .formation-hero > .shell {
    height: 360px;
    min-height: 360px;
  }

  .identity-country-page .country-formation-hero,
  .identity-country-page .country-formation-hero .shell,
  .identity-detail .service-hero,
  .identity-detail .service-hero .shell {
    height: auto;
    min-height: 360px;
  }
}

@media (max-width: 520px) {
  .identity-directory-page .formation-hero,
  .identity-directory-page .formation-hero > .shell {
    height: 330px;
    min-height: 330px;
  }

  .identity-country-page .country-formation-hero,
  .identity-country-page .country-formation-hero .shell,
  .identity-detail .service-hero,
  .identity-detail .service-hero .shell {
    height: auto;
    min-height: 330px;
  }
}

/* Button cleanup requested for the Immigration & Visas overview and country
   guides. Country-card CTAs share one baseline in every grid row. */
.identity-directory-page .formation-hero-copy > .text-link[href="#destinations"],
.identity-country-page .country-formation-hero-actions {
  display: none !important;
}

.identity-directory-page .gb-country-card-body {
  flex: 1 1 auto;
  width: 100%;
}

.identity-directory-page .gb-country-card-link {
  margin-top: auto !important;
}

.identity-directory-page .gb-country-card-link > [aria-hidden="true"] {
  display: none !important;
}

.identity-country-page main .country-guide-sidebar-cta a[href*="contact"] {
  display: inline-flex;
  min-height: 42px;
  width: max-content;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border: 1px solid var(--blue, #0b4c96);
  border-radius: 4px;
  background: var(--blue, #0b4c96);
  box-shadow: 0 10px 24px rgba(11,76,150,.18);
  color: #fff;
  font-size: var(--identity-meta) !important;
  font-weight: 850;
  letter-spacing: .025em;
  line-height: 1.3;
  text-decoration: none;
}

.identity-country-page main .country-guide-sidebar-cta a[href*="contact"]:hover,
.identity-country-page main .country-guide-sidebar-cta a[href*="contact"]:focus-visible {
  border-color: #fff;
  background: #fff;
  color: var(--navy, #06264d);
  transform: translateY(-4px);
}

@media (max-width: 760px) {
  .identity-country-page main .country-guide-sidebar-cta a[href*="contact"] {
    min-height: 40px;
    padding: 8px 16px;
  }
}

/* Compact country-guide rhythm: adjacent sections previously contributed
   116px of empty space before their actual content. */
.identity-country-page .country-guide-reading {
  padding-top: 44px;
  padding-bottom: 60px;
}

.identity-country-page .country-guide-article > .country-formation-section {
  padding: 30px 56px;
}

.identity-country-page .country-guide-article .country-formation-heading {
  margin-bottom: 24px;
}

.identity-country-page .country-guide-article .country-formation-eyebrow {
  margin: 0 0 12px !important;
}

.identity-country-page .country-guide-article .country-formation-copy h2 {
  margin-bottom: 16px;
}

.identity-country-page .country-guide-article .country-formation-copy > p {
  margin-bottom: 16px;
}

.identity-country-page .country-guide-article .country-formation-callout {
  margin-top: 22px;
  margin-bottom: 22px;
  padding: 20px 24px;
}

.identity-country-page .country-guide-article .country-formation-copy > .country-formation-callout:last-child {
  margin-bottom: 0;
}

.identity-country-page .country-guide-article .identity-evidence-grid article,
.identity-country-page .country-guide-article .country-formation-panel {
  padding: 24px;
}

.identity-country-page .country-guide-article .identity-country-note {
  margin-top: 20px;
  margin-bottom: 0;
  padding: 18px 22px;
}

.identity-country-page .country-guide-article .country-formation-copy > p:last-child {
  margin-bottom: 0;
}

.identity-country-page .country-guide-article .country-formation-process article {
  padding-top: 24px;
  padding-bottom: 24px;
}

.identity-country-page .country-guide-article .country-formation-faq summary {
  padding-top: 18px;
  padding-bottom: 18px;
}

@media (max-width: 760px) {
  .identity-country-page .country-guide-reading {
    padding-top: 30px;
    padding-bottom: 42px;
  }

  .identity-country-page .country-guide-article > .country-formation-section {
    padding: 26px 24px;
  }

  .identity-country-page .country-guide-article .country-formation-heading {
    margin-bottom: 20px;
  }
}

/* The Immigration & Visas overview ends after its planning resources; the
   generic consultation band is intentionally omitted before the footer. */
.identity-directory-page main > .page-cta {
  display: none !important;
}

/* Country guides also end after their review/source notice; the generic
   country consultation band is omitted on all seven destination pages. */
.identity-country-page main > .page-cta {
  display: none !important;
}

/* Compact the overview page as well: its directory and resource bands used
   substantially larger spacing than the country-guide pages. */
.identity-directory-page .gb-registration-directory {
  padding-top: 48px;
  padding-bottom: 56px;
}

.identity-directory-page .gb-registration-intro {
  margin-bottom: 28px;
}

.identity-directory-page .gb-region-filters {
  margin-bottom: 22px;
}

.identity-directory-page .content-section.content-section--soft {
  padding-top: 40px;
  padding-bottom: 40px;
}

.identity-directory-page .content-section.content-section--soft .section-intro-grid {
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 24px;
}

.identity-directory-page .content-section.content-section--soft .section-intro-grid > p {
  display: none !important;
}

.identity-directory-page .content-section.content-section--soft .related-grid > a {
  min-height: 0;
  padding: 24px;
  justify-content: flex-start;
}

.identity-directory-page .content-section.content-section--soft .related-grid h3 {
  margin: 16px 0 10px;
}

.identity-directory-page .content-section.content-section--soft .related-grid p {
  margin: 0;
}

@media (max-width: 760px) {
  .identity-directory-page .gb-registration-directory {
    padding-top: 34px;
    padding-bottom: 40px;
  }

  .identity-directory-page .content-section.content-section--soft {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .identity-directory-page .content-section.content-section--soft .section-intro-grid {
    margin-bottom: 20px;
  }
}
