/* =====================================================================
   Ainos 2026 改版共用樣式
   新頁面一律以 .ap 作為 section 前綴 (ainos page)，避免影響舊站樣式。
   ===================================================================== */
:root {
    --ap-blue: #006AB1;        /* 主色：沿用舊站標題藍 */
    --ap-blue-dark: #00549a;
    --ap-blue-light: #DCEDFC;  /* 淡藍底色區塊 */
    --ap-text: #3d3d3d;
    --ap-text-light: #666;
    --ap-radius: 16px;
    --ap-shadow: 0 6px 24px rgba(0, 60, 120, .10);
    --ap-font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", sans-serif;
}

/* 選單目前頁 */
.cid-sEC4qZxgH6 .nav-link.active,
.cid-sEC4qZxgH6 .dropdown-item.active { color: var(--ap-blue) !important; }

/* ---------- 新頁面共用 ---------- */
.ap { font-family: var(--ap-font); color: var(--ap-text); letter-spacing: .04em; position: relative; }
:where(.ap) img { max-width: 100%; height: auto; } /* :where = 0 specificity，頁面樣式可直接覆寫 */
.ap--light { background: var(--ap-blue-light); }
.ap-section { padding: 100px 0; }
.ap-section--sm { padding: 60px 0; }
.ap-container { max-width: 1600px; margin: 0 auto; padding: 0 40px; }
.ap-narrow { max-width: 1200px; margin: 0 auto; padding: 0 40px; }

/* 頁首主視覺：圖片內含標題文字 */
.ap-hero { line-height: 0; overflow: hidden; background: var(--ap-blue-light); margin-top: var(--ap-nav-h, 80px); }
.ap-hero img { width: 100%; height: auto; display: block; }
.ap-hero h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 標題 */
.ap-title { color: var(--ap-blue); font-family: var(--ap-font); font-weight: 700; font-size: 1.976rem; line-height: 1.35; letter-spacing: .06em; margin: 0 0 1.5rem; }
.ap-title--center { text-align: center; }
.ap-title--bar { display: flex; align-items: center; gap: 28px; }
.ap-title--bar::before { content: ""; flex: 0 0 10px; align-self: stretch; min-height: 1.1em; background: var(--ap-blue); }
.ap-subtitle { color: var(--ap-text); font-family: var(--ap-font); font-weight: 500; font-size: 1.14rem; line-height: 1.6; margin: 0 0 1rem; }
.ap-eyebrow { color: var(--ap-blue); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 0.938rem; }

/* 內文 */
.ap-text { font-family: var(--ap-font); font-size: 0.95rem; line-height: 2.1; color: var(--ap-text); font-weight: 400; }
.ap-text p { margin: 0 0 1.4em; }
.ap-text--center { text-align: center; }
.ap-text strong { color: var(--ap-blue); font-weight: 700; }

/* 卡片 */
.ap-card { background: #fff; border-radius: var(--ap-radius); box-shadow: var(--ap-shadow); overflow: hidden; }

/* 影片封面＋播放鈕 */
.ap-video { position: relative; display: block; cursor: pointer; line-height: 0; border: 0; padding: 0; background: none; width: 100%; }
.ap-video img { width: 100%; display: block; }
.ap-video::after { content: ""; position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -52px 0 0 -52px; border-radius: 50%;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l10.5-6.5z' fill='none' stroke='%231e88c8' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 56% 50%/46px no-repeat;
    box-shadow: 0 4px 20px rgba(0,0,0,.2); transition: transform .2s; }
.ap-video:hover::after { transform: scale(1.08); }

/* 影片燈箱 */
.ap-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; padding: 20px; }
.ap-lightbox.is-open { display: flex; }
.ap-lightbox__inner { position: relative; width: min(1200px, 100%); aspect-ratio: 16/9; }
.ap-lightbox__inner iframe { width: 100%; height: 100%; border: 0; }
.ap-lightbox__close { position: absolute; top: -48px; right: 0; color: #fff; font-size: 30.4px; line-height: 1; background: none; border: 0; cursor: pointer; }

/* ---------- 最新消息 ---------- */
.news-search-result { color: var(--ap-text-light); }
.news-content img { max-width: 100%; height: auto; }
.news-content table { max-width: 100%; }
.news-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid #ddd; font-size: 0.938rem; }
.news-pager a { color: var(--ap-blue); }
.news-pager__back { margin: 0 auto; }
.cid-sLTuYsvGB8 .pagination li.active a { font-weight: 700; text-decoration: underline; }

/* ---------- RWD ---------- */
@media (max-width: 1199px) {
    .ap-title { font-size: 1.672rem; }
    .ap-text { font-size: 0.938rem; }
    .ap-section { padding: 72px 0; }
}
@media (max-width: 767px) {
    .ap-container, .ap-narrow { padding: 0 20px; }
    .ap-title { font-size: 1.292rem; }
    .ap-title--bar { gap: 16px; }
    .ap-title--bar::before { flex-basis: 6px; }
    .ap-subtitle { font-size: 0.938rem; }
    .ap-text { font-size: 0.938rem; line-height: 1.95; }
    .ap-section { padding: 52px 0; }
    .ap-video::after { width: 64px; height: 64px; margin: -32px 0 0 -32px; background-size: 30px; }
}
