/* Club calendar (/calendar/). Markup: includes/sections/club-calendar.php
 * Day-type colors follow the Club's paper calendar (yellow full day, orange closed, blue special hours,
 * gray summer). Every fill carries near-black text at 7:1 or better, and every type also has an icon and a
 * label, so color is never the only signal. */

:root {
	--cc-ink: var(--jc-dark, #121010);
	--cc-blue: var(--jc-blue, #006A9C);
	--cc-tint: var(--jc-tint, #E6F3F9);
	--cc-line: #d9dde0;
	--cc-full: #ffe066;      /* 14.5:1 with --cc-ink */
	--cc-closed: #f28c28;    /*  7.7:1 */
	--cc-special: #9ed8f5;   /* 12.3:1 */
	--cc-summer: #d4d4d2;    /* 12.8:1 */
	--cc-staff: #d9c7ee;     /* 12.1:1 */
	--cc-open: #1e7b34;      /* text on white 5.3:1 */
	--cc-shut: #b42318;      /* text on white 6.5:1 */
}
/* the variables sit on :root so the club pages' chips get them too */
.cc-wrap {
	padding-top: 2.5rem;
	padding-bottom: 3rem;
}

/* ---- Is the Club open? ---------------------------------------------------------------- */
.cc-strip-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; color: var(--cc-ink); }
.cc-open-strip { margin-bottom: 2rem; }
.cc-status {
	height: 100%;
	background: #fff;
	border: 1px solid var(--cc-line);
	border-left: 6px solid var(--cc-open);
	border-radius: .5rem;
	padding: 1rem 1.25rem;
}
.cc-status-closed { border-left-color: var(--cc-shut); }
.cc-status-club { font-family: var(--jc-title, inherit); font-weight: 800; font-size: 1.1rem; color: var(--cc-ink); margin-bottom: .25rem; }
.cc-status-today { font-size: 1rem; color: var(--cc-ink); }
.cc-status-today i { color: var(--cc-open); margin-right: .35rem; }
.cc-status-closed .cc-status-today i { color: var(--cc-shut); }
.cc-status-next { margin-top: .35rem; color: #3d3a3a; }

/* ---- Filters ---------------------------------------------------------------------------- */
.cc-filters {
	background: var(--cc-tint);
	border-radius: .5rem;
	padding: 1rem 1.25rem;
	margin-bottom: 2rem;
}
.cc-filters .form-label, .cc-filters legend { font-weight: 700; color: var(--cc-ink); font-size: .95rem; margin-bottom: .35rem; }
.cc-filters legend { float: none; width: auto; }
.cc-type-toggles { display: flex; flex-wrap: wrap; gap: .4rem; }
.cc-toggle {
	display: inline-flex; align-items: center; gap: .35rem;
	border: 2px solid transparent;
	border-radius: 2rem;
	padding: .3rem .8rem;
	font-size: .9rem;
	font-weight: 600;
	color: var(--cc-ink);
	cursor: pointer;
	opacity: .55;
	text-decoration: line-through;
	background: #fff;
}
.btn-check:checked + .cc-toggle { opacity: 1; text-decoration: none; border-color: var(--cc-ink); }
.btn-check:focus-visible + .cc-toggle { outline: 3px solid var(--cc-blue); outline-offset: 2px; }
.cc-toggle.cc-full { background: var(--cc-full); }
.cc-toggle.cc-closed { background: var(--cc-closed); }
.cc-toggle.cc-special { background: var(--cc-special); }
.cc-toggle.cc-summer { background: var(--cc-summer); }
.cc-toggle.cc-staff { background: var(--cc-staff); }
.cc-toggle.cc-event { background: var(--cc-blue); color: #fff; }
.cc-views { display: flex; gap: .35rem; justify-content: flex-end; }
.cc-views .btn { white-space: nowrap; padding: .4rem .7rem; font-size: .85rem; }

/* ---- Month ------------------------------------------------------------------------------ */
.cc-month-head, .cc-year-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.cc-month-title { font-size: 1.75rem; font-weight: 800; color: var(--cc-ink); margin: 0; }
.cc-month { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fff; }
.cc-month th { background: var(--cc-blue); color: #fff; text-align: center; padding: .5rem; font-weight: 700; font-size: .9rem; }
.cc-month td { border: 1px solid var(--cc-line); vertical-align: top; height: 7.5rem; padding: .35rem; }
.cc-month td.cc-other-month { background: #f5f5f4; }
.cc-month td.cc-other-month .cc-date { color: #6b6767; }
.cc-date { font-family: var(--jc-num, monospace); font-weight: 700; color: var(--cc-ink); margin-bottom: .25rem; }
.cc-today { box-shadow: inset 0 0 0 3px var(--cc-blue); }
.cc-today-badge { font-family: var(--jc-ui, inherit); font-size: .7rem; background: var(--cc-blue); color: #fff; border-radius: 1rem; padding: .05rem .45rem; vertical-align: middle; }

.cc-full-cell { background: var(--cc-full); }
.cc-closed-cell { background: var(--cc-closed); }
.cc-special-cell { background: var(--cc-special); }
.cc-summer-cell { background: var(--cc-summer); }
.cc-staff-cell { background: var(--cc-staff); }

.cc-chips { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.cc-chip {
	font-size: .8rem;
	line-height: 1.25;
	border-radius: .35rem;
	padding: .25rem .4rem;
	color: var(--cc-ink);
	overflow-wrap: anywhere;
}
.cc-chip i { margin-right: .15rem; }
.cc-chip-sub { display: block; font-size: .72rem; opacity: .9; }
.cc-chip.cc-full { background: var(--cc-full); }
.cc-chip.cc-closed { background: var(--cc-closed); }
.cc-chip.cc-special { background: var(--cc-special); }
.cc-chip.cc-summer { background: var(--cc-summer); }
.cc-chip.cc-staff { background: var(--cc-staff); }
.cc-chip.cc-event { background: var(--cc-blue); color: #fff; }
.cc-chip.cc-event a { color: #fff; text-decoration: underline; }
/* a tinted cell (one club picked) already says the type: chips go quiet */
td[class*="-cell"] .cc-chip:not(.cc-event) { background: rgba(255, 255, 255, .6); }

.cc-month-agenda { display: none; }
.cc-empty { color: #3d3a3a; font-style: italic; }

/* ---- List (and the month on phones) ------------------------------------------------------ */
.cc-week-title { font-size: 1.1rem; font-weight: 800; color: var(--cc-blue); margin: 1.5rem 0 .5rem; border-bottom: 2px solid var(--cc-tint); padding-bottom: .25rem; }
.cc-agenda-day { display: flex; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--cc-line); }
.cc-agenda-date { flex: 0 0 4.5rem; text-align: center; }
.cc-agenda-wide .cc-agenda-date { flex-basis: 6.5rem; }
.cc-agenda-dow { display: block; font-size: .8rem; text-transform: uppercase; font-weight: 700; color: var(--cc-blue); }
.cc-agenda-num { display: block; font-family: var(--jc-num, monospace); font-size: 1.15rem; font-weight: 700; color: var(--cc-ink); }
.cc-agenda-day .cc-chips { flex: 1; }
.cc-agenda-day .cc-chip { font-size: .95rem; padding: .4rem .6rem; }
.cc-agenda-day .cc-chip-sub { display: inline; font-size: .9rem; }
.cc-agenda-day .cc-chip-sub::before { content: "· "; }
.cc-agenda-day.cc-today { box-shadow: none; background: var(--cc-tint); }

@media (max-width: 767.98px) {
	.cc-month { display: none; }
	.cc-month-agenda { display: block; }
	.cc-month-title { font-size: 1.35rem; }
	.cc-views { justify-content: stretch; }
	.cc-views .btn { flex: 1; padding: .4rem .3rem; font-size: .8rem; }
}

/* ---- School year --------------------------------------------------------------------------- */
.cc-year-sub { font-weight: 600; color: var(--cc-blue); }
.cc-year-actions { text-align: center; margin: .5rem 0 1rem; }
.cc-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; margin-bottom: .5rem; font-size: .9rem; color: var(--cc-ink); }
.cc-legend-item { display: inline-flex; align-items: center; gap: .35rem; }
.cc-swatch { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.4rem; padding: 0 .3rem; border-radius: .25rem; font-size: .75rem; font-family: var(--jc-num, monospace); font-weight: 700; color: var(--cc-ink); border: 1px solid rgba(0, 0, 0, .15); }
.cc-year-normal { text-align: center; color: #3d3a3a; margin-bottom: 1.25rem; }
.cc-year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.25rem 1.5rem; }
.cc-mini-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cc-mini-table caption { caption-side: top; font-weight: 800; color: var(--cc-ink); text-align: center; padding: 0 0 .25rem; text-transform: uppercase; letter-spacing: .03em; font-size: .9rem; }
.cc-mini-table th { font-size: .75rem; text-align: center; color: var(--cc-blue); padding: .1rem; }
.cc-mini-table td { text-align: center; font-family: var(--jc-num, monospace); font-size: .8rem; padding: .15rem 0; border: 1px solid #eceeef; color: var(--cc-ink); }
.cc-mini-list { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .82rem; color: var(--cc-ink); }
.cc-mini-list li { display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }

/* ---- Subscribe ------------------------------------------------------------------------------ */
.cc-subscribe { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--cc-line); }
.cc-sub-club { background: #fff; border: 1px solid var(--cc-line); border-radius: .5rem; padding: .75rem 1rem; }
.cc-sub-club .btn { margin: .15rem .25rem .15rem 0; }

/* ---- Print: the school-year page only ---------------------------------------------------- */
@media print {
	#header, .header, header, footer, #footer, .page-header, .cc-subscribe, .cc-open-strip, .cc-filters, .d-print-none,
	section:not(.cc-wrap) { display: none !important; }
	.cc-wrap { padding: 0; }
	.cc-year-grid { grid-template-columns: repeat(3, 1fr); gap: .6rem 1rem; }
	.cc-mini-table td { padding: .05rem 0; font-size: 9pt; }
	.cc-mini-list { font-size: 8pt; }
	.cc-full-cell, .cc-closed-cell, .cc-special-cell, .cc-summer-cell, .cc-staff-cell, .cc-swatch, .cc-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	@page { margin: .4in; }
}
