/**
 * =========================================================
 * XT DBS Footer CSS
 *
 * 文件位置：
 * /wp-content/themes/elementra/xt-custom/assets/css/xt-dbs-footer.css
 *
 * 作用：
 * 1. Design Build Sol footer styles
 * 2. Footer-only Fluent Forms subscribe style
 * 3. Mobile accordion style
 * 4. Fix duplicate underline
 * 5. Fix autofill / typed background gray block
 * =========================================================
 */

/* =========================
   Base Isolation
========================= */

.dbs-footer,
.dbs-footer * {
  box-sizing: border-box;
}

.dbs-footer {
  --dbs-max: 1380px;
  --dbs-side: clamp(18px, 4vw, 72px);

  --dbs-text: #2a221c;
  --dbs-muted: #6f665c;
  --dbs-soft: #968c81;
  --dbs-line: rgba(42, 34, 28, 0.11);
  --dbs-line-strong: rgba(42, 34, 28, 0.18);
  --dbs-gold: #b38a57;
  --dbs-hover: #1d1712;

  /* 这里改成更接近页脚背景的颜色，避免 autofill 出现灰块 */
  --dbs-autofill-bg: #f7f3ec;

  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 46px var(--dbs-side) 26px;
  color: var(--dbs-text);
  background:
    radial-gradient(circle at 8% 6%, rgba(179, 138, 87, 0.08), transparent 26%),
    radial-gradient(circle at 92% 0%, rgba(179, 138, 87, 0.05), transparent 22%),
    linear-gradient(180deg, #fbf8f2 0%, #f4eee5 100%);
  border-top: 1px solid rgba(42, 34, 28, 0.06);
  overflow: hidden;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.dbs-footer a {
  color: inherit;
  text-decoration: none;
}

.dbs-footer img,
.dbs-footer svg {
  display: block;
  max-width: 100%;
}

.dbs-footer ul,
.dbs-footer li,
.dbs-footer p,
.dbs-footer h1,
.dbs-footer h2,
.dbs-footer h3,
.dbs-footer h4 {
  margin-top: 0;
}

.dbs-footer button,
.dbs-footer input {
  font-family: inherit;
}

/* =========================
   Main Layout
========================= */

.dbs-footer__inner {
  width: min(var(--dbs-max), 100%);
  margin: 0 auto;
}

.dbs-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: clamp(34px, 6vw, 96px);
  align-items: end;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--dbs-line);
  animation: dbsFooterFadeUp 0.7s ease both;
}

.dbs-footer__brand {
  max-width: 720px;
}

.dbs-footer__logo {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 20px;
}

.dbs-footer__logo-image {
  width: clamp(260px, 22vw, 360px);
  height: auto;
  object-fit: contain;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.dbs-footer__logo:hover .dbs-footer__logo-image {
  transform: translateY(-2px);
  opacity: 0.88;
}

.dbs-footer__brand-text {
  max-width: 650px;
  margin: 0;
  color: var(--dbs-muted);
  font-size: 15px;
  line-height: 1.85;
}

.dbs-footer__subscribe {
  width: 100%;
  animation: dbsFooterFadeUp 0.7s ease 0.08s both;
}

.dbs-footer__subscribe-title {
  margin: 0 0 12px;
  color: var(--dbs-text);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dbs-footer__subscribe-text {
  margin: 0 0 16px;
  color: var(--dbs-muted);
  font-size: 14px;
  line-height: 1.7;
}

.dbs-footer__subscribe-note {
  margin: 11px 0 0;
  color: var(--dbs-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* =========================================================
   Fluent Forms Subscribe
========================================================= */

.dbs-footer__ff,
.dbs-footer__ff * {
  box-sizing: border-box !important;
}

.dbs-footer__ff {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid var(--dbs-line-strong) !important;
}

.dbs-footer__ff::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  bottom: -1px !important;
  width: 0 !important;
  height: 1px !important;
  background: var(--dbs-gold) !important;
  transition: width 0.34s ease !important;
  pointer-events: none !important;
}

.dbs-footer__ff:focus-within::after {
  width: 100% !important;
}

/* 清除内部重复线条 */
.dbs-footer__ff .fluentform,
.dbs-footer__ff .frm-fluent-form,
.dbs-footer__ff form,
.dbs-footer__ff fieldset,
.dbs-footer__ff .ff-t-container,
.dbs-footer__ff .ff-t-cell,
.dbs-footer__ff .ff-el-group {
  border: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.dbs-footer__ff form::before,
.dbs-footer__ff form::after,
.dbs-footer__ff fieldset::before,
.dbs-footer__ff fieldset::after,
.dbs-footer__ff .ff-t-container::before,
.dbs-footer__ff .ff-t-container::after,
.dbs-footer__ff .ff-t-cell::before,
.dbs-footer__ff .ff-t-cell::after,
.dbs-footer__ff .ff-el-group::before,
.dbs-footer__ff .ff-el-group::after {
  content: none !important;
  display: none !important;
}

.dbs-footer__ff .fluentform,
.dbs-footer__ff .frm-fluent-form,
.dbs-footer__ff form,
.dbs-footer__ff fieldset {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-inline-size: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dbs-footer__ff form {
  display: block !important;
  position: relative !important;
}

.dbs-footer__ff fieldset {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  column-gap: 18px !important;
  row-gap: 0 !important;
}

.dbs-footer__ff .ff-t-container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  column-gap: 18px !important;
  row-gap: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dbs-footer__ff .ff-t-cell {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: none !important;
  flex-basis: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dbs-footer__ff .ff-t-cell:first-child {
  grid-column: 1 !important;
  justify-self: stretch !important;
}

.dbs-footer__ff .ff-t-cell:last-child {
  grid-column: 2 !important;
  justify-self: end !important;
}

.dbs-footer__ff .ff-el-group {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.dbs-footer__ff .ff-el-group:not(.ff_submit_btn_wrapper) {
  grid-column: 1 !important;
  grid-row: 1 !important;
  justify-self: stretch !important;
  width: 100% !important;
}

.dbs-footer__ff .ff_submit_btn_wrapper,
.dbs-footer__ff .ff-el-group.ff_submit_btn_wrapper {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: center !important;
  width: auto !important;
  min-width: auto !important;
  max-width: none !important;
  text-align: right !important;
  margin-left: auto !important;
}

.dbs-footer__ff .ff-el-input--label,
.dbs-footer__ff .ff-el-input--label label,
.dbs-footer__ff label {
  display: none !important;
}

.dbs-footer__ff .ff-el-input--content {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* =========================
   输入框修复重点
   1. 背景始终透明
   2. 不要灰块
========================= */

.dbs-footer__ff input,
.dbs-footer__ff input[type="email"],
.dbs-footer__ff input[type="text"],
.dbs-footer__ff .ff-el-form-control {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  outline: none !important;
  border-radius: 0 !important;

  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;

  color: var(--dbs-text) !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  line-height: 44px !important;

  box-shadow: none !important;
  -webkit-box-shadow: none !important;

  appearance: none !important;
  -webkit-appearance: none !important;
  caret-color: var(--dbs-text) !important;
}

.dbs-footer__ff input::placeholder,
.dbs-footer__ff .ff-el-form-control::placeholder {
  color: #9d9387 !important;
  opacity: 1 !important;
}

.dbs-footer__ff input:focus,
.dbs-footer__ff .ff-el-form-control:focus {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* 修复浏览器自动填充灰块 / 黄底 */
.dbs-footer__ff input:-webkit-autofill,
.dbs-footer__ff input:-webkit-autofill:hover,
.dbs-footer__ff input:-webkit-autofill:focus,
.dbs-footer__ff input:-webkit-autofill:active,
.dbs-footer__ff .ff-el-form-control:-webkit-autofill,
.dbs-footer__ff .ff-el-form-control:-webkit-autofill:hover,
.dbs-footer__ff .ff-el-form-control:-webkit-autofill:focus,
.dbs-footer__ff .ff-el-form-control:-webkit-autofill:active {
  -webkit-text-fill-color: var(--dbs-text) !important;
  caret-color: var(--dbs-text) !important;

  /* 用接近页脚背景色覆盖浏览器 autofill 底色，而不是浅灰 */
  -webkit-box-shadow: 0 0 0 1000px var(--dbs-autofill-bg) inset !important;
  box-shadow: 0 0 0 1000px var(--dbs-autofill-bg) inset !important;

  border-radius: 0 !important;
  transition: background-color 9999s ease-in-out 0s !important;
}

/* 提交按钮 */
.dbs-footer__ff button,
.dbs-footer__ff button[type="submit"],
.dbs-footer__ff input[type="submit"],
.dbs-footer__ff .ff-btn,
.dbs-footer__ff .ff-btn-submit {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;

  width: auto !important;
  min-width: auto !important;
  max-width: none !important;

  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  outline: none !important;
  border-radius: 0 !important;

  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;

  color: var(--dbs-text) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 44px !important;

  text-transform: none !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;

  cursor: pointer !important;
  gap: 10px !important;
  white-space: nowrap !important;

  transition: color 0.25s ease, transform 0.25s ease !important;
}

.dbs-footer__ff button::before,
.dbs-footer__ff .ff-btn-submit::before {
  display: none !important;
  content: none !important;
}

.dbs-footer__ff button::after,
.dbs-footer__ff .ff-btn-submit::after {
  content: "→" !important;
  display: inline-block !important;
  font-size: 18px !important;
  line-height: 1 !important;
  margin-left: 2px !important;
  transition: transform 0.25s ease !important;
}

.dbs-footer__ff button:hover,
.dbs-footer__ff button[type="submit"]:hover,
.dbs-footer__ff .ff-btn:hover,
.dbs-footer__ff .ff-btn-submit:hover {
  color: var(--dbs-gold) !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  transform: translateX(2px) !important;
}

.dbs-footer__ff button:hover::after,
.dbs-footer__ff .ff-btn-submit:hover::after {
  transform: translateX(4px) !important;
}

.dbs-footer__ff .ff-el-is-error .text-danger,
.dbs-footer__ff .error,
.dbs-footer__ff .ff-errors-in-stack,
.dbs-footer__ff .ff-message-success {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  color: var(--dbs-muted) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

/* =========================
   Footer Link Columns
========================= */

.dbs-footer__main {
  display: grid;
  grid-template-columns: 0.95fr 0.95fr 0.95fr 1.15fr;
  gap: clamp(28px, 5vw, 76px);
  padding: 34px 0;
  border-bottom: 1px solid var(--dbs-line);
  animation: dbsFooterFadeUp 0.7s ease 0.14s both;
}

.dbs-footer__group {
  min-width: 0;
}

.dbs-footer__group-toggle {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--dbs-text);
  text-align: left;
  cursor: default;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  user-select: none;
}

.dbs-footer__group-toggle:hover,
.dbs-footer__group-toggle:focus,
.dbs-footer__group-toggle:active {
  background: transparent;
  color: var(--dbs-text);
  outline: none;
  box-shadow: none;
}

.dbs-footer__col-title {
  display: block;
  margin: 0 0 16px;
  color: var(--dbs-text);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dbs-footer__accordion-panel {
  overflow: visible;
  max-height: none;
  opacity: 1;
  transform: none;
}

.dbs-footer__accordion-inner {
  display: block;
}

.dbs-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 11px;
}

.dbs-footer__links li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dbs-footer__links a {
  position: relative;
  display: inline-flex;
  width: fit-content;
  color: var(--dbs-muted);
  font-size: 14px;
  line-height: 1.55;
  transition: color 0.25s ease, transform 0.25s ease;
}

.dbs-footer__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: var(--dbs-gold);
  transition: width 0.25s ease;
}

.dbs-footer__links a:hover {
  color: var(--dbs-hover);
  transform: translateX(3px);
}

.dbs-footer__links a:hover::after {
  width: 100%;
}

/* =========================
   Contact
========================= */

.dbs-footer__contact {
  display: grid;
  gap: 12px;
}

.dbs-footer__contact-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
}

.dbs-footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--dbs-muted);
  transition: color 0.25s ease, transform 0.25s ease;
}

.dbs-footer__contact-item:hover {
  color: var(--dbs-hover);
  transform: translateX(2px);
}

.dbs-footer__contact-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dbs-gold);
  opacity: 0.9;
  transition: color 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.dbs-footer__contact-item:hover .dbs-footer__contact-icon {
  color: var(--dbs-hover);
  opacity: 1;
  transform: translateY(-1px);
}

.dbs-footer__contact-icon svg {
  width: 17px;
  height: 17px;
}

.dbs-footer__contact-text {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-block;
  color: inherit;
  font-size: 14px;
  line-height: 1.6;
}

.dbs-footer__contact-address {
  max-width: 310px;
}

/* =========================
   Social
========================= */

.dbs-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.dbs-footer__social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--dbs-line);
  color: #6d6257;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.42);
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.dbs-footer__social a:hover {
  color: var(--dbs-hover);
  border-color: rgba(179, 138, 87, 0.65);
  background: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(66, 49, 30, 0.08);
}

.dbs-footer__social svg {
  width: 17px;
  height: 17px;
}

/* =========================
   Bottom
========================= */

.dbs-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 22px;
  color: var(--dbs-soft);
  font-size: 13px;
  line-height: 1.5;
  animation: dbsFooterFadeUp 0.7s ease 0.2s both;
}

.dbs-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px;
}

.dbs-footer__legal a {
  color: var(--dbs-soft);
  transition: color 0.25s ease;
}

.dbs-footer__legal a:hover {
  color: var(--dbs-hover);
}

/* =========================
   Animation
========================= */

@keyframes dbsFooterFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   Tablet
========================= */

@media (max-width: 1100px) {
  .dbs-footer__top {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .dbs-footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 44px;
  }
}

/* =========================
   Mobile
========================= */

@media (max-width: 767px) {
  .dbs-footer {
    padding: 38px 18px 22px;
  }

  .dbs-footer__top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 30px;
  }

  .dbs-footer__logo-image {
    width: 240px;
  }

  .dbs-footer__brand-text {
    font-size: 14px;
    line-height: 1.8;
  }

  .dbs-footer__subscribe-title {
    font-size: 20px;
  }

  .dbs-footer__subscribe-text {
    font-size: 14px;
  }

  .dbs-footer__ff {
    padding-bottom: 11px !important;
    border-bottom-color: rgba(42, 34, 28, 0.16) !important;
  }

  .dbs-footer__ff fieldset {
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 12px !important;
  }

  .dbs-footer__ff .ff-t-container {
    grid-template-columns: minmax(0, 1fr) auto !important;
    column-gap: 12px !important;
  }

  .dbs-footer__ff input,
  .dbs-footer__ff input[type="email"],
  .dbs-footer__ff input[type="text"],
  .dbs-footer__ff .ff-el-form-control {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    font-size: 14px !important;
    line-height: 42px !important;
  }

  .dbs-footer__ff button,
  .dbs-footer__ff button[type="submit"],
  .dbs-footer__ff input[type="submit"],
  .dbs-footer__ff .ff-btn,
  .dbs-footer__ff .ff-btn-submit {
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    font-size: 14px !important;
    line-height: 42px !important;
    gap: 8px !important;
  }

  .dbs-footer__subscribe-note {
    font-size: 12px;
  }

  .dbs-footer__main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 26px 0 28px;
    border-bottom: 1px solid var(--dbs-line);
  }

  .dbs-footer__group {
    border-bottom: 1px solid var(--dbs-line);
  }

  .dbs-footer__group:last-child {
    border-bottom: 0;
  }

  .dbs-footer__group-toggle {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
  }

  .dbs-footer__group-toggle::after {
    content: "+";
    flex: 0 0 auto;
    color: var(--dbs-soft);
    font-size: 22px;
    line-height: 1;
    font-weight: 300;
    transform: rotate(0deg);
    transition:
      transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
      color 0.28s ease;
  }

  .dbs-footer__group.is-open .dbs-footer__group-toggle::after {
    content: "−";
    color: var(--dbs-gold);
    transform: rotate(180deg);
  }

  .dbs-footer__col-title {
    margin: 0;
    font-size: 15px;
  }

  .dbs-footer__accordion-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    transition:
      max-height 0.56s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.36s ease,
      transform 0.46s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: max-height, opacity, transform;
  }

  .dbs-footer__group.is-open .dbs-footer__accordion-panel {
    opacity: 1;
    transform: translateY(0);
  }

  .dbs-footer__accordion-inner {
    padding: 0 0 22px;
  }

  .dbs-footer__links {
    gap: 13px;
  }

  .dbs-footer__links a,
  .dbs-footer__contact-text {
    font-size: 14px;
  }

  .dbs-footer__contact-address {
    max-width: 100%;
  }

  .dbs-footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .dbs-footer__legal {
    justify-content: flex-start;
    gap: 14px;
  }
}

@media (max-width: 420px) {
  .dbs-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dbs-footer__logo-image {
    width: 220px;
  }

  .dbs-footer__ff fieldset {
    column-gap: 10px !important;
  }

  .dbs-footer__ff .ff-t-container {
    column-gap: 10px !important;
  }

  .dbs-footer__ff input,
  .dbs-footer__ff input[type="email"],
  .dbs-footer__ff input[type="text"],
  .dbs-footer__ff .ff-el-form-control {
    font-size: 13px !important;
  }

  .dbs-footer__ff button,
  .dbs-footer__ff button[type="submit"],
  .dbs-footer__ff input[type="submit"],
  .dbs-footer__ff .ff-btn,
  .dbs-footer__ff .ff-btn-submit {
    font-size: 13px !important;
  }

  .dbs-footer__social a {
    width: 38px;
    height: 38px;
  }
}

/* =========================
   Reduced Motion
========================= */

@media (prefers-reduced-motion: reduce) {
  .dbs-footer__top,
  .dbs-footer__subscribe,
  .dbs-footer__main,
  .dbs-footer__bottom {
    animation: none;
  }

  .dbs-footer *,
  .dbs-footer *::before,
  .dbs-footer *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}