/* ==========================================================================
   Public Shell & Modern Clean Minimalist Flat Footer (扁平無方框·對齊上方文字邊界)
   ========================================================================== */

/* 防止全域水平溢出 */
html:has(> body[data-public-shell]) {
  overflow-x: clip;
}

body[data-public-shell] {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

body[data-public-shell] > main {
  flex: 1 0 auto;
}

body[data-public-shell] > .public-footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* 現代純淨極簡扁平頁尾：無卡片方框，維持簡潔俐落的頂部邊線與柔和底色 */
body[data-public-shell] .public-footer {
  display: block !important;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 38px 0 28px;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #475569;
  font-family: inherit;
}

/* 內層容器：左右文字邊界完全與上方區塊 (.page-main / .closing-cta) 垂直切齊，無方框無多餘內縮 */
.public-footer .footer-inner {
  display: flex;
  flex-direction: column;
  width: min(calc(100% - 48px), var(--content, 1350px));
  max-width: 1350px;
  margin: 0 auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-sizing: border-box;
  font-size: 13px;
  gap: 24px;
}

/* 上層主資料列：左右頂格拉開，左邊品牌與上方區塊左緣切齊，右邊導覽與右緣切齊 */
.public-footer .footer-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px 48px;
  flex-wrap: wrap;
  width: 100%;
}

/* 左側品牌資訊 */
.public-footer .footer-brand-col {
  flex: 0 1 340px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.public-footer .footer-brand-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-width: 0;
}

.public-footer .footer-brand {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.015em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.public-footer .footer-brand-tagline {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: #64748b;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* 右側三組結構化導覽：自然展開分布，右緣緊貼容器邊界 */
.public-footer .footer-nav {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 20px clamp(24px, 4vw, 56px);
  min-width: 0;
}

/* 分組節點 (支援 details 與 div) */
.public-footer .studio-footer-group {
  display: flex;
  flex-direction: column;
  min-width: 100px;
  border: none;
  margin: 0;
  padding: 0;
}

.public-footer .studio-footer-group summary,
.public-footer .footer-group-title {
  list-style: none;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px 0;
  cursor: default;
  user-select: none;
}

.public-footer .studio-footer-group summary::-webkit-details-marker,
.public-footer .studio-footer-group summary::marker {
  display: none;
}

.public-footer .studio-footer-group > div,
.public-footer .footer-group-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

/* 導覽超連結 */
.public-footer a {
  margin: 0;
  color: #475569;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.55;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.public-footer a:hover {
  color: #0284c7;
  text-decoration: none;
}

/* LINE 官方諮詢亮點樣式 */
.public-footer a.footer-link-line {
  color: #0284c7;
  font-weight: 600;
}

.public-footer a.footer-link-line:hover {
  color: #0369a1;
  text-decoration: underline;
}

/* 狀態提示 */
.public-footer .footer-unavailable-status {
  color: #94a3b8;
  font-size: 12px;
  font-style: italic;
}

/* 下層版權宣告列：左右頂格貼齊容器兩側，無多餘留白 */
.public-footer .footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  width: 100%;
}

.public-footer .footer-copy {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.public-footer .footer-meta-note {
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* 平板與手機斷點適應 (780px 以下，完全同步 .page-main 之左右邊距) */
@media (max-width: 780px) {
  body[data-public-shell] .public-footer {
    padding: 28px 0 22px;
  }

  .public-footer .footer-inner {
    width: min(calc(100% - 32px), var(--content, 1350px));
    gap: 20px;
  }

  .public-footer .footer-main-row {
    flex-direction: column;
    gap: 22px;
    align-items: stretch;
  }

  .public-footer .footer-brand-col {
    width: 100%;
  }

  .public-footer .footer-nav {
    justify-content: flex-start;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 18px 16px;
    width: 100%;
  }

  .public-footer .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-top: 14px;
  }
}

/* 小型手機斷點 (520px 以下，完全同步 .page-main 之左右邊距) */
@media (max-width: 520px) {
  .public-footer .footer-inner {
    width: min(calc(100% - 26px), var(--content, 1350px));
  }
}
