/* 表彰認證：照 ADP awards-and-recognition 的版面
 * 一排四欄（欄與欄之間直線分隔）：證書縮圖、標題、期限、「查看 PDF ›」，點下去開 PDF。
 * 下方再放兩欄文字清單。首頁與表彰認證頁共用。 */
:root { --sj-award-title: 22px; --sj-award-line: #cfd6dd; }

.sj-awards-wrap { max-width: 1140px; margin: 0 auto; padding: 56px 20px 24px; box-sizing: border-box; }
.sj-awards-head { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 40px; }
.sj-awards-ribbon { width: 64px; height: 64px; flex: none; }
.sj-awards-head h2 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: 4px; color: #000; }

.sj-awards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1140px; margin: 0 auto; }
.sj-award {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 12px 24px 8px; border-left: 1px solid var(--sj-award-line);
  color: #333; text-decoration: none;
}
.sj-award:first-child { border-left: 0; }
.sj-award__thumb { display: flex; align-items: center; justify-content: center; height: 150px; margin-bottom: 24px; }
/* 認證單位的標誌（徽章）：不放證書內容，點卡片才開 PDF */
.sj-award__thumb img {
  display: block; max-height: 140px; width: auto; max-width: 78%;
  transition: transform .25s;
}
.sj-award:hover .sj-award__thumb img { transform: translateY(-4px) scale(1.03); }
.sj-award__title { margin: 0 0 12px; font-size: var(--sj-award-title); font-weight: 600; line-height: 1.4; color: #000; }
.sj-award__sub { margin: 0 0 16px; font-size: 16px; line-height: 24px; color: #333; }
.sj-award__link {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 0; border: 0; background: transparent;            /* 不要外框 */
  font-size: 15px; font-weight: 600; color: #10A063;
}
.sj-pdf-ico { width: 18px; height: 18px; flex: none; }
.sj-award:hover .sj-award__link span, .sj-award:focus-visible .sj-award__link span { text-decoration: underline; }
.sj-awards-more { text-align: center; margin: 28px 0 0; }
.sj-awards-more a { font-size: 15px; font-weight: 600; color: #10A063; text-decoration: none; }
.sj-awards-more a:hover { text-decoration: underline; }

/* 全部證書：兩欄文字清單 */
.sj-awards-listwrap { padding-top: 40px; padding-bottom: 80px; }
.sj-awards-listhead { margin: 0 0 24px; font-size: 32px; font-weight: 700; letter-spacing: 4px; color: #000; }
.sj-awards-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 64px; }
.sj-awards-list li { break-inside: avoid; margin: 0 0 20px; font-size: 16px; line-height: 24px; color: #333; }
.sj-awards-list a { display: block; font-weight: 600; color: #2D568C; text-decoration: none; }
.sj-awards-list a:hover { text-decoration: underline; color: #10A063; }
.sj-awards-list span { display: block; color: #555; }

@media (max-width: 900px) {
  .sj-awards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sj-award:nth-child(odd) { border-left: 0; }
  .sj-award:nth-child(n+3) { border-top: 1px solid var(--sj-award-line); margin-top: 16px; padding-top: 28px; }
  .sj-awards-list { columns: 1; }
}
@media (max-width: 560px) {
  .sj-awards { grid-template-columns: 1fr; }
  .sj-award { border-left: 0; }
  .sj-award:nth-child(n+2) { border-top: 1px solid var(--sj-award-line); margin-top: 16px; padding-top: 28px; }
  .sj-awards-head h2, .sj-awards-listhead { font-size: 24px; letter-spacing: 2px; }
  .sj-awards-ribbon { width: 48px; height: 48px; }
}


/* PDF 閱讀視窗 */
.sj-pdf-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(10, 22, 34, .72); box-sizing: border-box; }
.sj-pdf-modal[hidden] { display: none; }
.sj-pdf-panel { display: flex; flex-direction: column; width: min(980px, 100%); height: min(92vh, 1200px);
  background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
.sj-pdf-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 22px; border-bottom: 1px solid #e3e8ee; }
.sj-pdf-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; color: #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sj-pdf-btn { flex: none; padding: 7px 16px; border: 2px solid #10A063; border-radius: 30px; font-size: 14px; font-weight: 600;
  color: #10A063; text-decoration: none; transition: background .2s, color .2s; }
.sj-pdf-btn:hover { background: #10A063; color: #fff; }
.sj-pdf-close { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #eef2f6; color: #333;
  font-size: 26px; line-height: 1; cursor: pointer; }
.sj-pdf-close:hover { background: #dfe6ed; }
.sj-pdf-frame { flex: 1; width: 100%; border: 0; background: #f3f5f7; }

/* 首頁「表彰認證」標題前的獎項圖示 */
.elementor-heading-title.sj-awards-title { display: flex; align-items: center; justify-content: center; gap: 16px; }
.sj-awards-ribbon--inline { width: 44px; height: 44px; flex: none; }

/* PDF 視窗的按鈕：蓋過主題預設的按鈕樣式（粉紅色） */
.sj-pdf-modal .sj-pdf-close { background: #eef2f6 !important; color: #333 !important; border: 0 !important; box-shadow: none !important; }
.sj-pdf-modal .sj-pdf-close:hover { background: #dfe6ed !important; }
.sj-pdf-modal .sj-pdf-close:focus-visible, .sj-pdf-modal .sj-pdf-btn:focus-visible { outline: 3px solid #2D568C; outline-offset: 2px; }

/* 首頁：卡片沒有單獨的「查看 PDF」，整張卡片仍可點；下方只有「查看全部 ›」 */
.sj-award:not(:has(.sj-award__link)) { padding-bottom: 20px; cursor: pointer; }
.sj-award:not(:has(.sj-award__link)):hover .sj-award__title { color: #10A063; }

/* 關閉鈕：X 在圓鈕正中央（蓋過主題預設按鈕的內距、行高） */
.sj-pdf-modal .sj-pdf-close {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0 !important; margin: 0 0 0 4px; line-height: 1 !important;
  border-radius: 50% !important; font-size: 0 !important;
}
.sj-pdf-modal .sj-pdf-close svg { display: block; width: 18px; height: 18px; }
.sj-pdf-panel:focus { outline: none; }
