/* Deckard Simple Event Calendar */
.deckcal-calendar,
.deckcal-upcoming,
.deckcal-details {
	--deckcal-accent: #2563eb;
	--deckcal-border: rgba(127, 127, 127, 0.28);
	--deckcal-muted: rgba(127, 127, 127, 0.95);
	--deckcal-soft: rgba(127, 127, 127, 0.07);
	--deckcal-radius: 10px;
	line-height: 1.45;
}
.deckcal-calendar *,
.deckcal-upcoming *,
.deckcal-details * { box-sizing: border-box; }

.deckcal-calendar { container-type: inline-size; font-size: 15px; margin: 0 0 2rem; }
.deckcal-calendar.is-loading .deckcal-body,
.deckcal-calendar.is-loading .deckcal-agenda { opacity: 0.45; transition: opacity 0.15s; }
.deckcal-loading { color: var(--deckcal-muted); }

/* Header */
.deckcal-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 1rem; }
.deckcal-title { margin: 0 auto 0 0 !important; font-size: 1.5em !important; line-height: 1.2; font-weight: 700; min-width: 9ch; }
.deckcal-nav { display: flex; align-items: center; gap: 0.4rem; }
.deckcal-btn {
	appearance: none; display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--deckcal-border); background: transparent; color: inherit;
	border-radius: 8px; padding: 0.45em 0.85em; font: inherit; font-size: 0.9em; line-height: 1.2;
	cursor: pointer; text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0;
}
.deckcal-btn:hover { border-color: var(--deckcal-accent); color: var(--deckcal-accent); background: transparent; }
.deckcal-icon-btn { width: 2.25em; height: 2.25em; padding: 0; font-size: 1.1em; }
.deckcal-toggle { display: inline-flex; border: 1px solid var(--deckcal-border); border-radius: 8px; overflow: hidden; }
.deckcal-toggle .deckcal-btn { border: 0; border-radius: 0; }
.deckcal-toggle .deckcal-btn[aria-pressed="true"] { background: var(--deckcal-accent); color: #fff; }
.deckcal-calendar button:focus-visible,
.deckcal-calendar a:focus-visible,
.deckcal-upcoming a:focus-visible { outline: 2px solid var(--deckcal-accent); outline-offset: 2px; }
.deckcal-status:empty { display: none; }
.deckcal-status { padding: 0.6rem 0.9rem; border-radius: 8px; background: #fef2f2; color: #991b1b; }

/* Month grid */
.deckcal-grid {
	display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
	border: 1px solid var(--deckcal-border); border-radius: var(--deckcal-radius); overflow: hidden;
}
.deckcal-weekday {
	padding: 0.55em 0.25em; text-align: center; font-size: 0.72em; font-weight: 700;
	text-transform: uppercase; letter-spacing: 0.05em; color: var(--deckcal-muted);
	border-bottom: 1px solid var(--deckcal-border); background: var(--deckcal-soft);
}
.deckcal-day {
	min-width: 0; min-height: 7.25em; padding: 0.35em; display: flex; flex-direction: column; gap: 0.2em;
	border-right: 1px solid var(--deckcal-border); border-bottom: 1px solid var(--deckcal-border); cursor: pointer;
}
.deckcal-day:nth-child(7n) { border-right: 0; }
.deckcal-day.is-last-row { border-bottom: 0; }
.deckcal-day.is-other { background: var(--deckcal-soft); }
.deckcal-day.is-other .deckcal-day-num { opacity: 0.5; }
.deckcal-day.is-selected { box-shadow: inset 0 0 0 2px var(--deckcal-accent); }
.deckcal-day-num {
	appearance: none; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center;
	width: 1.9em; height: 1.9em; padding: 0; border: 0; border-radius: 50%; background: transparent;
	color: inherit; font: inherit; font-size: 0.85em; font-weight: 600; cursor: pointer; min-height: 0; box-shadow: none;
}
.deckcal-day-num:hover { background: var(--deckcal-soft); color: inherit; }
.deckcal-day.is-today .deckcal-day-num { background: var(--deckcal-accent); color: #fff; }
.deckcal-chip {
	appearance: none; display: block; width: 100%; min-height: 0; text-align: left; cursor: pointer;
	border: 0; border-left: 3px solid var(--deckcal-ev, var(--deckcal-accent)); border-radius: 4px;
	background: rgba(127, 127, 127, 0.1);
	background: color-mix(in srgb, var(--deckcal-ev, var(--deckcal-accent)) 14%, transparent);
	color: inherit; padding: 0.18em 0.4em; font: inherit; font-size: 0.76em; line-height: 1.35;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: none; text-transform: none; letter-spacing: normal;
}
.deckcal-chip:hover { background: color-mix(in srgb, var(--deckcal-ev, var(--deckcal-accent)) 26%, transparent); color: inherit; }
.deckcal-chip-time { font-weight: 700; margin-right: 0.3em; }
.deckcal-more {
	appearance: none; align-self: flex-start; border: 0; background: none; padding: 0.1em 0.3em; min-height: 0;
	color: var(--deckcal-accent); font: inherit; font-size: 0.74em; font-weight: 600; cursor: pointer; box-shadow: none;
}
.deckcal-dots { display: none; }

/* Medium containers: drop the time so the event title has room */
@container (max-width: 880px) {
	.deckcal-chip-time { display: none; }
}

/* Small containers (phones, narrow columns): dots instead of chips */
@container (max-width: 620px) {
	.deckcal-day { min-height: 3.4em; align-items: center; padding: 0.3em 0.1em; }
	.deckcal-day-num { align-self: center; }
	.deckcal-chip, .deckcal-more { display: none; }
	.deckcal-dots { display: flex; gap: 3px; justify-content: center; }
	.deckcal-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--deckcal-ev, var(--deckcal-accent)); }
	.deckcal-weekday { font-size: 0.62em; padding: 0.5em 0; letter-spacing: 0; }
	.deckcal-title { font-size: 1.25em !important; width: 100%; }
}

/* Agenda + lists */
.deckcal-agenda { margin-top: 1.25rem; }
.deckcal-agenda-title { margin: 0 0 0.25rem !important; font-size: 1.05em !important; }
.deckcal-empty { color: var(--deckcal-muted); margin: 0.75rem 0; }
.deckcal-list { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.deckcal-event-row {
	display: flex; gap: 0.9rem; align-items: flex-start; margin: 0 !important; padding: 0.85rem 0;
	border-bottom: 1px solid var(--deckcal-border); list-style: none !important;
}
.deckcal-event-row:last-child { border-bottom: 0; }
.deckcal-row-stripe { flex: 0 0 4px; align-self: stretch; border-radius: 4px; background: var(--deckcal-ev, var(--deckcal-accent)); }
.deckcal-date-badge {
	flex: 0 0 3.4em; display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: 0.35em 0; border-radius: 8px; line-height: 1.1;
	background: rgba(127, 127, 127, 0.1);
	background: color-mix(in srgb, var(--deckcal-ev, var(--deckcal-accent)) 13%, transparent);
	color: var(--deckcal-ev, var(--deckcal-accent));
}
.deckcal-badge-mon { font-size: 0.7em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.deckcal-badge-day { font-size: 1.35em; font-weight: 800; }
.deckcal-row-img { flex: 0 0 5.5em; }
.deckcal-row-img img { display: block; width: 5.5em; height: 4em; object-fit: cover; border-radius: 8px; }
.deckcal-row-info { min-width: 0; flex: 1; }
.deckcal-row-title {
	appearance: none; display: inline; padding: 0; margin: 0; border: 0; background: none; min-height: 0; box-shadow: none;
	color: inherit; font: inherit; font-weight: 700; font-size: 1.02em; text-align: left; cursor: pointer;
	text-decoration: none; text-transform: none; letter-spacing: normal;
}
.deckcal-row-title:hover { color: var(--deckcal-accent); background: none; text-decoration: underline; }
.deckcal-row-meta { margin: 0.15em 0 0 !important; font-size: 0.88em; color: var(--deckcal-muted); }

/* Pop-up */
.deckcal-modal {
	width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0;
	border-radius: 14px; background: #fff; color: #1f2328; overflow: auto;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.deckcal-modal::backdrop { background: rgba(15, 23, 42, 0.55); }
.deckcal-close {
	appearance: none; position: absolute; top: 0.6rem; right: 0.6rem; z-index: 1; width: 2.1rem; height: 2.1rem; min-height: 0;
	display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, 0.92); color: #1f2328; font-size: 1.4rem; line-height: 1; cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.deckcal-modal-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.deckcal-modal-body { padding: 1.4rem 1.5rem 1.5rem; border-top: 4px solid var(--deckcal-ev, var(--deckcal-accent)); }
.deckcal-modal-title { margin: 0 2rem 0.35rem 0 !important; font-size: 1.35em !important; line-height: 1.25; color: inherit; }
.deckcal-modal-when { margin: 0 0 0.75rem !important; font-weight: 600; color: var(--deckcal-ev, var(--deckcal-accent)); }
.deckcal-modal-where, .deckcal-modal-cost, .deckcal-modal-excerpt { margin: 0 0 0.75rem !important; }
.deckcal-map-link { color: var(--deckcal-accent); font-size: 0.9em; }
.deckcal-online-badge {
	display: inline-block; font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
	padding: 0.2em 0.6em; border-radius: 99px; background: #fee2e2; color: #b91c1c;
}
.deckcal-online-badge::before { content: "● "; }
.deckcal-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.6rem; }
.deckcal-tag {
	font-size: 0.72em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.2em 0.6em; border-radius: 99px;
	background: color-mix(in srgb, var(--deckcal-ev, var(--deckcal-accent)) 14%, transparent); color: var(--deckcal-ev, var(--deckcal-accent));
}

/* Buttons (pop-up + single event page) */
.deckcal-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.deckcal-button,
.deckcal-button:visited {
	display: inline-block; padding: 0.6em 1.05em; border-radius: 8px; border: 1px solid var(--deckcal-accent);
	background: var(--deckcal-accent); color: #fff !important; font-size: 0.9em; font-weight: 600; line-height: 1.2; text-decoration: none !important;
}
.deckcal-button:hover { filter: brightness(1.08); }
.deckcal-button.is-ghost { background: transparent; color: var(--deckcal-accent) !important; }
.deckcal-button.is-ghost:hover { background: color-mix(in srgb, var(--deckcal-accent) 10%, transparent); filter: none; }

/* Built-in /events/ page */
.deckcal-archive { max-width: 1140px; margin: 0 auto; padding: 2.5rem 20px 3rem; }
.deckcal-archive-title { margin: 0 0 1.5rem; }

/* Single event page layout */
.deckcal-single { box-sizing: border-box; max-width: 1140px; margin: 0 auto; padding: 20px; }
.deckcal-single-title { margin: 0 0 20px; }
.deckcal-single-image { margin: 0 0 20px; }
.deckcal-single-image img { display: block; width: 100%; height: auto; border-radius: 10px; }
.deckcal-single-content > :last-child { margin-bottom: 0; }

/* Single event details box */
.deckcal-details {
	display: grid; gap: 0.7rem; margin: 0 0 2rem; padding: 1.25rem 1.4rem;
	border: 1px solid var(--deckcal-border); border-left: 4px solid var(--deckcal-accent); border-radius: var(--deckcal-radius);
}
.deckcal-detail { display: grid; grid-template-columns: 6.5em 1fr; gap: 1rem; }
.deckcal-detail-label { font-size: 0.78em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--deckcal-muted); padding-top: 0.2em; }
.deckcal-detail a { color: var(--deckcal-accent); }
.deckcal-repeat { font-size: 0.88em; color: var(--deckcal-muted); white-space: nowrap; }
.deckcal-details .deckcal-actions { margin-top: 0.3rem; }
@media (max-width: 480px) {
	.deckcal-detail { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ------------------------------------------------------------------------
   Theme-proofing: many themes (e.g. Hello Elementor) give every <button>
   and link their own colors on hover and focus. These rules are scoped and
   specific enough to win, so the calendar always uses its accent color.
   ------------------------------------------------------------------------ */
:is(.deckcal-calendar, .deckcal-upcoming, .deckcal-details) :is(button, a):is(:hover, :focus, :active) {
	text-decoration: none;
	box-shadow: none;
}

/* Header buttons: prev / next / today, and the Month | List toggle */
.deckcal-calendar .deckcal-btn,
.deckcal-calendar .deckcal-btn:is(:hover, :focus, :active) {
	background: transparent;
	color: inherit;
	border-color: var(--deckcal-border);
}
.deckcal-calendar .deckcal-btn:is(:hover, :focus-visible) {
	border-color: var(--deckcal-accent);
	color: var(--deckcal-accent);
}
.deckcal-calendar .deckcal-toggle .deckcal-btn,
.deckcal-calendar .deckcal-toggle .deckcal-btn:is(:hover, :focus, :active) { border: 0; }
.deckcal-calendar .deckcal-toggle .deckcal-btn[aria-pressed="true"],
.deckcal-calendar .deckcal-toggle .deckcal-btn[aria-pressed="true"]:is(:hover, :focus, :active) {
	background: var(--deckcal-accent);
	color: #fff;
}

/* Day numbers */
.deckcal-calendar .deckcal-day-num,
.deckcal-calendar .deckcal-day-num:is(:focus, :active) {
	background: transparent;
	color: inherit;
	border: 0;
}
.deckcal-calendar .deckcal-day-num:hover { background: var(--deckcal-soft); color: inherit; }
.deckcal-calendar .deckcal-day.is-today .deckcal-day-num,
.deckcal-calendar .deckcal-day.is-today .deckcal-day-num:is(:hover, :focus, :active) {
	background: var(--deckcal-accent);
	color: #fff;
}

/* Event chips in the month grid */
.deckcal-calendar .deckcal-chip,
.deckcal-calendar .deckcal-chip:is(:focus, :active) {
	background: rgba(127, 127, 127, 0.1);
	background: color-mix(in srgb, var(--deckcal-ev, var(--deckcal-accent)) 14%, transparent);
	color: inherit;
	border-top: 0;
	border-right: 0;
	border-bottom: 0;
}
.deckcal-calendar .deckcal-chip:hover {
	background: color-mix(in srgb, var(--deckcal-ev, var(--deckcal-accent)) 26%, transparent);
	color: inherit;
}

/* "+2 more" */
.deckcal-calendar .deckcal-more,
.deckcal-calendar .deckcal-more:is(:hover, :focus, :active) {
	background: none;
	border: 0;
	color: var(--deckcal-accent);
}
.deckcal-calendar .deckcal-more:hover { text-decoration: underline; }

/* Event titles in the agenda and List view */
.deckcal-calendar .deckcal-row-title,
.deckcal-calendar .deckcal-row-title:is(:focus, :active),
.deckcal-upcoming .deckcal-row-title,
.deckcal-upcoming .deckcal-row-title:is(:focus, :active) {
	background: none;
	border: 0;
	color: inherit;
}
:is(.deckcal-calendar, .deckcal-upcoming) .deckcal-row-title:hover {
	background: none;
	color: var(--deckcal-accent);
	text-decoration: underline;
}

/* Pop-up close button: white circle, accent on hover/focus */
.deckcal-calendar .deckcal-close,
.deckcal-calendar .deckcal-close:active {
	background: rgba(255, 255, 255, 0.92);
	color: #1f2328;
	border: 0;
}
.deckcal-calendar .deckcal-close:is(:hover, :focus-visible) {
	background: var(--deckcal-accent);
	color: #fff;
}
.deckcal-calendar .deckcal-close:focus:not(:focus-visible):not(:hover) {
	background: rgba(255, 255, 255, 0.92);
	color: #1f2328;
}

/* Text links (directions, online links, list titles on the event page) */
:is(.deckcal-calendar, .deckcal-upcoming, .deckcal-details) a:not(.deckcal-button):not(.deckcal-row-title),
:is(.deckcal-calendar, .deckcal-upcoming, .deckcal-details) a:not(.deckcal-button):not(.deckcal-row-title):is(:visited, :focus, :active) {
	color: var(--deckcal-accent);
}
:is(.deckcal-calendar, .deckcal-upcoming, .deckcal-details) a:not(.deckcal-button):not(.deckcal-row-title):hover {
	color: var(--deckcal-accent);
	text-decoration: underline;
}

/* Linked buttons (Register, Watch online, View event details, add to calendar) */
:is(.deckcal-calendar, .deckcal-details) a.deckcal-button,
:is(.deckcal-calendar, .deckcal-details) a.deckcal-button:is(:visited, :hover, :focus, :active) {
	background: var(--deckcal-accent);
	border-color: var(--deckcal-accent);
	color: #fff !important;
	text-decoration: none;
}
:is(.deckcal-calendar, .deckcal-details) a.deckcal-button.is-ghost,
:is(.deckcal-calendar, .deckcal-details) a.deckcal-button.is-ghost:is(:visited, :focus, :active) {
	background: transparent;
	color: var(--deckcal-accent) !important;
}
:is(.deckcal-calendar, .deckcal-details) a.deckcal-button.is-ghost:hover {
	background: color-mix(in srgb, var(--deckcal-accent) 10%, transparent);
}

/* Theme-proofing, part 2: keep each button's own size, shape and type
   (themes often set padding, borders, radius and font size on every button). */
.deckcal-calendar :is(.deckcal-btn, .deckcal-day-num, .deckcal-chip, .deckcal-more, .deckcal-row-title, .deckcal-close) {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	transition: none;
	min-height: 0;
	user-select: auto;
}
.deckcal-calendar .deckcal-btn { padding: 0.45em 0.85em; font-size: 0.9em; line-height: 1.2; border-radius: 8px; border-width: 1px; border-style: solid; font-weight: 400; white-space: nowrap; }
.deckcal-calendar .deckcal-icon-btn { width: 2.25em; height: 2.25em; padding: 0; font-size: 1.1em; }
.deckcal-calendar .deckcal-toggle .deckcal-btn { border-radius: 0; }
.deckcal-calendar .deckcal-day-num { width: 1.9em; height: 1.9em; padding: 0; border-radius: 50%; font-size: 0.85em; font-weight: 600; line-height: 1; }
.deckcal-calendar .deckcal-chip { display: block; width: 100%; padding: 0.18em 0.4em; border-radius: 4px; border-left: 3px solid var(--deckcal-ev, var(--deckcal-accent)); font-size: 0.76em; font-weight: 400; line-height: 1.35; text-align: left; white-space: nowrap; }
.deckcal-calendar .deckcal-more { padding: 0.1em 0.3em; border-radius: 0; font-size: 0.74em; font-weight: 600; line-height: 1.3; }
.deckcal-calendar .deckcal-row-title { display: inline; padding: 0; border-radius: 0; font-size: 1.02em; font-weight: 700; line-height: inherit; text-align: left; white-space: normal; }
.deckcal-calendar .deckcal-close { width: 2.1rem; height: 2.1rem; padding: 0; border-radius: 50%; font-size: 1.4rem; font-weight: 400; line-height: 1; }
@container (max-width: 620px) {
	.deckcal-calendar :is(.deckcal-chip, .deckcal-more) { display: none; }
}
