/* v517K — Useful Guide article rail center fix
   Scope: Useful Guide article pages only.
   This uses the same viewport-centered rail idea used by stable public subpages.
   It fixes the repeated left-drift by centering the real article rail first,
   then centering the article card inside that rail. */

body.useful-article-page{
  --ug-article-rail-v517K: 1280px;
  --ug-article-gutter-v517K: clamp(24px, 4vw, 56px);
  --ug-article-card-v517K: 1120px;
}

body.useful-article-page main{
  width:100vw !important;
  max-width:100vw !important;
  margin-left:calc(50% - 50vw) !important;
  margin-right:calc(50% - 50vw) !important;
  overflow-x:clip !important;
  box-sizing:border-box !important;
}

@supports not (overflow: clip){
  body.useful-article-page main{overflow-x:hidden !important;}
}

body.useful-article-page main > .section{
  width:min(calc(100vw - (var(--ug-article-gutter-v517K) * 2)), var(--ug-article-rail-v517K)) !important;
  max-width:var(--ug-article-rail-v517K) !important;
  margin-left:auto !important;
  margin-right:auto !important;
  padding-left:0 !important;
  padding-right:0 !important;
  box-sizing:border-box !important;
}

body.useful-article-page .guide-article,
body.useful-article-page .visa-exemption-cluster-v510G{
  width:100% !important;
  max-width:var(--ug-article-card-v517K) !important;
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box !important;
}

body.useful-article-page .guide-article .article-card,
body.useful-article-page .visa-exemption-cluster-v510G .article-card{
  width:100% !important;
  max-width:100% !important;
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box !important;
}

body.useful-article-page .guide-article-content,
body.useful-article-page .visa-exemption-cluster-v510G .guide-article-content{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
}

body.useful-article-page .guide-article-content > *,
body.useful-article-page .visa-exemption-cluster-v510G .guide-article-content > *{
  max-width:100% !important;
}

/* Keep wide comparison/table modules inside the centered card instead of letting them pull the page left. */
body.useful-article-page .guide-compare-table-v508G,
body.useful-article-page .guide-table,
body.useful-article-page .guide-table-wrap,
body.useful-article-page .guide-decision-table-v517A,
body.useful-article-page .guide-decision-table-v517B{
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  margin-left:0 !important;
  margin-right:0 !important;
  overflow-x:auto !important;
}

@media (max-width: 760px){
  body.useful-article-page{
    --ug-article-gutter-v517K: 16px;
    --ug-article-card-v517K: 100%;
  }

  body.useful-article-page main > .section{
    width:calc(100vw - 32px) !important;
  }
}
