/* Migration glue for the hanyang-paper.com layout.
   The original template toggled drop-downs with inline styles and a script;
   these rules reproduce the same visible behaviour with CSS only. */

.legacy-page {
  font-family: var(--font-body);
  color: #343434;
  background-color: #fff;
}

.navigation-n13m-1 .legacy-nav .dnarrw .tri { border-top-color: currentColor; }

/* Match the source desktop breakpoint and its two submenu layouts. */
@media (min-width: 769px) {
  .legacy-nav > li:not(.had-subnav) > .subnavs { display: none; }
  .legacy-nav > .had-subnav > .lv-2 { display: block; }
  .legacy-nav > .full-lv .lv-3 { display: flex; }
  .legacy-nav > .full-lv .lv-2-pe > li:not(:hover) > .lv-3 { height: 0; padding: 0; }
  .legacy-nav > .full-lv .lv-2-pe > li:hover > .lv-3 { height: 45vh; padding: 0 0 20px; }
  .legacy-nav > .had-subnav:not(.full-lv):not(:hover) > .lv-2 { max-height: 0; }
  .navigation-n13m-1 .legacy-nav > .had-subnav:not(.full-lv) .lv-3 { display: none; }
  .navigation-n13m-1 .legacy-nav .lv2img img { display: inline-block; }
  .navigation-n13m-1 .legacy-nav > .full-lv .lv-2-pe > li > a { font-weight: 700; }
  .navigation-n13m-1 .legacy-nav > .full-lv .lv-2-pe,
  .navigation-n13m-1 .legacy-nav > .full-lv .lv-3 { scrollbar-width: none; }
  .navigation-n13m-1 .legacy-nav > .full-lv .lv-2-pe::-webkit-scrollbar,
  .navigation-n13m-1 .legacy-nav > .full-lv .lv-3::-webkit-scrollbar { display: none; }
}

/* The original template used a custom <e> element for the language label. */
.legacy-lang-label {
  font-size: 13px;
}

/* Language switcher items: the flag sprite only ships one flag, so list
   items use the LocaleSwitcher emoji instead of .iconflag. The active locale
   keeps the source hover treatment. On mobile the source collapsed
   max-height:0 rule would hide the list even inside the open menu, so let
   it lay out fully there. */
.legacy-page .navigation-n13m-1 .language .list .legacy-lang-flag {
  font-size: 14px;
  line-height: 20px;
  float: left;
  margin-right: 4px;
}
.legacy-page .navigation-n13m-1 .language .list a.active,
.legacy-page .navigation-n13m-1 .language .list a.active:hover {
  background: #83ab3a;
  border-bottom-color: #83ab3a;
  color: #fff;
}
@media (max-width: 768px) {
  .legacy-page .navigation-n13m-1 .language .list {
    max-height: none;
  }
}

/* Mobile menu button state. */
@media (max-width: 768px) {
  .navigation-n13m-1 .navbar-ul {
    display: none;
    flex-direction: column;
    padding: 6px 0 6px 10px;
  }
  .navigation-n13m-1.dmenu .navbar-ul {
    display: flex;
  }
  .legacy-nav .lv-2,
  .legacy-nav .lv-3 {
    display: none;
    position: static;
  }
  .legacy-nav li.opened > .subnavs {
    display: block;
  }
}

@media (min-width: 769px) {
  .navigation-n13m-1 .navbar-ul {
    display: flex;
  }
}

/* React carousel replaces the original owl layout without leaving inactive
   slides in normal flow. Keep the source image geometry and text overlay. */
.legacy-page > .navigation-n13m-1 { top: 0; left: 0; right: 0; }
.legacy-page .carousel-n101m-53 { margin-top: 83px; }
.legacy-page .carousel-n101m-53 .legacy-carousel { display: block; opacity: 1; }
.legacy-page .about-us-list-n106m-1 .seorfh1 { margin: 0; font-size: inherit; line-height: inherit; font-weight: inherit; }
.legacy-page .legacy-slide { display: none; position: relative; }
.legacy-page .legacy-slide.is-active { display: block; }
.legacy-page .legacy-slide.is-active > .text { top: 0; }
.legacy-page .legacy-dots { position: absolute; inset-inline: 0; bottom: 25%; display: flex; justify-content: center; gap: 16px; z-index: 2; }
.legacy-page .legacy-dot { border: 0; padding: 0; width: 36px; height: 5px; background: #b9b9b9; cursor: pointer; }
.legacy-page .legacy-dot.is-active { background: rgb(var(--color-accent-500)); }
/* Keep the source site's distinct zone backgrounds measured from the live
   reference: inquiry #e8ebdd, footer #dbded1, advantage rgba(253,195,68,.56). */
.legacy-page .main.custom-style:not(.legacy-product-detail-page):has(.message-n122m-1),
.legacy-page .legacy-product-detail-page .message-n122m-1 { background-color: #e8ebdd; }
.legacy-page .main.custom-style:has(.about-us-list-n120m-55) { background-color: rgba(253, 195, 68, 0.56); }
.legacy-page .legacy-footer-zone { background-color: #dbded1; }

.legacy-page .product-list-n122m-1 .bli { min-width: 0; margin-inline-end: 10px; border-radius: var(--radius-card); }
.legacy-page .product-list-n122m-1 .bli:last-child { margin-inline-end: 0; }
/* Keep the source accordion behaviour: image scales by its 500px height with
   the intrinsic ratio; the narrower card just crops the sides. Preflight's
   max-width clamp was squashing the image whenever a card shrinks. */
.legacy-page .product-list-n122m-1 .bli img {
  width: auto;
  height: 100%;
  max-width: none;
}
@media (max-width: 991px) {
 .legacy-page .carousel-n101m-53 { margin-top: 55px; }
 .legacy-page .legacy-dots { bottom: 10px; }
 .legacy-page .legacy-dot { width: 24px; height: 3px; }
}

/* The source template fades images in via an iLazyImg -> loaded script.
   Static migration has no lazy-load script, so keep these images fully
   opaque instead of the template's 5% starting opacity (white haze). */
.legacy-page img.iLazyImg {
  opacity: 1;
  transition: none;
}

/* Homepage stat cards (about-us-list-n122m-61): the source text column is
   20px wider, which changes the desc line-break points; keep the glyph at the
   source's 50px while enlarging the badge circle. */
.legacy-page .about-us-list-n122m-61 .item {
  padding-left: 10px;
  padding-right: 10px;
}
.legacy-page .about-us-list-n122m-61 .icon {
  width: 70px;
  height: 70px;
  max-width: 70px;
  max-height: 70px;
  flex: 0 0 70px;
  padding: 5px;
  box-sizing: border-box;
}
.legacy-page .about-us-list-n122m-61 .icon img {
  width: 60px;
  height: 60px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* News carousel (news-list-n101m-2): three visible columns per slide, the
   source owl.carousel replaced with a React pager; tile styles come from
   site.css. */
.legacy-news-carousel .legacy-carousel-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.legacy-news-carousel .blk {
  margin: 0;
}
.legacy-news-carousel .owl-buttons button {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
}
.legacy-news-carousel .owl-buttons button:disabled {
  cursor: default;
}
.legacy-news-carousel .owl-buttons button:disabled .imco {
  opacity: 0.3;
}
@media (max-width: 767px) {
  .legacy-news-carousel .legacy-carousel-row { grid-template-columns: 1fr; }
}

/* Keep the featured sidebar slide stable while changing product images. */
.legacy-page .legacy-sidebar-products .item { aspect-ratio: 1 / 1; }
.legacy-page .legacy-sidebar-products .item > a { display: block; width: 100%; height: 100%; }
.legacy-page .legacy-sidebar-products .item img { display: block; width: 100%; height: 100%; object-fit: contain; }
.legacy-page .legacy-sidebar-products .owl-buttons button { padding: 0; margin: 0; cursor: pointer; }
.legacy-page .legacy-sidebar-products .owl-buttons button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Let the original .container widths win over Tailwind on News routes only. */
.legacy-page .main.container:has(.news-list-n101m-1),
.legacy-page .breadcrumb-n122m-1:has(li[aria-hidden="true"]) > .container,
.legacy-page .breadcrumb-n122m-1:has(li[aria-hidden="true"]) + .main.container {
  max-width: none;
}

/* Contact route: keep the banner below the fixed header and contain the legacy background. */
.legacy-page .breadcrumb-n122m-1:has(+ .legacy-contact-page) {
  margin-top: 83px;
}
@media (max-width: 768px) {
  .legacy-page .breadcrumb-n122m-1:has(+ .legacy-contact-page) { margin-top: 54px; }
}
.legacy-contact-page .widget.area-background-n4m-79 {
  position: relative;
  isolation: isolate;
}
.legacy-contact-page .contact-info-n101m-1 .box {
  min-width: 0;
}
.legacy-contact-page .contact-info-n101m-1 .box a {
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (min-width: 769px) {
  .legacy-contact-page .contact-info-n101m-1 .box { width: calc(100% / 3); }
}
