/* Happy Grove School Calendar
 * Colours follow the site's Elementor global colours when available.
 * Override in Dashboard → School Calendar → Settings. */

.hgc {
	--hgc-primary: var(--e-global-color-primary, #1F4E3D);
	--hgc-accent: var(--e-global-color-accent, #C99A2E);
	--hgc-ink: #1F2328;
	--hgc-muted: #5E6770;
	--hgc-line: #E2E5E9;
	--hgc-soft: #F6F7F8;
	--hgc-paper: #FFFFFF;
	--hgc-radius: 8px;
	--hgc-hatch: repeating-linear-gradient(135deg, rgba(14, 138, 134, .09) 0 6px, rgba(14, 138, 134, .02) 6px 12px);

	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--hgc-ink);
	background: var(--hgc-paper);
	border: 1px solid var(--hgc-line);
	border-radius: 12px;
	overflow: hidden;
	max-width: 1240px;
	margin: 0 auto 2rem;
	text-align: left;
}
.hgc *, .hgc *::before, .hgc *::after { box-sizing: border-box; }
.hgc h2, .hgc h3, .hgc h4, .hgc p, .hgc ul, .hgc ol, .hgc dl, .hgc dd, .hgc figure, .hgc blockquote {
	margin: 0; padding: 0; font-family: inherit; letter-spacing: normal; text-transform: none;
}
.hgc ul, .hgc ol { list-style: none; }

/* Button reset – colours come from variables so theme hover styles can't take over. */
.hgc button {
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	margin: 0;
	padding: 0;
	border-radius: var(--bradius, 0);
	border: var(--bbd, 0);
	box-shadow: none;
	cursor: pointer;
	min-height: 0;
	white-space: normal;
}
.hgc button,
.hgc button:hover,
.hgc button:focus,
.hgc button:active {
	background: var(--bbg, transparent);
	color: var(--bfg, inherit);
}
.hgc button:focus-visible,
.hgc a:focus-visible,
.hgc input:focus-visible,
.hgc .hgc-modal__panel:focus-visible {
	outline: 2px solid var(--hgc-accent);
	outline-offset: 2px;
}

/* ---------- Header ---------- */
.hgc .hgc-head {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	align-items: flex-end;
	justify-content: space-between;
	padding: 26px 28px 22px;
	background: var(--hgc-primary);
	color: #fff;
	border-bottom: 4px solid var(--hgc-accent);
}
.hgc .hgc-head__title { font-size: 1.6rem; line-height: 1.2; font-weight: 700; color: #fff; }
.hgc .hgc-head__sub { margin-top: 4px; font-size: 1rem; color: rgba(255, 255, 255, .82); }
.hgc .hgc-head__terms { display: flex; flex-wrap: wrap; gap: 8px; }
.hgc .hgc-term {
	display: grid;
	gap: 1px;
	padding: 8px 12px;
	border-radius: var(--hgc-radius);
	background: rgba(255, 255, 255, .1);
	border: 1px solid rgba(255, 255, 255, .18);
	font-size: .82rem;
	line-height: 1.35;
}
.hgc .hgc-term__name { font-weight: 700; }
.hgc .hgc-term__dates { color: rgba(255, 255, 255, .8); }
.hgc .hgc-term.is-current { background: rgba(255, 255, 255, .16); border-color: var(--hgc-accent); }
.hgc .hgc-term__now { color: var(--hgc-accent); font-weight: 700; }

.hgc .hgc-app { padding: 20px 28px 24px; }

/* ---------- Toolbar ---------- */
.hgc .hgc-bar {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}
.hgc .hgc-nav { display: flex; gap: 6px; }
.hgc .hgc-btn {
	--bbg: var(--hgc-paper);
	--bfg: var(--hgc-ink);
	--bbd: 1px solid var(--hgc-line);
	--bradius: 6px;
	padding: 7px 14px;
	font-size: .9rem;
	font-weight: 600;
}
.hgc .hgc-btn:hover { --bbg: var(--hgc-soft); --bbd: 1px solid #C9CED4; }
.hgc .hgc-btn--icon { padding: 5px 12px; font-size: 1.25rem; line-height: 1; }
.hgc .hgc-btn--primary { --bbg: var(--hgc-primary); --bfg: #fff; --bbd: 1px solid var(--hgc-primary); }
.hgc .hgc-btn--primary:hover { --bbg: var(--hgc-primary); --bfg: #fff; filter: brightness(1.12); }
.hgc .hgc-label {
	font-size: 1.75rem;
	line-height: 1.1;
	font-weight: 800;
	color: var(--hgc-primary);
	text-align: center;
}
.hgc .hgc-views {
	display: inline-flex;
	padding: 3px;
	border-radius: 8px;
	background: var(--hgc-soft);
	border: 1px solid var(--hgc-line);
}
.hgc .hgc-views__btn { --bradius: 6px; padding: 6px 14px; font-size: .9rem; font-weight: 600; --bfg: var(--hgc-muted); }
.hgc .hgc-views__btn:hover { --bfg: var(--hgc-ink); }
.hgc .hgc-views__btn[aria-pressed="true"] { --bbg: var(--hgc-paper); --bfg: var(--hgc-primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* ---------- Search + legend ---------- */
.hgc .hgc-tools {
	display: grid;
	grid-template-columns: minmax(180px, 240px) 1fr;
	gap: 14px 20px;
	align-items: start;
	padding: 14px 0 16px;
	border-top: 1px solid var(--hgc-line);
}
.hgc .hgc-search {
	width: 100%;
	padding: 8px 12px;
	font: inherit;
	font-size: .92rem;
	color: var(--hgc-ink);
	background: var(--hgc-paper);
	border: 1px solid var(--hgc-line);
	border-radius: 6px;
	box-shadow: none;
	margin: 0;
	min-height: 0;
}
.hgc .hgc-tools > * { min-width: 0; }
.hgc .hgc-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.hgc .hgc-chip {
	--bbg: var(--cbg);
	--bfg: var(--hgc-ink);
	--bbd: 1px solid transparent;
	--bradius: 999px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 11px 4px 9px;
	font-size: .8rem;
	font-weight: 600;
}
.hgc .hgc-chip:hover { --bbg: var(--cbg); --bbd: 1px solid var(--c); }
.hgc .hgc-chip__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.hgc .hgc-chip.is-off { --bbg: transparent; --bfg: var(--hgc-muted); --bbd: 1px dashed #C9CED4; }
.hgc .hgc-chip.is-off .hgc-chip__dot { background: transparent; box-shadow: inset 0 0 0 1.5px #A7AEB5; }
.hgc .hgc-legend__note { margin-top: 6px; font-size: .8rem; color: var(--hgc-muted); }
.hgc .hgc-linkbtn { --bfg: var(--hgc-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.hgc .hgc-linkbtn:hover { --bfg: var(--hgc-primary); }

/* ---------- Monthly quote + ongoing ---------- */
.hgc .hgc-quote {
	margin: 0 0 16px;
	padding: 2px 0 2px 16px;
	border-left: 3px solid var(--hgc-accent);
	max-width: 70ch;
}
.hgc .hgc-quote p { font-style: italic; font-size: 1rem; color: var(--hgc-ink); }
.hgc .hgc-quote figcaption { margin-top: 2px; font-size: .82rem; color: var(--hgc-muted); }
.hgc .hgc-quote figcaption::before { content: "– "; }

.hgc .hgc-ongoing { margin: 0 0 16px; }
.hgc .hgc-ongoing__title { font-size: .85rem; font-weight: 700; color: var(--hgc-muted); margin-bottom: 6px; }
.hgc .hgc-ongoing__list { display: flex; flex-wrap: wrap; gap: 6px; }
.hgc .hgc-ongoing__item {
	--bbg: var(--cbg);
	--bradius: 6px;
	display: inline-grid;
	gap: 0;
	padding: 5px 12px 5px 10px;
	border-left: 3px solid var(--c);
	text-align: left;
	font-size: .85rem;
}
.hgc .hgc-ongoing__item:hover { --bbg: var(--cbg); text-decoration: underline; }
.hgc .hgc-ongoing__name { font-weight: 600; }
.hgc .hgc-ongoing__when { font-size: .76rem; color: var(--hgc-muted); }

/* ---------- Month grid ---------- */
.hgc .hgc-month {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	border: 1px solid var(--hgc-line);
	border-radius: var(--hgc-radius);
	overflow: hidden;
	background: var(--hgc-line);
	gap: 1px;
}
.hgc .hgc-dow {
	background: var(--hgc-soft);
	padding: 8px 10px;
	font-size: .8rem;
	font-weight: 700;
	color: var(--hgc-muted);
}
.hgc .hgc-day {
	position: relative;
	min-height: 118px;
	padding: 6px 7px 8px;
	background: var(--hgc-paper);
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.hgc .hgc-day.has-events { cursor: pointer; }
.hgc .hgc-day.is-weekend { background: #FAFBFB; }
.hgc .hgc-day.is-break { background: var(--hgc-hatch), var(--hgc-paper); }
.hgc .hgc-day.is-out > * { opacity: .42; }
.hgc .hgc-day__num {
	--bradius: 50%;
	align-self: flex-start;
	display: inline-grid;
	place-items: center;
	min-width: 26px;
	height: 26px;
	padding: 0 4px;
	font-size: .85rem;
	font-weight: 600;
	color: var(--hgc-ink);
}
.hgc button.hgc-day__num:hover { --bbg: var(--hgc-soft); }
.hgc .hgc-day.is-today .hgc-day__num,
.hgc .hgc-day.is-today button.hgc-day__num:hover { --bbg: var(--hgc-accent); --bfg: #1F2328; background: var(--hgc-accent); border-radius: 50%; font-weight: 800; }
.hgc .hgc-day__events { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hgc .hgc-pill {
	--bbg: var(--cbg);
	--bfg: var(--hgc-ink);
	--bradius: 4px;
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
	padding: 3px 6px 3px 7px;
	border-left: 3px solid var(--c);
	font-size: .76rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.hgc .hgc-pill:hover { --bbg: var(--c); --bfg: #fff; }
.hgc .hgc-pill__time { font-weight: 700; opacity: .8; }
/* Multi-day events join across the week like a bar. */
.hgc .hgc-pill.is-cont-left { margin-left: -8px; width: calc(100% + 8px); border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: 10px; }
.hgc .hgc-pill.is-cont-right { margin-right: -8px; width: calc(100% + 8px); border-top-right-radius: 0; border-bottom-right-radius: 0; }
.hgc .hgc-pill.is-cont-left.is-cont-right { width: calc(100% + 16px); }
.hgc .hgc-more { --bfg: var(--hgc-primary); align-self: flex-start; font-size: .76rem; font-weight: 700; padding: 1px 4px; }
.hgc .hgc-more:hover { --bfg: var(--hgc-primary); text-decoration: underline; }

/* ---------- Year view ---------- */
.hgc .hgc-hint { font-size: .85rem; color: var(--hgc-muted); margin-bottom: 14px; }
.hgc .hgc-year {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
	gap: 18px;
}
.hgc .hgc-mini {
	padding: 12px 12px 10px;
	border: 1px solid var(--hgc-line);
	border-radius: var(--hgc-radius);
}
.hgc .hgc-mini__head { margin-bottom: 8px; }
.hgc .hgc-mini__title { --bfg: var(--hgc-primary); font-size: 1rem; font-weight: 800; }
.hgc .hgc-mini__title:hover { --bfg: var(--hgc-primary); text-decoration: underline; }
.hgc .hgc-mini__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.hgc .hgc-mini__dow { font-size: .7rem; font-weight: 700; color: var(--hgc-muted); padding-bottom: 2px; }
.hgc .hgc-mini__day {
	--bradius: 5px;
	position: relative;
	display: grid;
	place-items: center;
	height: 30px;
	font-size: .78rem;
	color: var(--hgc-muted);
	border-radius: 5px;
}
.hgc .hgc-mini__day.is-break { background: var(--hgc-hatch); }
.hgc .hgc-mini__day.has-events { --bfg: var(--hgc-ink); font-weight: 700; padding-bottom: 6px; }
.hgc .hgc-mini__day.has-events:hover { --bbg: var(--hgc-soft); }
.hgc .hgc-mini__day.is-break.has-events { --bbg: var(--hgc-hatch); }
.hgc .hgc-mini__day.is-today { box-shadow: inset 0 0 0 2px var(--hgc-accent); }
.hgc .hgc-mini__dots { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; }
.hgc .hgc-mini__dots i { width: 5px; height: 5px; border-radius: 50%; }
.hgc .hgc-mini__also { margin-top: 8px; font-size: .74rem; line-height: 1.35; color: var(--hgc-muted); }

/* ---------- List view ---------- */
.hgc .hgc-earlier { margin-bottom: 16px; }
.hgc .hgc-lmonth + .hgc-lmonth { margin-top: 26px; }
.hgc .hgc-lmonth__title {
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--hgc-primary);
	padding-bottom: 8px;
	margin-bottom: 12px;
	border-bottom: 2px solid var(--hgc-line);
}
.hgc .hgc-rows { display: grid; gap: 2px; }
.hgc .hgc-row {
	display: grid;
	grid-template-columns: 76px 1fr;
	gap: 14px;
	padding: 10px 8px;
	border-radius: 6px;
	align-items: start;
}
.hgc .hgc-row + .hgc-row { border-top: 1px solid var(--hgc-line); border-radius: 0; }
.hgc .hgc-row.is-past { opacity: .55; }
.hgc .hgc-row.is-now { background: rgba(201, 154, 46, .1); border-radius: 6px; }
.hgc .hgc-row__date {
	display: grid;
	justify-items: start;
	padding-left: 10px;
	border-left: 4px solid var(--c);
	line-height: 1.15;
}
.hgc .hgc-row__dow { font-size: .75rem; font-weight: 700; color: var(--hgc-muted); }
.hgc .hgc-row__num { font-size: 1.45rem; font-weight: 800; }
.hgc .hgc-row__to { font-size: .72rem; color: var(--hgc-muted); margin-top: 2px; }
.hgc .hgc-row__title { font-size: 1rem; font-weight: 700; text-align: left; }
.hgc .hgc-row__title:hover { --bfg: var(--hgc-primary); text-decoration: underline; }
.hgc .hgc-row__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: .82rem; color: var(--hgc-muted); }
.hgc .hgc-row__cat { color: var(--c); font-weight: 600; filter: brightness(.85); }

/* ---------- Empty / footer ---------- */
.hgc .hgc-empty {
	display: grid;
	justify-items: start;
	gap: 10px;
	padding: 14px 16px;
	margin-bottom: 16px;
	border: 1px dashed #C9CED4;
	border-radius: var(--hgc-radius);
	color: var(--hgc-muted);
}
.hgc .hgc-foot {
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid var(--hgc-line);
	font-size: .85rem;
	color: var(--hgc-muted);
}
.hgc .hgc-foot a { color: var(--hgc-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Modal ---------- */
.hgc .hgc-modal[hidden] { display: none; }
.hgc .hgc-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	place-items: center;
	padding: 20px;
}
.hgc .hgc-modal__backdrop { position: absolute; inset: 0; background: rgba(20, 26, 30, .5); }
.hgc .hgc-modal__panel {
	position: relative;
	width: 100%;
	max-width: 500px;
	max-height: calc(100vh - 40px);
	overflow: auto;
	padding: 26px 26px 24px;
	background: var(--hgc-paper);
	border-radius: 12px;
	border-top: 5px solid var(--hgc-primary);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
	animation: hgc-in .16s ease-out;
}
@keyframes hgc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hgc .hgc-modal__close {
	--bradius: 50%;
	--bfg: var(--hgc-muted);
	position: absolute;
	top: 10px;
	right: 12px;
	width: 34px;
	height: 34px;
	font-size: 1.6rem;
	line-height: 1;
}
.hgc .hgc-modal__close:hover { --bbg: var(--hgc-soft); --bfg: var(--hgc-ink); }
.hgc .hgc-back { display: inline-block; margin-bottom: 12px; font-size: .85rem; }
.hgc .hgc-ev__cat {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--cbg);
	box-shadow: inset 3px 0 0 var(--c);
	font-size: .78rem;
	font-weight: 700;
}
.hgc .hgc-ev__title { margin: 10px 36px 14px 0; font-size: 1.3rem; line-height: 1.25; font-weight: 800; color: var(--hgc-ink); }
.hgc .hgc-ev__facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .92rem; }
.hgc .hgc-ev__facts dt { font-weight: 700; color: var(--hgc-muted); }
.hgc .hgc-ev__desc { margin-top: 14px; font-size: .92rem; }
.hgc .hgc-ev__desc p + p { margin-top: 8px; }
.hgc .hgc-ev__actions { margin-top: 20px; }
.hgc .hgc-daynote { margin: -6px 0 12px; font-size: .88rem; color: #0E6E6B; font-weight: 600; }
.hgc .hgc-daylist { display: grid; gap: 8px; }
.hgc .hgc-daylist__item {
	--bbg: var(--cbg);
	--bradius: 6px;
	display: grid;
	gap: 2px;
	width: 100%;
	padding: 10px 12px;
	border-left: 4px solid var(--c);
	text-align: left;
}
.hgc .hgc-daylist__item:hover { --bbg: var(--cbg); filter: brightness(.97); }
.hgc .hgc-daylist__title { font-weight: 700; }
.hgc .hgc-daylist__meta { font-size: .8rem; color: var(--hgc-muted); }
html.hgc-lock { overflow: hidden; }

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
	.hgc .hgc-bar { grid-template-columns: auto auto; }
	.hgc .hgc-label { grid-column: 1 / -1; grid-row: 1; text-align: left; }
	.hgc .hgc-views { justify-self: end; }
	.hgc .hgc-tools { grid-template-columns: 1fr; }
	.hgc .hgc-day { min-height: 96px; }
}

/* ---------- Phone ---------- */
@media (max-width: 720px) {
	.hgc { border-radius: 0; border-left: 0; border-right: 0; }
	.hgc .hgc-head { padding: 20px 16px 16px; }
	.hgc .hgc-head__title { font-size: 1.3rem; }
	.hgc .hgc-app { padding: 14px 12px 18px; }
	.hgc .hgc-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
	.hgc .hgc-label { font-size: 1.4rem; width: 100%; order: -1; }
	.hgc .hgc-head__terms { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
	.hgc .hgc-term { flex: none; padding: 6px 10px; font-size: .76rem; }
	.hgc .hgc-btn { padding: 7px 11px; }
	.hgc .hgc-views__btn { padding: 6px 11px; }
	.hgc .hgc-legend { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 -12px; padding-left: 12px; padding-right: 12px; scrollbar-width: thin; }
	.hgc .hgc-chip { flex: none; }

	/* Month grid becomes a compact dot calendar – tap a day to see its events. */
	.hgc .hgc-dow { padding: 6px 0; text-align: center; font-size: .72rem; }
	.hgc .hgc-day { min-height: 58px; padding: 4px 2px 6px; align-items: center; gap: 3px; }
	.hgc .hgc-day__num { align-self: center; min-width: 26px; height: 26px; font-size: .82rem; }
	.hgc .hgc-day__events { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 3px; }
	.hgc .hgc-pill,
	.hgc .hgc-pill.is-cont-left,
	.hgc .hgc-pill.is-cont-right {
		width: 7px;
		height: 7px;
		margin: 0;
		padding: 0;
		border: 0;
		--bradius: 50%;
		--bbg: var(--c);
		font-size: 0;
		flex: none;
	}
	.hgc .hgc-more { font-size: .68rem; padding: 0; line-height: 7px; }
	.hgc .hgc-more__word { display: none; }

	.hgc .hgc-year { grid-template-columns: 1fr 1fr; gap: 10px; }
	.hgc .hgc-mini { padding: 8px 6px; }
	.hgc .hgc-mini__day { height: 26px; font-size: .7rem; }
	.hgc .hgc-mini__also { display: none; }

	.hgc .hgc-row { grid-template-columns: 62px 1fr; gap: 10px; padding: 10px 2px; }

	.hgc .hgc-modal { place-items: end center; padding: 0; }
	.hgc .hgc-modal__panel { max-width: none; border-radius: 16px 16px 0 0; max-height: 85vh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 420px) {
	.hgc .hgc-year { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.hgc .hgc-modal__panel { animation: none; }
}

@media print {
	.hgc { border: 0; }
	.hgc .hgc-nav, .hgc .hgc-views, .hgc .hgc-tools, .hgc .hgc-foot, .hgc .hgc-earlier { display: none !important; }
	.hgc .hgc-head { background: none; color: #000; border-bottom: 2px solid #000; }
	.hgc .hgc-head__title, .hgc .hgc-head__sub, .hgc .hgc-term__dates { color: #000; }
	.hgc .hgc-row.is-past { opacity: 1; }
}
