/* ==========================================================================
   port-bridge.css — glue for pages that keep their v2 content and only take
   the v3 chrome. Loaded LAST so these wins land on top of the old layers.
   1) old --th-* tokens mapped onto the v3 palette (one palette, not two)
   2) --rh-col widened from 760 to the 1200 grid
   3) the old file fonts swapped for Alexandria / IBM Plex Sans Arabic
   4) the new full-bleed chrome released from the editorial column rule
   ========================================================================== */

html:root{
  /* palette: old token names -> v3 values */
  --th-g900:#0C3524; --th-g800:#10402C; --th-g700:#14563A;
  --th-g50:#E8F0EA;
  --th-gold:#C8A45C; --th-gold-soft:#E4CB94;
  --th-cream:#FAF6EC;
  --th-orange:#C9761F;
  --th-ink:#0B2418; --th-ink2:#41564A;
  --th-line:rgba(11,36,24,.10);
  --th-surface:#FFFFFF;
  --th-r-lg:20px; --th-r-md:14px; --th-r-sm:10px;

  /* editorial column: 760px phone column -> 1200px desktop grid */
  --rh-col:1200px;
  --rh-pad:clamp(18px,4vw,40px);
  --rh-page:#FAF6EC;
  --rh-cream:#F2EADA;
  --rh-dark:#0C3524;
  --rh-line:rgba(200,164,92,.26);
  --rh-line-soft:rgba(200,164,92,.16);
  --rh-ink:#41564A;
  --rh-ink-soft:#71837A;

  /* type: the file layer's font variables point at the v3 faces */
  --ds-font-text:"IBM Plex Sans Arabic",-apple-system,"Segoe UI",Tahoma,Arial,sans-serif;
  --ds-font-display:"Alexandria","IBM Plex Sans Arabic",-apple-system,"Segoe UI",Tahoma,Arial,sans-serif;
}

/* the file layer sets font-family through --file-font-*; make the v3 faces win
   even where a rule resolves those vars early */
.th-root{font-family:var(--font-text)}
.th-root h1,.th-root h2,.th-root h3,.th-root h4,.th-root .th-pname{
  font-family:var(--font-display);
  letter-spacing:0;
}
[dir="rtl"] .th-root h1,[dir="rtl"] .th-root h2,[dir="rtl"] .th-root h3{
  line-height:1.35;letter-spacing:0;
}

/* site.css zeroes paragraph margins for its own shells; old pages rely on the
   browser default, so put it back inside the editorial body only */
.th-root p{margin-block:1em}

/* the new chrome is full-bleed: undo the .th-root > * column clamp for it */
.th-root > header.site-head,
.th-root > .drawer,
.th-root > footer.site-foot,
.th-root > .mobile-bar{
  max-width:none;margin-inline:0;padding-inline:0;width:100%;
}

/* the sticky bar sits over anchors; keep jump targets clear of it */
html{scroll-padding-top:84px}

/* the old bottom bar is gone; keep phones clear of the new one */
@media (max-width:899px){html body{padding-bottom:76px}}
@media (min-width:900px){html body{padding-bottom:0}}

/* product pages: the poster box was sized for a 760px column; keep it a
   product-poster size inside the 1200px grid instead of a 1200px-wide panel */
@media (min-width:900px){
  .th-root .th-pimg{max-width:680px;margin-inline:auto}
  .th-root .th-nimg{max-width:760px;margin-inline:auto}
}

/* crop stage rows: short summary chip on the right of each summary line */
.th-root .th-pd > summary { min-width: 0; }
.th-root .th-pd > summary > .th-pd-sum {
  margin-inline-start: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: #5d6b63;
  background: rgba(15, 45, 30, .06);
  border-radius: 999px;
  padding: 3px 9px;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: none;
}
@media (max-width: 420px) {
  .th-root .th-pd > summary > .th-pd-sum { font-size: 11.5px; max-width: 56%; padding: 2px 7px; }
}

/* filtered grids: the hidden attribute must actually hide, whatever a component rule says */
.pcard[hidden], .ccard[hidden], .syspanel[hidden], .th-syspanel[hidden], [data-cat][hidden] { display: none !important; }
