@charset "UTF-8";
/* ==========================================================================
   fy-edu.css｜輔英科技大學附設醫院・衛教專區
   --------------------------------------------------------------------------
   配色原則
   - 主色：官網導覽列與側欄藍（#0B5CB0），維持品牌識別
   - 中性：白底＋極淡暖灰卡片，降低冷感，閱讀較柔和
   - 點綴：藍綠色僅用於箭頭等小面積提示，不搶主色
   - 邊框：全頁只用三階灰（一般、互動、強調），不再混用
   字級：內文 16px 為基準，按鈕與標題略大，符合長輩閱讀需求
   無障礙：文字對比 ≥ 4.5:1，互動元件邊框 ≥ 3:1，觸控區 ≥ 44px
   相容：Bootstrap 3.3.7，所有選擇器以 .fy-edu 作用域隔離
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. 設計變數
   -------------------------------------------------------------------------- */
.fy-edu {
  /* 品牌藍 */
  --fy-brand: #0b5cb0;
  --fy-brand-hover: #094f9a;
  --fy-brand-deep: #084a8e;
  --fy-brand-soft: #eaf3fb;
  --fy-brand-tint: #d6e6f5;

  /* 點綴藍綠（僅用於箭頭等裝飾） */
  --fy-aqua: #17788d;
  --fy-aqua-light: #c4e8f1;

  /* 焦點框 */
  --fy-focus: #084a8e;

  /* 背景 */
  --fy-surface: #ffffff;
  --fy-paper: #fbf9f6;

  /* 邊框：三階 */
  --fy-line: #e8e1d6; /* 一般：卡片、分隔線 */
  --fy-line-strong: #988e80; /* 互動：按鈕、搜尋框（對比 ≥ 3:1） */
  --fy-line-hover: #8fb2d6; /* hover 邊框 */

  /* 文字 */
  --fy-text: #2b2622;
  --fy-text-sub: #5e564e;
  --fy-text-hint: #7a7068;

  /* 形狀與陰影 */
  --fy-radius-lg: 16px;
  --fy-radius-md: 12px;
  --fy-radius-pill: 999px;
  --fy-shadow-sm:
    0 1px 2px rgba(43, 38, 34, 0.04), 0 4px 12px rgba(43, 38, 34, 0.05);
  --fy-shadow-md: 0 8px 24px rgba(11, 92, 176, 0.12);

  box-sizing: border-box;
  color: var(--fy-text);
  font-size: 16px;
  line-height: 1.7;
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    "PingFang TC",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.fy-edu *,
.fy-edu *::before,
.fy-edu *::after {
  box-sizing: border-box;
}

/* 清除 Bootstrap 3 對 ul、li、a 的預設樣式 */
.fy-edu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fy-edu a {
  text-decoration: none;
}

/* 鍵盤焦點：統一深藍外框，清楚可辨 */
.fy-edu a:focus-visible,
.fy-edu button:focus-visible,
.fy-edu input:focus-visible {
  outline: 3px solid var(--fy-focus);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   1. 返回按鈕（單張列表頁）
   -------------------------------------------------------------------------- */
.fy-edu .fy-edu__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 20px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--fy-brand);
  background-color: var(--fy-surface);
  border: 1.5px solid var(--fy-line-strong);
  border-radius: 10px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

/* --------------------------------------------------------------------------
   2. 分類卡片（.fy-edu__group）
   -------------------------------------------------------------------------- */
.fy-edu__group {
  margin: 0 0 32px;
  padding: 28px 32px 32px;
  background-color: var(--fy-paper);
  border: 1px solid var(--fy-line);
  border-radius: var(--fy-radius-lg);
  box-shadow: var(--fy-shadow-sm);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.fy-edu__group:last-child {
  margin-bottom: 0;
}

/* 標題列：直條 ＋ 標題 */
.fy-edu__head {
  display: flex;
  align-items: center;
  margin: 0 0 24px;
  padding-bottom: 16px;
  min-width: 0;
  border-bottom: 1px solid var(--fy-line);
}

/* 單張列表頁：分隔線交由 head-wrap 負責 */
.fy-edu__head-wrap .fy-edu__head {
  margin: 0;
  padding: 0;
  border-bottom: none;
}

.fy-edu__bar {
  flex: 0 0 auto;
  width: 5px;
  height: 26px;
  margin-right: 14px;
  border-radius: 3px;
  background-color: var(--fy-brand);
}

.fy-edu__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--fy-brand-deep);
}

/* 單張列表頁：標題 ＋ 搜尋列 */
.fy-edu__head-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fy-line);
}

/* --------------------------------------------------------------------------
   3. 衛教首頁：膠囊按鈕
      ul.fy-edu__list > li.fy-edu__item > a.fy-edu__link
   -------------------------------------------------------------------------- */
.fy-edu__list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.fy-edu__item {
  margin: 0;
  padding: 0;
}

.fy-edu .fy-edu__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  min-height: 52px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  color: var(--fy-brand);
  background-color: var(--fy-surface);
  border: 1.5px solid var(--fy-line-strong);
  border-radius: var(--fy-radius-pill);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

/* 箭頭由 CSS 產生，HTML 不需額外元素 */
.fy-edu .fy-edu__link::after {
  content: "→";
  font-size: 1.05em;
  font-weight: 700;
  color: var(--fy-aqua);
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

/* 點擊中與鍵盤焦點：實心品牌藍 */
.fy-edu .fy-edu__link:focus-visible,
.fy-edu .fy-edu__link:active {
  background-color: var(--fy-brand);
  border-color: var(--fy-brand);
  color: #ffffff;
  box-shadow: var(--fy-shadow-md);
}

.fy-edu .fy-edu__link:focus-visible::after,
.fy-edu .fy-edu__link:active::after {
  color: var(--fy-aqua-light);
}

/* --------------------------------------------------------------------------
   4. 單張列表：搜尋列
   -------------------------------------------------------------------------- */
.fy-edu__search-box {
  position: relative;
  width: 100%;
  max-width: 380px;
}

.fy-edu .fy-edu__search-input {
  width: 100%;
  height: 52px;
  padding: 10px 48px 10px 20px;
  font-size: 16px; /* 16px 以上避免 iOS Safari 點擊時自動放大 */
  color: var(--fy-text);
  background-color: var(--fy-surface);
  border: 1.5px solid var(--fy-line-strong);
  border-radius: 26px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(43, 38, 34, 0.04);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.fy-edu .fy-edu__search-input:focus {
  border-color: var(--fy-brand);
  box-shadow: 0 0 0 3px rgba(11, 92, 176, 0.18);
}

.fy-edu .fy-edu__search-input::placeholder {
  color: var(--fy-text-hint);
  opacity: 1;
}

/* 清除按鈕：觸控區 44px，圖示維持視覺大小 */
.fy-edu .fy-edu__search-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  color: var(--fy-text-sub);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* 相容 JavaScript 以 style.display 或 class 顯示 */
.fy-edu .fy-edu__search-clear[style*="display: block"],
.fy-edu .fy-edu__search-clear.is-visible {
  display: flex;
}

.fy-edu .fy-edu__search-clear:hover {
  color: var(--fy-brand);
}

/* --------------------------------------------------------------------------
   5. 單張列表：卡片
      ul.fy-edu__doc-list > li > a.fy-edu__doc-link
   -------------------------------------------------------------------------- */
.fy-edu__doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.fy-edu__doc-list li {
  margin: 0;
  padding: 0;
}

.fy-edu .fy-edu__doc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 18px 22px;
  background-color: var(--fy-surface);
  border: 1px solid var(--fy-line);
  border-radius: var(--fy-radius-md);
  box-shadow: var(--fy-shadow-sm);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.fy-edu__doc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.fy-edu__doc-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--fy-text);
  transition: color 0.18s ease;
}

.fy-edu__doc-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--fy-text-sub);
}

/* 編號徽章：統一為品牌淡藍，不再使用暖色 */
.fy-edu__doc-badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--fy-brand);
  background-color: var(--fy-brand-soft);
  border-radius: 6px;
}

/* 右側圓形圖示（HTML 內容為 ↓） */
.fy-edu__doc-arrow {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: 16px;
  border-radius: 50%;
  color: var(--fy-brand);
  background-color: var(--fy-brand-soft);
  font-size: 18px;
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

/* 鍵盤焦點：與 hover 相同的邊框、陰影與反白 */
.fy-edu .fy-edu__doc-link:focus-visible {
  border-color: var(--fy-brand);
  box-shadow: var(--fy-shadow-md);
}

.fy-edu .fy-edu__doc-link:focus-visible .fy-edu__doc-name {
  color: var(--fy-brand);
}

.fy-edu .fy-edu__doc-link:focus-visible .fy-edu__doc-arrow {
  color: #ffffff;
  background-color: var(--fy-brand);
}

/* --------------------------------------------------------------------------
   6. 查無結果提示
   -------------------------------------------------------------------------- */
.fy-edu__no-result {
  margin-top: 12px;
  padding: 32px 20px;
  text-align: center;
  font-size: 16px;
  color: var(--fy-text-sub);
  background-color: var(--fy-surface);
  border: 1px dashed var(--fy-line-strong);
  border-radius: var(--fy-radius-md);
}

/* --------------------------------------------------------------------------
   7. 滑鼠 hover（僅支援 hover 的裝置，觸控裝置不會殘留狀態）
   -------------------------------------------------------------------------- */
@media (hover: hover) {
  .fy-edu__group:hover {
    border-color: var(--fy-brand-tint);
    box-shadow: var(--fy-shadow-md);
  }

  .fy-edu .fy-edu__back:hover {
    background-color: var(--fy-brand-soft);
    border-color: var(--fy-brand);
    color: var(--fy-brand-deep);
  }

  .fy-edu .fy-edu__link:hover {
    background-color: var(--fy-brand);
    border-color: var(--fy-brand);
    color: #ffffff;
    box-shadow: var(--fy-shadow-md);
  }

  .fy-edu .fy-edu__link:hover::after {
    color: var(--fy-aqua-light);
  }

  .fy-edu .fy-edu__search-input:hover {
    border-color: var(--fy-brand-hover);
  }

  .fy-edu .fy-edu__doc-link:hover {
    border-color: var(--fy-brand);
    box-shadow: var(--fy-shadow-md);
  }

  .fy-edu .fy-edu__doc-link:hover .fy-edu__doc-name {
    color: var(--fy-brand);
  }

  .fy-edu .fy-edu__doc-link:hover .fy-edu__doc-arrow {
    color: #ffffff;
    background-color: var(--fy-brand);
  }
}

/* --------------------------------------------------------------------------
   8. 尊重系統「減少動態效果」設定
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fy-edu *,
  .fy-edu *::before,
  .fy-edu *::after {
    transition: none;
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   9. RWD
   -------------------------------------------------------------------------- */

/* 平板與手機 */
@media (max-width: 768px) {
  .fy-edu__group {
    margin-bottom: 20px;
    padding: 20px 18px 22px;
    border-radius: 12px;
  }

  .fy-edu__head {
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  .fy-edu__title {
    font-size: 19px;
  }

  /* 首頁按鈕改為單欄滿版，方便大拇指點擊 */
  .fy-edu__list {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .fy-edu__item {
    width: 100%;
  }

  .fy-edu .fy-edu__link {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    min-height: 56px;
    padding: 12px 22px;
    white-space: normal;
    border-radius: 14px;
  }

  /* 單張列表：搜尋列滿版，卡片改為單欄 */
  .fy-edu__head-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .fy-edu__search-box {
    max-width: 100%;
  }

  .fy-edu__doc-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .fy-edu .fy-edu__doc-link {
    min-height: 80px;
    padding: 16px 18px;
  }
}

/* 小尺寸手機：字級不低於 16px */
@media (max-width: 480px) {
  .fy-edu__title {
    font-size: 18px;
  }

  .fy-edu .fy-edu__link {
    font-size: 16px;
  }

  .fy-edu__doc-name {
    font-size: 17px;
  }
}
