/* Static stand-ins for behaviour the archived Elementor CSS expects JS to add.
   Loaded after the archive stylesheets. */

/* Desktop nav: SmartMenus normally shows sub-menus on hover via JS. */
.elementor-nav-menu--main .elementor-nav-menu li:hover > ul,
.elementor-nav-menu--main .elementor-nav-menu li:focus-within > ul {
  display: block !important;
}

/* Desktop sub-menus: SmartMenus sizes them with JS (subMenusMinWidth 10em,
   subMenusMaxWidth 20em); size them to their content within the same bounds
   so long labels ("Câu chuyện sáng lập") stay inside the box. */
.elementor-nav-menu--main .elementor-nav-menu ul {
  width: max-content;
  min-width: 12em;
  max-width: 20em;
}

/* Mobile dropdown: hidden until the toggle is pressed (parity.js). */
.elementor-nav-menu--dropdown.elementor-nav-menu__container {
  max-height: 0;
  overflow: hidden;
  transform: scaleY(0);
  transform-origin: top;
  transition:
    transform 0.2s ease,
    max-height 0.2s ease;
}
.elementor-nav-menu--dropdown.elementor-nav-menu__container.mirror-open {
  max-height: 100vh;
  overflow-y: auto;
  transform: scaleY(1);
}
.elementor-nav-menu--dropdown .menu-item-has-children > ul {
  display: none;
}
.elementor-nav-menu--dropdown .menu-item-has-children.mirror-expanded > ul {
  display: block;
}

/* Nested tabs: show only the active panel. */
.e-n-tabs-content > .e-con:not(.e-active) {
  display: none;
}

/* Image carousel without Swiper: horizontal scroll-snap strip. */
.mirror-carousel .swiper-wrapper {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  transform: none !important;
}
.mirror-carousel .swiper-slide {
  flex: 0 0
    calc(
      (100% - (var(--mirror-per-view, 4) - 1) * 16px) /
        var(--mirror-per-view, 4)
    );
  scroll-snap-align: start;
}
.mirror-carousel .swiper-pagination,
.mirror-carousel .elementor-swiper-button {
  display: none;
}

/* Page template (PageTemplate.astro): vertical rhythm of the single-post
   template's outer container (50px top), since the pages' own Elementor CSS
   was never archived. */
.mirror-page > .e-con {
  /* Elementor sets these per element in the page CSS (cf. post-20426.css). */
  --display: flex;
  --flex-direction: column;
  --padding-top: 50px;
  --padding-bottom: 80px;
}
.mirror-page img {
  height: auto;
  max-width: 100%;
}

/* Archive pagination: the archive template's own CSS (post-24210) is gone, so
   use the site's measured home-page pagination style (centred, 16px/600,
   #b1b1b1 links, current page in the secondary colour, 5px apart). */
.elementor-location-archive .elementor-pagination {
  margin-top: 40px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  line-height: 20.8px;
}
.elementor-location-archive .elementor-pagination .page-numbers {
  display: inline-block;
  margin: 0 5px;
  color: #b1b1b1;
}
.elementor-location-archive .elementor-pagination .page-numbers.current,
.elementor-location-archive .elementor-pagination a.page-numbers:hover {
  color: var(--e-global-color-secondary, #37388d);
}

/* Missing images (parity.js / ArchiveCard): branded placeholder in posts-list
   image boxes, hidden elsewhere. */
.mirror-img-hidden {
  display: none !important;
}
.mirror-img-placeholder {
  background: #fdeef5;
  object-fit: cover;
  max-width: 100%;
  height: auto;
}
.elementor-post__thumbnail.mirror-thumb-placeholder {
  background: #fdeef5 url("/images/archive/d442d181-1.png") center / 70% auto no-repeat;
}
/* Archive card grid: Elementor's default cards image ratio (0.66); the widget
   CSS that set it lived in the lost post-24210.css. */
.elementor-location-archive .elementor-posts--skin-cards .elementor-post__thumbnail {
  padding-bottom: 66%;
}

/* Long unbreakable strings in crawled content (URLs, file names) must never
   make the page scroll sideways on phones. */
.mirror-page,
.elementor-widget-theme-post-content {
  overflow-wrap: anywhere;
}


/* Page template (flattened Elementor pages: logo grids, galleries): their
   original multi-column layout is lost, so cap image height and keep
   placeholders compact instead of stacking full-width boxes. */
.mirror-page .elementor-widget-container img {
  max-height: 520px;
  width: auto;
}
.mirror-page .elementor-widget-container img.mirror-img-placeholder {
  width: 300px;
  height: 200px;
}

/* Nested desktop sub-menus (e.g. Thư viện Tóc > Bệnh nhân): SmartMenus positions
   them beside their parent item with JS; without it the archived CSS dropped the
   third level on top of the second. Fly out to the right, wrap long labels. */
.elementor-nav-menu--main .elementor-nav-menu ul > li {
  position: relative;
}
.elementor-nav-menu--main .elementor-nav-menu ul ul {
  left: 100% !important;
  right: auto !important;
  top: 0 !important;
  margin: 0 !important;
  width: max-content !important;
  min-width: 14em !important;
  max-width: 22em !important;
}
.elementor-nav-menu--main .elementor-nav-menu ul ul a {
  white-space: normal !important;
  line-height: 1.35;
}

/* Tablet (768-1024px): the archived header nests the tablet-only burger widget
   inside a container that is also hidden on tablet, so tablets had no menu at all.
   Show that bar (search, cart, burger) on tablets. */
@media (min-width: 768px) and (max-width: 1024px) {
  .elementor-element-35d409aa.elementor-hidden-tablet {
    display: flex !important;
  }
}
