/* Events calendar: the month grid on /events (public/js/calendar.js). Platform system (DESIGN.md):
   the month set in condensed display type with the year in muted Extra Condensed numerals, a season
   strip of twelve months with a tick per event and the count beside them, a week grid ruled by
   horizontal hairlines only, day numbers as scoreboard numerals, event names in plain sentence case
   behind their type dot, and the selected day on the right with its number large. Blue marks today
   and the month in view. Restored 2026-11-05 at the owner's request with cleaner rules (one hairline
   weight, no frame or thick rule inside the grid) and clearer type (larger, darker small text). */

/* ---------- month head ---------- */
.cal-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-top:clamp(40px,5vw,64px); padding-bottom:24px; }
.cal-head[hidden],.cal-season[hidden] { display:none; }
.cal-title { min-width:0; }
.cal-title h2 { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 .28em; margin:0; font-family:var(--font-display); font-weight:800; font-size:clamp(56px,8vw,124px); line-height:.86; letter-spacing:-.01em; text-transform:uppercase; color:var(--text); }
.cal-year { font-size:1em; color:var(--ink-subtle); }
.cal-title .label { margin:16px 0 0; font-size:13px; color:var(--text-muted); }
.cal-nav { display:flex; align-items:center; gap:8px; flex:none; }
.cal-today,.cal-step { min-height:44px; border:1px solid var(--border); border-radius:2px; background:var(--bg-card); color:var(--text); cursor:pointer; transition:border-color .15s var(--ease-state),background-color .15s var(--ease-state); }
.cal-today { padding:0 16px; font-size:12px; }
.cal-step { display:grid; place-items:center; width:44px; }
.cal-step .ui-icon { width:18px; height:18px; }
.cal-today:hover,.cal-step:hover { border-color:var(--text); }
.cal-today:focus-visible,.cal-step:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }

/* ---------- season strip: one rule above, one below, no dividers between months ---------- */
.cal-season { display:grid; grid-template-columns:72px minmax(0,1fr); border-top:1px solid var(--line-strong); border-bottom:1px solid var(--border); }
.cal-season-year { align-self:center; color:var(--text-muted); }
.cal-season-months { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); }
.cal-season-m { position:relative; display:flex; flex-direction:column; justify-content:space-between; gap:12px; min-height:76px; padding:14px 10px 12px; border:0; background:transparent; color:var(--text-muted); text-align:left; cursor:pointer; transition:color .15s var(--ease-state),background-color .15s var(--ease-state); }
.cal-season-name { display:flex; align-items:center; gap:6px; font-family:var(--font-mono); font-size:12px; letter-spacing:.08em; text-transform:uppercase; }
.cal-season-m.is-now .cal-season-name::after { content:''; width:5px; height:5px; border-radius:50%; background:var(--accent-fill); }
.cal-ticks { display:flex; align-items:flex-end; gap:3px; min-height:16px; }
.cal-ticks i { display:block; width:4px; height:16px; background:var(--text); }
.cal-ticks i.is-past { background:var(--line-strong); }
.cal-count { margin-left:5px; font-family:var(--font-mono); font-size:12px; font-weight:500; line-height:1; color:var(--text); }
.cal-season-m.has-events { color:var(--text); }
.cal-season-m:hover { background:var(--surface); color:var(--text); }
.cal-season-m.is-current { color:var(--text); background:var(--surface); }
.cal-season-m.is-current::before { content:''; position:absolute; left:0; right:0; top:-1px; height:2px; background:var(--primary); }
.cal-season-m:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }

/* ---------- grid and the selected day ---------- */
.cal-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:48px; align-items:start; margin-top:40px; }
.cal-layout[hidden] { display:none; }
.cal-weekdays { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.cal-weekdays span { padding:0 12px 12px; font-family:var(--font-mono); font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted); }
/* Weeks are ruled by horizontal hairlines only; the cells take shape from their spacing, their hover
   and the selected day's fill. */
.cal-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); border-top:1px solid var(--line-strong); }
.cal-cell { position:relative; display:flex; flex-direction:column; gap:10px; min-width:0; min-height:clamp(96px,8.6vw,124px); padding:12px; border-bottom:1px solid var(--border); transition:background-color .15s var(--ease-state); }
.cal-cell:hover { background:color-mix(in srgb,var(--text) 3.5%,transparent); }
.cal-cell.is-selected { background:var(--surface); }
/* The day number is the cell's button: its hit area covers the cell, the event names sit above it. */
.cal-num { position:static; display:flex; align-items:center; gap:8px; padding:0; border:0; background:transparent; color:var(--text-muted); text-align:left; cursor:pointer; }
.cal-num::after { content:''; position:absolute; inset:0; }
.cal-num:focus-visible { outline:none; }
.cal-num:focus-visible::after { outline:2px solid var(--primary); outline-offset:-2px; }
.cal-num .num { font-size:28px; line-height:.9; }
.cal-cell.has-events .cal-num { color:var(--text); }
.cal-cell.is-outside .cal-num { opacity:.38; }
.cal-cell.is-today .cal-num { color:var(--primary); opacity:1; }
.cal-now { padding:3px 6px 2px; border-radius:2px; background:var(--accent-fill); color:var(--on-accent); font-family:var(--font-mono); font-size:10px; font-weight:500; letter-spacing:.06em; line-height:1; text-transform:uppercase; }
.cal-events { position:relative; z-index:1; display:grid; gap:8px; min-width:0; }
.cal-ev { display:flex; align-items:flex-start; gap:8px; min-width:0; padding:0; border:0; background:transparent; color:var(--text); font-family:var(--font-body); font-size:13px; font-weight:600; line-height:1.35; text-align:left; cursor:pointer; }
.cal-ev span { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; transition:color .15s var(--ease-state); }
.cal-ev .type-dot { flex:none; width:7px; height:7px; margin-top:6px; border-radius:1px; }
.cal-ev.is-past { color:var(--text-muted); }
.cal-cell.is-outside .cal-ev { opacity:.6; }
.cal-ev.is-cont span { opacity:.6; }
.cal-ev:hover span,.cal-ev:focus-visible span { color:var(--primary); text-decoration:underline; text-underline-offset:3px; text-decoration-thickness:1px; }
.cal-ev:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.cal-more { justify-self:start; padding:0; border:0; background:transparent; color:var(--text-muted); cursor:pointer; }
.cal-more:hover { color:var(--text); }
.cal-dots { display:none; }
.cal-hint { margin:16px 0 0; font-size:14px; line-height:1.5; color:var(--text-muted); }

.cal-day { position:sticky; top:var(--sticky-top,116px); min-width:0; }
.cal-day>.label { margin:0 0 6px; color:var(--text-muted); }
.cal-day h3 { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 14px; margin:0; padding-bottom:20px; border-bottom:1px solid var(--line-strong); }
.cal-day h3 .num { font-size:clamp(88px,8vw,128px); color:var(--text); }
.cal-day-month { font-family:var(--font-display); font-weight:800; font-size:22px; line-height:1; text-transform:uppercase; color:var(--text-muted); }
.cal-day-events { display:grid; }
.cal-card { display:grid; justify-items:start; gap:8px; width:100%; padding:18px 0; border:0; border-bottom:1px solid var(--border); background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.cal-card-head { display:flex; align-items:center; gap:8px; }
.cal-card-head .type-dot { width:7px; height:7px; border-radius:1px; }
.cal-card-head .label { color:var(--text-muted); }
.cal-card-title { font-family:var(--font-body); font-size:17px; font-weight:600; line-height:1.3; transition:color .15s var(--ease-state); }
.cal-card.is-past .cal-card-title { color:var(--text-muted); }
.cal-card:hover .cal-card-title,.cal-card:focus-visible .cal-card-title { color:var(--primary); }
.cal-card:focus-visible { outline:2px solid var(--primary); outline-offset:4px; }
.cal-card-meta { display:flex; flex-wrap:wrap; gap:2px 12px; font-size:14px; line-height:1.45; color:var(--text-muted); }
.cal-card .event-state { font-family:var(--font-mono); font-size:11px; letter-spacing:.06em; text-transform:uppercase; padding:4px 8px; border-radius:2px; }
.cal-free { margin:18px 0 0; font-size:16px; line-height:1.5; color:var(--text-muted); }
.cal-sub { margin:28px 0 0; padding-bottom:4px; color:var(--text-muted); }
.cal-jumps { display:grid; gap:8px; margin-top:14px; }
.cal-jump { display:flex; align-items:center; gap:14px; width:100%; padding:16px; border:0; border-radius:2px; background:var(--surface); color:var(--text); text-align:left; cursor:pointer; transition:background-color .15s var(--ease-state); }
.cal-jump-body { display:grid; gap:6px; flex:1; min-width:0; }
.cal-jump-body .label { color:var(--text-muted); }
.cal-jump strong { font-family:var(--font-body); font-size:16px; font-weight:600; line-height:1.3; }
.cal-jump .ui-icon { flex:none; width:18px; height:18px; transition:transform .3s var(--ease-state); }
.cal-jump:hover { background:color-mix(in srgb,var(--text) 10%,transparent); }
.cal-jump.is-after:hover .ui-icon { transform:translateX(4px); }
.cal-jump.is-before:hover .ui-icon { transform:translateX(-4px); }
.cal-jump:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }

@media (max-width:1100px) {
  .cal-layout { grid-template-columns:minmax(0,1fr) 280px; gap:32px; }
  .cal-ev { font-size:12px; }
}
@media (max-width:900px) {
  .cal-layout { grid-template-columns:minmax(0,1fr); }
  .cal-day { position:static; }
}
@media (max-width:700px) {
  .cal-head { flex-wrap:wrap; }
  .cal-title h2 { font-size:56px; }
  .cal-season { grid-template-columns:minmax(0,1fr); }
  .cal-season-year { display:none; }
  .cal-season-months { grid-template-columns:repeat(12,minmax(64px,1fr)); overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; }
  .cal-season-months::-webkit-scrollbar { display:none; }
  .cal-season-m { min-height:64px; padding:12px 8px 10px; }
  .cal-layout { margin-top:24px; }
  .cal-weekdays span { padding:0 0 8px; text-align:center; font-size:11px; letter-spacing:.04em; }
  .cal-cell { align-items:center; gap:6px; min-height:56px; padding:8px 2px; }
  .cal-num { justify-content:center; }
  .cal-num .num { font-size:22px; }
  .cal-now,.cal-events { display:none; }
  .cal-dots { display:flex; gap:3px; }
  .cal-dots .type-dot { width:5px; height:5px; }
}
