/**
 * 全主题通用小工具样式（页脚 / 侧栏 / 首页区块）
 * 各主题可在自身 CSS 中覆盖 .yh-widgets 下的细节
 */

/* 页脚列网格：主题在 footer grid 容器上叠加 yh-footer-grid 与列数修饰类 */
.yh-footer-grid {
  display: grid;
  gap: var(--yh-footer-gap, 1.75rem 2rem);
  align-items: start;
}

.yh-footer-grid--cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

.yh-footer-grid--cols-2 {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
}

.yh-footer-grid--cols-3 {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
}

.yh-footer-grid--cols-4 {
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
}

.yh-footer-grid--cols-5 {
  grid-template-columns: minmax(0, 1.2fr) repeat(4, minmax(0, 1fr));
}

.yh-footer-grid--cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.yh-footer-col {
  min-width: 0;
}

.yh-footer-col-title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.35;
}

.yh-footer-logo {
  display: inline-block;
  font-size: 1.125rem;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

.yh-footer-logo:hover {
  text-decoration: none;
  opacity: 0.88;
}

.yh-footer-slogan,
.yh-footer-desc {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.65;
  opacity: 0.82;
}

.yh-footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.8125rem;
}

.yh-footer-contact a {
  color: inherit;
  text-decoration: none;
}

.yh-footer-contact a:hover {
  text-decoration: underline;
}

.yh-footer-nav,
.footer-nav,
.sf-footer-nav,
.pf-footer-nav,
.ph-footer-nav,
.if-footer-nav,
.tx-footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.yh-footer-nav a,
.footer-nav a,
.sf-footer-nav a,
.pf-footer-nav a,
.ph-footer-nav a,
.if-footer-nav a,
.tx-footer-nav a {
  display: block;
  font-size: 0.8125rem;
  color: inherit;
  text-decoration: none;
  opacity: 0.82;
}

.yh-footer-nav a:hover,
.footer-nav a:hover,
.sf-footer-nav a:hover,
.pf-footer-nav a:hover,
.ph-footer-nav a:hover,
.if-footer-nav a:hover,
.tx-footer-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* 深色页脚：导航列标题与链接（兼容 corporate / enterprise 系列） */
.footer-main .yh-footer-col-title,
.corp-footer .yh-footer-col-title,
.sf-footer-main .yh-footer-col-title,
.pf-footer-main .yh-footer-col-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  opacity: 1;
}

.footer-main .yh-footer-nav a,
.corp-footer .yh-footer-nav a,
.sf-footer-main .yh-footer-nav a,
.pf-footer-main .yh-footer-nav a {
  font-size: 0.875rem;
  opacity: 1;
}

.footer-main .yh-footer-nav a,
.corp-footer .yh-footer-nav a {
  color: rgba(255, 255, 255, 0.75);
}

.footer-main .yh-footer-nav a:hover,
.corp-footer .yh-footer-nav a:hover {
  color: #fff;
}

.sf-footer-main .yh-footer-nav a {
  color: rgba(255, 255, 255, 0.75);
}

.sf-footer-main .yh-footer-nav a:hover {
  color: #fff;
}

.pf-footer-main .yh-footer-nav a {
  color: rgba(255, 255, 255, 0.78);
}

.pf-footer-main .yh-footer-nav a:hover {
  color: #fff;
}

.footer-main .yh-footer-col--widget .widget,
.footer-main .yh-footer-col--widget section.widget,
.corp-footer .yh-footer-col--widget .widget,
.sf-footer-main .yh-footer-col--widget .widget,
.pf-footer-main .yh-footer-col--widget .widget {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.82);
}

.footer-main .yh-footer-col--widget .widget h3,
.corp-footer .yh-footer-col--widget .widget h3,
.sf-footer-main .yh-footer-col--widget .widget h3,
.pf-footer-main .yh-footer-col--widget .widget h3 {
  color: #fff;
  border: 0;
  padding: 0;
}

.yh-footer-bottom {
  border-top: 1px solid var(--yh-footer-bottom-border, rgba(0, 0, 0, 0.08));
  padding: 0.875rem 0;
}

.yh-footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.yh-footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  opacity: 0.75;
}

@media (max-width: 767px) {
  .yh-footer-grid--cols-2,
  .yh-footer-grid--cols-3,
  .yh-footer-grid--cols-4,
  .yh-footer-grid--cols-5,
  .yh-footer-grid--cols-6 {
    grid-template-columns: 1fr 1fr;
  }

  .yh-footer-grid .yh-footer-col--brand,
  .yh-footer-grid .yh-footer-col--widget {
    grid-column: 1 / -1;
  }
}

@media (max-width: 479px) {
  .yh-footer-grid--cols-2,
  .yh-footer-grid--cols-3,
  .yh-footer-grid--cols-4,
  .yh-footer-grid--cols-5,
  .yh-footer-grid--cols-6 {
    grid-template-columns: 1fr;
  }
}

.yh-widgets {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.yh-widgets--footer {
  gap: 1.25rem;
}

.yh-footer-col--widget .yh-widgets--footer {
  gap: 0;
}

/* 页脚小工具列：嵌入各主题 footer grid 时使用（兼容旧模板） */
.yh-footer-widgets-col {
  min-width: 0;
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .yh-footer-widgets-col {
    grid-column: auto;
  }

  /* 3 列页脚网格 + 小工具列 → 扩展为 4 列 */
  .if-footer-grid:has(.yh-footer-widgets-col),
  .ph-footer-grid:has(.yh-footer-widgets-col),
  .tx-footer-grid:has(.yh-footer-widgets-col),
  .ag-footer-grid:has(.yh-footer-widgets-col),
  .ts-footer-grid:has(.yh-footer-widgets-col) {
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .if-footer-grid:has(.yh-footer-widgets-col),
  .ph-footer-grid:has(.yh-footer-widgets-col),
  .tx-footer-grid:has(.yh-footer-widgets-col) {
    grid-template-columns: 1.35fr 1fr 1fr 1.1fr;
  }

  .ag-footer-grid:has(.yh-footer-widgets-col),
  .ts-footer-grid:has(.yh-footer-widgets-col) {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

.yh-widgets--homepage-top,
.yh-widgets--homepage-before-posts,
.yh-widgets--homepage-after-posts {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.yh-widgets:not(.yh-widgets--footer) .widget,
.yh-widgets:not(.yh-widgets--footer) section.widget {
  background: var(--yh-widget-bg, #fff);
  border: 1px solid var(--yh-widget-border, rgba(0, 0, 0, 0.08));
  border-radius: var(--yh-widget-radius, 8px);
  padding: 1rem 1.125rem;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.yh-widgets--footer .widget,
.yh-widgets--footer section.widget {
  background: var(--yh-widget-footer-bg, transparent);
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  color: var(--yh-widget-footer-text, inherit);
}

.yh-widgets--footer .widget h3,
.yh-widgets--footer section.widget h3 {
  margin-bottom: 0.65rem;
  font-size: 0.8125rem;
  font-weight: 650;
}

.yh-widgets .widget h3,
.yh-widgets section.widget h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.yh-widgets .widget ul,
.yh-widgets section.widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.yh-widgets .widget li + li,
.yh-widgets section.widget li + li {
  margin-top: 0.35rem;
}

.yh-widgets .widget a,
.yh-widgets section.widget a {
  color: inherit;
  text-decoration: none;
}

.yh-widgets .widget a:hover,
.yh-widgets section.widget a:hover {
  text-decoration: underline;
}

.yh-widgets .widget-search input[type="search"],
.yh-widgets .widget-search input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

.yh-widgets .widget-ad-media,
.yh-widgets .widget-ad-media img,
.yh-widgets .widget-ad-media video {
  max-width: 100%;
  height: auto;
  display: block;
}

.yh-widgets .widget-text p:last-child {
  margin-bottom: 0;
}

.yh-sidebar-widgets.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
