/* Pacing calendar -- a real visual month grid with carousel navigation,
   plus a searchable List view. Loaded after styles.css. */

.cal-legend-item{display:inline-flex; align-items:center; gap:5px; margin-left:12px; font-size:13px; font-weight:600}
.cal-swatch{display:inline-block; width:12px; height:12px; border-radius:3px}

/* ---------- Controls ---------- */
.cal-controls{display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; margin:16px 0}
.cal-view-toggle{display:flex; gap:6px}
.cal-view-btn{
	background:var(--surface); border:1.5px solid var(--border); color:var(--ink); padding:8px 14px;
	border-radius:999px; font-weight:700; font-size:14px; cursor:pointer;
}
.cal-view-btn.active{background:var(--primary); color:#fff; border-color:var(--primary)}
.cal-nav{display:flex; align-items:center; gap:8px; flex-wrap:wrap}
.cal-nav button{
	background:var(--primary); color:#fff; border:none; padding:8px 14px; border-radius:999px;
	font-weight:700; font-size:14px; cursor:pointer;
}
.cal-nav button:hover{background:var(--primary-dark)}
#cal-month-jump{padding:8px 10px; border-radius:8px; border:1.5px solid var(--border); font-size:14px; background:var(--surface); color:var(--ink)}

/* ---------- Month grid ---------- */
.cal-month-title{text-align:center; margin:6px 0 10px}
.cal-dow-row{display:grid; grid-template-columns:repeat(5, 1fr); gap:6px; margin-bottom:4px}
.cal-dow{font-weight:800; text-align:center; font-size:12px; text-transform:uppercase; letter-spacing:.03em; color:var(--muted); padding:2px 0}
.cal-week{display:grid; grid-template-columns:repeat(5, 1fr); gap:6px; margin-bottom:6px}
.cal-day{
	min-height:112px; border:1px solid var(--border); border-radius:10px; padding:6px;
	background:var(--surface); display:flex; flex-direction:column; gap:3px; overflow:hidden;
}
.cal-day.cal-empty{background:transparent; border-color:transparent}
.cal-day.is-holiday{background:var(--bg); justify-content:center; align-items:center; text-align:center; gap:2px}
.cal-day.is-today{outline:3px solid var(--primary); outline-offset:-3px}
.cal-daynum{font-weight:800; font-size:13px; color:var(--ink)}
.cal-holiday-label{font-size:10.5px; color:var(--muted); font-style:italic}
.cal-semester-flag{font-size:11px}

.cal-entry{
	display:block; font-size:10.5px; line-height:1.35; padding:3px 6px; border-radius:6px;
	text-decoration:none; color:#fff; font-weight:700; overflow:hidden; text-overflow:ellipsis;
	white-space:nowrap;
}
.cal-entry:hover{filter:brightness(1.12)}
.cal-entry-ji{background:var(--primary)}
.cal-entry-evo{background:#6b3fc9}
.cal-entry-pang{background:#0f766e}
.cal-entry-open{
	background:transparent !important; color:var(--muted) !important; border:1px dashed var(--border);
	font-weight:600; font-style:italic;
}

@media (max-width:800px){
	.cal-day{min-height:88px; padding:4px}
	.cal-entry{font-size:9.5px; padding:2px 4px}
	.cal-daynum{font-size:12px}
}
@media (max-width:560px){
	.cal-dow{font-size:10px}
	.cal-day{min-height:70px}
}

/* ---------- List view ---------- */
.cal-tabs{display:flex; gap:6px; margin:12px 0 8px}
.cal-tab-btn{
	background:var(--surface); border:1.5px solid var(--border); color:var(--ink); padding:8px 16px;
	border-radius:999px; font-weight:700; font-size:14px; cursor:pointer;
}
.cal-tab-btn.active{background:var(--primary); color:#fff; border-color:var(--primary)}
#cal-search{
	width:100%; box-sizing:border-box; padding:10px 14px; font-size:15px; border:1.5px solid var(--border);
	border-radius:var(--radius-sm); background:var(--surface); color:var(--ink); margin-bottom:12px;
}
.cal-band-summary{margin-top:0}
.cal-open-note{background:#fdf6e8; border-left:4px solid #a16207; padding:8px 12px; border-radius:0 8px 8px 0; font-size:14px}
.cal-table td, .cal-table th{white-space:nowrap}
.cal-table td:nth-child(4){white-space:normal; min-width:220px}
.cal-table td:nth-child(5){white-space:normal; min-width:160px}
.cal-note{font-size:12.5px; color:var(--muted); font-style:italic}
tr.cal-today{outline:3px solid var(--primary); outline-offset:-3px}
tr.cal-today td:first-child{font-weight:800; color:var(--primary)}

/* ---------- Dark mode (opt-in, NOT automatic) ---------- */
/* Light stays the default for every visitor regardless of
   OS/browser preference -- these rules only apply under an
   explicit data-theme="dark" on <html>, which nothing currently
   sets. Kept for a future manual toggle instead of deleted. */
[data-theme="dark"] .cal-open-note{background:#2e2308; color:#ffe4ab; border-color:#c9860a}
[data-theme="dark"] .cal-view-btn, [data-theme="dark"] .cal-tab-btn{color:var(--ink)}

@media print{
	.cal-controls, .cal-nav, #cal-search, .cal-tabs{display:none !important}
	#cal-list-view{display:block !important}
	#cal-grid-view{display:none !important}
}
