/**
 * Charitable Events - front-end single event page.
 *
 * @package charitable-events
 */

.charitable-event-single { max-width: 760px; margin: 2em auto; padding: 0 1em; }
.charitable-event-single .charitable-event-image { margin: 0 0 1.25em; }
.charitable-event-single .charitable-event-image img { max-width: 100%; height: auto; border-radius: 6px; }

.charitable-event-meta { list-style: none; margin: 0 0 1.25em; padding: 0; }
.charitable-event-meta li { margin: 0 0 0.35em; }

.charitable-event-description { margin: 0 0 1.75em; }

.charitable-event-venue-name { font-weight: 600; }
.charitable-event-venue-address { display: block; margin-top: 0.15em; color: #555; }
.charitable-event-location { margin: 0 0 1.75em; }
.charitable-event-leaflet {
	width: 100%;
	height: 300px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	margin: 0 0 0.75em;
	z-index: 0;
}
.charitable-event-map-links { display: flex; flex-wrap: wrap; gap: 0.5em; margin: 0.75em 0 0; }

.charitable-event-tickets { margin: 0 0 1.75em; }
.charitable-event-ticket-list { list-style: none; margin: 0; padding: 0; }
.charitable-event-ticket {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	padding: 0.9em 1em;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	margin: 0 0 0.6em;
	background: #fff;
}
.charitable-event-ticket-title { font-weight: 600; flex: 1 1 40%; }
.charitable-event-ticket-price { font-weight: 600; }
.charitable-event-ticket-fmv { color: #666; font-size: 0.85em; flex: 1 1 100%; }
.charitable-event-ticket-qty-label { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.03em; color: #666; }
/* input[type=number] + the type attribute out-specifies a theme's blanket
   `input[type="number"]{width:100%}`, which otherwise stretched Qty full-width. */
input.charitable-event-ticket-qty[type="number"] {
	width: 4.5em;
	min-width: 0;
	max-width: 4.5em;
	padding: 8px 6px;
	font-size: 0.85em;
	text-align: center;
	box-sizing: border-box;
}
.charitable-event-ticket-total { font-size: 1.15em; font-weight: 700; margin: 0.75em 0 0; text-align: right; padding-right: 1em; }

/* Shared widget + campaign-builder block chrome. */
.charitable-event-details { margin: 0 0 1.5em; }
.charitable-events-ticket-widget { margin: 0 0 1.5em; }
.charitable-events-ticket-widget .charitable-event-donation-form { margin-top: 1em; }
.charitable-event-form-placeholder,
.charitable-events-block-placeholder {
	margin: 0.5em 0;
	padding: 0.9em 1em;
	border: 1px dashed #c9c9c9;
	border-radius: 6px;
	background: #fafafa;
	color: #666;
	font-size: 0.9em;
}
.charitable-events-block-placeholder p { margin: 0; }

/* -------------------------------------------------------------------------
 * Front-end enhancements: stock badges, countdown, calendar + share actions.
 * All scoped under .charitable-event-single and using neutral, translucent
 * colors so they read on both light and dark themes.
 * ------------------------------------------------------------------------- */

/* Ticket stock / sold-out badges. */
.charitable-events-ticket-widget .charitable-event-ticket-stock {
	display: inline-block;
	padding: 0.15em 0.65em;
	font-size: 0.78em;
	font-weight: 600;
	line-height: 1.6;
	border-radius: 999px;
	border: 1px solid rgba( 127, 127, 127, 0.4 );
	background: rgba( 127, 127, 127, 0.12 );
	white-space: nowrap;
}
.charitable-events-ticket-widget .charitable-event-ticket-stock--low {
	color: #8a5300;
	border-color: rgba( 214, 158, 46, 0.6 );
	background: rgba( 237, 180, 60, 0.18 );
}
.charitable-events-ticket-widget .charitable-event-ticket-stock--out {
	color: #a12622;
	border-color: rgba( 200, 55, 50, 0.6 );
	background: rgba( 214, 69, 65, 0.16 );
}
.charitable-events-ticket-widget .charitable-event-ticket--soldout {
	opacity: 0.7;
}
.charitable-events-ticket-widget .charitable-event-ticket--soldout .charitable-event-ticket-qty {
	cursor: not-allowed;
}

/* Countdown to start. */
.charitable-event-single .charitable-event-countdown {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
	margin: 0 0 1.5em;
}
.charitable-event-single .charitable-event-countdown-unit {
	flex: 1 1 auto;
	min-width: 64px;
	text-align: center;
	padding: 0.6em 0.4em;
	border: 1px solid rgba( 127, 127, 127, 0.3 );
	border-radius: 6px;
	background: rgba( 127, 127, 127, 0.08 );
}
.charitable-event-single .charitable-event-countdown-value {
	display: block;
	font-size: 1.6em;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}
.charitable-event-single .charitable-event-countdown-label {
	display: block;
	margin-top: 0.25em;
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.7;
}
.charitable-event-single .charitable-event-countdown--started {
	display: block;
}
.charitable-event-single .charitable-event-countdown-started {
	font-weight: 600;
}

/* Actions row: add-to-calendar + share. */
.charitable-event-single .charitable-event-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75em 2em;
	margin: 0 0 1.75em;
}
.charitable-event-single .charitable-event-calendar,
.charitable-event-single .charitable-event-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}
.charitable-event-single .charitable-event-actions-label {
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.55;
	margin-right: 0.15em;
}

/* Shared pill button (calendar + map). */
.charitable-event-single .charitable-event-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	margin: 0;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border-radius: 8px;
	border: 1px solid rgba( 127, 127, 127, 0.28 );
	background: rgba( 127, 127, 127, 0.06 );
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.charitable-event-single .charitable-event-btn:hover,
.charitable-event-single .charitable-event-btn:focus {
	background: rgba( 127, 127, 127, 0.14 );
	border-color: rgba( 127, 127, 127, 0.45 );
	color: inherit;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.08 );
}
.charitable-event-single .charitable-event-btn:active { transform: translateY( 1px ); }
.charitable-event-single .charitable-event-btn--primary {
	background: var( --ce-accent, #5AA152 );
	border-color: var( --ce-accent, #5AA152 );
	color: #fff;
}
.charitable-event-single .charitable-event-btn--primary:hover,
.charitable-event-single .charitable-event-btn--primary:focus {
	background: var( --ce-accent-hover, #4e8f47 );
	border-color: var( --ce-accent-hover, #4e8f47 );
	color: #fff;
}
.charitable-event-single .charitable-event-icon { width: 16px; height: 16px; flex: 0 0 auto; display: block; }

/* Circular share icon buttons. */
.charitable-event-single .charitable-event-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid rgba( 127, 127, 127, 0.3 );
	background: rgba( 127, 127, 127, 0.06 );
	color: inherit;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.charitable-event-single .charitable-event-share-btn .charitable-event-icon { width: 18px; height: 18px; }
.charitable-event-single .charitable-event-share-btn:hover,
.charitable-event-single .charitable-event-share-btn:focus {
	transform: translateY( -1px );
	color: #fff;
}
.charitable-event-single .charitable-event-share-x:hover,
.charitable-event-single .charitable-event-share-x:focus { background: #000; border-color: #000; }
.charitable-event-single .charitable-event-share-facebook:hover,
.charitable-event-single .charitable-event-share-facebook:focus { background: #1877F2; border-color: #1877F2; }
.charitable-event-single .charitable-event-share-linkedin:hover,
.charitable-event-single .charitable-event-share-linkedin:focus { background: #0A66C2; border-color: #0A66C2; }
.charitable-event-single .charitable-event-share-copy:hover,
.charitable-event-single .charitable-event-share-copy:focus { background: var( --ce-accent, #5AA152 ); border-color: var( --ce-accent, #5AA152 ); }

/* Share tiles: brand-colored icon buttons from the shared network catalog. */
.charitable-event-single .charitable-event-share-tile {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	line-height: 0;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.06s ease, opacity 0.15s ease;
}
.charitable-event-single .charitable-event-share-tile svg { width: 32px; height: 32px; display: block; }
.charitable-event-single .charitable-event-share-tile:hover,
.charitable-event-single .charitable-event-share-tile:focus { transform: translateY( -1px ); opacity: 0.9; }

/* Copy button icon toggle (link icon <-> check on success). */
.charitable-event-single .charitable-event-copy-default { display: inline-flex; }
.charitable-event-single .charitable-event-copy-done { display: none; }
.charitable-event-single .charitable-event-share-copy.is-copied { background: var( --ce-accent, #5AA152 ); color: #fff; }
.charitable-event-single .charitable-event-share-copy.is-copied .charitable-event-copy-default { display: none; }
.charitable-event-single .charitable-event-share-copy.is-copied .charitable-event-copy-done { display: inline-flex; }
.charitable-event-single .charitable-event-share-copy.is-copied .charitable-event-copy-done svg { width: 20px; height: 20px; }

@media ( prefers-color-scheme: dark ) {
	.charitable-events-ticket-widget .charitable-event-ticket-stock--low { color: #f0c869; }
	.charitable-events-ticket-widget .charitable-event-ticket-stock--out { color: #f2a19d; }
}

/* -------------------------------------------------------------------------
 * Selectable single-event layouts: Classic (default), Hero, Split.
 * All scoped under .charitable-event-single. Full-bleed is best-effort /
 * defensive (relies on the wrapper being a centered, max-width column and no
 * overflow-clipping ancestor). Colors stay translucent / neutral so they read
 * on light and dark themes; the hero banner supplies its own dark backdrop.
 * ------------------------------------------------------------------------- */

/* Give the grid children room to shrink so the donation form never overflows. */
.charitable-event-single .charitable-event-hero-body > *,
.charitable-event-single .charitable-event-split > *,
.charitable-event-single .charitable-events-ticket-widget {
	min-width: 0;
}

/* Hero banner: full-bleed cover image with a dark gradient for legible text. */
.charitable-event-single .charitable-event-hero {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc( 50% - 50vw );
	margin-bottom: 1.75em;
	min-height: 340px;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	background-color: #2b2f36; /* solid tinted fallback when there is no image */
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
.charitable-event-single .charitable-event-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient( to top, rgba( 0, 0, 0, 0.78 ), rgba( 0, 0, 0, 0.32 ) 60%, rgba( 0, 0, 0, 0.16 ) );
	pointer-events: none;
}
.charitable-event-single .charitable-event-hero-overlay {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	padding: 2.75em 1em 1.85em;
	color: #fff;
}
.charitable-event-single .charitable-event-hero-overlay .charitable-event-title {
	margin: 0 0 0.4em;
	color: #fff;
	font-size: 2.4em;
	line-height: 1.12;
	text-shadow: 0 1px 3px rgba( 0, 0, 0, 0.4 );
}
.charitable-event-single .charitable-event-hero-overlay .charitable-event-meta {
	margin: 0;
	color: rgba( 255, 255, 255, 0.94 );
}
.charitable-event-single .charitable-event-hero-overlay .charitable-event-venue-address {
	color: rgba( 255, 255, 255, 0.82 );
}

/* Hero body: details on the left, ticket widget on the right. */
.charitable-event-single .charitable-event-hero-body {
	display: grid;
	grid-template-columns: minmax( 0, 2fr ) minmax( 0, 1fr );
	gap: 2em;
}

/* Split: details on the left, a sticky ticket widget on the right. */
.charitable-event-single .charitable-event-split {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) 340px;
	gap: 2em;
}
.charitable-event-single .charitable-event-sticky {
	position: sticky;
	top: 32px;
}

/* Split lead image: constrained, not full-bleed. */
.charitable-event-single--split .charitable-event-image img {
	width: 100%;
	max-height: 360px;
	object-fit: cover;
}

/* Collapse the two-column layouts and drop sticky on small screens. */
@media ( max-width: 782px ) {
	.charitable-event-single .charitable-event-hero-body,
	.charitable-event-single .charitable-event-split {
		grid-template-columns: 1fr;
	}
	.charitable-event-single .charitable-event-sticky {
		position: static;
		top: auto;
	}
	.charitable-event-single .charitable-event-hero {
		min-height: 260px;
	}
	.charitable-event-single .charitable-event-hero-overlay .charitable-event-title {
		font-size: 1.9em;
	}
}

/* Per-attendee details (optional; JS reveals rows as quantities change). */
.charitable-event-attendees {
	margin: 1em 0;
	padding: 1em;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
}
.charitable-event-attendees[hidden],
.charitable-event-attendee-group[hidden],
.charitable-event-attendee-row[hidden] {
	display: none;
}
.charitable-event-attendees-title {
	margin: 0 0 0.25em;
	font-size: 1.05em;
}
.charitable-event-attendees-optional {
	font-weight: 400;
	color: #6b7280;
	font-size: 0.85em;
}
.charitable-event-attendees-hint {
	margin: 0 0 0.75em;
	color: #6b7280;
	font-size: 0.9em;
}
.charitable-event-attendees-error {
	margin: 0 0 0.75em;
	color: #b32d2e;
	font-size: 0.9em;
	font-weight: 600;
}
.charitable-event-attendees-error[hidden] { display: none; }
.charitable-event-attendee-group {
	margin-top: 0.75em;
}
.charitable-event-attendee-group-title {
	margin: 0 0 0.4em;
	font-size: 0.95em;
}
.charitable-event-attendee-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin-bottom: 0.6em;
}
.charitable-event-attendee-num {
	flex: 0 0 auto;
	color: #6b7280;
	font-size: 0.9em;
	min-width: 2em;
}
.charitable-event-attendee-row input,
.charitable-event-attendee-row select {
	flex: 1 1 8em;
	min-width: 0;
}
/* The custom-field <select> otherwise renders the browser's native arrow tight
   against the right edge. Swap in a custom chevron with real breathing room (the
   theme's border/radius/height are kept - appearance:none only drops the native
   arrow, not the border). */
.charitable-event-attendee-row select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 2.25em;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75em center;
	background-size: 12px;
}

/* Events list / discovery (shortcode + archive). */
.charitable-events-archive-header {
	margin-bottom: 1em;
}
.charitable-events-list-heading {
	margin: 0 0 0.75em;
}
.charitable-events-list-empty {
	color: #6b7280;
}
.charitable-events-list-grid {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 1.25em;
}
.charitable-events-list--cols-1 .charitable-events-list-grid {
	grid-template-columns: 1fr;
}
.charitable-events-list--cols-2 .charitable-events-list-grid {
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
}
.charitable-events-list--cols-4 .charitable-events-list-grid {
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
}
.charitable-events-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}
.charitable-events-card-link {
	text-decoration: none;
	color: inherit;
}
.charitable-events-card-image img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
}
.charitable-events-card-title {
	margin: 0.6em 0.8em 0.2em;
	font-size: 1.15em;
	line-height: 1.25;
}
.charitable-events-card .charitable-event-meta {
	margin: 0 0.8em;
	padding: 0;
	list-style: none;
	font-size: 0.9em;
	color: #4b5563;
}
.charitable-events-card-cta {
	margin: 0.75em 0.8em 0.9em;
	align-self: flex-start;
	font-weight: 600;
	text-decoration: none;
}
@media ( max-width: 782px ) {
	.charitable-events-list-grid,
	.charitable-events-list--cols-2 .charitable-events-list-grid,
	.charitable-events-list--cols-4 .charitable-events-list-grid {
		grid-template-columns: 1fr;
	}
}

/* Extra-donation upsell (ticket widget). */
.charitable-event-extra {
	margin: 0.75em 0;
	text-align: right;
	padding-right: 1em; /* line the field + label right edge up with the ticket row's qty box */
}
.charitable-event-extra-label {
	display: block;
	font-size: 0.9em;
	margin-bottom: 0.25em;
}
.charitable-event-extra-field {
	display: flex;
	align-items: center;
	gap: 0.35em;
	max-width: 12em;
	margin-left: auto; /* right-align the field within the extra block */
}
.charitable-event-extra-currency {
	color: #6b7280;
}
.charitable-event-extra-input {
	flex: 1 1 auto;
	min-width: 0;
}

/* Event status banner (cancelled / ended / campaign-paused) at the top of the page. */
.charitable-event-status-banner {
	border-radius: 6px;
	padding: 12px 16px;
	margin: 0 0 20px;
	font-weight: 600;
	border: 1px solid transparent;
}
.charitable-event-status-banner--cancelled { background: #fce8e8; color: #b32d2e; border-color: #f0c8c8; }
.charitable-event-status-banner--ended { background: #f0f0f1; color: #50575e; border-color: #dcdcde; }
.charitable-event-status-banner--paused { background: #fef4e1; color: #7a5c00; border-color: #f0d9a0; }

/* Closed-sales notice shown inside the ticket widget in place of the buy form. */
.charitable-events-ticket-widget--closed .charitable-event-status-notice {
	background: #f6f7f8;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	padding: 14px 16px;
	color: #50575e;
	margin: 0;
}
.charitable-events-ticket-widget--closed .charitable-event-status-notice--cancelled { color: #b32d2e; }

/* Event photo slideshow. clear:both drops it below floated layout columns
   (e.g. the Split layout) so it spans the full page width. */
.charitable-events-gallery { margin: 30px 0; clear: both; width: 100%; }
.charitable-events-gallery:focus { outline: none; }
.charitable-events-gallery__heading { margin: 0 0 12px; }
.charitable-events-gallery__viewport { position: relative; }
.charitable-events-gallery__track { list-style: none; margin: 0; padding: 0; }
.charitable-events-gallery__slide { display: none; margin: 0; }
.charitable-events-gallery__slide.is-active { display: block; }
.charitable-events-gallery__figure { margin: 0; }
.charitable-events-gallery__zoom {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}
.charitable-events-gallery__img {
	display: block;
	width: 100%;
	max-height: 520px;
	height: auto;
	border-radius: 8px;
	object-fit: cover;
}
.charitable-events-gallery__caption {
	margin: 8px 0 0;
	font-size: 0.9em;
	color: #6b7280;
	text-align: center;
}
.charitable-events-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba( 0, 0, 0, 0.5 );
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}
.charitable-events-gallery__nav:hover { background: rgba( 0, 0, 0, 0.75 ); }
.charitable-events-gallery__nav--prev { left: 10px; }
.charitable-events-gallery__nav--next { right: 10px; }
.charitable-events-gallery__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 12px 0 0;
}
.charitable-events-gallery__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: #cbd5e1;
	cursor: pointer;
}
.charitable-events-gallery__dot.is-active { background: #374151; }

/* Lightbox. */
body.charitable-events-lightbox-open { overflow: hidden; }
.charitable-events-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba( 0, 0, 0, 0.85 );
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px;
}
.charitable-events-lightbox img {
	max-width: 92vw;
	max-height: 88vh;
	border-radius: 6px;
}
.charitable-events-lightbox__close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: rgba( 255, 255, 255, 0.15 );
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}
.charitable-events-lightbox__close:hover { background: rgba( 255, 255, 255, 0.3 ); }
