/* ============================================================
   社團法人臺中市藥師公會 — 全站共用樣式 site.css
   用途：內頁共用（頁首、導覽列、頁尾、內文排版）
   設計來源：2026 新版首頁 index.html 的設計系統
   維護方式：所有內頁引用此檔，改一處全站生效
   ============================================================ */

:root {
  --primary: #1a5c8a;
  --primary-dark: #0f3d60;
  --primary-light: #2e7bbf;
  --accent: #e8a820;
  --accent-light: #f5c842;
  --text-dark: #1a2332;
  --text-mid: #4a5568;
  --text-light: #718096;
  --bg-light: #f4f7fb;
  --bg-white: #ffffff;
  --border: #dce4ef;
  --green: #2e8b57;
  --red: #c0392b;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', sans-serif;
  color: var(--text-dark);
  background: var(--bg-white);
  margin: 0;
  line-height: 1.7;
}

/* ─── TOP BAR ─── */
#topbar {
  background: var(--primary-dark);
  color: #cddff0;
  font-size: 0.82rem;
  padding: 6px 0;
}
#topbar a { color: #cddff0; text-decoration: none; }
#topbar a:hover { color: var(--accent-light); }
#topbar .topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
#topbar .contact-info span { margin-right: 20px; }
#topbar .social-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 0.78rem;
  transition: background .2s;
}
#topbar .social-links a:hover { background: rgba(255,255,255,0.22); }

/* ─── HEADER ─── */
#header {
  background: var(--bg-white);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(26,92,138,0.10);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-icon {
  height: 48px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

/* ─── NAVBAR ─── */
#navbar {
  display: flex;
  align-items: center;
  gap: 2px;
}
#navbar > ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 2px;
}
#navbar > ul > li { position: relative; }
#navbar > ul > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 6px;
  transition: background .18s, color .18s;
  white-space: nowrap;
}
#navbar > ul > li > a:hover,
#navbar > ul > li.active > a {
  background: var(--bg-light);
  color: var(--primary);
}
/* Dropdown */
#navbar ul ul {
  list-style: none;
  margin: 0; padding: 8px 0;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(26,92,138,0.13);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .2s;
  z-index: 200;
}
#navbar ul li:hover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#navbar ul ul li a {
  display: block;
  padding: 7px 18px;
  font-size: 0.86rem;
  color: var(--text-mid);
  text-decoration: none;
  transition: background .15s, color .15s;
}
#navbar ul ul li a:hover {
  background: var(--bg-light);
  color: var(--primary);
}
.nav-member-btn {
  background: var(--primary);
  color: white !important;
  border-radius: 6px;
  padding: 7px 16px !important;
  font-weight: 600 !important;
}
.nav-member-btn:hover {
  background: var(--primary-dark) !important;
  color: white !important;
}

/* Mobile nav */
.mobile-nav-toggle {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--primary);
  background: none;
  border: none;
  padding: 4px;
}
.mobile-close { display: none; }
@media (max-width: 992px) {
  .mobile-nav-toggle { display: block; }
  #navbar {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.98);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 30px 30px;
    overflow-y: auto;
    z-index: 999;
  }
  #navbar.open { display: flex; }
  #navbar > ul { flex-direction: column; width: 100%; gap: 0; }
  #navbar > ul > li > a {
    padding: 12px 6px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }
  #navbar ul ul {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 16px;
    background: var(--bg-light);
  }
  .mobile-close {
    position: fixed;
    top: 18px;
    right: 20px;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--primary-dark);
    background: none;
    border: none;
    z-index: 1001;
    display: none;
  }
  #navbar.open .mobile-close { display: block; }
}

/* ─── 內頁標題帶（PAGE HEAD）─── */
.page-head {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 40px 0 32px;
}
.page-head-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}
.page-head h1 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 6px;
}
.breadcrumb-nav {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
}
.breadcrumb-nav a { color: rgba(255,255,255,0.85); text-decoration: none; }
.breadcrumb-nav a:hover { color: var(--accent-light); }
.breadcrumb-nav .sep { margin: 0 8px; color: rgba(255,255,255,0.4); }

/* ─── 內頁內容區（PAGE CONTENT）─── */
.page-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}
.page-content h2 {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin: 36px 0 16px;
}
.page-content h2:first-child { margin-top: 0; }
.page-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin: 28px 0 10px;
}
.page-content p { font-size: 0.95rem; color: var(--text-mid); margin: 0 0 14px; }
.page-content ul, .page-content ol { font-size: 0.95rem; color: var(--text-mid); padding-left: 24px; }
.page-content li { margin-bottom: 8px; }
.page-content a { color: var(--primary); }
.page-content a:hover { color: var(--primary-dark); }
.page-content img { max-width: 100%; height: auto; border-radius: 8px; }

/* 內頁表格 */
.page-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 16px 0 24px;
}
.page-content table th {
  background: var(--primary);
  color: white;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}
.page-content table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mid);
  vertical-align: top;
}
.page-content table tr:hover td { background: var(--bg-light); }
/* 表格在手機可橫向捲動：外層包 <div class="table-scroll"> */
.table-scroll { overflow-x: auto; }

/* 時間軸（沿革類頁面適用） */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 24px 28px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline .t-year {
  display: inline-block;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.timeline p { margin: 0; }

/* 人物卡片（理監事、主委類頁面適用） */
.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 22px 18px;
  margin: 20px 0 32px;
}
.person-card { text-align: center; }
.person-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 3px 12px rgba(26,92,138,0.10);
  margin-bottom: 8px;
}
.person-role {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: .08em;
}
.person-name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: .12em;
}
.person-title {
  display: block;
  font-size: 0.78rem;
  color: var(--text-light);
}

/* 姓名格（顧問、會員代表類名單） */
.name-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
  margin: 14px 0 28px;
}
.name-grid span {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: var(--text-mid);
  text-align: center;
  white-space: nowrap;
}
.name-grid span b { color: var(--primary); font-weight: 600; margin-right: 4px; }

/* 人物介紹（理事長頁） */
.profile-row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin: 8px 0 32px;
}
.profile-row .profile-photo {
  flex: 0 0 auto;
  width: 240px;
  min-width: 0;
  height: auto;
  align-self: flex-start;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(26,92,138,0.12);
}
.profile-row > div { flex: 1; min-width: 0; }
.profile-row h3:first-child { margin-top: 0; }
@media (max-width: 640px) {
  .profile-row { flex-direction: column; }
  .profile-row .profile-photo { flex: none; width: 70%; max-width: 260px; margin: 0 auto; }
}

/* 條文（章程、辦法類頁面適用） */
.law-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.law-item:last-child { border-bottom: none; }
.law-no {
  flex-shrink: 0;
  width: 86px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.law-item p { margin: 0; }
.law-item ul, .law-item ol { margin: 6px 0 0; }
@media (max-width: 480px) {
  .law-item { flex-direction: column; gap: 2px; }
  .law-no { width: auto; }
}

/* 連結清單（活動花絮、相簿/影片列表適用） */
.link-list { list-style: none; margin: 14px 0 28px; padding: 0; }
.link-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.link-list li:hover { background: var(--bg-light); }
.link-list li > i {
  flex-shrink: 0;
  color: var(--primary);
  font-size: 1.05rem;
  position: relative;
  top: 2px;
}
.link-list li > i.bi-youtube { color: var(--red); }
.link-list a { color: var(--text-mid); text-decoration: none; }
.link-list a:hover { color: var(--primary); text-decoration: underline; }

/* 提示卡片 */
.note-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text-mid);
  margin: 20px 0;
}

/* ─── 徵才頁元件 ─── */
.last-updated { text-align: right; font-size: 0.85rem; color: var(--text-light); margin: 0 0 10px; }
.notice-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-mid);
  margin: 0 0 18px;
}
.job-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; font-size: 0.9rem; }
.job-toolbar input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.count-info { color: var(--text-light); font-size: 0.82rem; }
.no-results { display: none; text-align: center; color: var(--text-light); padding: 24px 0; }
/* 手機:表格轉卡片 */
@media (max-width: 768px) {
  .job-table thead { display: none; }
  .job-table, .job-table tbody, .job-table tr, .job-table td { display: block; width: 100%; }
  .job-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 14px;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(26,92,138,0.06);
  }
  .job-table td { border: none; padding: 3px 0; }
  .job-table td::before {
    content: attr(data-th) "：";
    font-weight: 600;
    color: var(--primary);
    margin-right: 4px;
  }
  .job-table tr:hover td { background: transparent; }
}
.apply-box { text-align: center; margin: 30px 0 10px; }
.apply-btn,
.page-content a.apply-btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background .15s;
}
.apply-btn:hover,
.page-content a.apply-btn:hover { background: var(--primary-dark); color: #fff; }
.info-text { font-size: 0.82rem; color: var(--text-light); margin-top: 10px; }

/* ─── FOOTER ─── */
#footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.82);
  padding: 48px 0 0;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .f-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 10px;
}
.footer-brand p { font-size: 0.84rem; line-height: 1.7; margin: 0 0 16px; }
.footer-contact p { font-size: 0.84rem; line-height: 1.9; margin: 0; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.1);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  text-decoration: none;
  transition: background .18s;
}
.footer-social a:hover { background: var(--accent); }
.footer-col h6 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col ul li { margin-bottom: 7px; }
.footer-col ul li a {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}
.footer-col ul li a:hover { color: white; }
.footer-col ul li a::before {
  content: '›';
  color: var(--accent);
  font-size: 1rem;
}
.footer-bottom {
  text-align: center;
  padding: 16px 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}
.footer-bottom a { color: rgba(255,255,255,0.55); text-decoration: none; }

/* ─── BACK TO TOP ─── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 40px; height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.1rem;
  box-shadow: 0 3px 12px rgba(26,92,138,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 800;
}
.back-to-top.show { opacity: 1; pointer-events: all; }
.back-to-top:hover { background: var(--primary-dark); color: white; }
