/* ==========================================================================
   Stone Hill: restyle of the CCBPress events calendar ([ccbpress_event_calendar])
   CSS only. Scoped to #content .ccbpress-event-calendar so nothing else changes.
   Overrides the plugin's calendar.css and its Customizer color settings.
   ========================================================================== */

#content .ccbpress-event-calendar {
	--shc-blue: #41748d; --shc-blue-dark: #335970; --shc-soft: rgba(65,116,141,.07);
	--shc-line: #d8e3e8; --shc-green: #597f4e; --shc-green-soft: #eef3ec; --shc-ink: #3d3d3d; --shc-text: #515151;
	font-family: "proxima-nova", "Helvetica Neue", Arial, sans-serif;
	color: var(--shc-text);
	margin: 10px 0 40px;
}

/* ---- Header: month title with round arrow buttons ---------------------- */
#content .ccbpress-event-calendar-header {
	display: flex; align-items: center; justify-content: center; gap: 18px;
	border: 0 !important; background: transparent !important; padding: 0 0 22px; border-radius: 0;
}
#content .ccbpress-event-calendar-prev-month,
#content .ccbpress-event-calendar-next-month { float: none; margin: 0; order: 0; }
#content .ccbpress-event-calendar-month {
	order: 1; min-width: 290px; text-align: center;
	font-family: "jaf-lapture-display", Georgia, serif; font-weight: 600; font-size: 34px; line-height: 1.2;
	color: var(--shc-ink) !important;
}
#content .ccbpress-event-calendar-next-month { order: 2; }
#content .ccbpress-event-calendar-prev-month a,
#content .ccbpress-event-calendar-next-month a {
	float: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
	border: 1px solid var(--shc-line); border-radius: 50%; background: #fff !important;
	color: var(--shc-blue) !important; transition: background .2s, border-color .2s;
}
#content .ccbpress-event-calendar-prev-month a:hover,
#content .ccbpress-event-calendar-next-month a:hover { background: var(--shc-soft) !important; border-color: var(--shc-blue); }
#content .ccbpress-event-calendar-header .dashicons { font-size: 20px; width: 20px; height: 20px; line-height: 20px; color: var(--shc-blue); }

/* ---- Grid ---------------------------------------------------------------- */
#content .ccbpress-event-calendar-table {
	border: 0 !important; border-top: 2px solid var(--shc-blue) !important; border-collapse: collapse;
	background: #fff;
}
#content .ccbpress-event-calendar-table th {
	padding: 12px 10px !important; background: transparent !important; border: 0 !important;
	border-bottom: 1px solid var(--shc-line) !important; text-align: left !important;
	font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--shc-blue) !important;
}
#content .ccbpress-event-calendar-table td {
	border: 1px solid var(--shc-line) !important; background: #fff !important;
}
/* Sized for exactly 5 one-line events: the plugin shows up to 5, or 4 plus "+N more" in the 5th line. */
#content .ccbpress-event-calendar-days td { height: 156px; max-height: 156px; }
#content .ccbpress-event-calendar-table td .ccbpress-event-calendar-cell-container { height: 156px; padding: 8px 6px 0; }
#content .ccbpress-event-calendar-table td.ccbpress-event-calendar-blank { background: #fafbfb !important; }

/* Date numbers (top-left, serif); today gets a filled circle */
#content .ccbpress-event-calendar-date {
	display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; margin: 0 0 4px;
	text-align: center; font-family: "jaf-lapture-display", Georgia, serif; font-weight: 600; font-size: 18px; line-height: 1;
	color: var(--shc-ink) !important; background: transparent !important; border-radius: 50%;
}
#content .ccbpress-event-calendar-today .ccbpress-event-calendar-date { background: var(--shc-blue) !important; color: #fff !important; }
#content td.ccbpress-event-calendar-today { background: rgba(65,116,141,.035) !important; }

/* Events: one line each (full name on hover), left accent bar, bold time */
#content .ccbpress-event-calendar-days td ul li { white-space: nowrap; overflow: hidden; margin: 0 0 2px; line-height: 16px; height: 20px; }
#content .ccbpress-event-calendar-days td ul li a {
	display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
	padding: 2px 5px 2px 6px; border-left: 3px solid var(--shc-blue); border-radius: 0 3px 3px 0;
	font-size: 12.5px; line-height: 16px; color: var(--shc-text) !important; background: transparent !important;
	text-decoration: none !important;
}
#content .ccbpress-event-calendar-days td ul li a:hover { background: var(--shc-soft) !important; text-decoration: none !important; }
#content .ccbpress-event-calendar-table .ccbpress-event-time { font-size: 12.5px; font-weight: 700; color: var(--shc-ink); margin-right: 3px; }
#content .ccbpress-event-calendar-days td ul li a.ccbpress-event-calendar-all-day-event {
	border-left-color: var(--shc-green); background: var(--shc-green-soft) !important; color: var(--shc-ink) !important; font-weight: 600;
}

/* "+N more" and the expanded day */
#content .ccbpress-event-calendar-more-link { padding: 0 9px; height: 26px; line-height: 22px; background: #fff; }
#content td.ccbpress-event-calendar-today .ccbpress-event-calendar-more-link { background: #f9fbfc; }
#content .ccbpress-event-calendar-more-link a {
	font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--shc-blue) !important;
}
#content .ccbpress-event-calendar-day-show-more .ccbpress-event-calendar-cell-container {
	width: 260px; max-height: 420px; background: #fff !important; border: 1px solid var(--shc-line) !important;
	border-radius: 6px; box-shadow: 0 12px 34px rgba(0,0,0,.18); padding: 10px 12px 12px !important;
}
/* The close X sits on the date's row, so the card starts with the date (no empty band on top). */
#content .ccbpress-event-calendar-day-show-more .ccbpress-event-calendar-close { top: 12px; left: auto; right: 10px; width: 26px; height: 26px; line-height: 26px; }
#content .ccbpress-event-calendar-close a { color: var(--shc-blue) !important; }
#content .ccbpress-event-calendar-days td.ccbpress-event-calendar-day-show-more ul li { height: auto; white-space: normal; margin-bottom: 4px; }
#content .ccbpress-event-calendar-days td.ccbpress-event-calendar-day-show-more ul li a { white-space: normal; text-overflow: clip; }

/* Footer row (empty) */
#content .ccbpress-event-calendar-footer { border: 0 !important; background: transparent !important; padding: 0; }

/* ---- Phones (the plugin adds .ccbpress-mobile on small screens) --------- */
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-header { gap: 10px; padding-bottom: 14px; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-month { min-width: 0; font-size: 24px; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-prev-month a,
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-next-month a { width: 36px; height: 36px; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-table th { text-align: center !important; padding: 8px 0 !important; letter-spacing: .04em; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-table td { border: 0 !important; background: transparent !important; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-days td { height: auto; max-height: none; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-table td .ccbpress-event-calendar-cell-container { height: auto; padding: 6px 0 18px; text-align: center; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-date { width: 34px; height: 34px; font-size: 16px; margin: 0 auto; }
/* Small dot under days that have events (the plugin marks empty days). It sits below the date's
   circle, clear of the today/selected rings (the selected-today ring reaches 4px outside the circle). */
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-date:after {
	content: ""; position: absolute; left: 50%; bottom: -14px; width: 5px; height: 5px; margin: 0 0 0 -2.5px;
	border-radius: 50%; background-color: var(--shc-blue) !important;
}
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-empty-day .ccbpress-event-calendar-date:after { display: none; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-mobile-events {
	border: 0 !important; border-top: 1px solid var(--shc-line) !important; margin-top: 8px; background: #fff;
}
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-mobile-events ul li { white-space: normal; margin: 0 0 8px; }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-mobile-events ul li a {
	display: block; white-space: normal; padding: 8px 10px; border-left: 3px solid var(--shc-blue);
	font-size: 15px; line-height: 1.35; color: var(--shc-ink) !important; text-decoration: none !important;
}
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-mobile-events .ccbpress-event-time { display: block; font-size: 13px; color: var(--shc-blue); }
#content .ccbpress-event-calendar.ccbpress-mobile .ccbpress-event-calendar-close-mobile {
	float: right; margin: 6px; color: var(--shc-blue) !important; border: 0 !important;
}

/* ---- Ministry filters ----------------------------------------------------- */
#content .ccbpress-event-calendar .shc-cal-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
#content .ccbpress-event-calendar .shc-cal-filter {
	display: inline-flex; align-items: center; margin: 0; padding: 6px 15px; border: 1px solid var(--shc-line); border-radius: 999px;
	background: #fff; color: var(--shc-text); font: inherit; font-size: 14px; line-height: 1.4; letter-spacing: 0; text-transform: none;
	cursor: pointer; box-shadow: none; transition: background .15s, border-color .15s, color .15s;
}
#content .ccbpress-event-calendar .shc-cal-filter:hover { border-color: var(--shc-blue); background: var(--shc-soft); }
#content .ccbpress-event-calendar .shc-cal-filter[aria-pressed="true"] { background: var(--shc-blue); border-color: var(--shc-blue); color: #fff; }
#content .ccbpress-event-calendar .shc-cal-filter:focus-visible { outline: 2px solid var(--shc-blue); outline-offset: 2px; }
#content .ccbpress-event-calendar .shc-cal-filter-status { flex-basis: 100%; font-size: 13px; color: #7f7474; min-height: 1em; }

/* While a ministry is selected: hide other events, show every match (no "+N more" cap) */
#content .ccbpress-event-calendar.shc-filtering .shc-hidden { display: none !important; }
#content .ccbpress-event-calendar.shc-filtering .ccbpress-event-calendar-more-link,
#content .ccbpress-event-calendar.shc-filtering .ccbpress-event-calendar-close { display: none !important; }
#content .ccbpress-event-calendar.shc-filtering .ccbpress-event-calendar-days td { height: auto; max-height: none; }
#content .ccbpress-event-calendar.shc-filtering .ccbpress-event-calendar-table td .ccbpress-event-calendar-cell-container { height: auto; min-height: 120px; padding-bottom: 8px; }
#content .ccbpress-event-calendar.shc-filtering td.shc-no-match .ccbpress-event-calendar-date { color: #78868c !important; }
#content .ccbpress-event-calendar.shc-filtering.ccbpress-mobile .ccbpress-event-calendar-table td .ccbpress-event-calendar-cell-container { min-height: 0; }
#content .ccbpress-event-calendar.shc-filtering.ccbpress-mobile td.shc-no-match .ccbpress-event-calendar-date:after { display: none; }

/* ---- Phones: tapped day highlighted, its date shown above its events ---- */
#content .ccbpress-event-calendar.ccbpress-mobile td.ccbpress-event-calendar-selected-day .ccbpress-event-calendar-date {
	background: var(--shc-green-soft) !important; box-shadow: inset 0 0 0 2px var(--shc-blue);
}
#content .ccbpress-event-calendar.ccbpress-mobile td.ccbpress-event-calendar-today.ccbpress-event-calendar-selected-day .ccbpress-event-calendar-date {
	background: var(--shc-blue) !important; color: #fff !important; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--shc-blue);
}
#content .ccbpress-event-calendar .shc-panel-date {
	margin: 4px 0 10px; font-family: "jaf-lapture-display", Georgia, serif; font-size: 22px; font-weight: 600; color: var(--shc-ink);
}
#content .ccbpress-event-calendar .shc-panel-empty { padding: 6px 0 10px; font-size: 15px; color: #7f7474; }
#content .ccbpress-event-calendar.shc-filtering td.ccbpress-event-calendar-today.shc-no-match .ccbpress-event-calendar-date { color: #fff !important; opacity: .75; }

/* ---- Changing months without a reload: dim the old month while the next one loads ---- */
#content .ccbpress-event-calendar.shc-loading .ccbpress-event-calendar-table,
#content .ccbpress-event-calendar.shc-loading .ccbpress-event-calendar-month { opacity: .45; transition: opacity .15s; }
#content .ccbpress-event-calendar.shc-loading { cursor: progress; }

/* ---- Hover card for an event (appended to <body>, so not scoped under #content) ---- */
.shc-pop {
	position: absolute; z-index: 100002; width: 290px; box-sizing: border-box; padding: 14px 16px 12px;
	background: #fff; border: 1px solid #d8e3e8; border-top: 3px solid #41748d; border-radius: 6px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, .18); pointer-events: none;
	font-family: "proxima-nova", "Helvetica Neue", Arial, sans-serif; font-size: 13.5px; line-height: 1.4; color: #515151; text-align: left;
	opacity: 0; transform: translateY(4px); transition: opacity .12s ease-out, transform .12s ease-out;
}
.shc-pop[hidden] { display: none; }
.shc-pop.shc-pop-in { opacity: 1; transform: none; }
.shc-pop-title { margin: 0 0 4px; font-family: "jaf-lapture-display", Georgia, serif; font-size: 18px; font-weight: 600; line-height: 1.25; color: #3d3d3d; }
.shc-pop-when { margin: 0 0 8px; font-weight: 700; color: #41748d; }
.shc-pop-loc, .shc-pop-org { position: relative; margin: 0 0 3px; padding-left: 18px; }
.shc-pop-loc:before, .shc-pop-org:before {
	position: absolute; left: 0; top: 1px; font-family: dashicons; font-size: 14px; line-height: 1; color: #41748d;
}
.shc-pop-loc:before { content: "\f230"; }
.shc-pop-org:before { content: "\f110"; }
.shc-pop-desc {
	margin: 8px 0 0; padding-top: 8px; border-top: 1px solid #e6edf0;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
.shc-pop-more { margin: 8px 0 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #41748d; }
@media (prefers-reduced-motion: reduce) { .shc-pop { transition: none; transform: none; } }

/* ---- Days that have passed (marked by calendar.js) ---- */
#content .ccbpress-event-calendar td.shc-past .ccbpress-event-calendar-cell-container { opacity: .7; transition: opacity .15s; }
#content .ccbpress-event-calendar td.shc-past:hover .ccbpress-event-calendar-cell-container,
#content .ccbpress-event-calendar td.shc-past:focus-within .ccbpress-event-calendar-cell-container,
#content .ccbpress-event-calendar td.shc-past.ccbpress-event-calendar-day-show-more .ccbpress-event-calendar-cell-container { opacity: 1; }
#content .ccbpress-event-calendar.ccbpress-mobile td.shc-past .ccbpress-event-calendar-cell-container { opacity: 1; }
#content .ccbpress-event-calendar.ccbpress-mobile td.shc-past .ccbpress-event-calendar-date { opacity: .45; }
#content .ccbpress-event-calendar.ccbpress-mobile td.shc-past.ccbpress-event-calendar-selected-day .ccbpress-event-calendar-date { opacity: 1; }

/* ---- Event page: Add to calendar ---- */
#content .shc-add-cal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 18px 0 8px; }
#content .shc-add-cal-label { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7f7474; margin-right: 2px; }
#content .shc-add-cal-link {
	display: inline-block; padding: 7px 14px; border: 1px solid #41748d; border-radius: 999px;
	font-size: 14px; font-weight: 600; line-height: 1.2; color: #41748d !important; text-decoration: none !important; background: #fff;
}
#content .shc-add-cal-link:hover, #content .shc-add-cal-link:focus-visible { background: #41748d; color: #fff !important; }

/* Screen-reader-only announcement of the month after changing months */
#shc-cal-live { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
