@charset "UTF-8";
/* ============================================================
   a11y-toolbar.css — 無障礙快捷列樣式
   功能：字體大小 A-/A+（3 級）、高對比模式、重設
   位置：topbar .websites 右側
   WCAG 2.2 AA 合規
   ============================================================ */

/* --- 工具列容器 --- */
.a11y-toolbar {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 2px;
  flex: 0 0 auto;
  height: 25px;
}

/* --- 按鈕共用 --- */
.a11y-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 21px;
  min-width: 24px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #00857a;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.a11y-toolbar button:hover {
  background-color: rgba(0, 191, 168, 0.15);
  border-color: #00bfa8;
  color: #00bfa8;
}

.a11y-toolbar button:focus-visible {
  outline: 2px solid #005848;
  outline-offset: 1px;
}

.a11y-toolbar button.active {
  background-color: #00bfa8;
  color: #fff;
  border-color: #00bfa8;
}

.a11y-toolbar button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.a11y-toolbar button:disabled:hover {
  background: transparent;
  border-color: transparent;
}

/* --- 字體大小按鈕特殊樣式 --- */
#a11y-font-decrease {
  font-size: 11px;
}

#a11y-font-increase {
  font-size: 14px;
}

/* --- 高對比按鈕圖示 --- */
#a11y-contrast {
  font-size: 14px;
}

/* --- 重設按鈕 --- */
#a11y-reset {
  font-size: 14px;
}

/* --- 分隔線 --- */
.a11y-toolbar__sep {
  color: #b0d4cf;
  font-size: 12px;
  margin: 0 1px;
  user-select: none;
}

/* ============================================================
   字體大小層級（套用在 body）
   Level 0: 預設（不加樣式）
   Level 1: 120%
   Level 2: 140%
   ============================================================ */
html[data-font-size="1"] {
  font-size: 120% !important;
}

html[data-font-size="2"] {
  font-size: 140% !important;
}

/* ============================================================
   高對比模式（套用在 body）
   使用 filter invert + hue-rotate 全頁反轉
   圖片、影片、Canvas、iframe 反轉回來
   ============================================================ */
html[data-high-contrast="true"] {
  filter: invert(1) hue-rotate(180deg);
  -webkit-filter: invert(1) hue-rotate(180deg);
  background-color: #fff; /* invert 後變成黑底 */
}

html[data-high-contrast="true"] img,
html[data-high-contrast="true"] video,
html[data-high-contrast="true"] canvas,
html[data-high-contrast="true"] iframe,
html[data-high-contrast="true"] svg,
html[data-high-contrast="true"] picture,
html[data-high-contrast="true"] [style*="background-image"] {
  filter: invert(1) hue-rotate(180deg);
  -webkit-filter: invert(1) hue-rotate(180deg);
}

/* 高對比模式下工具列按鈕保持可辨識 */
html[data-high-contrast="true"] .a11y-toolbar button.active {
  background-color: #00bfa8;
  color: #fff;
}

/* ============================================================
   響應式：手機版
   ============================================================ */
@media (max-width: 767px) {
  .a11y-toolbar {
    gap: 1px;
  }

  .a11y-toolbar button {
    min-width: 20px;
    padding: 0 3px;
    font-size: 11px;
    height: 19px;
  }

  #a11y-font-decrease {
    font-size: 10px;
  }

  #a11y-font-increase {
    font-size: 12px;
  }

  #a11y-contrast,
  #a11y-reset {
    font-size: 12px;
  }

  .a11y-toolbar__sep {
    font-size: 10px;
  }
}

/* 極小螢幕：只顯示字體和對比按鈕，隱藏分隔線和重設 */
@media (max-width: 374px) {
  .a11y-toolbar__sep {
    display: none;
  }

  #a11y-reset {
    display: none;
  }
}
