/* Group-buy calendar page. Same tokens and type as the store homepage (design/design.css). */
:root {
  --paper: #faf8f3;
  --ink: #343a30;
  --muted: #676d60;
  --olive: #46533a;
  --line: #dddcd2;
  --orange: #a84c2b;
  --cream: #eee9dd;
  --serif: "Songti TC", "PMingLiU", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 40px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 30; background: #fff; padding: 10px 14px; }
.skip:focus { left: 8px; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 76px; padding: 0 40px;
  background: rgba(250, 248, 243, 0.97); border-bottom: 1px solid var(--line);
}
.logo img { width: 190px; height: auto; mix-blend-mode: multiply; }
.header-nav { display: flex; gap: 24px; font-size: 14px; }
.header-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.header-nav [aria-current] { color: var(--orange); font-weight: 600; }

.calendar-hero { padding-top: 40px; padding-bottom: 8px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; margin-bottom: 26px;
  border: 1px solid var(--olive); border-radius: 999px; color: var(--olive); font-size: 14px; font-weight: 600; text-decoration: none;
}
.back-link:hover { background: var(--olive); color: #fff; }
.eyebrow { font-family: Arial, sans-serif; font-size: 11px; letter-spacing: 0.19em; font-weight: 600; color: var(--muted); }
.calendar-hero h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.4; margin: 10px 0 14px; letter-spacing: -0.02em; }
.lead { max-width: 640px; color: #5c6256; font-size: 17px; line-height: 1.9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 11px 20px; border-radius: 3px;
  font-weight: 500; font-size: 15px; text-decoration: none; transition: background 0.2s;
}
.primary { background: var(--olive); color: #fff; }
.primary:hover { background: #303f29; }
.secondary { border: 1px solid #a5ab9e; background: transparent; }
.secondary:hover { background: rgba(70, 83, 58, 0.06); }
.summary { margin-top: 22px; min-height: 3.4em; font-size: 14px; color: var(--muted); }
.summary a { color: var(--orange); }
.summary button { color: var(--orange); text-decoration: underline; min-height: 44px; }

/* Month view: the homepage's calendar grid, with the picked day's campaigns as cards. */
.month-view { padding-bottom: 34px; }
.calendar-hero + .month-view .month-heading { border-top: 0; padding-top: 12px; }
.calendar-intro { padding-bottom: 36px; }
.calendar-intro .hero-actions { margin-top: 0; }
.calendar-intro .lead { margin-top: 22px; }
.calendar-intro .summary { margin-top: 12px; min-height: 0; }
.month-heading { border-top: 1px solid var(--line); padding-top: 30px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.month-heading h2 { font-size: 26px; line-height: 1.4; }
.month-heading p { font-size: 14px; color: var(--muted); }
.month-layout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
.month-board { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 16px; }
.month-controls { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.month-controls h3 { flex: 1; text-align: center; font-size: 18px; }
.month-controls button { min-width: 44px; min-height: 44px; border-radius: 3px; }
.month-controls button:hover { background: rgba(70, 83, 58, 0.08); }
.month-today { border: 1px solid var(--line) !important; padding: 0 12px; font-size: 14px; }
.month-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.month-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.legend-start::before { background: var(--olive); }
.legend-end::before { background: var(--orange); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.month-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 52px; padding: 6px 0 4px; border-radius: 4px; font-size: 14px; }
.month-day:disabled { color: #b4b8ad; }
.month-day.has-events:not(:disabled) { background: var(--cream); font-weight: 600; }
.month-day.today span { color: var(--orange); font-weight: 700; }
.month-day[aria-pressed="true"]:not(:disabled) { background: var(--olive); color: #fff; }
.month-day[aria-pressed="true"].today span { color: #fff; }
.month-day small { display: flex; gap: 3px; }
.month-day i { font-style: normal; font-size: 10px; line-height: 16px; min-width: 16px; padding: 0 3px; border-radius: 8px; color: #fff; }
.start-dot { background: var(--olive); }
.end-dot { background: var(--orange); }
.month-day[aria-pressed="true"] .start-dot { background: #fff; color: var(--olive); }
.month-day[aria-pressed="true"] .end-dot { box-shadow: 0 0 0 1px #fff; }
.month-agenda h3 { font-size: 20px; line-height: 1.4; margin-bottom: 14px; }
.month-agenda .calendar-items { grid-template-columns: 1fr; }
.event-badge { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--olive); }
.event-badge.end { background: var(--orange); }
.calendar-lists { padding-bottom: 40px; }
/* Hold the space the live lists will take, so the footer does not jump when they arrive. */
.calendar-lists[aria-busy="true"] { min-height: 150vh; }
.calendar-group { border-top: 1px solid var(--line); padding: 30px 0 34px; }
.calendar-group > header { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 18px; }
.calendar-group h2 { font-size: 26px; line-height: 1.4; }
.calendar-group h2 .count, .evergreen .count { font-family: Arial, sans-serif; font-size: 15px; color: var(--muted); margin-left: 8px; font-weight: 600; }
.calendar-group > header p, .group-note { font-size: 14px; color: var(--muted); }
#closing h2 { color: var(--orange); }
.evergreen summary { display: flex; align-items: baseline; gap: 4px; min-height: 44px; cursor: pointer; list-style: none; }
.evergreen summary::-webkit-details-marker { display: none; }
.evergreen summary::after { content: "展開 ▾"; margin-left: auto; font-size: 14px; color: var(--muted); }
.evergreen[open] summary::after { content: "收起 ▴"; }
.evergreen .group-note { margin: 6px 0 18px; }

.calendar-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.calendar-items:empty { display: none; }
.calendar-empty { color: var(--muted); font-size: 14px; padding: 6px 0; }
.cal-item {
  display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 16px;
  padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 4px;
}
.cal-thumb { width: 92px; aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden; background: var(--cream); }
.cal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cal-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cal-item h3 { font-size: 18px; line-height: 1.45; overflow-wrap: anywhere; }
.cal-dates { font-size: 13px; color: var(--muted); }
.cal-dates strong { color: var(--ink); font-weight: 600; }
.cal-countdown { display: inline-block; font-size: 13px; font-weight: 700; color: var(--olive); }
.cal-countdown.is-urgent { color: var(--orange); }
.cal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; }
.cal-actions .button { min-height: 44px; padding: 9px 16px; font-size: 14px; }
.cal-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }

.back-cta { border-top: 1px solid var(--line); padding-top: 34px; padding-bottom: 44px; }
.back-cta h2 { font-size: 24px; line-height: 1.4; }
.back-cta p { margin-top: 6px; color: var(--muted); font-size: 15px; }
.back-cta .hero-actions { margin-top: 18px; }
.site-footer { border-top: 1px solid var(--line); padding-top: 26px; padding-bottom: 40px; font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.site-footer a { text-decoration: underline; }

.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 40;
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.toast.show { opacity: 1; }
.reminder-dialog { border: 0; border-radius: 6px; padding: 0; width: min(420px, calc(100vw - 32px)); color: var(--ink); }
.reminder-dialog::backdrop { background: rgba(30, 34, 28, 0.45); }
.reminder-dialog .dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.reminder-dialog h2 { font-size: 20px; }
.reminder-dialog .close { min-height: 44px; padding: 0 6px; }
.reminder-options { display: grid; gap: 10px; padding: 18px; }
.reminder-options p { font-size: 14px; color: var(--muted); }

@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .site-header { padding: 0 18px; min-height: 64px; gap: 12px; }
  .logo img { width: 128px; }
  .header-nav { gap: 14px; font-size: 13px; }
  .header-nav a:last-child { display: none; }
  .calendar-hero { padding-top: 22px; padding-bottom: 4px; }
  .calendar-hero + .month-view .month-heading { padding-top: 8px; }
  .back-link { margin-bottom: 16px; }
  .month-heading { display: block; padding-top: 24px; }
  .month-heading p { margin-top: 4px; }
  .month-heading h2 { font-size: 23px; }
  .month-layout { grid-template-columns: 1fr; gap: 20px; }
  .month-board { padding: 12px; }
  .month-day { min-height: 46px; }
  .back-cta .button { width: 100%; }
  .lead { font-size: 15px; line-height: 1.8; }
  .hero-actions .button { width: 100%; }
  .calendar-group { padding: 24px 0 26px; }
  .calendar-group > header { display: block; }
  .calendar-group > header p { margin-top: 4px; }
  .calendar-group h2 { font-size: 23px; }
  .calendar-items { grid-template-columns: 1fr; }
  .cal-item { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .cal-thumb { width: 76px; }
}
@media (max-width: 360px) {
  .logo img { width: 112px; }
  .month-controls h3 { font-size: 16px; }
  .cal-item { grid-template-columns: 1fr; }
  .cal-thumb { width: 100%; aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { transition: none; }
}
