/* A small, persistent language choice sits beside the shared navigation. */
.fx-header .site-language {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 1px;
  padding-left: clamp(12px, 1.4vw, 24px);
  border-left: 1px solid #dbbd8a50;
}
.site-language button {
  appearance: none;
  border: 0;
  background: none;
  color: #d7cbc3;
  padding: 0 6px;
  min-height: 44px;
  font: 500 12px/1 Sora, "PingFang SC", sans-serif;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
}
.site-language button[aria-pressed="true"] { color: var(--gold, #dbbd8a); text-decoration: underline; text-underline-offset: 5px; }
.site-language button:hover { color: #fff; }
.site-language .language-divider { color: #ad9c89; font: 12px/1 sans-serif; }
html:lang(en).model-open .depth-interaction:after { content: "Drag to rotate 360° · Hover to explore"; }
@media (min-width: 761px) and (max-width: 1060px) {
  .fx-header { gap: 14px; }
  .fx-header img { width: 122px; }
  .fx-header .top-nav { gap: clamp(10px, 1.6vw, 18px); font-size: 12px; }
  .fx-header .site-language { padding-left: 8px; }
}
@media (max-width: 760px) {
  .fx-header { grid-template-columns: minmax(0,1fr) auto auto; column-gap: 10px; }
  .fx-header .fx-brand { grid-row: 1; grid-column: 1; }
  .fx-header .site-language { grid-row: 1; grid-column: 2; align-self: center; border: 0; padding: 0; }
  .fx-header .fx-nav-toggle { grid-row: 1; grid-column: 3; }
  .fx-header .top-nav { grid-row: 2; }
  .site-language button { min-width: 30px; padding: 0 2px; }
  html:lang(en).model-open .depth-interaction:after { content: "Drag to rotate · Tap an assembly"; }
}
@media (max-width: 359px) {
  .fx-header { column-gap: 5px; padding-inline: 12px; }
  .fx-header img { width: 105px; }
  .fx-header.is-nav-ready .fx-nav-toggle { min-width: 70px; }
}
/* The two awards share the same columns as the Chinese edition. Let the
   English names wrap inside them, including the longer technical awards. */
html:lang(en) .honours-selected .honours-latest .honour-item { container-type: inline-size; }
html:lang(en) .honours-selected .honours-latest .honour-awards-expanded {
  width: 100%;
  grid-template-columns: repeat(2,minmax(0,1fr));
  column-gap: clamp(10px, 1.2vw, 20px);
}
html:lang(en) .honours-selected .honours-latest .award-name:not(.award-technical) {
  font-size: clamp(18px, 9.1cqw, 54px);
}
html:lang(en) .honours-selected .honours-latest .honour-awards-expanded .award-name {
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.3;
}
@media (max-width: 760px) {
  html:lang(en) .section-dock a { white-space: normal; text-align: center; }
}
@media (max-width: 375px) {
  html:lang(en) .section-dock a { font-size: 11px; padding-inline: 1px; }
}

/* A native modal owns its focus and controls, including the language choice. */
dialog .site-language {
  display: inline-flex;
  align-items: center;
  flex: none;
}
dialog .site-language button { min-width: 36px; }
dialog .site-language button:focus-visible { outline: 2px solid var(--gold, #dbbd8a); outline-offset: 1px; }
.dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(20px, 3vw, 40px);
}
.dialog-toolbar .dialog-close { margin: 0; min-height: 44px; }
@media (max-width: 560px) {
  .video-dialog-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: 8px;
    row-gap: 2px;
    padding: 8px 10px 6px;
  }
  .video-dialog-header h2 { grid-column: 1 / -1; padding: 3px 4px 0; }
  .video-dialog-header .site-language { justify-self: start; }
  .video-dialog-header .video-dialog-close { grid-column: 3; }
}

/* Balance display lines within each phrase, including headings with a gold
   second line. Keep longer reading copy aligned to its usual text column. */
:where(p, li) { text-wrap: pretty; }
:where(h1, h2, h3, h4, figcaption, dt, dd, .award-name, .article-toc a,
       .mentor-selector-focus, .mentor-qualification, .join-consent,
       .hero-description, .section-lead, .campus-address, #campus-view-hint) {
  text-wrap: balance;
}

/* These headings sit beside a film, an application form or a plan. Size
   the English display type to the actual text column at each breakpoint. */
html:lang(en) :is(.frc-copy, .panel-copy) { container-type: inline-size; }
html:lang(en) .frc-copy :is(h2, h3.chapter-title),
html:lang(en) #about-frc .frc-scene:first-child h2,
html:lang(en) :is(#frc-season, #frc-roles, #frc-growth) .chapter-title {
  font-size: clamp(23px, 9.5cqi, 68px);
  line-height: 1.16;
}
html:lang(en) .fx-document .panel-copy :is(h1, h2) {
  font-size: clamp(26px, 9.4cqi, 70px);
  line-height: 1.2;
}

/* Each gold phrase is its own typographic line in the display composition. */
:is(.scene-copy, .frc-copy, .showcase-heading, .panel-copy) :is(h1, h2, h3) > br:has(+ em) { display: none; }
:is(.scene-copy, .frc-copy, .showcase-heading, .panel-copy) :is(h1, h2, h3) > em {
  display: block;
  text-wrap: balance;
}
.join-field > span, .join-consent > span { text-wrap: balance; }

@media (max-width: 374px) {
  html:lang(en) #build .scene-copy h2 { font-size: clamp(28px, 8.8vw, 33px); }
}
