/*
 * MPAS annual calendar — the year-at-a-glance matrix, PORTRAIT like the original.
 * Screen: a centred portrait "sheet" mirroring the print output (scrolls
 *         horizontally only on very narrow phones).
 * Print : @page A3 portrait, site chrome hidden, one sheet. (Pick A4 + "fit to
 *         page" in the print dialog for an A4 copy.)
 *
 * Uniform rows: every cell's content sits in a fixed-height .mpas-cal__in that
 * clips overflow, so row heights are even regardless of how much text a day has.
 */

.mpas-cal {
	--c-public:    #5cb85c; --c-public-bg:    #d8f0d8;
	--c-ia:        #f0901e; --c-ia-bg:        #fde3c6;
	--c-meeting:   #f2cf1b; --c-meeting-bg:   #fdf3bf;
	--c-bbq:       #5b9bd5; --c-bbq-bg:       #d6e6f6;
	--c-cosmology: #e879ab; --c-cosmology-bg: #fbdcec;
	--c-scag:      #b3a062; --c-scag-bg:      #ece5cd;
	--c-workshop:  #2bb6a3; --c-workshop-bg:  #cdeee9;
	--c-social:    #9b7fd4; --c-social-bg:    #e6ddf6;
	--c-training:  #8a8d91; --c-training-bg:  #e3e4e6;
	--c-deadline:  #c0606a; --c-deadline-bg:  #f6dde0;
	--c-other:     #777;    --c-other-bg:     #ececec;
	--c-grey:      #d9d9d9;
	--rowh: 44px;            /* uniform cell-content height (screen) */
	color: #1a1a1a;
}

/* --- Toolbar (screen only) ------------------------------------------------ */
.mpas-cal__bar {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; flex-wrap: wrap; margin: 0 auto .8rem; max-width: 900px;
}
.mpas-cal__nav { display: flex; gap: .5rem; }
.mpas-cal__yr {
	display: inline-block; padding: .35rem .8rem; border: 1px solid #ccc;
	border-radius: 6px; text-decoration: none; color: #14213d; font-weight: 600;
	background: #fff;
}
.mpas-cal__yr:hover { background: #14213d; color: #fff; border-color: #14213d; }
.mpas-cal__print {
	padding: .45rem 1rem; border: 0; border-radius: 6px; cursor: pointer;
	background: #14213d; color: #fff; font-weight: 600; font-size: .95rem;
}
.mpas-cal__print:hover { background: #25406e; }

/* --- Sheet + title (portrait) -------------------------------------------- */
.mpas-cal__sheet {
	background: #fff; max-width: 900px; margin: 0 auto; padding: 10px 12px 14px;
	box-shadow: 0 1px 8px rgba(0,0,0,.12); overflow-x: auto;
}
.mpas-cal__title {
	text-align: center; color: #1f3c88; font-size: 1.3rem; margin: 0 0 .4rem;
	font-weight: 800; letter-spacing: .01em;
}

/* --- The grid ------------------------------------------------------------- */
.mpas-cal__grid {
	border-collapse: collapse; width: 100%; min-width: 720px;
	table-layout: fixed; font-size: 10px; line-height: 1.1;
}
.mpas-cal__grid th, .mpas-cal__grid td { border: 1px solid #b9b9b9; vertical-align: top; }
.mpas-cal__mhead {
	background: #1f3c88; color: #fff; font-style: italic; font-weight: 700;
	text-align: center; padding: 2px 1px; font-size: 10.5px;
}
.mpas-cal__dayhead {
	background: #1f3c88; color: #fff; width: 20px; text-align: center;
	font-size: 10px; padding: 2px 0;
}
.mpas-cal__daynum {
	background: #f0f0f0; text-align: center; font-weight: 700; width: 20px;
	font-size: 10px;
}

/* --- Day cells (uniform height) ------------------------------------------ */
.mpas-cal__cell { padding: 0; background: #fff; }
.mpas-cal__in { height: var(--rowh); overflow: hidden; padding: 1px 2px; }
.mpas-cal__cell--void { background: #f7f7f7; border-color: #e3e3e3; }
.mpas-cal__cell--grey { background: var(--c-grey); }

.mpas-cal__cell--public    { background: var(--c-public-bg); }
.mpas-cal__cell--ia        { background: var(--c-ia-bg); }
.mpas-cal__cell--meeting   { background: var(--c-meeting-bg); }
.mpas-cal__cell--bbq       { background: var(--c-bbq-bg); }
.mpas-cal__cell--cosmology { background: var(--c-cosmology-bg); }
.mpas-cal__cell--scag      { background: var(--c-scag-bg); }
.mpas-cal__cell--workshop  { background: var(--c-workshop-bg); }
.mpas-cal__cell--social    { background: var(--c-social-bg); }
.mpas-cal__cell--training  { background: var(--c-training-bg); }
.mpas-cal__cell--deadline  { background: var(--c-deadline-bg); }
.mpas-cal__cell--other     { background: var(--c-other-bg); }

.mpas-cal__wd { font-weight: 400; color: #333; font-size: 10px; }
/* School holidays: the weekday letter is bold + underlined (regular days are not),
   so the two are clearly distinguishable — matches the legend. */
.mpas-cal__cell--school .mpas-cal__wd { font-weight: 800; text-decoration: underline; }

/* Moon glyphs */
.mpas-cal__moon { float: right; font-size: 10px; line-height: 1; }
.mpas-cal__moon--full    { color: #000; }
.mpas-cal__moon--new     { color: #000; }
.mpas-cal__moon--eclipse { color: #c0392b; }

/* Cell content */
.mpas-cal__cellbody { display: block; clear: both; margin-top: 0; }
.mpas-cal__ev {
	display: block; font-size: 8.5px; line-height: 1.05; font-weight: 600;
	padding-left: 2px; border-left: 2px solid var(--c-other); margin-top: 1px;
}
.mpas-cal__ev--public    { border-color: var(--c-public); }
.mpas-cal__ev--ia        { border-color: var(--c-ia); }
.mpas-cal__ev--meeting   { border-color: var(--c-meeting); }
.mpas-cal__ev--bbq       { border-color: var(--c-bbq); }
.mpas-cal__ev--cosmology { border-color: var(--c-cosmology); }
.mpas-cal__ev--scag      { border-color: var(--c-scag); }
.mpas-cal__ev--workshop  { border-color: var(--c-workshop); }
.mpas-cal__ev--social    { border-color: var(--c-social); }
.mpas-cal__ev--training  { border-color: var(--c-training); }
.mpas-cal__ev--deadline  { border-color: var(--c-deadline); }

.mpas-cal__note { display: block; font-size: 8px; line-height: 1.05; color: #333; }
.mpas-cal__note--hol { font-weight: 700; }
.mpas-cal__note--ext { color: #6a4a12; font-weight: 600; }
.mpas-cal__note--sky { color: #1f3c88; font-style: italic; }
.mpas-cal__note--dst { color: #7a3b00; font-style: italic; }

/* --- Legend --------------------------------------------------------------- */
.mpas-cal__legend {
	display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .7rem; font-size: 11px;
}
.mpas-cal__legcol { flex: 1 1 220px; min-width: 200px; }
.mpas-cal__legcol h3 { margin: 0 0 .3rem; font-size: 12px; color: #1f3c88; }
.mpas-cal__keys { list-style: none; margin: 0; padding: 0; }
.mpas-cal__keys li { display: flex; align-items: center; gap: .4rem; margin: 1px 0; line-height: 1.2; }
.mpas-cal__keys--notes li { display: block; margin-left: 0; }
.mpas-cal__sw {
	display: inline-block; width: 16px; height: 11px; border: 1px solid #999;
	flex: 0 0 auto; text-align: center; font-size: 9px; line-height: 10px;
}
.mpas-cal__sw--school { background: #fff; }
.mpas-cal__sw--school b { text-decoration: underline; }
.mpas-cal__credit { margin-top: .5rem; font-size: 10px; color: #666; text-align: center; }

/* --- Print: A3 portrait, just the sheet ---------------------------------- */
@media print {
	@page { size: A3 portrait; margin: 6mm; }
	.mpas-cal { --rowh: 10.2mm; }
	body { background: #fff !important; }
	body * { visibility: hidden !important; }
	.mpas-cal__sheet, .mpas-cal__sheet * { visibility: visible !important; }
	.mpas-cal__sheet {
		position: absolute; left: 0; top: 0; width: 100%; max-width: none;
		margin: 0; padding: 0; box-shadow: none; overflow: visible !important;
	}
	.mpas-cal__bar { display: none !important; }
	.mpas-cal__grid { min-width: 0; font-size: 7.5px; }
	.mpas-cal__wd { font-size: 7.5px; }
	.mpas-cal__moon { font-size: 7.5px; }
	.mpas-cal__ev { font-size: 7px; }
	.mpas-cal__note { font-size: 6.5px; }
	.mpas-cal__title { font-size: 15px; }
	.mpas-cal__grid th, .mpas-cal__grid td,
	.mpas-cal__cell, .mpas-cal__sw { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
