/* ===========================================================================
   hy-legacy.css — scoped compatibility layer for the 21 product / category
   pages whose ORIGINAL body copy is preserved.

   Why this file exists
   --------------------
   The original free template shipped ~520 KB of CSS (bootstrap.min.css 150 KB,
   style-main.css 258 KB, font-awesome5.css 72 KB, theme skin + responsive).
   Only a small subset of those rules is actually used by the product tables
   and body copy. Deleting rules inside style-main.css is risky because the
   same selectors are shared with the other four language sites.

   Instead, this file re-implements ONLY the classes the 21 pages really use,
   scoped under `.hy-legacy` so it can never collide with the new `hy-` shell
   or affect the 11 fully rebuilt pages. Scope wrapper is added at build time
   in build_en.py -> build_product_pages().

   Verified class inventory (21 pages, measured 2026-11-14):
     container 63, row 74, col-md-12 57, col-md-6 33, col-lg-4 33,
     col-md-5 12, col-md-7 12, col-md-3 8, col-lg-9 6, col-12 13,
     table 53, table-bordered 53, table-hover 53, table-container 49,
     mytext 183, text-theme-colored2 104, fa-angle-right 42, item 36,
     section-content 28, main-content-area 21, description-list 12,
     news-sidebar 8 (removed at build time — the JS feed never worked).

   Design tokens are inherited from hy-site.css (deep blue #122f4a,
   orange #d4763a) so the legacy tables visually belong to the new site.
   =========================================================================== */

.hy-legacy {
  --hy-navy: #122f4a;
  --hy-orange: #d4763a;
  --hy-ink: #22303c;
  --hy-line: #dfe6ed;
  color: var(--hy-ink);
  font-size: 15px;
  line-height: 1.7;
}
.hy-legacy *,
.hy-legacy *::before,
.hy-legacy *::after { box-sizing: border-box; }

.hy-legacy img { max-width: 100%; height: auto; border: 0; }
.hy-legacy a { color: #1c5b8f; text-decoration: none; }
.hy-legacy a:hover { color: var(--hy-orange); text-decoration: underline; }
.hy-legacy h1, .hy-legacy h2, .hy-legacy h3,
.hy-legacy h4, .hy-legacy h5, .hy-legacy h6 {
  color: var(--hy-navy); line-height: 1.3; margin: 0 0 .6em;
}
.hy-legacy p { margin: 0 0 1em; }
.hy-legacy ul, .hy-legacy ol { margin: 0 0 1em; padding-inline-start: 1.4em; }
.hy-legacy li { margin-bottom: .35em; }

/* ---------- 1. Grid (bootstrap 3/4 class names, re-implemented) ---------- */
.hy-legacy .container {
  width: 100%; max-width: 1200px; margin-inline: auto;
  padding-inline: 20px;
}
.hy-legacy .row {
  display: flex; flex-wrap: wrap; margin-inline: -12px;
}
.hy-legacy .row > [class*="col-"] {
  padding-inline: 12px; min-width: 0; flex: 0 0 100%; max-width: 100%;
}
/* Column widths MUST have the same specificity as the fallback above
   (0-3-0) and come after it. The old rules were only `.hy-legacy .col-lg-4`
   (0-2-0), so the 100% fallback won and every three-across product photo
   row collapsed into a single vertical stack once bootstrap.css was gone. */
.hy-legacy .row > .col-12     { flex: 0 0 100%;    max-width: 100%; }
.hy-legacy .row > .col-md-3   { flex: 0 0 25%;     max-width: 25%; }
.hy-legacy .row > .col-md-5   { flex: 0 0 41.666%; max-width: 41.666%; }
.hy-legacy .row > .col-md-6   { flex: 0 0 50%;     max-width: 50%; }
.hy-legacy .row > .col-md-7   { flex: 0 0 58.333%; max-width: 58.333%; }
.hy-legacy .row > .col-md-9   { flex: 0 0 75%;     max-width: 75%; }
.hy-legacy .row > .col-md-12  { flex: 0 0 100%;    max-width: 100%; }
.hy-legacy .row > .col-lg-4   { flex: 0 0 33.333%; max-width: 33.333%; }
.hy-legacy .row > .col-lg-9   { flex: 0 0 75%;     max-width: 75%; }
.hy-legacy .row > .col-lg-12  { flex: 0 0 100%;    max-width: 100%; }
.hy-legacy .main-content-area { padding-block: 8px 30px; }
.hy-legacy .section-content { padding-block: 10px; }

@media (max-width: 900px) {
  .hy-legacy .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .hy-legacy .row > .col-md-6.col-lg-4,
  .hy-legacy .row > .col-md-3.col-lg-4 { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 600px) {
  .hy-legacy .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
  .hy-legacy .row > .col-md-6.col-lg-4,
  .hy-legacy .row > .col-md-3.col-lg-4 { flex: 0 0 100%; max-width: 100%; }
}

/* ---------- 2. Tables (the main reason the theme CSS was needed) --------- */
.hy-legacy table,
.hy-legacy .table {
  width: 100%; border-collapse: collapse; margin: 0 0 26px;
  background: #fff; font-size: 14px; line-height: 1.55;
}
.hy-legacy table th,
.hy-legacy table td,
.hy-legacy .table th,
.hy-legacy .table td {
  padding: 9px 14px; border: 1px solid var(--hy-line);
  vertical-align: top; text-align: start;
}
.hy-legacy table th,
.hy-legacy .table th {
  background: #edf3f8; color: var(--hy-navy);
  font-weight: 600; white-space: nowrap;
}
.hy-legacy .table-bordered th,
.hy-legacy .table-bordered td { border: 1px solid var(--hy-line); }
.hy-legacy .table-hover tr:hover td,
.hy-legacy .table-hover tr:hover th { background: #f7fafc; }
.hy-legacy table caption { text-align: start; padding: 6px 0; color: #5a6b7b; }
.hy-legacy .table-container {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 12px 0 22px; width: 100%;
}
.hy-legacy .table-container > table { margin-bottom: 0; min-width: 520px; }
.hy-legacy .scroll-tip {
  display: none; color: #6b7c8c; font-size: 13px;
  text-align: center; margin: 0 0 4px;
}
@media (max-width: 900px) {
  .hy-legacy .scroll-tip { display: block; }
  .hy-legacy table th, .hy-legacy table td { padding: 7px 10px; }
}

/* ---------- 3. Body copy / headings -------------------------------------- */
/* The legacy body copy types its own "•" characters inside <li class="mytext">.
   The original theme set .mytext{display:block}, which suppresses the browser
   list marker. Keep that behaviour: forcing display:list-item produces a
   double bullet on every line (measured on a 500 px viewport). */
.hy-legacy .mytext {
  display: block; font-size: 14.5px; font-weight: 400;
  color: var(--hy-ink); line-height: 1.75; text-indent: 2ch;
}
.hy-legacy .text-theme-colored2,
.hy-legacy .text-theme-colored2 span { color: var(--hy-orange) !important; }
.hy-legacy .text-theme-colored0 { color: #fff !important; }
.hy-legacy .h1 { font-size: 26px; font-weight: 700; }
.hy-legacy .style35 { font-style: italic; }

/* The original red title bar carried each product page's only <h1>.
   It is restyled (not hidden) so every product page keeps exactly one h1. */
.hy-legacy .mytitlehead {
  width: 100%; background: var(--hy-navy); border-radius: 6px;
  padding: 6px 18px; margin: 0 0 18px;
}
.hy-legacy .mytitlehead h1 {
  font-size: clamp(20px, 2.1vw, 27px); color: #fff;
  margin: 0; padding: 6px 0; font-weight: 700;
}
.hy-legacy .mytitlehead .text-theme-colored0 {
  margin: 0; padding: 0; text-transform: none;
}
.hy-legacy .tm-sc-section-title,
.hy-legacy .title-wrapper { margin: 0 0 14px; }
.hy-legacy .description-list { margin: 0 0 22px; }
.hy-legacy .description-list dt {
  font-weight: 700; color: var(--hy-navy); margin-top: 10px;
}
.hy-legacy .description-list dd { margin: 2px 0 8px; }

/* ---------- 4. Product photo rows (3 across on desktop) ------------------ */
/* Original markup, previously styled by the removed bootstrap.css:
     <div class="row mb-20 mt-20">
       <div class="col-md-6 col-lg-4 …"><img …></div> × 3   (× 9 on element.html)
   The grid in section 1 restores the three-across layout; these rules keep
   every photo at one consistent ratio and give the rows some air. */
.hy-legacy .row.mb-20.mt-20 { margin-inline: -9px; row-gap: 18px; }
.hy-legacy .row.mb-20.mt-20 > [class*="col-"] { padding-inline: 9px; }
.hy-legacy .row.mb-20.mt-20 img {
  width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover;
  display: block; border-radius: 5px;
  border: 1px solid var(--hy-line) !important;  /* beats legacy inline black border */
  background: #f4f7fa;
}
@media (max-width: 600px) {
  .hy-legacy .row.mb-20.mt-20 { row-gap: 12px; }
}

/* The 12 FeCrAl / NiCr grade pages used to repeat the same three stock
   photos above the specification table. Appearance cannot distinguish those
   grades — only composition testing can — so the client asked for the whole
   carousel block to be removed (done in build_en.py at build time). */

/* ---------- 5. Icon-font replacement (font-awesome5.css removed) --------- */
.hy-legacy .fa { display: inline-block; font-style: normal; line-height: 1; }
.hy-legacy .fa-angle-right::before { content: "\203A"; color: var(--hy-orange); font-weight: 700; padding-inline-end: 4px; }
.hy-legacy .fa-angle-up::before  { content: "\2039"; transform: rotate(90deg); display: inline-block; }

/* ---------- 6. Legacy chrome that the new shell replaces ----------------- */
.hy-legacy .page-title,
.hy-legacy .tm-page-title,
.hy-legacy .breadcrumbs,
.hy-legacy .scrollToTop { display: none !important; }

/* V5.1: 旧模板用 .hidden-mobile-mode 在窄屏隐藏三分之二的产品图；
   新响应式网格改为堆叠展示，三张图在任何宽度下都可见。
   该类在中文站已是悬空类（旧 style-main.css 不再加载），
   build_cn.py 会把它从输出标记中移除，此处亦刻意不做隐藏。 */

/* ---------- 7. Spacing utility classes used by the legacy markup --------- */
.hy-legacy .mt-0   { margin-top: 0 !important; }
.hy-legacy .mt-10  { margin-top: 10px !important; }
.hy-legacy .mb-10  { margin-bottom: 10px !important; }
.hy-legacy .mt-20  { margin-top: 20px !important; }
.hy-legacy .mb-20  { margin-bottom: 20px !important; }
.hy-legacy .mt-60  { margin-top: 40px !important; }
.hy-legacy .pt-50  { padding-top: 28px !important; }
.hy-legacy .pb-50  { padding-bottom: 28px !important; }
.hy-legacy .pb-70  { padding-bottom: 40px !important; }
.hy-legacy .mb-md-30 { margin-bottom: 20px !important; }

/* ---------- 8. Legacy sidebar removed at build time (safety net) --------- */
.hy-legacy .news-sidebar { display: none !important; }
