/* TEMS Newsletter — 台灣緊急醫療救護通訊
   乾淨、響應式、易維護的樣式表 */

:root {
  --brand: #b32026;        /* 急救紅 */
  --brand-dark: #8a181d;
  --ink: #222;
  --muted: #666;
  --line: #e5e5e5;
  --bg: #ffffff;
  --bg-soft: #f7f5f3;
  --max: 960px;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  line-height: 1.85;
  background: var(--bg);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  border-top: 5px solid var(--brand);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--max);
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 46px; width: auto; border-radius: 4px; }
.brand-text b { font-size: 1.15rem; color: var(--ink); display: block; letter-spacing: .5px; }
.brand-text span { font-size: .8rem; color: var(--muted); }

.nav a {
  color: var(--ink);
  font-weight: 600;
  margin-left: 22px;
  font-size: .98rem;
}
.nav a:hover { color: var(--brand); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  text-align: center;
  padding: 54px 20px;
}
.hero h1 { margin: 0 0 8px; font-size: 2rem; letter-spacing: 1px; }
.hero p { margin: 0; opacity: .9; }

/* ---------- Sections ---------- */
section { padding: 40px 0; }
.section-title {
  font-size: 1.4rem;
  color: var(--brand);
  border-left: 5px solid var(--brand);
  padding-left: 12px;
  margin: 0 0 24px;
}

/* ---------- Latest issue card ---------- */
.latest {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 26px;
  align-items: start;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.latest img { border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.12); width: 100%; }
.latest h3 { margin: 0 0 6px; font-size: 1.25rem; }
.latest .date { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.latest ul { margin: 0 0 16px; padding-left: 20px; }
.latest ul li { margin-bottom: 4px; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none !important;
}
.btn:hover { background: var(--brand-dark); }

/* ---------- Archive list ---------- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.archive-grid a {
  display: block;
  text-align: center;
  padding: 14px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
  transition: .15s;
}
.archive-grid a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; transform: translateY(-2px); }
.archive-grid a.pending { color: #aaa; font-weight: 400; }

/* ---------- Events ---------- */
.event {
  border-left: 3px solid var(--brand);
  padding: 4px 0 4px 16px;
  margin-bottom: 20px;
  background: var(--bg-soft);
  border-radius: 0 6px 6px 0;
  padding: 14px 16px;
}
.event b { display: block; }

/* ---------- Article (issue page) ---------- */
.article { padding: 40px 0 60px; }
.article .kicker { color: var(--brand); font-weight: 700; letter-spacing: 1px; }
.article h1 { font-size: 1.8rem; margin: 6px 0 4px; line-height: 1.4; }
.article .meta { color: var(--muted); font-size: .92rem; margin-bottom: 30px; }
.article h2 {
  font-size: 1.35rem;
  margin: 44px 0 6px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.article h2 .tag { color: var(--brand); }
.article h3 { font-size: 1.1rem; margin: 26px 0 6px; color: var(--brand-dark); }
.article p { margin: 12px 0; text-align: justify; }
.article figure { margin: 24px 0; text-align: center; }
.article figure img { border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.12); }
.article figure figcaption { font-size: .88rem; color: var(--muted); margin-top: 8px; }
.article .byline { font-style: normal; color: var(--muted); font-size: .95rem; }
.article ol.refs { font-size: .88rem; color: var(--muted); }
.article ol.refs li { margin-bottom: 8px; }
.callout {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 20px 0;
}
.figs-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.figs-2 figure { margin: 8px 0; }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  line-height: 2;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #2b2b2b;
  color: #cfcfcf;
  text-align: center;
  padding: 30px 20px;
  font-size: .88rem;
  margin-top: 40px;
}
.site-footer a { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  body { font-size: 16px; }
  .latest { grid-template-columns: 1fr; }
  .latest img { max-width: 220px; margin: 0 auto; }
  .figs-2 { grid-template-columns: 1fr; }
  .nav a { margin-left: 14px; }
  .hero h1 { font-size: 1.5rem; }
}

/* ---------- Masthead（首頁標題圖片） ---------- */
.masthead {
  background: #fff;
  text-align: center;
  padding: 26px 20px 16px;
  border-bottom: 3px solid var(--brand);
}
.masthead img { max-width: 720px; width: 100%; height: auto; }
.masthead .subtitle { color: var(--brand); font-weight: 700; margin-top: 4px; letter-spacing: 2px; font-size: 1.05rem; }

/* ---------- 段落分隔標題條（文章頁） ---------- */
.section-divider { display: block; width: 100%; margin: 50px 0 4px; }
@media (max-width: 680px){ .masthead .subtitle { font-size: .95rem; } }

/* ---------- 手機收合選單（漢堡） ---------- */
.nav-toggle{display:none;flex-direction:column;justify-content:center;gap:5px;background:none;border:0;cursor:pointer;padding:8px;margin-left:auto}
.nav-toggle span{display:block;width:26px;height:3px;background:var(--ink);border-radius:2px;transition:.2s}
.site-header.nav-open .nav-toggle span:nth-child(1){transform:translateY(8px) rotate(45deg)}
.site-header.nav-open .nav-toggle span:nth-child(2){opacity:0}
.site-header.nav-open .nav-toggle span:nth-child(3){transform:translateY(-8px) rotate(-45deg)}

@media (max-width:680px){
  .nav-toggle{display:flex}
  .header-inner{flex-wrap:wrap}
  .brand-text b{font-size:1rem}
  .brand-text span{font-size:.72rem}
  .nav{display:none;flex-basis:100%;width:100%;flex-direction:column;align-items:stretch;gap:0;padding-top:8px}
  .site-header.nav-open .nav{display:flex}
  .nav a{margin:0;padding:14px 6px;border-top:1px solid var(--line);font-size:1.05rem}
  /* 手機閱讀優化 */
  .wrap{padding:0 16px}
  .article{padding:22px 0 40px}
  .article h1{font-size:1.4rem}
  .article h2{font-size:1.16rem;margin-top:30px}
  .article h3{font-size:1.02rem}
  .article p{text-align:left}
  .section-divider{margin:32px 0 2px}
  .masthead{padding:18px 16px 12px}
  .masthead img{max-width:100%}
  .masthead .subtitle{letter-spacing:1px}
}

/* ---------- 造訪人次計數器 ---------- */
.visits{margin-top:16px;font-size:.85rem;color:#b9b9b9}
.visits img{height:30px;vertical-align:middle;margin-left:6px}

/* ---------- 舊站（Weebly）匯入內容 legacy-content ---------- */
/* 由 Weebly 匯入的歷史刊物，沿用原始 HTML，這裡把舊站 class 對應到本站樣式 */
.legacy-content { line-height: 1.85; }
.legacy-content h2.wsite-content-title,
.legacy-content .wsite-content-title {
  font-size: 1.35rem;
  color: var(--ink);
  margin: 44px 0 6px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  line-height: 1.5;
}
.legacy-content .wsite-content-title font[size="6"],
.legacy-content .wsite-content-title strong { color: var(--brand); }
.legacy-content .paragraph { margin: 12px 0; text-align: justify; }
.legacy-content .paragraph[style*="text-align:right"] { color: var(--muted); font-size: .95rem; }
.legacy-content h3 { font-size: 1.1rem; margin: 26px 0 6px; color: var(--brand-dark); }
.legacy-content p { margin: 12px 0; text-align: justify; }
.legacy-content a { color: var(--brand); word-break: break-word; }
.legacy-content .wsite-image { margin: 24px 0; text-align: center; }
.legacy-content .wsite-image img { border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.12); max-width: 100%; height: auto; }
.legacy-content .wsite-multicol-table { width: 100%; border-collapse: collapse; }
.legacy-content .wsite-multicol-table-wrap { overflow-x: auto; }
.legacy-content iframe { max-width: 100%; }
.legacy-content ul, .legacy-content ol { padding-left: 22px; }
.legacy-content hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
@media (max-width: 680px){
  .legacy-content .wsite-content-title { font-size: 1.16rem; margin-top: 30px; }
  .legacy-content .paragraph, .legacy-content p { text-align: left; }
  .legacy-content .wsite-multicol-col { display: block; width: 100% !important; }
}
