/* =============================================================================
 *  10-festivals.css — 传统节日：日历控件 + 八个节日详解
 *  ---------------------------------------------------------------------------
 *  只吃 00-tokens.css 的变量，不写死颜色，换主题自动跟着变。
 *  控件结构由 80-festivals.js 生成，类名以 fest- 开头；节日详解写在 HTML 里，
 *  沿用 07-wiki.css 的 .section / .checklist / .steps / .note，这里只补节日特有的块。
 *  与 09-terms.css 同套路，两边互不依赖。
 * ========================================================================== */

/* ---------------------------------------------------------------- 控件容器 */
.fest-wrap {
  margin: 20px 0 0;
  padding: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
}

/* ---------------------------------------------------------------- 年份选择条 */
.fest-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.fest-sel {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 6px;
  cursor: pointer;
  max-width: 120px;
}
.fest-unit { font-size: 13px; color: var(--muted); margin-inline-end: 4px; }

.fest-nav {
  font: inherit;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-2);
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 6px 10px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.fest-nav:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
}
.fest-nav:active { transform: translateY(1px); }

.fest-today {
  font: inherit;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-2);
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 7px 12px;
  cursor: pointer;
  margin-inline-start: auto;
  transition: background .15s, color .15s, border-color .15s;
}
.fest-today:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
}
.fest-today:active { transform: translateY(1px); }

.fest-sel:focus-visible,
.fest-nav:focus-visible,
.fest-today:focus-visible,
.fest-row:focus-visible,
.fest-go:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.fest-empty { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- 节日清单 */
.fest-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.fest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  transition: border-color .15s, background .15s;
}
.fest-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.fest-row.is-missing { opacity: .6; }

.fest-emoji { font-size: 26px; line-height: 1; flex: 0 0 auto; }

.fest-main { flex: 1 1 auto; min-width: 0; }

.fest-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
}
.fest-when {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.fest-solar {
  margin-top: 3px;
  font-size: 13px;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.fest-go {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-2);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px dashed var(--accent);
}
.fest-go:hover { border-bottom-style: solid; }

/* ---------------------------------------------------------------- 八个节日详解 */
.fest-item {
  margin-top: 26px;
  padding: 0 0 4px;
  border-top: 2px solid var(--accent);
}
.fest-item:first-of-type { margin-top: 8px; }

.fest-item h3 {
  margin: 14px 0 6px;
  font-size: 21px;
  line-height: 1.35;
  color: var(--ink);
}

.fest-sum {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--accent-2);
}

.fest-block {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
}
.fest-block h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-2);
}
.fest-block p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.75;
}
.fest-block p:last-child { margin-bottom: 0; }
.fest-block p + p { margin-top: 0; }

/* 点清单里的「看详解」时对应小节闪一下，和节气页同一个交互 */
.fest-item.is-flash { animation: fest-flash 1.6s ease-out 1; }
@keyframes fest-flash {
  0%, 40% { background: var(--accent-soft); }
  100% { background: transparent; }
}

/* ---------------------------------------------------------------- 窄屏 */
@media (max-width: 640px) {
  .fest-wrap { padding: 12px; }
  .fest-list { grid-template-columns: 1fr; }
  .fest-emoji { font-size: 22px; }
  .fest-row { align-items: flex-start; }
  .fest-go { margin-top: 2px; }
  .fest-item h3 { font-size: 19px; }
  .fest-block { padding: 10px 12px; }
  .fest-block p { font-size: 14px; line-height: 1.7; }
}

/* ---------------------------------------------------------------- 降低动效 */
@media (prefers-reduced-motion: reduce) {
  .fest-item.is-flash { animation: none; }
}
