/* =================================================================
 * baseline.css  — base=elementor  (v1.0.0)
 * 目标：在 base.css 的通用重置之上，为 Elementor 底座提供最小骨架。
 * 允许使用 Elementor 原生类（.elementor-*, .e-con, .e-parent, .elementor-widget-*）
 * 作为选择器，但禁止裸元素选择器（header/.nav/img 等无限定）。
 * 所有 Elementor 之外的自定义片段必须走 .sf-elementor-<section>-<uid> Namespace。
 * 加载顺序：base.css → baseline.css → 主题 style → sf-fallback
 * ================================================================= */

/* -------- 1. 容器（flex 版 Elementor section / e-con） -------- */
.elementor,
.elementor-section,
.e-con {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.e-con.e-parent {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.e-con-boxed {
  padding: 16px;
}

.elementor-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 16px;
}

.elementor-row {
  display: flex;
  flex-wrap: wrap;
}

.elementor-column-wrap,
.elementor-widget-wrap {
  width: 100%;
}

/* -------- 2. Header 高度锁定（防 CLS） -------- */
.elementor-location-header,
.elementor-section.sticky-header,
.site-header {
  width: 100%;
  min-height: 64px;
  background: #fff;
}

@media (max-width: 768px) {
  .elementor-location-header,
  .elementor-section.sticky-header,
  .site-header {
    min-height: 56px;
  }
}

/* -------- 3. 图片容器：强制 aspect-ratio + object-fit -------- */
.elementor-widget-image {
  display: block;
  width: 100%;
}

.elementor-widget-image .elementor-image,
.elementor-widget-image figure {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
}

.elementor-widget-image .elementor-image img,
.elementor-widget-image figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 方形缩略图变体（.square 修饰符） */
.elementor-widget-image.elementor-widget-image--square .elementor-image,
.elementor-widget-image.elementor-widget-image--square figure {
  aspect-ratio: 1 / 1;
}

/* 海报/横幅变体 */
.elementor-widget-image.elementor-widget-image--banner .elementor-image,
.elementor-widget-image.elementor-widget-image--banner figure {
  aspect-ratio: 21 / 9;
}

/* -------- 4. 按钮基础 -------- */
.elementor-button,
.elementor-button-link {
  display: inline-block;
  padding: 10px 20px;
  min-height: 40px;
  line-height: 1.4;
  font-weight: 600;
  border-radius: 4px;
  background: #ffc83d;
  color: #111;
  transition: background .18s ease, transform .1s ease;
}

.elementor-button:hover,
.elementor-button-link:hover {
  background: #ffb300;
  transform: translateY(-1px);
}

/* -------- 5. 菜单基础（nav-menu-horizontal） -------- */
.elementor-nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.elementor-nav-menu > li {
  position: relative;
}

.elementor-nav-menu > li > a {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  min-height: 44px;
  color: inherit;
}

.elementor-nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  padding: 8px 0;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 9000;
}

.elementor-nav-menu > li:hover > .sub-menu {
  opacity: 1;
  pointer-events: auto;
}

/* -------- 6. 响应式断点 -------- */
@media (max-width: 1024px) {
  .elementor-container { max-width: 100%; }
}

@media (max-width: 768px) {
  .e-con.e-parent { flex-direction: column; }
  .elementor-nav-menu { flex-direction: column; width: 100%; }
  .elementor-widget-image .elementor-image,
  .elementor-widget-image figure { aspect-ratio: 16 / 9; }
}

/* -------- 7. 图片失败：与 sf-fallback.js 协同（.sf-broken 由 JS 注入） -------- */
.sf-broken {
  visibility: hidden;
}
.elementor-widget.sf-img-fail {
  display: none !important;
}
