/* Nantucket Events — calendar layout (Option B)
   Left: 2/3 scrollable event list. Right: 1/3 sticky mini calendar.
   Stacks to calendar-on-top on mobile.
   Colors and fonts inherit from the active theme. */

.ne-calendar {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 2rem;
	max-width: 1200px;
	margin: 0 auto;
	align-items: start;
}

.ne-calendar__list {
	min-width: 0;
}

.ne-calendar__day-heading {
	margin: 0 0 1rem;
	font-size: 1.5rem;
}

.ne-calendar__empty {
	opacity: 0.6;
	padding: 2rem 0;
}

.ne-calendar__cards {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ne-event-card {
	display: flex;
	gap: 0;
	border: 1px solid rgba(0,0,0,.10);
	border-radius: 8px;
	overflow: hidden;
	align-items: stretch;
}

/* The image link wrapper takes the flex slot; the inner div fills it */
.ne-event-card__image-link {
	flex: 0 0 33.333%;
	align-self: flex-start;
	display: block;
	text-decoration: none;
}

.ne-event-card__image {
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.ne-event-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ne-event-card__body {
	flex: 1;
	min-width: 0;
	padding: 1rem;
}

.ne-event-card__title {
	margin: 0 0 0.25rem;
	font-size: 1.1rem;
}

.ne-event-card__title a {
	text-decoration: none;
	color: inherit;
}

.ne-event-card__time,
.ne-event-card__location {
	margin: 0 0 0.25rem;
	opacity: 0.75;
	font-size: 0.9rem;
}

/* Location name + address stacked */
.ne-event-card__location-name {
	display: block;
	font-weight: 600;
}

.ne-event-card__location-address {
	display: block;
	font-size: 0.85rem;
	opacity: 0.8;
}

.ne-event-card__body {
	display: flex;
	flex-direction: column;
}

.ne-event-card__footer {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: auto;
	padding-top: 0.5rem;
}

.ne-event-card__terms {
	font-size: 0.85rem;
	margin-bottom: 0;
}

.ne-event-card__terms a {
	text-decoration: none;
	color: inherit;
}

.ne-event-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: flex-end;
}

.ne-badge {
	display: inline-block;
	font-size: 0.75rem;
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: rgba(0,0,0,.06);
	text-decoration: none;
}

.ne-badge--free {
	background: rgba(28,107,28,.10);
	color: #1c6b1c;
}

.ne-badge--soldout {
	background: rgba(161,28,28,.10);
	color: #a11c1c;
}

.ne-badge--limited {
	background: rgba(138,97,0,.12);
	color: #8a6100;
}

.ne-badge--register {
	background: var(--e-global-color-primary, #1b3a5a);
	color: #fff !important;
}

.ne-badge--register:hover {
	opacity: 0.88;
	color: #fff !important;
}

.ne-badge--tickets {
	background: rgba(28,107,60,.12);
	color: #1a6636;
}

.ne-badge--tickets:hover {
	background: rgba(28,107,60,.20);
	color: #1a6636;
}

/* Sidebar — sticky mini calendar */
:root {
	--ne-navbar-height: 80px; /* fallback while JS measures the real value */
}

.ne-calendar__sidebar {
	position: sticky;
	top: calc( var( --ne-navbar-height ) + 1rem );
	align-self: start;
}

.ne-mini-calendar {
	border: 1px solid rgba(0,0,0,.10);
	border-radius: 8px;
	padding: 1rem;
}

/* Month navigation header: ‹  Month Year  › */
.ne-mini-calendar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.6rem;
}

.ne-mini-calendar__heading {
	font-size: 0.95rem;
	font-weight: 700;
	text-align: center;
	flex: 1;
}

.ne-mini-calendar__nav {
	background: none;
	border: none;
	font-size: 1.3rem;
	line-height: 1;
	padding: 0.1rem 0.4rem;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.15s;
	flex: 0 0 auto;
	color: inherit;
}

.ne-mini-calendar__nav:hover {
	background: rgba(0,0,0,.06);
}

.ne-mini-calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
	text-align: center;
}

.ne-mini-calendar__day {
	padding: 0.4rem 0;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.85rem;
	position: relative;
}

.ne-mini-calendar__day:hover {
	background: rgba(0,0,0,.06);
}

.ne-mini-calendar__day--has-events::after {
	content: '';
	display: block;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--e-global-color-primary, #1b3a5a);
	margin: 2px auto 0;
}

.ne-mini-calendar__day--selected {
	background: var(--e-global-color-primary, #1b3a5a) !important;
	color: #fff !important;
}

/* Mobile: calendar on top, list below */
@media (max-width: 782px) {
	.ne-calendar {
		grid-template-columns: 1fr;
	}

	.ne-calendar__sidebar {
		position: static;
		order: -1;
	}
}

/* Update indicator */
.ne-update-badge {
	display: inline-block;
	background: rgba(138,97,0,.10);
	color: #8a6100;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	margin-bottom: 0.4rem;
	cursor: help;
}

/* Description excerpt */
.ne-event-card__excerpt {
	margin: 0.5rem 0 0;
	font-size: 0.88rem;
	opacity: 0.75;
	line-height: 1.5;
}

.ne-event-card__read-more {
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	color: inherit;
}

.ne-event-card__read-more:hover {
	text-decoration: underline;
}

/* Stack all sidebar panels with consistent spacing */
.ne-calendar__sidebar-inner {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* Sidebar filters */
.ne-calendar__filters {
	border: 1px solid rgba(0,0,0,.10);
	border-radius: 8px;
	padding: 0.1rem 1rem 0.75rem;
	background: rgba(27,58,90,.035);
}

/* Toggle button — sits at the top of the filters block */
.ne-filters-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.5rem 0;
	background: none;
	border: none;
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--e-global-color-primary, #1b3a5a);
	cursor: pointer;
	text-align: left;
	gap: 0.4rem;
}

.ne-filters-toggle:hover {
	opacity: 0.75;
}

.ne-filters-toggle__icon {
	font-size: 0.65rem;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.ne-filters-toggle.is-open .ne-filters-toggle__icon {
	transform: rotate(180deg);
}

/* Collapsible body */
.ne-filters-body {
	padding-top: 0.6rem;
}

.ne-calendar__filters input[type="search"] {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid rgba(0,0,0,.18);
	border-radius: 4px;
	box-sizing: border-box;
	margin-bottom: 0.6rem;
	font-family: inherit;
}

.ne-calendar__filters .ne-inline-check {
	display: block;
	font-size: 0.9rem;
	margin-bottom: 0.75rem;
}

/* Parent pills — 2-column grid */
.ne-category-parents {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.4rem;
	margin-bottom: 0.4rem;
}

/* Child pill group — slides open below the grid */
.ne-category-children {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	padding: 0.5rem 0 0.4rem 0.6rem;
	border-left: 3px solid var(--e-global-color-primary, #1b3a5a);
	margin-bottom: 0.5rem;
}

/* Force [hidden] to work even if the theme overrides it */
.ne-category-children[hidden] {
	display: none !important;
}

.ne-filter-pill--child {
	font-size: 0.75rem !important;
	padding: 0.15rem 0.5rem !important;
}

.ne-calendar .ne-filter-pill {
	background: transparent !important;
	border: 1px solid var(--e-global-color-primary, #1b3a5a) !important;
	border-radius: 999px;
	padding: 0.25rem 0.7rem;
	font-size: 0.8rem;
	color: var(--e-global-color-primary, #1b3a5a) !important;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	box-shadow: none !important;
	font-family: inherit;
}

.ne-calendar .ne-filter-pill:hover {
	background: rgba(0,0,0,.05) !important;
}

.ne-calendar .ne-filter-pill.is-active {
	background: var(--e-global-color-primary, #1b3a5a) !important;
	color: #fff !important;
	border-color: transparent !important;
}

.ne-calendar__filters .description {
	font-size: 0.75rem;
	opacity: 0.65;
}

/* =========================================================================
   [ne_register_button] shortcode
   ========================================================================= */

.ne-register-button-wrap {
	text-align: center;
}

.ne-register-button {
	display: inline-block;
	background: var(--e-global-color-primary, #1b3a5a);
	color: #fff !important;
	text-decoration: none;
	padding: 0.7rem 1.6rem;
	border-radius: 4px;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	transition: opacity 0.15s, box-shadow 0.15s;
	line-height: 1.4;
	font-family: inherit;
}

.ne-register-button:hover {
	opacity: 0.88;
	box-shadow: 0 2px 8px rgba(0,0,0,0.18);
	color: #fff !important;
}

/* =========================================================================
   Category-browse mode — ne-calendar--category
   Full-width single column (no sidebar), date group headings.
   ========================================================================= */

.ne-calendar--category {
	grid-template-columns: 1fr;
}

/* Cap the image column so cards don't grow too tall on the full-width layout */
.ne-calendar--category .ne-event-card__image-link {
	flex: 0 0 min( 33.333%, 220px );
}

.ne-calendar__back-link {
	margin: 0 0 1rem;
	font-size: 0.9rem;
}

.ne-calendar__back-link a {
	text-decoration: none;
	color: inherit;
}

.ne-calendar__back-link a:hover {
	text-decoration: underline;
}

.ne-calendar__date-group {
	margin-bottom: 2rem;
}

.ne-calendar__date-group-heading {
	font-size: 1rem;
	font-weight: 700;
	border-bottom: 2px solid var(--e-global-color-primary, #1b3a5a);
	color: var(--e-global-color-primary, #1b3a5a);
	padding-bottom: 0.3rem;
	margin: 0 0 0.75rem;
}

/* =========================================================================
   Next Occurrences shortcode [ne_next_occurrences]
   ========================================================================= */

.ne-next-occurrences {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ne-next-occurrence-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid rgba(0,0,0,.08);
	text-decoration: none;
	color: inherit;
	font-size: 0.9rem;
	transition: background 0.15s;
}

.ne-next-occurrence-row:first-child {
	border-top: 1px solid rgba(0,0,0,.08);
}

.ne-next-occurrence-row:hover {
	background: rgba(0,0,0,.04);
}

.ne-next-occurrence-date {
	font-weight: 500;
}

.ne-next-occurrence-time {
	opacity: 0.65;
	font-size: 0.85rem;
	white-space: nowrap;
	margin-left: 1rem;
}

/* =========================================================================
   Related Events shortcode [ne_related_events]
   ========================================================================= */

/* Carousel wrapper: arrow buttons flank the scrolling rail */
.ne-related-events-carousel {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Arrow nav buttons */
.ne-re-nav {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	border: 1px solid var(--e-global-color-primary, #1b3a5a);
	background: transparent;
	color: var(--e-global-color-primary, #1b3a5a);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	padding: 0;
}

.ne-re-nav:hover:not(:disabled) {
	background: var(--e-global-color-primary, #1b3a5a);
	color: #fff;
}

.ne-re-nav:disabled {
	opacity: 0.3;
	cursor: default;
}

.ne-related-events {
	flex: 1;
	min-width: 0;
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	gap: 1.25rem;
	/* Hide scrollbar — navigation handled by arrow buttons */
	scrollbar-width: none;
	padding-bottom: 0;
}

.ne-related-events::-webkit-scrollbar {
	display: none;
}

.ne-related-event-card {
	/* 3 cards visible: (100% - 2 gaps) / 3 */
	flex: 0 0 calc( 33.333% - 0.834rem );
	scroll-snap-align: start;
	border-radius: 6px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0,0,0,0.1);
	transition: box-shadow 0.2s, transform 0.2s;
}

/* On narrow screens show ~1.5 cards so the scroll is obvious */
@media ( max-width: 600px ) {
	.ne-related-event-card {
		flex: 0 0 calc( 75% - 0.834rem );
	}
}

.ne-related-event-card:hover {
	box-shadow: 0 4px 14px rgba(0,0,0,0.15);
	transform: translateY(-2px);
}

.ne-related-event-card__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Square image on top */
.ne-related-event-card__image {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: rgba(0,0,0,.06);
}

.ne-related-event-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Organizer logo fallback — fit the whole logo, don't crop */
.ne-related-event-card__image--logo {
	background: rgba(0,0,0,.03);
}

.ne-related-event-card__image--logo img {
	object-fit: contain;
	padding: 10%;
}

.ne-related-event-card__image-placeholder {
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,.08);
}

/* Title + date·time below the image */
.ne-related-event-card__body {
	padding: 0.65rem 0.8rem 0.8rem;
}

.ne-related-event-card__title {
	font-size: 0.9rem;
	font-weight: 700;
	margin: 0 0 0.3rem;
	line-height: 1.3;
}

.ne-related-event-card__meta {
	font-size: 0.78rem;
	opacity: 0.65;
	margin: 0;
}

/* =========================================================================
   Related Events filter bar (added when more than one relation type exists)
   ========================================================================= */

.ne-related-events-wrap {
	/* Wraps both the filter bar and the card grid */
}

.ne-related-events__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin-bottom: 1.5rem;
	border-bottom: 1px solid rgba(0,0,0,.12);
}

.ne-re-filter {
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px; /* sit on top of the container border-bottom */
	padding: 0.5rem 1.1rem;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	opacity: 0.55;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s, opacity 0.2s;
	line-height: 1.5;
	white-space: nowrap;
	font-family: inherit;
}

.ne-re-filter:hover {
	opacity: 1;
}

.ne-re-filter.is-active {
	opacity: 1;
	border-bottom-color: var(--e-global-color-primary, #1b3a5a);
	color: var(--e-global-color-primary, #1b3a5a);
}

/* ── Global search results panel ────────────────────────────────────── */

.ne-search-results {
	margin-bottom: 1rem;
}

.ne-search-results__heading {
	margin: 0 0 1rem;
	font-size: 1.25rem;
}

.ne-search-results__cards {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* Search result cards use the same ne-event-card styles; no extra rules needed */

/* =========================================================================
   Inline advertisement slot — filled by JS with a randomly chosen image
   ========================================================================= */

.ne-inline-ad-slot {
	border-radius: 8px;
	overflow: hidden;
	line-height: 0; /* collapse gap around img */
}

.ne-inline-ad-slot a {
	display: block;
	line-height: 0;
}

.ne-inline-ad-slot img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

/* =========================================================================
   Sidebar advertisement blocks (image-based, square or rectangle)
   ========================================================================= */

.ne-sidebar-ad {
	border: 1px solid rgba(0,0,0,.10);
	border-radius: 8px;
	overflow: hidden;
	line-height: 0; /* collapse gap around img */
}

.ne-sidebar-ad a {
	display: block;
	line-height: 0;
}

/* Ad images render at their natural proportions — upload at exactly
   300 × 300 px (square) or 300 × 100 px (rectangle). */
.ne-sidebar-ad__img {
	display: block;
	width: 100%;
	height: auto;
}

/* =========================================================================
   Recurring Annual Events sidebar panel
   ========================================================================= */

.ne-recurring-events {
	border: 1px solid rgba(0,0,0,.10);
	border-radius: 8px;
	padding: 0.75rem 1rem;
	background: rgba(27,58,90,.035);
}

/* Collapsible toggle button for the annual events panel */
.ne-recurring-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.25rem 0;
	background: none;
	border: none;
	font-family: inherit;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--e-global-color-primary, #1b3a5a);
	cursor: pointer;
	text-align: left;
	gap: 0.4rem;
}

.ne-recurring-toggle:hover {
	opacity: 0.75;
}

.ne-recurring-toggle.is-open .ne-filters-toggle__icon {
	transform: rotate(180deg);
}

.ne-recurring-body {
	padding-top: 0.4rem;
}

/* Legacy heading class — kept for backward compat but no longer rendered */
.ne-recurring-events__heading {
	font-size: 1.1rem;
	font-weight: 700;
	font-family: var(--e-global-typography-primary-font-family, inherit);
	color: var(--e-global-color-primary, #1b3a5a);
	margin: 0 0 0.6rem;
	line-height: 1.3;
}

.ne-recurring-events__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ne-recurring-events__item {
	display: flex;
	flex-direction: column;
	padding: 0.55rem 0;
	border-bottom: 1px solid rgba(0,0,0,.07);
}

.ne-recurring-events__item:last-child {
	border-bottom: none;
}

.ne-recurring-events__name {
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1.3;
}

.ne-recurring-events__month {
	font-size: 0.78rem;
	opacity: 0.65;
	font-style: italic;
	margin-top: 0.1rem;
}

.ne-recurring-events__desc {
	font-size: 0.78rem;
	opacity: 0.6;
	margin-top: 0.1rem;
	line-height: 1.4;
}

.ne-recurring-events__link {
	color: inherit;
	text-decoration: none;
}

.ne-recurring-events__link:hover {
	color: var(--e-global-color-primary, #1b3a5a);
	text-decoration: underline;
}

/* =========================================================================
   Single Event — description prose
   Many themes apply a global CSS reset that zeros out paragraph margins
   inside plugin-rendered containers. These rules restore readable spacing
   for the WYSIWYG description on single event pages.
   ========================================================================= */

.ne-single-event__description p {
	margin-top: 0;
	margin-bottom: 1em;
	line-height: 1.7;
}

.ne-single-event__description p:last-child {
	margin-bottom: 0;
}

.ne-single-event__description ul,
.ne-single-event__description ol {
	margin: 0 0 1em 1.5em;
	padding: 0;
	line-height: 1.7;
}

.ne-single-event__description li {
	margin-bottom: 0.3em;
}

.ne-single-event__description a {
	color: var(--e-global-color-primary, #1b3a5a);
	text-decoration: underline;
}

.ne-single-event__description a:hover {
	opacity: 0.75;
}

/* [ne_recurrence_label] shortcode */
.ne-recurrence-label {
	text-align: center;
}
