/**
 * ICR Canada Events — front end
 *
 * Everything is namespaced under .icre and driven by custom properties that
 * the settings screen writes into :root, so a site owner can restyle the
 * whole thing without touching this file.
 */

.icre {
	--icre-gap: 20px;
	--icre-pad: 22px;
	--icre-rail: 74px;

	color: var(--icre-ink, #14161a);
	font-family: var(--icre-font, inherit);
	font-size: var(--icre-font-size, inherit);
	line-height: 1.5;
	box-sizing: border-box;
}

.icre *,
.icre *::before,
.icre *::after {
	box-sizing: inherit;
}

.icre.icre-density-compact {
	--icre-gap: 12px;
	--icre-pad: 16px;
	--icre-rail: 62px;
}

.icre .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* -------------------------------------------------- Layout */

.icre-list {
	display: flex;
	flex-direction: column;
	gap: var(--icre-gap);
}

.icre-grid {
	display: grid;
	gap: var(--icre-gap);
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 600px) {
	.icre-grid.icre-cols-2,
	.icre-grid.icre-cols-3,
	.icre-grid.icre-cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.icre-grid.icre-cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.icre-grid.icre-cols-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* -------------------------------------------------- Card */

.icre-card {
	background: var(--icre-surface, #fff);
	border: 1px solid var(--icre-line, #e3e6e4);
	border-radius: var(--icre-radius, 10px);
	overflow: hidden;
	transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.icre-has-shadow .icre-card {
	box-shadow: var(--icre-shadow, none);
}

.icre-card:hover {
	border-color: var(--icre-accent-line, #c9d6d4);
}

.icre-card-media {
	display: block;
	line-height: 0;
	background: var(--icre-surface-alt, #f7f8f7);
}

.icre-card-media img {
	width: 100%;
	height: 100%;
	max-height: 220px;
	object-fit: cover;
	display: block;
}

.icre-card-inner {
	display: flex;
	align-items: flex-start;
	gap: var(--icre-pad);
	padding: var(--icre-pad);
}

/* The date rail is the signature element: a fixed-width column of tabular
   numerals separated from the content by a hairline. */
.icre-rail {
	flex: 0 0 var(--icre-rail);
	width: var(--icre-rail);
	padding-right: var(--icre-pad);
	border-right: 1px solid var(--icre-line, #e3e6e4);
	text-align: center;
	font-variant-numeric: tabular-nums;
	align-self: stretch;
}

.icre-rail-month {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--icre-accent, #155e5a);
}

.icre-rail-day {
	display: block;
	font-size: 2.15em;
	font-weight: 650;
	line-height: 1.05;
	letter-spacing: -.02em;
	margin-top: 2px;
}

.icre-rail-dow {
	display: block;
	font-size: 12px;
	color: var(--icre-muted, #6b7280);
	margin-top: 2px;
}

.icre-card-body {
	min-width: 0;
	flex: 1 1 auto;
}

.icre-eyebrow {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--icre-accent, #155e5a);
	background: var(--icre-accent-soft, #eef4f3);
	border-radius: calc(var(--icre-radius, 10px) / 2);
	padding: 3px 8px;
	margin-bottom: 8px;
}

.icre-card-title {
	margin: 0 0 6px;
	font-size: 1.2em;
	line-height: 1.25;
	letter-spacing: -.01em;
}

.icre-card-title a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(var(--icre-accent-line, #c9d6d4), var(--icre-accent-line, #c9d6d4));
	background-size: 0 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size .25s ease;
}

.icre-card-title a:hover,
.icre-card-title a:focus-visible {
	background-size: 100% 1px;
}

.icre-meta {
	list-style: none;
	margin: 0 0 10px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: .9em;
	color: var(--icre-muted, #6b7280);
}

.icre-meta li {
	margin: 0;
	position: relative;
}

.icre-meta li + li::before {
	content: "";
	position: absolute;
	left: -8px;
	top: 50%;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	background: currentColor;
	opacity: .5;
	transform: translateY(-50%);
}

.icre-meta-when {
	color: var(--icre-ink, #14161a);
	font-weight: 500;
}

.icre-excerpt {
	margin: 0 0 14px;
	font-size: .95em;
	color: var(--icre-muted, #6b7280);
}

.icre-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.icre-btn {
	display: inline-block;
	background: var(--icre-accent, #155e5a);
	color: var(--icre-accent-ink, #fff);
	border: 1px solid var(--icre-accent, #155e5a);
	border-radius: calc(var(--icre-radius, 10px) - 2px);
	padding: 9px 18px;
	font-size: .92em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: filter .15s ease;
}

.icre-btn:hover,
.icre-btn:focus-visible {
	filter: brightness(1.12);
	color: var(--icre-accent-ink, #fff);
}

.icre-link {
	color: var(--icre-accent, #155e5a);
	font-size: .92em;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid transparent;
}

.icre-link:hover,
.icre-link:focus-visible {
	border-bottom-color: currentColor;
}

.icre :focus-visible {
	outline: 2px solid var(--icre-accent, #155e5a);
	outline-offset: 2px;
	border-radius: 3px;
}

.icre-empty {
	margin: 0;
	padding: 28px var(--icre-pad);
	text-align: center;
	color: var(--icre-muted, #6b7280);
	background: var(--icre-surface-alt, #f7f8f7);
	border: 1px dashed var(--icre-line, #e3e6e4);
	border-radius: var(--icre-radius, 10px);
}

/* Grid cards stack the rail above the body so narrow columns stay readable. */
.icre-card-grid .icre-card-inner {
	flex-direction: column;
	gap: 14px;
}

.icre-card-grid .icre-rail {
	width: auto;
	flex: 0 0 auto;
	padding: 0 0 12px;
	border-right: 0;
	border-bottom: 1px solid var(--icre-line, #e3e6e4);
	text-align: left;
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.icre-card-grid .icre-rail-day {
	font-size: 26px;
	margin: 0;
}

.icre-card-grid .icre-rail-dow {
	margin: 0;
}

/* -------------------------------------------------- Calendar */

.icre-cal {
	border: 1px solid var(--icre-line, #e3e6e4);
	border-radius: var(--icre-radius, 10px);
	background: var(--icre-surface, #fff);
	overflow: hidden;
}

.icre-has-shadow .icre-cal {
	box-shadow: var(--icre-shadow, none);
}

.icre-cal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--icre-surface-alt, #f7f8f7);
	border-bottom: 1px solid var(--icre-line, #e3e6e4);
}

.icre-cal-title {
	margin: 0;
	font-size: 1.05em;
	font-weight: 650;
	letter-spacing: .01em;
	text-align: center;
	flex: 1 1 auto;
}

.icre-cal-nav {
	appearance: none;
	background: var(--icre-surface, #fff);
	border: 1px solid var(--icre-line, #e3e6e4);
	border-radius: calc(var(--icre-radius, 10px) - 3px);
	color: var(--icre-ink, #14161a);
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	padding: 8px 12px;
	transition: border-color .15s ease, background .15s ease;
}

.icre-cal-nav:hover {
	border-color: var(--icre-accent, #155e5a);
	color: var(--icre-accent, #155e5a);
}

.icre-cal-grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 0;
}

.icre-cal-grid th {
	padding: 10px 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--icre-muted, #6b7280);
	border-bottom: 1px solid var(--icre-line, #e3e6e4);
	text-align: center;
}

.icre-cal-grid th abbr {
	text-decoration: none;
	border: 0;
}

.icre-day {
	vertical-align: top;
	height: 92px;
	padding: 6px;
	border-right: 1px solid var(--icre-line, #e3e6e4);
	border-bottom: 1px solid var(--icre-line, #e3e6e4);
}

.icre-density-compact .icre-day {
	height: 68px;
}

.icre-cal-grid tr td:last-child {
	border-right: 0;
}

.icre-cal-grid tr:last-child td {
	border-bottom: 0;
}

.icre-day-empty {
	background: var(--icre-surface-alt, #f7f8f7);
}

.icre-daynum {
	display: inline-block;
	min-width: 24px;
	font-size: .82em;
	font-variant-numeric: tabular-nums;
	color: var(--icre-muted, #6b7280);
	text-align: center;
	line-height: 24px;
	border-radius: 999px;
}

.icre-is-today .icre-daynum {
	background: var(--icre-accent, #155e5a);
	color: var(--icre-accent-ink, #fff);
	font-weight: 700;
}

.icre-day-chips {
	list-style: none;
	margin: 2px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.icre-chip {
	appearance: none;
	display: block;
	width: 100%;
	text-align: left;
	background: var(--icre-accent-soft, #eef4f3);
	border: 0;
	border-left: 2px solid var(--icre-accent, #155e5a);
	border-radius: 3px;
	color: var(--icre-ink, #14161a);
	cursor: pointer;
	font: inherit;
	font-size: 11.5px;
	line-height: 1.3;
	padding: 3px 5px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	transition: background .15s ease;
}

.icre-chip:hover,
.icre-chip[aria-expanded="true"] {
	background: var(--icre-accent-line, #c9d6d4);
}

.icre-chip-time {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	margin-right: 4px;
	color: var(--icre-accent, #155e5a);
}

.icre-chip-more {
	background: transparent;
	border-left-color: transparent;
	color: var(--icre-muted, #6b7280);
	font-weight: 600;
}

.icre-cal-panel:not(:empty) {
	border-top: 1px solid var(--icre-line, #e3e6e4);
	background: var(--icre-surface-alt, #f7f8f7);
}

.icre-day-detail {
	padding: var(--icre-pad);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.icre-day-heading {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--icre-muted, #6b7280);
}

.icre-empty-month {
	border: 0;
	background: transparent;
}

.icre-cal-loading {
	opacity: .45;
	pointer-events: none;
	transition: opacity .15s ease;
}

/* Small screens: the calendar becomes a scrollable strip rather than a
   cramped grid, and chips collapse to dots. */
@media (max-width: 600px) {
	.icre-day {
		height: 64px;
		padding: 4px 2px;
	}

	.icre-chip {
		font-size: 0;
		line-height: 0;
		padding: 0;
		height: 5px;
		border-left: 0;
		border-radius: 999px;
		background: var(--icre-accent, #155e5a);
	}

	.icre-chip-more {
		display: none;
	}

	.icre-card-inner {
		flex-direction: column;
	}

	.icre-rail {
		width: auto;
		flex: 0 0 auto;
		padding: 0 0 12px;
		border-right: 0;
		border-bottom: 1px solid var(--icre-line, #e3e6e4);
		text-align: left;
		display: flex;
		align-items: baseline;
		gap: 8px;
	}

	.icre-rail-day {
		font-size: 26px;
	}
}

/* Addresses that link out to a map */

.icre-meta-where a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dotted var(--icre-accent-line, #c9d6d4);
}

.icre-meta-where a:hover,
.icre-meta-where a:focus-visible {
	color: var(--icre-accent, #155e5a);
	border-bottom-color: currentColor;
}

.icre-map {
	display: inline-block;
	margin-top: 4px;
	font-size: .88em;
}

/* -------------------------------------------------- Sharing */

.icre-share {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--icre-line, #e3e6e4);
}

.icre-share-embed .icre-share {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.icre-share-heading {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--icre-muted, #6b7280);
}

.icre-share-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.icre-share-list li {
	margin: 0;
}

.icre-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	appearance: none;
	background: var(--icre-surface, #fff);
	border: 1px solid var(--icre-line, #e3e6e4);
	border-radius: 999px;
	color: var(--icre-muted, #6b7280);
	cursor: pointer;
	font: inherit;
	font-size: .82em;
	font-weight: 600;
	line-height: 1;
	padding: 7px 12px;
	text-decoration: none;
	transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.icre-share-btn:hover,
.icre-share-btn:focus-visible {
	color: var(--icre-accent, #155e5a);
	border-color: var(--icre-accent-line, #c9d6d4);
	background: var(--icre-accent-soft, #eef4f3);
}

.icre-share-icon {
	flex: 0 0 auto;
}

.icre-share-status {
	font-size: .82em;
	color: var(--icre-accent, #155e5a);
	font-weight: 600;
}

/* Narrow screens: icons only, names read out to assistive tech. */
@media (max-width: 480px) {
	.icre-share-name {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(1px, 1px, 1px, 1px);
		white-space: nowrap;
	}

	.icre-share-btn {
		padding: 9px;
	}
}

/* -------------------------------------------------- Single event */

.icre-single {
	margin: 0 0 28px;
}

.icre-facts {
	border: 1px solid var(--icre-line, #e3e6e4);
	border-left: 3px solid var(--icre-accent, #155e5a);
	border-radius: var(--icre-radius, 10px);
	background: var(--icre-surface, #fff);
	padding: var(--icre-pad);
}

.icre-facts dl {
	margin: 0 0 16px;
	display: grid;
	gap: 14px;
}

@media (min-width: 700px) {
	.icre-facts dl {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.icre-fact dt {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--icre-muted, #6b7280);
	margin-bottom: 3px;
}

.icre-fact dd {
	margin: 0;
	font-size: 1em;
}

.icre-fact dd span {
	display: block;
}

.icre-address {
	color: var(--icre-muted, #6b7280);
	font-size: .92em;
}

.icre-repeat {
	display: block;
	font-size: .85em;
	color: var(--icre-muted, #6b7280);
}

@media (prefers-reduced-motion: reduce) {
	.icre *,
	.icre *::before,
	.icre *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}
