/* 紫荊文學獎　全站樣式
   主色取紫荊花的紫紅，底色米白，標題襯線。手機優先。
   顏色都經過對比檢查：正文與連結在米白底上 ≥ 4.5:1（WCAG AA）。 */

:root {
  --plum: #7a2e6e;          /* 主色（紫荊紫紅） */
  --plum-deep: #5d1f53;     /* 深色：連結、標題 */
  --plum-ink: #3b1235;      /* 最深：大標 */
  --cream: #fdfbf7;         /* 米白底 */
  --cream-2: #f6f1e9;       /* 次底色（區塊交錯） */
  --ink: #2b2723;           /* 內文 */
  --ink-soft: #5b534c;      /* 次要文字 */
  --line: #e0d7cb;
  --focus: #9a1750;
  --shadow: 0 1px 2px rgba(59, 18, 53, .06), 0 8px 24px rgba(59, 18, 53, .08);
  --wrap: 68rem;
  --serif: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.35; color: var(--plum-ink); font-weight: 700; }

a { color: var(--plum-deep); text-underline-offset: .18em; }
a:hover { color: var(--focus); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

img, picture { max-width: 100%; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--plum-deep); color: #fff; padding: .6rem 1rem; border-radius: 0 0 .4rem .4rem;
  text-decoration: none; transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ───────── 頁首與主選單 ───────── */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 251, 247, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-head__inner {
  max-width: var(--wrap); margin: 0 auto; padding: .6rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
}
.site-head__brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.3; }
.site-head__name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--plum-ink); letter-spacing: .04em; }
.site-head__tagline { font-size: .78rem; color: var(--ink-soft); }

.site-nav__toggle {
  font: inherit; font-size: .95rem; color: var(--plum-deep); background: transparent;
  border: 1px solid var(--line); border-radius: .35rem; padding: .35rem .8rem; cursor: pointer;
}
.site-nav__toggle[hidden] { display: none; }
.site-nav__list {
  list-style: none; display: flex; flex-wrap: wrap; gap: .2rem .9rem; margin: 0; padding: 0;
}
.site-nav__list a {
  display: inline-block; padding: .3rem .1rem; font-size: .95rem; text-decoration: none; color: var(--ink);
  border-bottom: 2px solid transparent;
}
.site-nav__list a:hover { color: var(--plum-deep); border-bottom-color: var(--plum); }
.site-nav__list a[aria-current="page"] { color: var(--plum-deep); border-bottom-color: var(--plum); font-weight: 500; }

/* JS 開啟後才變成可收合的漢堡選單（沒有 JS 時選單一直展開，仍然可用） */
.js .site-nav__toggle { display: inline-block; }
@media (max-width: 47.99em) {
  .js .site-nav__list { display: none; width: 100%; flex-direction: column; gap: 0; }
  .js .site-nav__list.is-open { display: flex; }
  .js .site-nav__list li { border-top: 1px solid var(--line); }
  .js .site-nav__list a { display: block; padding: .7rem .2rem; }
  .site-head__inner { position: relative; }
  .site-nav { width: 100%; }
}
@media (min-width: 48em) {
  .js .site-nav__toggle { display: none; }
  .site-nav { width: auto; }
}

/* ───────── 版面 ───────── */

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 2rem 1rem 3.5rem; }
main { display: block; }

.section-title {
  font-size: 1.35rem; margin: 2.6rem 0 1rem;
  padding-bottom: .4rem; border-bottom: 2px solid var(--line);
}
.group-title { font-size: 1.1rem; margin: 1.6rem 0 .6rem; color: var(--plum-deep); }

/* 內頁頁首 */
.page-hero { position: relative; background: var(--plum-ink); color: #fff; overflow: hidden; }
.page-hero__media { position: absolute; inset: 0; }
.page-hero__media picture, .page-hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40, 12, 36, .55) 0%, rgba(40, 12, 36, .72) 55%, rgba(40, 12, 36, .88) 100%);
}
.page-hero--plain { background: linear-gradient(150deg, var(--plum-ink), var(--plum) 70%, #a8517f); }
.page-hero--plain::after { content: none; }
.page-hero__inner {
  position: relative; z-index: 1;
  max-width: var(--wrap); margin: 0 auto; padding: 3.2rem 1rem 2.6rem;
}
.page-hero__kicker { margin: 0 0 .5rem; font-size: .9rem; letter-spacing: .08em; color: #f1d9ea; }
.page-hero__title { margin: 0; font-size: clamp(1.7rem, 5.2vw, 2.7rem); color: #fff; }
.page-hero__lead { margin: .9rem 0 0; max-width: 46rem; color: #f5e9f1; font-size: 1.02rem; }

/* 事實清單 */
.factlist { margin: 0 0 2rem; padding: 1rem 1.2rem; background: var(--cream-2); border-radius: .6rem; border: 1px solid var(--line); }
.factlist__row { display: flex; flex-wrap: wrap; gap: .2rem 1rem; padding: .35rem 0; }
.factlist dt { font-weight: 700; color: var(--plum-deep); min-width: 7rem; }
.factlist dd { margin: 0; }

/* 按鈕 */
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 0; }
.button {
  display: inline-block; padding: .7rem 1.5rem; border-radius: .4rem;
  border: 1.5px solid var(--plum-deep); color: var(--plum-deep); background: transparent;
  text-decoration: none; font-weight: 500;
}
.button:hover { background: var(--plum-deep); color: #fff; }
.button--primary { background: var(--plum-deep); color: #fff; }
.button--primary:hover { background: var(--plum-ink); color: #fff; border-color: var(--plum-ink); }

.filelink { font-weight: 500; }

/* 卡片 */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 40em) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60em) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card { display: flex; }
.card__link {
  display: flex; flex-direction: column; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: .7rem; overflow: hidden;
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card__link:hover { transform: translateY(-3px); border-color: var(--plum); box-shadow: 0 10px 30px rgba(59, 18, 53, .14); color: var(--ink); }
.card__media { display: block; aspect-ratio: 3 / 2; background: var(--cream-2); }
.card__media picture, .card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__media-blank { display: block; width: 100%; height: 100%; background: linear-gradient(140deg, var(--plum-ink), var(--plum) 65%, #c07ba6); }
.card__body { display: block; padding: 1rem 1.1rem 1.3rem; }
.card__title { display: block; font-family: var(--serif); font-size: 1.15rem; font-weight: 700; color: var(--plum-ink); }
.card__summary { display: block; margin-top: .4rem; font-size: .93rem; color: var(--ink-soft); line-height: 1.7; }
.card--featured .card__link { border-color: var(--plum); border-width: 2px; background: #fffdf9; }
.card--featured .card__title { color: var(--plum-deep); }
.card--featured .card__title::after { content: " →"; }

/* 文章內容 */
.prose { max-width: 44rem; }
.prose h2 { font-size: 1.4rem; margin: 2.4rem 0 .9rem; padding-bottom: .35rem; border-bottom: 2px solid var(--line); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.12rem; margin: 1.8rem 0 .6rem; color: var(--plum-deep); }
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .4rem; }
.prose a { font-weight: 500; }
/* 現代詩要保留作者排的換行與空行 */
.prose--work p { white-space: pre-wrap; }

/* 表格 */
.table-wrap { margin: 1.6rem 0; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: .97rem; }
/* 表格標題：頁面上方已經有同名的標題，所以只留給螢幕閱讀器用，不重複顯示 */
.data-table caption {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.data-table th, .data-table td { border: 1px solid var(--line); padding: .7rem .8rem; text-align: left; vertical-align: top; }
.data-table thead th { background: var(--plum-ink); color: #fff; font-weight: 500; }
.data-table tbody th { background: var(--cream-2); color: var(--plum-ink); white-space: nowrap; }
@media (max-width: 34em) {
  .data-table, .data-table tbody, .data-table tr, .data-table td, .data-table th { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tr { margin-bottom: 1rem; border: 1px solid var(--line); }
  .data-table th, .data-table td { border: 0; border-bottom: 1px solid var(--line); }
  .data-table td[data-label]::before { content: attr(data-label) "："; font-weight: 700; color: var(--plum-deep); }
}

/* 徵稿類別的圖卡（類別有配圖時才出現） */
.cat-figures { list-style: none; margin: 1.6rem 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40em) { .cat-figures { grid-template-columns: repeat(3, 1fr); } }
.cat-figure { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: .6rem; overflow: hidden; }
.cat-figure__media { display: block; aspect-ratio: 3 / 2; }
.cat-figure__media picture, .cat-figure__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-figure__name { padding: .8rem 1rem 0; font-family: var(--serif); font-weight: 700; color: var(--plum-ink); }
.cat-figure__limit { padding: .1rem 1rem 1rem; color: var(--ink-soft); font-size: .93rem; }

.notes { margin: 0 0 1.5rem; padding-left: 1.3rem; color: var(--ink-soft); font-size: .95rem; }
.notes--single { padding-left: 0; }

/* 清單 */
.plain-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.plain-list li { padding: .55rem 0; border-bottom: 1px solid var(--line); }
.plain-list--inline { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; }
.plain-list--inline li { border: 0; padding: .3rem 0; }
.plain-list__note { color: var(--ink-soft); font-size: .9rem; }

.works-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.works-list__item { border-bottom: 1px solid var(--line); }
.works-list__item a { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; padding: .8rem .2rem; text-decoration: none; }
.works-list__item a:hover { background: var(--cream-2); }
.works-list__award { color: var(--plum-deep); font-weight: 700; min-width: 5rem; }
.works-list__title { font-family: var(--serif); font-size: 1.08rem; color: var(--plum-ink); }
.works-list__author { color: var(--ink-soft); font-size: .92rem; }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list__item { border-bottom: 1px solid var(--line); }
.news-list__item a { display: flex; flex-wrap: wrap; gap: .2rem 1rem; padding: .8rem .2rem; text-decoration: none; }
.news-list__item time { color: var(--ink-soft); font-size: .9rem; min-width: 8.5rem; }
.news-list__title { font-family: var(--serif); color: var(--plum-ink); }
.news-list__item a:hover .news-list__title { color: var(--focus); }

.empty {
  margin: 1.5rem 0; padding: 2.2rem 1.2rem; text-align: center;
  background: var(--cream-2); border: 1px dashed var(--line); border-radius: .6rem; color: var(--ink-soft);
}

.judge { margin-top: 2.4rem; padding: 1.4rem 1.4rem .4rem; background: var(--cream-2); border-radius: .6rem; }
.judge .section-title { margin-top: 0; }

.page-nav { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* ───────── 頁尾 ───────── */

.site-foot { background: var(--plum-ink); color: #f1e6ee; margin-top: 3rem; }
.site-foot__inner { max-width: var(--wrap); margin: 0 auto; padding: 2.4rem 1rem 2.8rem; }
.site-foot__text { margin: 0 0 1.2rem; max-width: 46rem; font-size: .95rem; }
.site-foot__links { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0 0 1.4rem; padding: 0; }
.site-foot__links a { color: #f9ecf5; font-size: .95rem; }
.site-foot__links a:hover { color: #fff; }
.site-foot__copy { margin: 0; font-size: .85rem; color: #d9c4d3; }
