/**
 * Interactive Events Calendar – front-end styles.
 * Design: "Class Calendar" (Claude Design) — crisp & institutional,
 * navy #13214a, beige #dcbe8c, dark beige #b4945f, Public Sans.
 *
 * Everything is scoped under .iec-cal so theme/Elementor styles are not
 * affected, and theme styles can't break the calendar. Re-colour it from
 * your theme with e.g.  .iec-cal { --iec-navy: #7a1f2b; }
 */

/* ---------- Tokens (light) ---------- */
.iec-cal {
	--iec-navy: #13214a;
	--iec-beige: #dcbe8c;
	--iec-beige-dk: #b4945f;

	--bg: #f7f5f0;
	--surface: #ffffff;
	--sunk: #f2efe8;
	--hover: #faf8f3;
	--ink: #131a2e;
	--muted: #5b6275;
	--line: #e4dfd3;
	--line-strong: #cfc7b6;
	--beige-text: #86683a;
	--primary: var(--iec-navy);
	--on-primary: #ffffff;
	--today-bg: var(--iec-navy);
	--today-ink: #ffffff;
	--heat: var(--iec-navy);
	--heat-ink: #ffffff;
	--shadow: 0 14px 36px rgba(19, 33, 74, 0.16);

	/* Category colours (slot 0-7). */
	--c0: var(--iec-navy);
	--c1: var(--iec-beige-dk);
	--c2: oklch(0.55 0.09 195);
	--c3: oklch(0.55 0.09 40);
	--c4: oklch(0.55 0.09 320);
	--c5: oklch(0.55 0.09 145);
	--c6: oklch(0.55 0.11 10);
	--c7: #5b6275;
}

/* ---------- Tokens (dark) ---------- */
.iec-cal[data-theme="dark"] {
	--bg: #0b1122;
	--surface: #111a33;
	--sunk: #0d152b;
	--hover: #16213f;
	--ink: #eceef4;
	--muted: #9ba3b9;
	--line: #222d4d;
	--line-strong: #34416b;
	--beige-text: #dcbe8c;
	--primary: #dcbe8c;
	--on-primary: #13214a;
	--today-bg: #dcbe8c;
	--today-ink: #13214a;
	--heat: #dcbe8c;
	--heat-ink: #13214a;
	--shadow: 0 14px 36px rgba(0, 0, 0, 0.45);

	--c0: oklch(0.78 0.07 265);
	--c1: #dcbe8c;
	--c2: oklch(0.78 0.08 195);
	--c3: oklch(0.78 0.08 40);
	--c4: oklch(0.78 0.08 320);
	--c5: oklch(0.78 0.08 145);
	--c6: oklch(0.78 0.09 10);
	--c7: #9ba3b9;
}

/* ---------- Base + theme-proofing ---------- */
.iec-cal {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	padding: 32px 16px 40px;
	border-radius: 16px;
	background: var(--bg);
	color: var(--ink);
	font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
	text-align: left;
	transition: background-color 0.2s, color 0.2s;
}

.iec-cal *,
.iec-cal *::before,
.iec-cal *::after {
	box-sizing: border-box;
}

.iec-cal [hidden] {
	display: none !important;
}

/* Themes love to style every <button>; start from a clean slate. */
.iec-cal button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	font: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}

.iec-cal input {
	font: inherit;
	color: inherit;
}

.iec-cal a {
	color: var(--primary);
}

.iec-cal a:hover {
	color: var(--iec-beige-dk);
}

.iec-cal h2,
.iec-cal h3,
.iec-cal p,
.iec-cal dl,
.iec-cal dd {
	margin: 0;
	padding: 0;
	font-family: inherit;
	color: inherit;
	text-transform: none;
	letter-spacing: normal;
}

.iec-cal button:focus-visible,
.iec-cal input:focus-visible,
.iec-cal [role="button"]:focus-visible,
.iec-cal a:focus-visible {
	outline: 2px solid var(--iec-beige-dk);
	outline-offset: 1px;
}

.iec-cal .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.iec-cal__inner {
	position: relative;
	max-width: 920px;
	margin: 0 auto;
}

.iec-cal__fallback {
	margin: 16px 0 0;
	padding-left: 20px;
}

.iec-cal--ready .iec-cal__fallback {
	display: none;
}

.iec-cal__dot {
	flex: none;
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cat, var(--c0));
}

/* Colour slots → --cat */
.iec-cal .iec-c0 { --cat: var(--c0); }
.iec-cal .iec-c1 { --cat: var(--c1); }
.iec-cal .iec-c2 { --cat: var(--c2); }
.iec-cal .iec-c3 { --cat: var(--c3); }
.iec-cal .iec-c4 { --cat: var(--c4); }
.iec-cal .iec-c5 { --cat: var(--c5); }
.iec-cal .iec-c6 { --cat: var(--c6); }
.iec-cal .iec-c7 { --cat: var(--c7); }

/* ---------- Header ---------- */
.iec-cal__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--line);
}

.iec-cal__heading {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.iec-cal__eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--beige-text);
}

.iec-cal .iec-cal__title {
	font-size: 28px;
	line-height: 1.1;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.iec-cal__actions {
	display: flex;
	flex: 1 1 300px;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.iec-cal__search {
	position: relative;
	flex: 1 1 200px;
	max-width: 300px;
}

.iec-cal__search-icon {
	position: absolute;
	left: 12px;
	top: 12px;
	color: var(--muted);
	pointer-events: none;
}

.iec-cal .iec-cal__search-input {
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 34px 0 36px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	background: var(--surface);
	color: var(--ink);
	font-size: 14px;
	outline: none;
	box-shadow: none;
}

.iec-cal .iec-cal__search-input {
	-webkit-appearance: none;
	appearance: none;
}

.iec-cal .iec-cal__search-input::-webkit-search-cancel-button,
.iec-cal .iec-cal__search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	display: none;
}

.iec-cal .iec-cal__search-input::placeholder {
	color: var(--muted);
	opacity: 1;
}

.iec-cal .iec-cal__search-clear {
	position: absolute;
	right: 6px;
	top: 6px;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 6px;
	color: var(--muted);
	font-size: 18px;
	line-height: 1;
}

.iec-cal .iec-cal__search-clear:hover {
	background: var(--sunk);
}

.iec-cal__results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	min-width: 280px;
	z-index: 25;
	max-height: 340px;
	overflow: auto;
	padding: 6px;
	border: 1px solid var(--line-strong);
	border-radius: 10px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.iec-cal__results-label {
	padding: 6px 8px 8px;
	font-size: 12px;
	color: var(--muted);
}

.iec-cal .iec-cal__result {
	display: flex;
	gap: 10px;
	width: 100%;
	padding: 8px;
	border-radius: 6px;
	text-align: left;
}

.iec-cal .iec-cal__result:hover,
.iec-cal .iec-cal__result:focus-visible {
	background: var(--sunk);
}

.iec-cal__result .iec-cal__dot {
	width: 8px;
	height: 8px;
	margin-top: 6px;
}

.iec-cal__stack {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.iec-cal__strong {
	font-size: 14px;
	font-weight: 600;
}

.iec-cal__card .iec-cal__stack:first-child > span {
	white-space: nowrap;
}

.iec-cal__small {
	font-size: 12px;
	color: var(--muted);
}

.iec-cal .iec-cal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--line-strong);
	border-radius: 8px;
	background: var(--surface);
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

.iec-cal .iec-cal__btn:hover {
	background: var(--sunk);
}

.iec-cal__theme-icon {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1.5px solid currentColor;
	background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

.iec-cal .iec-cal__btn--primary,
.iec-cal a.iec-cal__btn--primary {
	border: 0;
	background: var(--primary);
	color: var(--on-primary);
	font-weight: 600;
	text-decoration: none;
}

.iec-cal .iec-cal__btn--primary:hover,
.iec-cal a.iec-cal__btn--primary:hover {
	background: var(--primary);
	color: var(--on-primary);
	filter: brightness(1.12);
}

/* ---------- Toolbar ---------- */
.iec-cal__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 0 14px;
}

.iec-cal__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.iec-cal .iec-cal__btn--sm {
	height: 36px;
	font-weight: 600;
}

.iec-cal__arrows {
	display: flex;
}

.iec-cal .iec-cal__arrow {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border: 1px solid var(--line-strong);
	background: var(--surface);
}

.iec-cal .iec-cal__arrow:first-child {
	border-radius: 8px 0 0 8px;
}

.iec-cal .iec-cal__arrow:last-child {
	border-left: 0;
	border-radius: 0 8px 8px 0;
}

.iec-cal .iec-cal__arrow:hover {
	background: var(--sunk);
}

.iec-cal .iec-cal__period {
	font-size: 19px;
	font-weight: 600;
	letter-spacing: -0.005em;
}

.iec-cal__tabs {
	display: flex;
	gap: 2px;
	padding: 3px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: var(--sunk);
}

.iec-cal .iec-cal__tab {
	height: 30px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	border-radius: 6px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
}

.iec-cal .iec-cal__tab[aria-selected="true"] {
	background: var(--surface);
	color: var(--ink);
	box-shadow: 0 1px 2px rgba(19, 33, 74, 0.14);
}

/* ---------- Category chips ---------- */
.iec-cal__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding-bottom: 16px;
}

.iec-cal .iec-cal__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 32px;
	padding: 0 12px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 500;
}

.iec-cal .iec-cal__chip[aria-pressed="true"] {
	border-color: color-mix(in srgb, var(--cat) 45%, var(--surface));
	background: color-mix(in srgb, var(--cat) 14%, var(--surface));
	color: var(--ink);
}

.iec-cal__chip-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 1.5px solid var(--cat);
}

.iec-cal__chip[aria-pressed="true"] .iec-cal__chip-dot {
	background: var(--cat);
}

.iec-cal__chip-count {
	color: var(--muted);
	font-weight: 400;
}

.iec-cal .iec-cal__link {
	height: 32px;
	display: inline-flex;
	align-items: center;
	padding: 0 10px;
	color: var(--beige-text);
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ---------- Month (full) ---------- */
.iec-cal__frame {
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--line);
}

.iec-cal__grid {
	display: grid;
	gap: 1px;
}

.iec-cal__weekday {
	padding: 10px;
	background: var(--sunk);
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.iec-cal__cell {
	min-width: 0;
	min-height: 118px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 6px;
	background: var(--surface);
	cursor: pointer;
}

.iec-cal__cell--out {
	background: var(--sunk);
}

.iec-cal__cell--active {
	box-shadow: inset 0 0 0 2px var(--iec-beige-dk);
}

.iec-cal__num {
	width: 26px;
	height: 26px;
	flex: none;
	display: grid;
	place-items: center;
	border-radius: 50%;
	font-size: 13px;
	font-weight: 500;
}

.iec-cal__cell--out .iec-cal__num {
	color: var(--muted);
}

.iec-cal .is-today {
	background: var(--today-bg);
	color: var(--today-ink) !important;
	font-weight: 700;
}

.iec-cal .iec-cal__pill {
	display: block;
	width: 100%;
	padding: 3px 6px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--iec-beige) 26%, var(--surface));
	color: var(--beige-text);
	font-size: 11px;
	font-weight: 600;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.iec-cal .iec-cal__pill:hover {
	background: color-mix(in srgb, var(--iec-beige) 40%, var(--surface));
}

.iec-cal .iec-cal__ev {
	display: flex;
	align-items: center;
	gap: 5px;
	width: 100%;
	min-width: 0;
	padding: 2px 4px;
	border-radius: 4px;
	font-size: 12px;
	text-align: left;
}

.iec-cal .iec-cal__ev:hover {
	background: var(--sunk);
}

.iec-cal__ev-time {
	flex: none;
	color: var(--muted);
}

.iec-cal__ev-title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}

.iec-cal__more {
	padding-left: 4px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
}

/* ---------- Month (compact) ---------- */
.iec-cal__box {
	padding: 8px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.iec-cal__weekday--c {
	padding: 6px 0;
	background: none;
	font-size: 11px;
	text-align: center;
}

.iec-cal .iec-cal__cday {
	height: 52px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	border-radius: 8px;
}

.iec-cal .iec-cal__cday[aria-pressed="true"] {
	background: color-mix(in srgb, var(--iec-beige) 38%, var(--surface));
}

.iec-cal__cday .iec-cal__num {
	font-size: 14px;
}

.iec-cal__cday--out .iec-cal__num {
	color: var(--muted);
}

.iec-cal__dots {
	display: flex;
	gap: 3px;
	height: 5px;
}

.iec-cal__dots .iec-cal__dot {
	width: 5px;
	height: 5px;
}

/* ---------- Strip (compact week/day) ---------- */
.iec-cal__strip {
	display: grid;
	gap: 4px;
	padding: 6px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.iec-cal .iec-cal__sday {
	height: 64px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	border-radius: 8px;
}

.iec-cal .iec-cal__sday[aria-pressed="true"] {
	background: var(--primary);
	color: var(--on-primary);
}

.iec-cal__sday.is-today-text {
	color: var(--beige-text);
}

.iec-cal__sday-short {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.8;
}

.iec-cal__sday-num {
	font-size: 17px;
	font-weight: 700;
}

.iec-cal__sday-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: transparent;
}

.iec-cal__sday-dot.has {
	background: var(--muted);
}

.iec-cal__sday[aria-pressed="true"] .iec-cal__sday-dot.has {
	background: var(--on-primary);
}

/* ---------- Agenda ---------- */
.iec-cal__agenda {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 18px;
}

.iec-cal__agenda-title {
	font-size: 16px;
	font-weight: 600;
}

.iec-cal .iec-cal__banner {
	display: block;
	width: 100%;
	padding: 8px 12px;
	border-radius: 8px;
	background: color-mix(in srgb, var(--iec-beige) 26%, var(--surface));
	color: var(--beige-text);
	font-size: 13px;
	font-weight: 600;
	text-align: left;
}

.iec-cal .iec-cal__card {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr);
	gap: 12px;
	width: 100%;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	text-align: left;
}

.iec-cal .iec-cal__card:hover {
	border-color: var(--line-strong);
}

.iec-cal__card-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 500;
}

.iec-cal__card-title {
	font-size: 15px;
	font-weight: 600;
}

.iec-cal__empty {
	padding: 28px 12px;
	border: 1px dashed var(--line-strong);
	border-radius: 10px;
	color: var(--muted);
	font-size: 14px;
	text-align: center;
}

/* ---------- Week / Day time grid ---------- */
.iec-cal__scroll {
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.iec-cal__week {
	min-width: 640px;
}

.iec-cal__wrow {
	display: grid;
}

.iec-cal__whead {
	border-bottom: 1px solid var(--line);
	background: var(--sunk);
}

.iec-cal .iec-cal__wday {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-left: 1px solid var(--line);
	text-align: left;
}

.iec-cal .iec-cal__wday:hover {
	background: var(--hover);
}

.iec-cal__wday-short {
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.iec-cal__wday .iec-cal__num {
	width: 28px;
	height: 28px;
	font-size: 15px;
	font-weight: 700;
}

.iec-cal__allday-row {
	border-bottom: 1px solid var(--line);
}

.iec-cal__allday-label {
	padding: 6px 8px 6px 0;
	color: var(--muted);
	font-size: 11px;
	text-align: right;
}

.iec-cal__allday-cell {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 4px;
	border-left: 1px solid var(--line);
}

.iec-cal__hours > div {
	position: relative;
	height: 52px;
}

.iec-cal__hours span {
	position: absolute;
	right: 8px;
	top: 4px;
	color: var(--muted);
	font-size: 11px;
	white-space: nowrap;
}

.iec-cal__col {
	position: relative;
	border-left: 1px solid var(--line);
	background-image: repeating-linear-gradient(to bottom, transparent 0 51px, var(--line) 51px 52px);
}

.iec-cal__col--today {
	background-color: color-mix(in srgb, var(--iec-beige) 10%, transparent);
}

.iec-cal .iec-cal__block {
	position: absolute;
	display: flex;
	flex-direction: column;
	gap: 1px;
	overflow: hidden;
	padding: 4px 6px;
	border: 1px solid color-mix(in srgb, var(--cat) 42%, var(--surface));
	border-radius: 6px;
	background: color-mix(in srgb, var(--cat) 15%, var(--surface));
	text-align: left;
}

.iec-cal .iec-cal__block:hover {
	border-color: var(--cat);
}

.iec-cal__block-code {
	display: flex;
	align-items: center;
	gap: 5px;
	overflow: hidden;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.iec-cal__block-sub {
	overflow: hidden;
	color: var(--muted);
	font-size: 11px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.iec-cal__day .iec-cal__block {
	gap: 2px;
	padding: 6px 10px;
	border-radius: 8px;
}

.iec-cal__day .iec-cal__block-title {
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.iec-cal__now {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--iec-beige-dk);
	pointer-events: none;
}

/* Day layout */
.iec-cal__daywrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 248px;
	gap: 20px;
	align-items: start;
}

.iec-cal__day {
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.iec-cal__day-allday {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 10px 16px;
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--iec-beige) 22%, var(--surface));
}

.iec-cal__day-allday .iec-cal__pill {
	padding: 0;
	background: none;
	font-size: 13px;
}

.iec-cal__day-grid {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	padding-top: 8px;
}

.iec-cal__aside {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.iec-cal__mini {
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.iec-cal__mini-title {
	padding: 0 2px 10px;
	font-size: 14px;
	font-weight: 600;
}

.iec-cal__mgrid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 2px;
}

.iec-cal__mhead {
	padding-bottom: 4px;
	color: var(--muted);
	font-size: 10px;
	font-weight: 600;
	text-align: center;
}

.iec-cal .iec-cal__mday {
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
}

.iec-cal .iec-cal__mday.lvl1 { background: color-mix(in srgb, var(--heat) 14%, var(--surface)); }
.iec-cal .iec-cal__mday.lvl2 { background: color-mix(in srgb, var(--heat) 32%, var(--surface)); }
.iec-cal .iec-cal__mday.lvl3 { background: color-mix(in srgb, var(--heat) 58%, var(--surface)); color: var(--heat-ink); }
.iec-cal .iec-cal__mday.is-today { background: var(--today-bg); color: var(--today-ink); }
.iec-cal .iec-cal__mday.is-special { box-shadow: inset 0 0 0 1.5px var(--iec-beige-dk); }
.iec-cal .iec-cal__mday.is-current { box-shadow: inset 0 0 0 2px var(--ink); }
.iec-cal .iec-cal__mday:empty { cursor: default; }

.iec-cal__summary {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0 4px;
}

.iec-cal__label {
	color: var(--muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.iec-cal__summary-text {
	font-size: 15px;
	font-weight: 600;
}

/* ---------- Year ---------- */
.iec-cal__year {
	display: grid;
	gap: 12px;
}

.iec-cal__ymonth {
	padding: 12px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.iec-cal .iec-cal__ymonth-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	width: 100%;
	padding: 0 2px 8px;
	text-align: left;
}

.iec-cal__ymonth-name {
	font-size: 14px;
	font-weight: 700;
}

.iec-cal__ymonth-count {
	color: var(--muted);
	font-size: 11px;
}

.iec-cal__ymonth .iec-cal__mday {
	height: 24px;
	border-radius: 4px;
	font-size: 11px;
}

.iec-cal__legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	padding-top: 14px;
	color: var(--muted);
	font-size: 12px;
}

.iec-cal__legend > span {
	display: flex;
	align-items: center;
	gap: 4px;
}

.iec-cal__swatch {
	width: 12px;
	height: 12px;
	border-radius: 3px;
}

/* ---------- Popover ---------- */
.iec-cal__scrim {
	position: fixed;
	inset: 0;
	z-index: 20;
}

.iec-cal__popover {
	position: absolute;
	z-index: 21;
	width: 300px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	border: 1px solid var(--line-strong);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

.iec-cal__pop-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
}

.iec-cal__pop-title {
	font-size: 15px;
	font-weight: 700;
}

.iec-cal__pop-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-height: 280px;
	margin: 0 -6px;
	overflow: auto;
}

.iec-cal .iec-cal__pop-item {
	display: flex;
	gap: 10px;
	padding: 8px 6px;
	border-radius: 6px;
	text-align: left;
}

.iec-cal .iec-cal__pop-item:hover {
	background: var(--sunk);
}

.iec-cal__pop-item .iec-cal__dot {
	width: 8px;
	height: 8px;
	margin-top: 5px;
}

/* ---------- Detail drawer ---------- */
.iec-cal__overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(8, 12, 28, 0.42);
}

.iec-cal__drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	width: 420px;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	background: var(--surface);
	color: var(--ink);
	box-shadow: var(--shadow);
	animation: iec-slide 0.18s ease-out;
}

.admin-bar .iec-cal__drawer {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .iec-cal__drawer {
		top: 46px;
	}
}

@keyframes iec-slide {
	from { transform: translateX(24px); opacity: 0; }
	to { transform: none; opacity: 1; }
}

.iec-cal__drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--line);
}

.iec-cal__tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 28px;
	padding: 0 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--cat) 16%, var(--surface));
	font-size: 12px;
	font-weight: 600;
}

.iec-cal__tag .iec-cal__dot {
	width: 8px;
	height: 8px;
}

.iec-cal .iec-cal__close {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border-radius: 8px;
	color: var(--muted);
	font-size: 22px;
	line-height: 1;
}

.iec-cal .iec-cal__close:hover {
	background: var(--sunk);
}

.iec-cal__drawer-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: 22px 24px;
}

.iec-cal__drawer-image {
	display: block;
	width: 100% !important;
	height: 200px !important;
	max-width: none;
	border-radius: 10px;
	object-fit: cover;
	background: var(--sunk);
}

.iec-cal__drawer-kicker {
	color: var(--beige-text);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
}

.iec-cal .iec-cal__drawer-title {
	font-size: 24px;
	line-height: 1.2;
	font-weight: 700;
	text-wrap: pretty;
}

.iec-cal__dl {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 12px;
	font-size: 14px;
}

.iec-cal__dl dt {
	color: var(--muted);
	font-weight: 400;
}

.iec-cal__dl dd {
	font-weight: 500;
}

.iec-cal .iec-cal__desc {
	font-size: 14px;
	line-height: 1.6;
	text-wrap: pretty;
}

.iec-cal__drawer-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 18px;
}

.iec-cal .iec-cal__drawer-links .iec-cal__link {
	height: auto;
	padding: 0;
	font-size: 14px;
}

.iec-cal__drawer-foot {
	display: flex;
	gap: 8px;
	padding: 16px 24px;
	border-top: 1px solid var(--line);
	background: var(--sunk);
}

.iec-cal__drawer-foot .iec-cal__btn {
	flex: 1;
	height: 42px;
}

/* ---------- Status ---------- */
.iec-cal__notice {
	margin-bottom: 12px;
	padding: 8px 12px;
	border-radius: 8px;
	background: var(--sunk);
	color: var(--muted);
	font-size: 13px;
}

.iec-cal--loading .iec-cal__body {
	opacity: 0.6;
	transition: opacity 0.15s;
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
	.iec-cal {
		padding: 24px 12px 32px;
		border-radius: 12px;
	}

	.iec-cal .iec-cal__title {
		font-size: 24px;
	}

	.iec-cal__search {
		max-width: none;
	}

	.iec-cal__daywrap {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.iec-cal,
	.iec-cal__drawer {
		transition: none;
		animation: none;
	}
}

/* Drawer lives in a <body>-level "portal" so page-builder transforms can't trap it. */
.iec-cal.iec-cal--portal {
	position: static;
	width: auto;
	padding: 0;
	border-radius: 0;
	background: none;
}

/* ---------- Hover card (event title + image) ---------- */
.iec-cal.iec-cal--hovercard {
	position: fixed;
	z-index: 100001;
	width: 260px;
	max-width: calc(100vw - 16px);
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
	box-shadow: var(--shadow);
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.iec-cal.iec-cal--hovercard.is-visible {
	opacity: 1;
	transform: none;
}

.iec-cal__hc-media {
	aspect-ratio: 16 / 9;
	background: var(--sunk);
}

.iec-cal__hc-media img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

.iec-cal__hc-media--empty {
	aspect-ratio: auto;
	height: 6px;
	background: var(--cat);
}

.iec-cal__hc-body {
	display: grid;
	gap: 6px;
	justify-items: start;
	padding: 12px 14px 14px;
}

.iec-cal__hc-title {
	color: var(--ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.iec-cal__hc-when {
	color: var(--muted);
	font-size: 12.5px;
}

@media (prefers-reduced-motion: reduce) {
	.iec-cal.iec-cal--hovercard {
		transition: none;
		transform: none;
	}
}
