/*
 * HOA Web Events: front end (calendar, single event details, upcoming list).
 * Everything is scoped under .hwe; fonts come from the theme. Colours are CSS custom properties
 * on the .hwe wrapper, so a child theme can override them:
 *   .hwe { --hwe-accent: #1a8a3c; --hwe-allday: #dcefe2; }
 */

.hwe {
	--hwe-accent: #1a8a3c;
	--hwe-accent-ink: #167a35;
	--hwe-allday: #dcefe2;
	--hwe-ink: #1f2124;
	--hwe-muted: #5d6166;
	--hwe-line: #dcdee0;
	--hwe-soft: #f5f6f7;
	--hwe-past: #5d6166;
	--hwe-other: #6b7075;
	--hwe-today-bg: #f2f8f4;
	--hwe-radius: 4px;
	box-sizing: border-box;
	color: var(--hwe-ink);
	line-height: 1.45;
}
.hwe *,
.hwe *::before,
.hwe *::after {
	box-sizing: border-box;
}
.hwe .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	white-space: nowrap;
}
.hwe a {
	color: inherit;
}
.hwe :focus-visible {
	outline: 2px solid var(--hwe-accent);
	outline-offset: 2px;
}
.hwe .hwe-icon {
	width: 1em;
	height: 1em;
	fill: currentColor;
	vertical-align: -0.125em;
}
.hwe .hwe-icon-lock {
	width: 0.8em;
	height: 0.8em;
	margin-right: 4px;
	vertical-align: -0.05em;
}
.hwe .hwe-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	margin: 0;
	padding: 6px 16px;
	border: 1px solid var(--hwe-line);
	border-radius: var(--hwe-radius);
	background: #fff;
	color: var(--hwe-ink);
	font: inherit;
	font-size: 0.95em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
}
.hwe .hwe-btn:hover {
	background: var(--hwe-soft);
}
.hwe .hwe-btn-primary {
	border-color: var(--hwe-accent-ink);
	background: var(--hwe-accent-ink);
	color: #fff;
	font-weight: 600;
}
.hwe .hwe-btn-primary:hover {
	background: var(--hwe-accent-ink);
	filter: brightness(0.92);
}

/* ---- Toolbar ------------------------------------------------------------ */
.hwe-calendar {
	position: relative;
	margin: 0 0 32px;
}
.hwe-calendar.is-loading .hwe-body {
	opacity: 0.55;
	transition: opacity 0.15s;
}
.hwe-toolbar {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 0 16px;
	margin: 0 0 24px;
	padding: 8px;
	border: 1px solid var(--hwe-line);
	border-radius: var(--hwe-radius);
	background: #fff;
}
.hwe-search {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	gap: 8px;
	margin: 0;
}
.hwe-search-field {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	align-items: center;
}
.hwe-search-field .hwe-icon-search {
	position: absolute;
	left: 12px;
	color: var(--hwe-muted);
	pointer-events: none;
}
.hwe .hwe-search-input {
	width: 100%;
	min-height: 40px;
	margin: 0;
	padding: 6px 12px 6px 38px;
	border: 0;
	border-radius: var(--hwe-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	box-shadow: none;
}
.hwe .hwe-search-input:focus {
	outline: 2px solid var(--hwe-accent);
	outline-offset: 0;
}
.hwe .hwe-cat-select {
	min-height: 40px;
	max-width: 220px;
	margin: 0;
	padding: 4px 28px 4px 10px;
	border: 1px solid var(--hwe-line);
	border-radius: var(--hwe-radius);
	background-color: #fff;
	color: inherit;
	font: inherit;
}
.hwe-views {
	display: flex;
	align-items: center;
	gap: 4px;
	padding-left: 12px;
	border-left: 1px solid var(--hwe-line);
}
.hwe .hwe-view {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 10px;
	border-bottom: 3px solid transparent;
	color: var(--hwe-muted);
	font-weight: 600;
	text-decoration: none;
}
.hwe .hwe-view:hover {
	color: var(--hwe-ink);
}
.hwe .hwe-view.is-active {
	border-bottom-color: var(--hwe-accent);
	color: var(--hwe-ink);
}

/* ---- Month navigation ---------------------------------------------------- */
.hwe-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 0 0 18px;
}
.hwe .hwe-nav-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: var(--hwe-ink);
	text-decoration: none;
}
.hwe .hwe-nav-arrow:hover {
	background: var(--hwe-soft);
}
.hwe .hwe-nav-arrow svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}
.hwe-picker {
	position: relative;
}
.hwe-picker > summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	list-style: none;
	cursor: pointer;
}
.hwe-picker > summary::-webkit-details-marker {
	display: none;
}
.hwe .hwe-month-heading {
	margin: 0;
	padding: 0;
	font-size: 1.75em;
	font-weight: 700;
	line-height: 1.2;
}
.hwe .hwe-caret {
	width: 16px;
	height: 16px;
	fill: currentColor;
}
.hwe-popover {
	position: absolute;
	z-index: 50;
	top: calc(100% + 6px);
	left: 0;
	min-width: 240px;
	padding: 12px;
	border: 1px solid var(--hwe-line);
	border-radius: var(--hwe-radius);
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}
.hwe-picker-years {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 8px;
	font-weight: 700;
}
.hwe-picker-years a {
	padding: 2px 10px;
	font-size: 1.3em;
	text-decoration: none;
}
.hwe .hwe-picker-months {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.hwe .hwe-picker-months a {
	display: block;
	padding: 6px 4px;
	border-radius: var(--hwe-radius);
	text-align: center;
	text-decoration: none;
}
.hwe .hwe-picker-months a:hover {
	background: var(--hwe-soft);
}
.hwe .hwe-picker-months a.is-active {
	background: var(--hwe-accent-ink);
	color: #fff;
}

/* ---- Month grid ------------------------------------------------------------ */
.hwe .hwe-grid {
	width: 100%;
	margin: 0;
	border: 1px solid var(--hwe-line);
	border-collapse: collapse;
	table-layout: fixed;
}
.hwe .hwe-grid th {
	padding: 8px 4px;
	border: 0;
	border-bottom: 1px solid var(--hwe-line);
	background: transparent;
	color: var(--hwe-muted);
	font-size: 0.75em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-align: center;
	text-transform: uppercase;
}
.hwe .hwe-grid th abbr {
	border: 0;
	text-decoration: none;
}
.hwe .hwe-grid td {
	position: relative;
	height: 128px;
	padding: 6px 6px 8px;
	border: 1px solid var(--hwe-line);
	background: #fff;
	vertical-align: top;
}
.hwe .hwe-daynum {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 4px;
	font-size: 1.05em;
	font-weight: 700;
}
.hwe .hwe-day.is-other {
	background: #fbfbfb;
}
.hwe .hwe-day.is-other .hwe-daynum {
	color: var(--hwe-other);
	font-weight: 400;
}
.hwe .hwe-day.is-today {
	background: var(--hwe-today-bg);
}
.hwe .hwe-day.is-today .hwe-daynum time {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 4px;
	border-radius: 14px;
	background: var(--hwe-accent-ink);
	color: #fff;
}
.hwe .hwe-day-btn {
	display: none;
}
.hwe .hwe-events {
	margin: 0;
	padding: 0;
	list-style: none;
}
.hwe .hwe-events li {
	margin: 0 0 6px;
	padding: 0;
}
.hwe .hwe-ev {
	position: relative;
	display: block;
	font-size: 0.85em;
	line-height: 1.3;
	text-decoration: none;
	word-wrap: break-word;
}
.hwe .hwe-ev-timed {
	padding-left: 6px;
	border-left: 3px solid var(--hwe-ev-color, var(--hwe-accent));
}
.hwe .hwe-ev-time {
	display: block;
	color: var(--hwe-muted);
	font-size: 0.92em;
}
.hwe .hwe-ev-title {
	display: block;
	font-weight: 700;
}
.hwe .hwe-ev:hover .hwe-ev-title {
	text-decoration: underline;
}
.hwe .hwe-ev-allday {
	padding: 3px 8px;
	border-radius: 3px;
	background: var(--hwe-allday);
}
@supports (background: color-mix(in srgb, red 20%, white)) {
	.hwe .hwe-ev-allday[style*='--hwe-ev-color'] {
		background: color-mix(in srgb, var(--hwe-ev-color) 22%, white);
	}
}
.hwe-dim-past .hwe-ev.hwe-is-past .hwe-ev-title,
.hwe-dim-past .hwe-ev.hwe-is-past .hwe-ev-time {
	color: var(--hwe-past);
	font-weight: 400;
}
.hwe-dim-past .hwe-ev-allday.hwe-is-past {
	background: var(--hwe-soft);
}
.hwe-dim-past .hwe-ev-timed.hwe-is-past {
	border-left-color: var(--hwe-line);
}

/* Tooltip */
.hwe .hwe-tip {
	position: absolute;
	z-index: 60;
	bottom: calc(100% + 6px);
	left: 0;
	display: none;
	width: max-content;
	max-width: 260px;
	padding: 8px 10px;
	border-radius: var(--hwe-radius);
	background: #1f2124;
	color: #fff;
	font-size: 0.95em;
	font-weight: 400;
	line-height: 1.35;
	pointer-events: none;
}
.hwe .hwe-tip > span {
	display: block;
}
.hwe .hwe-tip-date {
	font-weight: 700;
}
.hwe .hwe-ev:hover .hwe-tip,
.hwe .hwe-ev:focus-visible .hwe-tip {
	display: block;
}

/* "+ n more" */
.hwe-more {
	position: relative;
	font-size: 0.85em;
}
.hwe-more > summary {
	display: inline-block;
	color: var(--hwe-ink);
	font-weight: 700;
	list-style: none;
	cursor: pointer;
	text-decoration: underline;
}
.hwe-more > summary::-webkit-details-marker {
	display: none;
}
.hwe-more-panel {
	min-width: 220px;
	font-size: 1.15em;
}
.hwe .hwe-more-date {
	margin: 0 0 8px;
	font-weight: 700;
}
.hwe .hwe-grid tr td:nth-child(n + 5) .hwe-more-panel,
.hwe .hwe-grid tr td:nth-child(n + 5) .hwe-tip {
	right: 0;
	left: auto;
}

.hwe-day-detail {
	margin: 12px 0 0;
	padding: 12px;
	border: 1px solid var(--hwe-line);
	border-radius: var(--hwe-radius);
}
.hwe-day-detail[hidden] {
	display: none;
}
.hwe .hwe-day-detail-date {
	margin: 0 0 8px;
	font-weight: 700;
}

/* ---- List view ----------------------------------------------------------- */
.hwe .hwe-list-month {
	margin: 24px 0 8px;
	padding: 0 0 6px;
	border-bottom: 1px solid var(--hwe-line);
	font-size: 1.1em;
}
.hwe .hwe-list-month:first-child {
	margin-top: 0;
}
.hwe .hwe-list-items {
	margin: 0;
	padding: 0;
	list-style: none;
}
.hwe .hwe-list-item {
	display: flex;
	gap: 18px;
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--hwe-soft);
}
.hwe .hwe-date-block {
	display: flex;
	flex: 0 0 56px;
	flex-direction: column;
	align-items: center;
	line-height: 1.1;
}
.hwe .hwe-date-mon {
	color: var(--hwe-muted);
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.hwe .hwe-date-day {
	font-size: 1.75em;
	font-weight: 700;
}
.hwe .hwe-list-main {
	flex: 1 1 auto;
	min-width: 0;
}
.hwe .hwe-list-time,
.hwe .hwe-list-venue {
	margin: 0 0 2px;
	color: var(--hwe-muted);
	font-size: 0.9em;
}
.hwe .hwe-list-title {
	margin: 0 0 4px;
	font-size: 1.15em;
	line-height: 1.3;
}
.hwe .hwe-list-title a {
	text-decoration: none;
}
.hwe .hwe-list-title a:hover {
	text-decoration: underline;
}
.hwe .hwe-list-excerpt {
	margin: 4px 0 0;
}
.hwe-dim-past .hwe-list-item.hwe-is-past .hwe-list-title {
	color: var(--hwe-past);
}
.hwe .hwe-search-summary {
	margin: 0 0 16px;
}
.hwe .hwe-search-summary a {
	font-weight: 600;
}
.hwe .hwe-empty {
	padding: 24px 0;
	color: var(--hwe-muted);
}
.hwe-pager {
	display: flex;
	justify-content: space-between;
	margin: 20px 0 0;
}
.hwe-pager a {
	font-weight: 600;
	text-decoration: none;
}
.hwe-pager .hwe-pager-next {
	margin-left: auto;
}

/* ---- Login prompt -------------------------------------------------------- */
.hwe-login-prompt {
	padding: 24px;
	border: 1px solid var(--hwe-line);
	border-radius: var(--hwe-radius);
	text-align: center;
}

/* ---- Small screens -------------------------------------------------------- */
@media (max-width: 767px) {
	.hwe-toolbar {
		flex-direction: column;
		gap: 8px;
	}
	.hwe-search {
		flex-wrap: wrap;
	}
	.hwe-search-field {
		flex-basis: 100%;
	}
	.hwe .hwe-find {
		flex: 1 1 auto;
	}
	.hwe-views {
		justify-content: center;
		padding: 6px 0 0;
		border-top: 1px solid var(--hwe-line);
		border-left: 0;
	}
	.hwe .hwe-month-heading {
		font-size: 1.35em;
	}
	.hwe .hwe-grid td {
		height: 56px;
		padding: 4px 2px;
		text-align: center;
	}
	.hwe .hwe-grid th {
		padding: 6px 0;
		font-size: 0.7em;
		letter-spacing: 0;
	}
	.hwe .hwe-daynum {
		flex-direction: column;
		gap: 2px;
		font-size: 0.95em;
	}
	/* With JavaScript, cells show a dot; tapping lists the day's events below the grid. */
	.hwe-js .hwe-grid .hwe-events,
	.hwe-js .hwe-grid .hwe-more {
		display: none;
	}
	.hwe-js .hwe-day-btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-height: 24px;
		margin: 0;
		padding: 0;
		border: 0;
		background: transparent;
		cursor: pointer;
	}
	.hwe-js .hwe-dot {
		display: block;
		width: 8px;
		height: 8px;
		border-radius: 50%;
		background: var(--hwe-accent);
	}
	.hwe-js .hwe-day.has-events {
		cursor: pointer;
	}
	.hwe-js .hwe-day.is-selected {
		box-shadow: inset 0 0 0 2px var(--hwe-accent);
	}
	.hwe .hwe-tip {
		display: none !important;
	}
	.hwe-day-detail .hwe-events li {
		margin-bottom: 10px;
	}
	.hwe-day-detail .hwe-ev {
		font-size: 1em;
	}
}

/* ---- Theme fit ------------------------------------------------------------ */
/* Some themes (OceanWP) underline every link in page content with a very specific selector.
   The calendar's own controls and event links are styled without underlines. */
.hwe a.hwe-ev,
.hwe a.hwe-view,
.hwe a.hwe-btn,
.hwe a.hwe-nav-arrow,
.hwe .hwe-picker-years a,
.hwe .hwe-picker-months a,
.hwe .hwe-list-title a,
.hwe .hwe-pager a,
.hwe .hwe-up-title a,
.hwe .hwe-single-cats a {
	text-decoration: none !important;
}
.hwe a.hwe-ev:hover .hwe-ev-title,
.hwe .hwe-list-title a:hover,
.hwe .hwe-up-title a:hover,
.hwe .hwe-pager a:hover {
	text-decoration: underline !important;
}

/* ---- Single event --------------------------------------------------------- */
.hwe-single {
	margin: 0 0 24px;
}
.hwe .hwe-back {
	margin: 0 0 12px;
	font-size: 0.95em;
}
.hwe .hwe-back a {
	font-weight: 600;
	text-decoration: none !important;
}
.hwe .hwe-single-when {
	margin: 0 0 12px;
	font-size: 1.15em;
	font-weight: 700;
}
.hwe .hwe-single-repeats {
	margin: 0 0 18px;
	padding: 10px 14px;
	border-left: 3px solid var(--hwe-accent);
	background: var(--hwe-soft);
}
.hwe .hwe-single-rule,
.hwe .hwe-single-next-label {
	margin: 0 0 4px;
	font-weight: 600;
}
.hwe .hwe-single-next {
	margin: 0;
	padding-left: 18px;
}
.hwe .hwe-single-image {
	margin: 0 0 18px;
}
.hwe .hwe-single-image img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--hwe-radius);
}
.hwe .hwe-single-description {
	margin: 0 0 24px;
}
.hwe .hwe-single-details {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 18px 28px;
	padding: 18px 0 0;
	border-top: 1px solid var(--hwe-line);
}
.hwe .hwe-single-detail h3 {
	margin: 0 0 6px;
	color: var(--hwe-muted);
	font-size: 0.8em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}
.hwe .hwe-single-detail p,
.hwe .hwe-single-detail address {
	margin: 0 0 6px;
	font-style: normal;
}
.hwe .hwe-venue-name {
	font-weight: 700;
}
.hwe .hwe-single-link {
	align-self: center;
}
.hwe .hwe-denied {
	padding: 18px;
	border: 1px solid var(--hwe-line);
}
/* Links in the event details must look like links whatever the theme does. */
.hwe-single a:not(.hwe-btn) {
	color: var(--hwe-accent-ink);
	text-decoration: underline !important;
	text-underline-offset: 2px;
}
.hwe-single .hwe-back a {
	color: inherit;
	text-decoration: none !important;
}
.hwe-single .hwe-back a:hover {
	text-decoration: underline !important;
}

/* ---- Upcoming events list ------------------------------------------------- */
.hwe .hwe-up-heading {
	margin: 0 0 16px;
}
.hwe .hwe-up-list {
	margin: 0;
	padding: 0;
	list-style: none;
}
.hwe .hwe-up-item {
	display: flex;
	align-items: flex-start;
	gap: 18px;
	margin: 0 0 18px;
	padding: 0;
}
.hwe .hwe-up-date {
	display: flex;
	flex: 0 0 48px;
	flex-direction: column;
	align-items: center;
	line-height: 1.05;
}
.hwe .hwe-up-mon {
	color: var(--hwe-muted);
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.hwe .hwe-up-day {
	font-size: 1.9em;
	font-weight: 700;
}
.hwe .hwe-up-main {
	min-width: 0;
	padding-top: 2px;
}
.hwe .hwe-up-time,
.hwe .hwe-up-venue {
	margin: 0;
	color: var(--hwe-muted);
	font-size: 0.85em;
}
.hwe .hwe-up-title {
	margin: 2px 0 0;
	font-weight: 700;
	line-height: 1.3;
}
.hwe .hwe-up-link {
	margin: 4px 0 0;
	font-style: italic;
	font-weight: 700;
}
.hwe .hwe-up-empty {
	color: var(--hwe-muted);
}
