/* 第一次來、行事曆、節慶詳細頁（app/features/guide.py）。數據語言：紙白、細線、粗襯線大標＝資料組成的一句、出處收進「這是怎麼來的」。
   顏色一律用島引馬祖的變數；類名前綴 gd-。 */

/* 頁首 */
.gd-head { border-bottom: 2px solid var(--dl-ink); padding: 22px 0 16px; }
.gd-kick { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.gd-kick__n { font: 900 18px/1.2 var(--dl-serif); letter-spacing: .12em; margin: 0; color: var(--dl-ink); }
.gd-kick__m { font-size: 13px; color: var(--dl-ink2, #56676c); }
.gd-kick .pt-how { margin: 0 0 0 auto; max-width: 520px; }
.gd-kick .pt-how[open] { flex-basis: 100%; margin-left: 0; max-width: none; }
.gd-kick .pt-how summary { border-radius: 0; border-color: var(--dl-ink); background: transparent; letter-spacing: .06em; }
.gd-head .dl-title { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.3; margin: 16px 0 0; max-width: 26em; }
.gd-head .dl-sub { margin-top: 10px; }
.gd-head .pt-lead { margin: 10px 0 0; color: var(--dl-ink2, #56676c); font-size: 15px; line-height: 1.75; max-width: 46em; }
.gd-how__g { margin: 8px 0 2px; font-weight: 700; color: var(--dl-ink); list-style: none; margin-left: -14px; }
.gd-how li a { color: inherit; word-break: break-all; }
@media (max-width: 760px) { .gd-head { padding-top: 16px; } .gd-head .dl-title { font-size: 26px; line-height: 1.38; } .gd-kick .pt-how { margin-left: 0; } }

.gd-sec { padding: 34px 0 0; scroll-margin-top: 90px; }
.gd-sec > .dl-sh { margin-bottom: 0; }
.gd-fine { font-size: 13px; color: var(--dl-ink3, #82949a); line-height: 1.7; margin: 12px 0 0; }
.gd-src { font-size: 12px; color: var(--dl-ink3, #82949a); white-space: nowrap; text-decoration: none; border-bottom: 1px dotted currentColor; margin-left: 6px; }
.gd-src:hover { color: var(--tide); }
.gd-tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
          background: var(--surface-sunken, #eef1ef); color: var(--dl-ink2, #56676c); }
.gd-tag.is-fest { background: rgba(127,47,78,.1); color: #7f2f4e; }
.gd-tag.is-ev { background: rgba(12,112,120,.1); color: var(--tide, #0c7078); }
.gd-tag.is-about { background: var(--hold-tint, #fbf0dc); color: var(--dl-hold, #a15c00); }
.gd-tag.is-calc { background: rgba(16,36,42,.06); color: var(--dl-ink2, #56676c); }
.gd-gaps { margin-top: 28px; border-top: 1px solid var(--dl-hair); padding-top: 12px; font-size: 14px; color: var(--dl-ink2, #56676c); }
.gd-gaps summary { cursor: pointer; font-weight: 700; color: var(--dl-ink); min-height: 36px; display: flex; align-items: center; }
.gd-gaps ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.8; }

/* 章節目錄（同島引馬祖 fv__chap，改細線） */
.gd-chap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--dl-hair); margin-top: 18px; }
.gd-chap a { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 10px; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--dl-hair); text-decoration: none; color: var(--dl-ink); min-width: 0; }
.gd-chap a:hover b { color: var(--tide); }
.gd-chap em { grid-row: 1 / 3; font: 600 22px/1.1 var(--dl-mono); font-style: normal; color: #b9c8ca; }
.gd-chap a.is-alt em { color: var(--dl-warm, #c2560c); }
.gd-chap b { font: 700 17px/1.35 var(--dl-serif); }
.gd-chap span { font-size: 13px; line-height: 1.55; color: var(--dl-ink3, #82949a); }
@media (max-width: 1000px) { .gd-chap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gd-chap { grid-template-columns: minmax(0, 1fr); } .gd-chap a { padding: 10px 0; } .gd-chap span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

/* 常見誤會翻卡 */
.gd-flips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; border-top: 2px solid var(--dl-ink); padding-top: 18px; }
@media (max-width: 1000px) { .gd-flips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .gd-flips { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.gd-flip { position: relative; min-width: 0; }
.gd-flip__b { appearance: none; display: block; width: 100%; min-height: 220px; padding: 0; border: 1px solid var(--dl-hair); border-radius: 4px; background: var(--dl-paper2, #fff);
              font: inherit; color: var(--dl-ink); text-align: left; cursor: pointer; overflow: hidden; }
.gd-flip__b:hover { border-color: var(--tide); }
.gd-flip__art { position: relative; display: block; height: 110px; }
.gd-flip__q { display: block; padding: 12px 14px 0; font: 700 17px/1.45 var(--dl-serif); }
.gd-flip__hint { display: block; padding: 6px 14px 14px; font-size: 12.5px; color: var(--tide); font-weight: 600; }
.gd-flip__back { display: none; padding: 16px 14px 44px; }
.gd-flip__back b { display: block; font: 700 15px/1.45 var(--dl-serif); color: var(--dl-ink2, #56676c); text-decoration: line-through; text-decoration-color: rgba(194,86,12,.6); }
.gd-flip__back span { display: block; margin-top: 8px; font-size: 15px; line-height: 1.75; color: var(--dl-ink); }
.gd-flip.is-on .gd-flip__b { background: #eaf2f1; border-color: var(--tide); }
.gd-flip.is-on .gd-flip__front { display: none; }
.gd-flip.is-on .gd-flip__back { display: block; }
.gd-flip__src { position: absolute; left: 14px; bottom: 12px; display: none; font-size: 12px; color: var(--dl-ink3, #82949a); max-width: calc(100% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-flip.is-on .gd-flip__src { display: block; }
.gd-flip__src a { color: inherit; }
@media (max-width: 560px) {
  .gd-flip__b { min-height: 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); }
  .gd-flip__front { display: contents; }
  .gd-flip__art { grid-row: 1 / 3; height: auto; min-height: 88px; }
  .gd-flip__q { padding: 12px 12px 0; font-size: 16px; }
  .gd-flip__hint { padding: 4px 12px 12px; }
  .gd-flip.is-on .gd-flip__b { display: block; }
}

/* 章節 */
.gd-ch { padding-top: 40px; scroll-margin-top: 90px; }
.gd-ch__h { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 14px; align-items: baseline; padding-bottom: 12px; }
.gd-ch__h em { font: 600 28px/1 var(--dl-mono); font-style: normal; color: var(--dl-warm, #c2560c); }
.gd-ch__h h2 { margin: 0; font: 900 clamp(24px, 2.6vw, 30px)/1.3 var(--dl-serif); }
.gd-ch__h p { grid-column: 2; margin: 4px 0 0; font-size: 15px; color: var(--dl-ink2, #56676c); line-height: 1.7; }
.gd-pts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--dl-hair); }
@media (max-width: 760px) { .gd-pts { grid-template-columns: minmax(0, 1fr); } }
.gd-pt { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--dl-hair); min-width: 0; }
.gd-pt__i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-tint, #e6f0ef); color: var(--tide, #0c7078); }
.gd-pt__i.is-warn { background: var(--hold-tint, #fbf0dc); color: var(--dl-hold, #a15c00); }
.gd-pt__t { font-size: 15px; line-height: 1.75; color: var(--dl-ink); padding-top: 3px; }
.gd-pt__t b { display: block; font-weight: 700; }
.gd-pt__t .pt-tbd { font-weight: 600; }
.gd-tips { margin-top: 14px; border-left: 3px solid var(--dl-warm, #c2560c); padding: 4px 0 4px 14px; }
.gd-tips b { font-size: 13px; color: var(--dl-warm, #c2560c); letter-spacing: .1em; }
.gd-tips ul { margin: 4px 0 0; padding-left: 18px; font-size: 14.5px; line-height: 1.8; color: var(--dl-ink2, #56676c); }
.gd-ch .pt-nums { margin-bottom: 10px; }
.gd-ch .pt-num__v { font-size: 28px; }
.gd-more { margin: 12px 0 0; font-size: 14px; font-weight: 700; }
.gd-more a { color: var(--tide); text-decoration: none; }

/* 出發前清單 */
.gd-todo { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--dl-ink); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
@media (max-width: 760px) { .gd-todo { grid-template-columns: minmax(0, 1fr); } }
.gd-todo li { border-bottom: 1px solid var(--dl-hair); }
.gd-todo label { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; cursor: pointer; font-size: 15px; line-height: 1.65; }
.gd-todo input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--tide, #0c7078); }
.gd-todo li.is-done span { color: var(--dl-ink3, #82949a); text-decoration: line-through; }
.gd-prog { height: 6px; background: var(--dl-hair); border-radius: 3px; overflow: hidden; margin: 10px 0 14px; }
.gd-prog i { display: block; height: 100%; width: 0; background: var(--tide, #0c7078); transition: width .25s; }

/* 行事曆：上方四格數字 */
.gd-cal .pt-nums { margin-top: 0; }
.gd-calbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; }
.gd-calbar h3 { margin: 0; font: 700 20px/1.2 var(--dl-serif); min-width: 8em; text-align: center; }
.gd-navb { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--dl-hair); border-radius: 999px; color: var(--dl-ink); text-decoration: none; background: var(--dl-paper2, #fff); font: inherit; cursor: pointer; }
.gd-navb[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.gd-navb svg { width: 16px; height: 16px; }
.gd-navb.is-l svg { transform: rotate(180deg); }
.gd-calbar__today { margin-left: auto; font-size: 13.5px; font-weight: 700; color: var(--tide); text-decoration: none; }
.gd-split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.gd-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 2px solid var(--dl-ink); border-left: 1px solid var(--dl-hair); }
.gd-grid__h { font-size: 12px; line-height: 30px; text-align: center; color: var(--dl-ink3, #82949a); font-weight: 600; border-right: 1px solid var(--dl-hair); border-bottom: 1px solid var(--dl-hair); }
.gd-grid__h.is-end { color: #9c3a2c; }
.gd-cell { appearance: none; border: 0; border-right: 1px solid var(--dl-hair); border-bottom: 1px solid var(--dl-hair); background: var(--dl-paper2, #fff); min-height: 84px; padding: 6px 7px;
           display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font: inherit; color: var(--dl-ink); text-align: left; cursor: pointer; min-width: 0; }
.gd-cell:hover { background: #f1f5f4; }
.gd-cell.is-out { background: var(--surface-sunken, #eef1ef); color: var(--dl-ink3, #82949a); }
.gd-cell.is-past { opacity: .5; }
.gd-cell__d { font: 600 13px/22px var(--dl-mono); }
.gd-cell.is-today .gd-cell__d { background: var(--tide, #0c7078); color: #fff; border-radius: 999px; width: 22px; text-align: center; }
.gd-cell.is-sel { box-shadow: inset 0 0 0 2px var(--dl-warm, #c2560c); }
.gd-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.gd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tide, #0c7078); display: inline-block; }
.gd-dot.is-fest { background: #7f2f4e; }
.gd-cell__n { font-size: 12px; color: var(--dl-ink3, #82949a); }
.gd-cell__n b { color: var(--dl-ink); font-size: 13px; margin-right: 1px; }
.gd-long { margin: 10px 0 0; font-size: 13px; color: var(--dl-ink2, #56676c); line-height: 1.7; }
.gd-long b { color: var(--dl-ink); margin-right: 6px; }
.gd-long span { white-space: nowrap; }
.gd-long a { color: inherit; }
.gd-day { border-top: 2px solid var(--dl-ink); padding-top: 10px; }
.gd-day__t { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font: 700 18px/1.3 var(--dl-serif); }
.gd-day__t span { font: 500 13px/1 var(--dl-sans); color: var(--dl-ink3, #82949a); }
.gd-key { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--dl-hair); font-size: 12.5px; color: var(--dl-ink3, #82949a); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.gd-key span { display: inline-flex; align-items: center; gap: 5px; }
.gd-week { display: none; }
@media (max-width: 760px) {
  .gd-split { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .gd-grid, .gd-calbar { display: none; }
  .gd-week { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 6px; align-items: center; border-top: 2px solid var(--dl-ink); padding-top: 12px; }
  .gd-week__m { grid-column: 1 / -1; display: flex; align-items: baseline; font: 700 17px/1.3 var(--dl-serif); }
  .gd-week__m span { margin-right: auto; }
  .gd-week__m a { font: 700 13px/1 var(--dl-sans); color: var(--tide); text-decoration: none; margin-left: 14px; }
  .gd-week > div { min-width: 0; }
  .gd-week__row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .gd-week__row[hidden] { display: none; }
  .gd-wb { appearance: none; border: 1px solid var(--dl-hair); border-radius: 8px; background: var(--dl-paper2, #fff); padding: 5px 0 6px; font: inherit; color: var(--dl-ink);
           display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; min-width: 0; }
  .gd-wb small { font-size: 11px; color: var(--dl-ink3, #82949a); }
  .gd-wb b { font: 600 16px/1.2 var(--dl-mono); }
  .gd-wb i { font-style: normal; font-size: 11px; color: var(--tide); min-height: 14px; }
  .gd-wb.is-out b { color: var(--dl-ink3, #82949a); }
  .gd-wb.is-today b { color: var(--tide); }
  .gd-wb.is-sel { border-color: var(--dl-warm, #c2560c); box-shadow: inset 0 0 0 1px var(--dl-warm, #c2560c); }
  .gd-day { border-top: 1px solid var(--dl-hair); }
}

/* 兩行清單（同島引馬祖 festlist） */
.gd-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--dl-ink); }
.gd-day .gd-list, .gd-list.is-thin { border-top: 0; }
.gd-li { position: relative; display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 0 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--dl-hair); }
.gd-li:hover { background: rgba(12,112,120,.04); }
.gd-li__d { font: 600 14px/22px var(--dl-mono); white-space: nowrap; }
.gd-li__d small { display: block; font: 400 11.5px/16px var(--dl-sans); color: var(--dl-ink3, #82949a); }
.gd-li__n { font-size: 15.5px; line-height: 22px; font-weight: 700; min-width: 0; }
.gd-li__n a { color: var(--dl-ink); text-decoration: none; }
.gd-li__n a::after { content: ''; position: absolute; inset: 0; }
.gd-li__n a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gd-li__s { display: flex; gap: 4px 8px; align-items: center; margin-top: 3px; font-size: 12.5px; line-height: 18px; color: var(--dl-ink3, #82949a); white-space: nowrap; overflow: hidden; }
.gd-li__s > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.gd-li__go { font-size: 12.5px; font-weight: 700; color: var(--tide); white-space: nowrap; }
.gd-day .gd-li { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 560px) { .gd-li { grid-template-columns: 5.6em minmax(0, 1fr); gap: 0 10px; } .gd-li__d { font-size: 13px; } }
.gd-empty { padding: 14px 0; color: var(--dl-ink3, #82949a); font-size: 14px; list-style: none; }

/* 節慶詳細 */
.gd-band { position: relative; margin: 18px 0 0; aspect-ratio: 21 / 8; overflow: hidden; background: #e6ebea; border-radius: 2px; }
.gd-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gd-band figcaption, .gd-ph figcaption { font-size: 12px; color: var(--dl-ink3, #82949a); line-height: 1.6; }
.gd-band figcaption { position: absolute; right: 0; bottom: 0; background: rgba(255,255,255,.88); padding: 3px 8px; max-width: 80%; }
.gd-band figcaption a, .gd-ph figcaption a { color: inherit; }
@media (max-width: 560px) { .gd-band { aspect-ratio: 4 / 3; } .gd-band figcaption { position: static; background: none; padding: 6px 0 0; max-width: none; } .gd-band.has-cap { aspect-ratio: auto; overflow: visible; } .gd-band.has-cap img { position: static; aspect-ratio: 4 / 3; } }
.gd-facts { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0 40px; margin-top: 22px; }
@media (max-width: 860px) { .gd-facts { grid-template-columns: minmax(0, 1fr); } }
.gd-dl { margin: 0; display: grid; grid-template-columns: 6.5em minmax(0, 1fr); border-top: 2px solid var(--dl-ink); }
.gd-dl dt, .gd-dl dd { margin: 0; padding: 11px 0; border-bottom: 1px solid var(--dl-hair); font-size: 15px; line-height: 1.7; }
.gd-dl dt { font-size: 13px; color: var(--dl-ink3, #82949a); padding-top: 13px; }
.gd-what p { margin: 0 0 12px; font-size: 16px; line-height: 1.95; color: var(--dl-ink); }
.gd-what { border-top: 2px solid var(--dl-ink); padding-top: 14px; }
.gd-yrs { width: 100%; border-collapse: collapse; border-top: 2px solid var(--dl-ink); font-size: 14.5px; }
.gd-yrs th, .gd-yrs td { text-align: left; padding: 10px 8px 10px 0; border-bottom: 1px solid var(--dl-hair); vertical-align: top; }
.gd-yrs th { font-size: 12px; color: var(--dl-ink3, #82949a); font-weight: 600; }
.gd-yrs td.num { font-family: var(--dl-mono); white-space: nowrap; }
.gd-yrs tr.is-next td { background: rgba(194,86,12,.06); }
.gd-phs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border-top: 2px solid var(--dl-ink); padding-top: 16px; }
@media (max-width: 760px) { .gd-phs { grid-template-columns: minmax(0, 1fr); } }
.gd-ph { margin: 0; min-width: 0; }
.gd-ph__im { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e6ebea; border-radius: 2px; }
.gd-ph__im img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gd-ph figcaption { margin-top: 6px; }
.gd-ph figcaption b { display: block; color: var(--dl-ink); font-size: 14px; font-weight: 600; }
.gd-others { display: flex; flex-wrap: wrap; gap: 8px; border-top: 2px solid var(--dl-ink); padding-top: 14px; }
.gd-others a { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--dl-hair); border-radius: 999px; text-decoration: none; color: var(--dl-ink); font-size: 14px; background: var(--dl-paper2, #fff); }
.gd-others a:hover { border-color: var(--tide); color: var(--tide); }

[data-theme="dark"] .gd-flip__b, [data-theme="dark"] .gd-cell, [data-theme="dark"] .gd-wb, [data-theme="dark"] .gd-navb, [data-theme="dark"] .gd-others a { background: var(--surface-raised); color: var(--ink); }
[data-theme="dark"] .gd-cell.is-out { background: var(--surface-sunken); }
[data-theme="dark"] .gd-flip.is-on .gd-flip__b { background: var(--surface-sunken); }
@media (max-width: 560px) { .gd-head .dl-title__cl { white-space: normal; } }
/* 行事曆活圖：大標不壓到右邊的年環 */
@media (min-width: 761px) { .gd-cal .pt-pghero .dl-title { font-size: clamp(28px, 2.7vw, 36px); line-height: 1.32; } }
/* 格子底部：進行中的長期活動畫成細條（紫＝節慶、青＝活動），數字只算當天的短期活動 */
.gd-cell { position: relative; }
.gd-cell__l { position: absolute; left: 0; right: 0; bottom: 4px; display: grid; gap: 2px; }
.gd-cell__l i { display: block; height: 3px; background: rgba(12,112,120,.35); }
.gd-cell__l i.is-fest { background: rgba(127,47,78,.4); }
