/* --- 官網藍色系：對齊 e首發票主站視覺 --- */
:root {
  --einv-brand-blue: #1f5bd8;
  --einv-brand-blue-light: #3b82f6;
  --einv-brand-blue-dark: #0b3f9f;
  --einv-brand-blue-soft: #eaf3ff;
  --einv-brand-blue-border: #9cc5ff;
  --einv-content-font-size: 0.7rem;

  --md-primary-fg-color: var(--einv-brand-blue);
  --md-primary-fg-color--light: var(--einv-brand-blue-light);
  --md-primary-fg-color--dark: var(--einv-brand-blue-dark);
  --md-accent-fg-color: var(--einv-brand-blue);
  --md-typeset-a-color: var(--einv-brand-blue);
}

.md-header,
.md-tabs {
  background-color: var(--einv-brand-blue);
}

.md-search__form {
  background-color: rgba(255, 255, 255, 0.18);
}

.md-search__form:hover,
.md-search__form:focus-within {
  background-color: rgba(255, 255, 255, 0.28);
}

.md-typeset a {
  color: var(--einv-brand-blue);
}

.md-typeset a:hover {
  color: var(--einv-brand-blue-dark);
}

.md-typeset .admonition.abstract,
.md-typeset details.abstract {
  border-color: var(--einv-brand-blue-border);
}

.md-typeset .abstract > .admonition-title,
.md-typeset .abstract > summary {
  background-color: var(--einv-brand-blue-soft);
  color: var(--einv-brand-blue-dark);
}

.md-typeset .abstract > .admonition-title::before,
.md-typeset .abstract > summary::before {
  background-color: var(--einv-brand-blue);
}

.md-footer,
.md-footer-meta {
  background-color: var(--einv-brand-blue-dark);
}

/* 文件管理用：版本紀錄、變更紀錄縮小並置於頁尾視覺 */
.md-typeset .version-record {
  font-size: 0.85em;
  color: var(--md-default-fg-color--light, #6c757d);
}
.md-typeset .version-record table {
  font-size: inherit;
}
/* 收合區塊（版本紀錄）整體置底視覺 */
.md-typeset details[open] .version-record,
.md-typeset details .version-record {
  margin-top: 0.5em;
}

/* --- 頁尾：覆寫 Material flex，強制三欄 grid + 全寬 --- */
/* 解除 Material .md-grid 對 footer inner 的欄位限制，避免自訂頁尾被壓成單欄 */
footer.md-footer .md-footer-meta__inner.md-grid {
  display: block !important;
  grid-template-columns: none !important;
  width: 100%;
  max-width: 76rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: max(0.8rem, env(safe-area-inset-left));
  padding-right: max(0.8rem, env(safe-area-inset-right));
}

.md-footer .md-copyright {
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  flex: 1 1 auto !important;
  margin: 0;
  padding: 0.85rem 0 0.5rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.55rem;
}

.md-footer .md-copyright__highlight {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
}

/* 隱藏 generator（備援；主設定見 mkdocs.yml extra.generator: false） */
.md-footer .md-copyright > a[href*="mkdocs-material"] {
  display: none !important;
}

.einv-footer {
  width: 100%;
  padding: 0.75rem 0 0.25rem;
}

/* 使用 flex 強制橫向三等分（較不受 .md-typeset 子元素 width 影響） */
footer.md-footer .einv-footer__grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  gap: 1rem 1.25rem;
  width: 100% !important;
  box-sizing: border-box;
}

footer.md-footer .einv-footer__grid > section {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 0.35rem;
  box-sizing: border-box;
}

footer.md-footer .md-footer-meta.md-typeset .einv-footer__grid > section > p {
  max-width: none !important;
}

.einv-footer h2 {
  margin: 0 0 0.35rem;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}

.einv-footer p {
  margin: 0.15rem 0;
  line-height: 1.5;
  font-size: 0.54rem;
}

.einv-footer a {
  color: #bfdbfe;
}

.einv-footer a:hover {
  color: #ffffff;
}

@media screen and (max-width: 47.9375rem) {
  footer.md-footer .einv-footer__grid {
    flex-direction: column !important;
    flex-wrap: wrap !important;
  }

  footer.md-footer .einv-footer__grid > section {
    flex: 1 1 auto !important;
    width: 100%;
  }
}

/* --- 全站正文與標題（含政策頁中英並列）--- */
/* 以右側目錄（Material .md-nav）為基準；只作用於正文容器，避免影響頁尾等其他 .md-typeset 區塊。 */
.md-content__inner.md-typeset {
  font-size: var(--einv-content-font-size);
  line-height: 1.6;
}

.md-sidebar--secondary .md-nav {
  font-size: var(--einv-content-font-size);
  line-height: 1.3;
}

/* 段落、清單與表格明確繼承正文基準，避免 Material table/admonition 預設字級另起一套。 */
.md-content__inner.md-typeset > p,
.md-content__inner.md-typeset li {
  font-size: inherit;
}

.md-content__inner.md-typeset table:not([class]) {
  font-size: inherit;
}

.md-content__inner.md-typeset table:not([class]) td,
.md-content__inner.md-typeset table:not([class]) th {
  font-size: inherit;
  padding: 0.75em 1em;
}

.md-content__inner.md-typeset .admonition,
.md-content__inner.md-typeset details {
  font-size: 0.95em;
  line-height: 1.55;
}

.md-typeset h1 {
  font-size: 1.45em;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.02em;
  margin-bottom: 0.35em;
}

.md-typeset h1 + blockquote {
  font-size: 0.95em;
  color: var(--md-typeset-color, inherit);
  opacity: 0.92;
  border-left-width: 0.12rem;
  margin-top: 0.35em;
}

.md-typeset h2 {
  font-size: 1.25em;
  font-weight: 600;
  margin-top: 1.35em;
  margin-bottom: 0.45em;
  line-height: 1.35;
}

.md-typeset h3 {
  font-size: 1.12em;
  font-weight: 600;
  margin-top: 1.1em;
  margin-bottom: 0.35em;
}

.md-typeset h4 {
  font-size: 1em;
  font-weight: 600;
  margin-top: 0.95em;
}
