/* QHDSVN: Global Structural Layout Correction v2.0
   Scope: ALL Vietnamese and English public routes, archives, research, contact,
   video, legal pages, historical articles and administrative forms.
   Applies after legacy and theme CSS. Prevents collapsed / floating / narrow
   columns while preserving deliberate nested card and hero composition. */

html, body { min-width: 0; max-width: 100%; }
body { overflow-x: clip; }
main { display: block; position: relative; width: 100%; min-width: 0; }

/* Page-level bands must participate in document flow. This addresses the
   historical .light-section absolute positioning that caused the left rail. */
main > section,
main > .section,
main > .h-band,
main > .light-section,
main > .chronology {
  position: relative;
  display: block;
  float: none;
  inset: auto;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  margin-left: 0;
  margin-right: 0;
}

/* Main headings and nested containers inherit the section width instead of
   accidental rules targeting entire content areas. */
main .section-heading,
main .rev-section-top,
main .rev-info-grid,
main .section-layout,
main .article-layout,
main .history-grid,
main .attachment-grid,
main .contact-layout {
  position: relative;
  inset: auto;
  min-width: 0;
  max-width: 100%;
}
main .section-heading { width: 100%; height: auto; min-height: 0; }
main .section-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: -17px;
  width: 65px;
  height: 3px;
  background: var(--gold, #C9A15A);
  pointer-events: none;
}
main .section-heading.centered::before { left: 50%; transform: translateX(-50%); }

/* Fluid contained content at all levels without breaking site-specific media
   layouts. Grid children and text may shrink but never to 42px strips. */
main .shell,
main .section > .shell,
main .h-band > .shell { min-width: 0; max-width: 1280px; }
main :is(.articles-grid, .video-grid, .video-library, .rev-card-grid,
        .rev-work-grid, .rev-video-grid, .rev-publication-layout,
        .rev-feature-grid, .rev-info-grid, .rev-footer-grid,
        .section-layout, .history-grid, .contact-layout,
        .article-layout, .attachment-grid) { min-width: 0; max-width: 100%; }
main :is(.articles-grid, .video-grid, .video-library, .rev-card-grid,
        .rev-work-grid, .rev-video-grid, .rev-publication-layout,
        .rev-feature-grid, .rev-info-grid, .section-layout,
        .history-grid, .contact-layout, .article-layout,
        .attachment-grid) > * { min-width: 0; }

/* Keep visible title hierarchy and article cards readable in both languages. */
main :is(.section-heading h1, .section-heading h2, .section-heading h3,
        .rev-section-top h2, .inner-hero h1, .article-cover h1) {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}
main .article-card,
main .video-card,
main .rev-info-card { min-width: 0; max-width: 100%; }
main .rich-content :is(img, video, iframe, table) { max-width: 100%; }

/* The clean background request is retained. No new ornamental art is added. */
@media(max-width:1000px) {
  main :is(.article-layout, .section-layout, .rev-info-grid,
           .contact-layout, .attachment-grid, .history-grid) { min-width: 0; }
}
@media(max-width:620px) {
  main .section-heading { width:100%; }
  main .article-card, main .video-card { width:100%; }
}
