/**
 * Nelson Calendar — core frontend styles.
 *
 * Token rules (Nelson-Dashboard-Asset-And-Style-Compliance.md):
 * every color consumes var(--nelson-*) with a neutral standalone
 * fallback, so surfaces inherit the Honey theme when Nelson Dashboard
 * scopes the body with .nelson-frontend, and stay WCAG-AA neutral
 * (grays/blues) when the plugin runs standalone. No hardcoded palette.
 */

/* ---------------------------------------------------------------- *
 * Base
 * ---------------------------------------------------------------- */

.nc-calendar {
	color: var(--nelson-text, #1f2937);
	font-size: 1rem;
	line-height: 1.5;
}

.nc-calendar a {
	color: var(--nelson-link, #1d4ed8);
}

.nc-calendar a:hover,
.nc-calendar a:focus {
	color: var(--nelson-link-hover, #1e3a8a);
}

.nc-calendar :focus-visible {
	outline: 2px solid var(--nelson-input-focus-border, #2563eb);
	outline-offset: 2px;
}

.nc-calendar .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal;
}

.nc-empty {
	color: var(--nelson-text-light, #4b5563);
	font-style: italic;
	padding: 1rem 0;
}

/* Buttons */
.nc-button {
	background: var(--nelson-bg-light, #f3f4f6);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 6px;
	color: var(--nelson-text, #1f2937);
	cursor: pointer;
	display: inline-block;
	font-size: 0.95rem;
	font-weight: 600;
	padding: 0.5rem 1rem;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nc-button:hover {
	background: var(--nelson-bg-white, #ffffff);
	border-color: var(--nelson-text-light, #4b5563);
}

.nc-button-primary {
	background: var(--nelson-primary, #2563eb);
	border-color: var(--nelson-primary, #2563eb);
	color: var(--nelson-button-text, #ffffff);
}

.nc-button-primary:hover {
	background: var(--nelson-primary-dark, #1e40af);
	border-color: var(--nelson-primary-dark, #1e40af);
	color: var(--nelson-button-text, #ffffff);
}

.nc-button-ghost {
	background: transparent;
	border-color: var(--nelson-border, #d1d5db);
}

/* Status badges */
.nc-badge {
	border-radius: 999px;
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 0.15rem 0.6rem;
	text-transform: uppercase;
	vertical-align: middle;
}

.nc-badge-cancelled {
	background: var(--nelson-error, #b91c1c);
	color: var(--nelson-bg-white, #ffffff);
}

.nc-badge-postponed {
	background: var(--nelson-warning, #b45309);
	color: var(--nelson-bg-white, #ffffff);
}

.nc-badge-moved_online {
	background: var(--nelson-info, #1e40af);
	color: var(--nelson-bg-white, #ffffff);
}

.nc-status-cancelled .nc-chip-title,
.nc-status-cancelled .nc-list-title,
.nc-status-cancelled .nc-summary-title {
	text-decoration: line-through;
}

/* Upgrade prompt */
.nc-upgrade-prompt {
	background: var(--nelson-bg-light, #f3f4f6);
	border: 1px dashed var(--nelson-border, #d1d5db);
	border-radius: 8px;
	margin: 0 0 1rem;
	padding: 1.25rem;
	text-align: center;
}

.nc-upgrade-prompt h3 {
	margin: 0 0 0.5rem;
}

.nc-upgrade-prompt p {
	color: var(--nelson-text-light, #4b5563);
	margin: 0 0 0.75rem;
}

/* ---------------------------------------------------------------- *
 * Month/week grid
 * ---------------------------------------------------------------- */

.nc-grid-toolbar {
	align-items: center;
	display: flex;
	gap: 0.75rem;
	justify-content: space-between;
	margin: 0 0 0.6rem;
}

.nc-grid-title {
	font-size: 1.5rem;
	margin: 0;
	text-align: center;
}

.nc-nav-link {
	border-radius: 6px;
	display: inline-flex;
	gap: 0.35rem;
	padding: 0.35rem 0.65rem;
	text-decoration: none;
	white-space: nowrap;
}

.nc-nav-link:hover,
.nc-nav-link.nc-current {
	background: var(--nelson-bg-light, #f3f4f6);
}

.nc-grid {
	border-collapse: collapse;
	table-layout: fixed;
	width: 100%;
}

.nc-grid-colhead {
	background: var(--nelson-table-header-bg, #f3f4f6);
	border: 1px solid var(--nelson-table-border, #d1d5db);
	color: var(--nelson-table-header-text, #1f2937);
	font-size: 0.85rem;
	padding: 0.4rem 0.25rem;
	text-align: center;
}

.nc-grid-colhead abbr {
	text-decoration: none;
}

.nc-grid-cell {
	border: 1px solid var(--nelson-table-border, #d1d5db);
	height: 6.5rem;
	padding: 0.3rem;
	position: relative;
	vertical-align: top;
}

.nc-grid-cell.nc-out-month {
	background: var(--nelson-bg-light, #f9fafb);
	color: var(--nelson-text-light, #6b7280);
}

.nc-grid-cell.nc-today {
	box-shadow: inset 0 0 0 2px var(--nelson-primary, #2563eb);
}

.nc-grid-cell:focus-visible {
	outline-offset: -2px;
}

.nc-day-num {
	display: block;
	font-size: 0.85rem;
	font-weight: 700;
	margin-bottom: 0.2rem;
}

/* Theme-proof list reset: some themes (e.g. Divi) add bullets, indent, and
 * text-indent to <ul>/<li>, which breaks the day-cell event stack and stops
 * multi-day bars from joining. Force the reset under our own root. */
.nc-calendar .nc-day-events {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.nc-calendar .nc-day-events > li {
	list-style: none !important;
	margin: 0 0 3px !important;
	padding: 0 !important;
	text-indent: 0 !important;
}

.nc-calendar .nc-day-events > li::marker {
	content: '' !important;
}

.nc-calendar .nc-day-events > li::before {
	display: none !important;
}

.nc-event-chip {
	background: var(--nelson-badge-bg, #e0e7ff);
	border-radius: 4px;
	color: var(--nelson-badge-text, #1e3a8a);
	display: block;
	font-size: 0.78rem;
	overflow: hidden;
	padding: 0.1rem 0.35rem;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nc-event-chip:hover,
.nc-event-chip:focus {
	background: var(--nelson-primary, #2563eb);
	color: var(--nelson-button-text, #ffffff);
}

.nc-chip-time {
	font-weight: 700;
	margin-right: 0.25rem;
}

.nc-chip-status {
	font-size: 0.7rem;
	text-transform: uppercase;
}

.nc-more-events {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.75rem;
	padding-left: 0.35rem;
}

/* Busy state while AJAX paging */
.nc-calendar[aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

/* ---------------------------------------------------------------- *
 * List / agenda
 * ---------------------------------------------------------------- */

.nc-list-date,
.nc-summary-date {
	border-bottom: 2px solid var(--nelson-border, #d1d5db);
	font-size: 1.05rem;
	margin: 1.25rem 0 0.5rem;
	padding-bottom: 0.25rem;
}

.nc-list-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nc-list-item {
	border-bottom: 1px solid var(--nelson-border, #e5e7eb);
	display: flex;
	gap: 1rem;
	padding: 0.75rem 0;
}

.nc-list-when {
	color: var(--nelson-text-light, #4b5563);
	flex: 0 0 10rem;
	font-size: 0.9rem;
}

.nc-list-item-date {
	display: block;
	font-weight: 700;
}

/* Featured-image thumbnail. Decorative: the title link beside it is the
   real target, so this is aria-hidden and out of the tab order. */
.nc-list-thumb {
	display: block;
	flex: 0 0 6rem;
	line-height: 0;
}

.nc-list-thumb img {
	aspect-ratio: 4 / 3;
	border-radius: 4px;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.nc-list-body {
	flex: 1;
	min-width: 0;
}

@media (max-width: 600px) {
	.nc-list-thumb {
		flex-basis: 4rem;
	}
}

.nc-list-title {
	font-size: 1.05rem;
	font-weight: 700;
	text-decoration: none;
}

.nc-list-location {
	color: var(--nelson-text-light, #4b5563);
	display: block;
	font-size: 0.9rem;
	margin-top: 0.15rem;
}

.nc-list-excerpt {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.92rem;
	margin: 0.35rem 0 0;
}

/* ---------------------------------------------------------------- *
 * Summary view
 * ---------------------------------------------------------------- */

.nc-summary-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nc-summary-item {
	align-items: baseline;
	border-bottom: 1px dotted var(--nelson-border, #e5e7eb);
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	padding: 0.35rem 0;
}

.nc-summary-time {
	color: var(--nelson-text-light, #4b5563);
	flex: 0 0 6rem;
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.nc-summary-title {
	font-weight: 600;
	text-decoration: none;
}

.nc-summary-location {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.85rem;
}

/* ---------------------------------------------------------------- *
 * Photo view
 * ---------------------------------------------------------------- */

.nc-photo-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.nc-photo-card {
	background: var(--nelson-bg-white, #ffffff);
	border: 1px solid var(--nelson-border, #e5e7eb);
	border-radius: 8px;
	overflow: hidden;
}

.nc-photo-link {
	color: inherit;
	display: block;
	text-decoration: none;
}

.nc-photo-img,
.nc-photo-placeholder {
	aspect-ratio: 16 / 10;
	background: var(--nelson-bg-light, #f3f4f6);
	display: block;
	object-fit: cover;
	width: 100%;
}

.nc-photo-body {
	display: block;
	padding: 0.75rem;
}

.nc-photo-date {
	color: var(--nelson-text-light, #4b5563);
	display: block;
	font-size: 0.85rem;
}

.nc-photo-title {
	display: block;
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0.2rem 0;
}

.nc-photo-location {
	color: var(--nelson-text-light, #4b5563);
	display: block;
	font-size: 0.85rem;
}

/* ---------------------------------------------------------------- *
 * Map view
 * ---------------------------------------------------------------- */

.nc-map-container {
	background: var(--nelson-bg-light, #f3f4f6);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 8px;
	margin-bottom: 1rem;
	min-height: 3rem;
}

.nc-map-container:not(.nc-map-placeholder) {
	min-height: 20rem;
}

.nc-map-note {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.9rem;
	margin: 0;
	padding: 0.75rem 1rem;
}

.nc-map-venues {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.nc-map-venue-card {
	background: var(--nelson-bg-white, #ffffff);
	border: 1px solid var(--nelson-border, #e5e7eb);
	border-radius: 8px;
	padding: 1rem;
}

.nc-map-venue-name {
	font-size: 1.05rem;
	margin: 0 0 0.25rem;
}

.nc-map-venue-address {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.88rem;
	margin: 0 0 0.5rem;
}

.nc-map-venue-events {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nc-map-venue-events li {
	border-top: 1px dotted var(--nelson-border, #e5e7eb);
	padding: 0.35rem 0;
}

.nc-map-event-when {
	color: var(--nelson-text-light, #4b5563);
	display: block;
	font-size: 0.83rem;
}

/* ---------------------------------------------------------------- *
 * Single event
 * ---------------------------------------------------------------- */

.nc-single-event-wrap {
	margin: 0 auto;
	max-width: 1000px;
	padding: 1.5rem 1rem 3rem;
}

/* Two-column detail layout: featured image on the left, event details on the
 * right. The header (H1) above and everything below (description, organizers,
 * RSVP, related/upcoming events) span the full width. */
.nc-single-columns {
	align-items: start;
	display: grid;
	gap: 1.5rem;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	margin: 0 0 1.5rem;
}

.nc-single-columns--no-media {
	grid-template-columns: 1fr;
}

.nc-single-col-media .nc-single-thumb {
	margin: 0;
}

.nc-single-col-details > *:last-child {
	margin-bottom: 0;
}

@media (max-width: 782px) {
	.nc-single-columns {
		grid-template-columns: 1fr;
	}
}

.nc-single-header {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.nc-single-title {
	margin: 0;
}

.nc-single-meta {
	background: var(--nelson-bg-light, #f9fafb);
	border: 1px solid var(--nelson-border, #e5e7eb);
	border-radius: 8px;
	margin: 0 0 1rem;
	padding: 0.9rem 1.1rem;
}

.nc-single-meta p {
	margin: 0.25rem 0;
}

.nc-single-tz {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.88em;
}

.nc-single-capacity {
	font-weight: 700;
}

.nc-single-thumb {
	margin: 0 0 1rem;
}

.nc-single-thumb img {
	border-radius: 8px;
	height: auto;
	max-width: 100%;
}

/* Promo media (video / image / oEmbed) on the single event page. */
.nc-single-promo {
	margin: 0 0 1rem;
}

.nc-single-promo img,
.nc-single-promo video,
.nc-single-promo iframe,
.nc-single-promo .wp-video,
.nc-single-promo .mejs-container {
	border-radius: 8px;
	height: auto;
	max-width: 100%;
}

.nc-single-promo .wp-video,
.nc-single-promo video {
	width: 100% !important;
}

.nc-single-footer {
	border-top: 1px solid var(--nelson-border, #e5e7eb);
	margin-top: 2rem;
	padding-top: 1rem;
}

/* Add to calendar */
.nc-add-to-calendar {
	display: inline-block;
	margin: 0 0 1rem;
	position: relative;
}

.nc-atc-menu {
	background: var(--nelson-bg-white, #ffffff);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	list-style: none;
	margin: 0.25rem 0 0;
	min-width: 12rem;
	padding: 0.25rem 0;
	position: absolute;
	z-index: 20;
}

.nc-atc-menu li a {
	display: block;
	padding: 0.45rem 0.9rem;
	text-decoration: none;
}

.nc-atc-menu li a:hover,
.nc-atc-menu li a:focus {
	background: var(--nelson-bg-light, #f3f4f6);
}

/* ---------------------------------------------------------------- *
 * Forms (RSVP / feedback / search / filter)
 * ---------------------------------------------------------------- */

.nc-rsvp,
.nc-feedback {
	background: var(--nelson-bg-white, #ffffff);
	border: 1px solid var(--nelson-border, #e5e7eb);
	border-radius: 8px;
	margin: 1.5rem 0;
	padding: 1.25rem;
}

.nc-rsvp-counts {
	color: var(--nelson-text-light, #4b5563);
}

.nc-rsvp-field {
	margin: 0 0 0.9rem;
}

.nc-rsvp-field label,
.nc-search-label,
.nc-filter-field label,
.nc-checkin-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.nc-calendar input[type="text"],
.nc-calendar input[type="email"],
.nc-calendar input[type="search"],
.nc-calendar input[type="date"],
.nc-calendar select,
.nc-calendar textarea {
	background: var(--nelson-input-bg, #ffffff);
	border: 1px solid var(--nelson-input-border, #d1d5db);
	border-radius: 6px;
	color: var(--nelson-input-text, #1f2937);
	font-size: 1rem;
	max-width: 100%;
	padding: 0.45rem 0.6rem;
}

.nc-calendar input:focus,
.nc-calendar select:focus,
.nc-calendar textarea:focus {
	border-color: var(--nelson-input-focus-border, #2563eb);
	outline: 2px solid var(--nelson-input-focus-border, #2563eb);
	outline-offset: 1px;
}

.nc-field-hint {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.85rem;
	margin: 0.25rem 0 0;
}

/* Honeypot: visually removed, still in the DOM for bots. */
.nc-hp-wrap {
	left: -9999px;
	position: absolute;
	top: -9999px;
}

.nc-form-message {
	border-radius: 6px;
	margin-top: 0.75rem;
}

.nc-form-message.nc-ok {
	background: var(--nelson-bg-light, #f0fdf4);
	border: 1px solid var(--nelson-success, #15803d);
	color: var(--nelson-success, #15803d);
	padding: 0.6rem 0.9rem;
}

.nc-form-message.nc-err {
	background: var(--nelson-bg-light, #fef2f2);
	border: 1px solid var(--nelson-error, #b91c1c);
	color: var(--nelson-error, #b91c1c);
	padding: 0.6rem 0.9rem;
}

.nc-feedback-rating {
	border: 0;
	margin: 0 0 0.9rem;
	padding: 0;
}

.nc-rating-option {
	display: inline-block;
	margin-right: 0.75rem;
}

/* Search */
.nc-search-row {
	display: flex;
	gap: 0.5rem;
}

.nc-search-row input[type="search"] {
	flex: 1;
}

/* Filter bar */
.nc-filter-bar {
	background: var(--nelson-bg-light, #f9fafb);
	border: 1px solid var(--nelson-border, #e5e7eb);
	border-radius: 8px;
	margin: 0 0 1rem;
	padding: 1rem;
}

.nc-filter-fields {
	display: grid;
	gap: 0.75rem;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.nc-filter-checkbox {
	align-items: center;
	align-self: end;
	display: flex;
	gap: 0.4rem;
}

.nc-filter-checkbox label {
	margin: 0;
}

.nc-filter-actions {
	align-items: center;
	display: flex;
	gap: 1rem;
	margin-top: 0.9rem;
}

.nc-filter-reset {
	font-size: 0.9rem;
}

/* ---------------------------------------------------------------- *
 * Check-in screen
 * ---------------------------------------------------------------- */

.nc-checkin {
	margin: 0 auto;
	max-width: 560px;
	padding: 2rem 1rem 4rem;
	text-align: center;
}

.nc-checkin-title {
	margin-bottom: 1rem;
}

.nc-checkin-scope {
	margin-bottom: 1.5rem;
}

.nc-checkin-form {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.nc-checkin-input {
	font-size: 1.4rem;
	padding: 0.8rem 1rem;
	text-align: center;
	width: 100%;
}

.nc-checkin-result {
	border-radius: 8px;
	font-size: 1.2rem;
	font-weight: 700;
	margin: 1rem 0;
	min-height: 2.5rem;
	padding: 0.5rem;
}

.nc-checkin-result.nc-ok {
	background: var(--nelson-success, #15803d);
	color: var(--nelson-bg-white, #ffffff);
}

.nc-checkin-result.nc-warn {
	background: var(--nelson-warning, #b45309);
	color: var(--nelson-bg-white, #ffffff);
}

.nc-checkin-result.nc-err {
	background: var(--nelson-error, #b91c1c);
	color: var(--nelson-bg-white, #ffffff);
}

.nc-checkin-count {
	color: var(--nelson-text-light, #4b5563);
	font-size: 1.05rem;
}

/* Archive */
.nc-archive-wrap {
	max-width: var(--nc-content-width, 1080px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 16px;
	padding-right: 16px;
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- *
 * Online / virtual join box (P2 §7)
 * ---------------------------------------------------------------- */

.nc-online-box {
	margin: 20px 0;
	padding: 16px;
	background: var(--nelson-card-bg, #ffffff);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 8px;
}

.nc-online-box h2 {
	margin: 0 0 10px;
	font-size: 1.125rem;
}

.nc-online-join {
	display: inline-block;
}

.nc-online-join--pending {
	opacity: 0.6;
	pointer-events: none;
}

.nc-online-gated,
.nc-online-countdown,
.nc-online-ended {
	margin: 8px 0 0;
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.9375rem;
}

/* ---------------------------------------------------------------- *
 * Per-event / per-category colors (P2 §9)
 * ---------------------------------------------------------------- */

.nc-event-chip.nc-has-color {
	background: var(--nc-event-color);
	color: var(--nelson-button-text, #ffffff);
	border-left: 3px solid rgba(0, 0, 0, 0.25); /* functional edge, not a palette token */
}

.nc-event-chip.nc-has-color .nc-chip-time,
.nc-event-chip.nc-has-color .nc-chip-title {
	color: var(--nelson-button-text, #ffffff);
}

.nc-list-item.nc-has-color {
	border-left: 4px solid var(--nc-event-color);
	padding-left: 10px;
}

/* ---------------------------------------------------------------- *
 * Multi-day event spanning bars
 * ---------------------------------------------------------------- */

.nc-event-chip--span {
	background: var(--nelson-badge-bg, #e0e7ff);
	color: var(--nelson-badge-text, #1e3a8a);
	border-radius: 0;
	position: relative;
	z-index: 1;
	min-height: 1.25rem;
	line-height: 1.25rem;
}

/* A colored multi-day event keeps its per-event color across the whole bar
 * (the plain --span rule above would otherwise override .nc-has-color). */
.nc-event-chip--span.nc-has-color {
	background: var(--nc-event-color);
	color: var(--nelson-button-text, #ffffff);
}

.nc-event-chip--span .nc-chip-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nc-span-start {
	border-top-left-radius: 4px;
	border-bottom-left-radius: 4px;
	margin-left: 2px;
}

.nc-span-end {
	border-top-right-radius: 4px;
	border-bottom-right-radius: 4px;
	margin-right: 2px;
}

/* Continuation edges bleed past the cell padding (8px) + border so adjacent
 * day segments overlap and read as one continuous bar. */
.nc-span-continues-after {
	margin-right: -12px;
}

.nc-span-continues-before {
	margin-left: -12px;
}

.nc-day-event--span {
	margin-bottom: 2px;
}

/* ---------------------------------------------------------------- *
 * View switcher (Month | Week | Day | List)
 * ---------------------------------------------------------------- */

.nc-view-switcher {
	display: flex;
	gap: 4px;
	justify-content: flex-end;
	margin-bottom: 10px;
}

/* When the switcher sits inside the grid header (month/week), center it
 * directly under the month/year title. */
.nc-grid-wrap .nc-view-switcher {
	justify-content: center;
	margin: 0 0 0.85rem;
}

.nc-view-switch {
	padding: 5px 12px;
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 6px;
	font-size: 0.8125rem;
	text-decoration: none;
	color: var(--nelson-link, #1d4ed8);
	background: var(--nelson-card-bg, #ffffff);
}

.nc-view-switch:hover,
.nc-view-switch:focus {
	background: var(--nelson-bg-light, #f3f4f6);
}

.nc-view-switch--active {
	background: var(--nelson-tab-active-bg, #1f2937);
	color: var(--nelson-tab-active-text, #ffffff);
	border-color: var(--nelson-tab-active-bg, #1f2937);
	pointer-events: none;
}

/* ---------------------------------------------------------------- *
 * Viewer timezone toggle (free)
 * ---------------------------------------------------------------- */

.nc-tz-toggle {
	margin: 0 0 10px;
}

.nc-tz-toggle[hidden] {
	display: none;
}

.nc-tz-toggle-label {
	align-items: center;
	color: var(--nelson-text-light, #4b5563);
	cursor: pointer;
	display: inline-flex;
	font-size: 0.85rem;
	gap: 0.4rem;
}

.nc-tz-toggle-input {
	cursor: pointer;
	margin: 0;
}

.nc-tz-name {
	font-variant-numeric: tabular-nums;
}

/* Converted times carry a title tooltip with the event-tz original. */
[data-nc-utc][title] {
	cursor: help;
}

/* ---------------------------------------------------------------- *
 * Ticket purchase box
 * ---------------------------------------------------------------- */

.nc-ticket-box {
	margin-top: 20px;
	padding: 16px;
	background: var(--nelson-card-bg, #ffffff);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 8px;
}

.nc-ticket-heading {
	margin: 0 0 10px;
	font-size: 1.125rem;
}

.nc-ticket-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 10px;
}

.nc-ticket-table td {
	padding: 8px 6px;
	border-bottom: 1px solid var(--nelson-border, #e5e7eb);
	vertical-align: middle;
}

.nc-ticket-price {
	font-weight: 600;
	white-space: nowrap;
}

.nc-ticket-remaining {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.8125rem;
	text-align: right;
	white-space: nowrap;
}

.nc-ticket-qty-row {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 0 0;
}

.nc-ticket-qty-row input[type="number"] {
	width: 72px;
	padding: 6px 8px;
	border: 1px solid var(--nelson-input-border, #d1d5db);
	border-radius: 6px;
	background: var(--nelson-input-bg, #ffffff);
	color: var(--nelson-input-text, #1f2937);
}

/* ---------------------------------------------------------------- *
 * Event hover popover
 * ---------------------------------------------------------------- */

.nc-popover {
	position: absolute;
	z-index: 99999;
	max-width: 320px;
	padding: 12px 14px;
	background: var(--nelson-card-bg, #ffffff);
	color: var(--nelson-text, #1f2937);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); /* functional overlay shadow */
	font-size: 0.875rem;
	line-height: 1.45;
	pointer-events: none;
}

.nc-popover[hidden] {
	display: none;
}

.nc-popover-title {
	font-weight: 700;
	margin-bottom: 2px;
}

.nc-popover-status {
	display: inline-block;
	margin-bottom: 4px;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: 0.75rem;
	text-transform: capitalize;
	background: var(--nelson-badge-bg, #fef3c7);
	color: var(--nelson-badge-text, #92400e);
}

.nc-popover-time {
	color: var(--nelson-text-light, #4b5563);
}

.nc-popover-location {
	color: var(--nelson-text-light, #4b5563);
}

.nc-popover-excerpt {
	margin-top: 6px;
	color: var(--nelson-text, #1f2937);
}

.nc-popover-rsvp {
	margin-top: 6px;
	font-size: 0.8125rem;
	color: var(--nelson-text-light, #4b5563);
}

.nc-archive-header {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	margin-bottom: 1rem;
}

/* ---------------------------------------------------------------- *
 * Responsive: month grid collapses to a stacked day list
 * ---------------------------------------------------------------- */

@media (max-width: 640px) {
	.nc-grid,
	.nc-grid tbody,
	.nc-grid tr {
		display: block;
		width: 100%;
	}

	.nc-grid thead {
		display: none;
	}

	.nc-grid-cell {
		border-width: 0 0 1px;
		display: none;
		height: auto;
		min-height: 0;
		padding: 0.5rem 0.25rem;
	}

	/* Only days with events (or today) show on mobile. */
	.nc-grid-cell.nc-has-events,
	.nc-grid-cell.nc-today {
		display: block;
	}

	.nc-grid-cell .nc-day-num::after {
		content: "";
	}

	.nc-day-num {
		font-size: 1rem;
	}

	.nc-list-item {
		flex-direction: column;
		gap: 0.25rem;
	}

	.nc-list-when {
		flex-basis: auto;
	}

	.nc-summary-time {
		flex-basis: 100%;
	}
}

/* ---------------------------------------------------------------- *
 * Event submission form (Pro) — [nelson_event_submit]
 * ---------------------------------------------------------------- */

.nc-submit-form {
	background: var(--nelson-bg-light, #f9fafb);
	border: 1px solid var(--nelson-border, #e5e7eb);
	border-radius: 8px;
	margin: 0 0 1rem;
	max-width: 640px;
	padding: 1.25rem;
}

.nc-submit-field {
	margin: 0 0 0.9rem;
}

.nc-submit-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3rem;
}

.nc-submit-field input[type="text"],
.nc-submit-field input[type="url"],
.nc-submit-field input[type="email"],
.nc-submit-field input[type="datetime-local"],
.nc-submit-field select,
.nc-submit-field textarea {
	background: var(--nelson-input-bg, #fff);
	border: 1px solid var(--nelson-input-border, #d1d5db);
	border-radius: 6px;
	box-sizing: border-box;
	color: var(--nelson-text, #1f2937);
	padding: 0.5rem 0.65rem;
	width: 100%;
}

.nc-submit-field textarea {
	resize: vertical;
}

.nc-submit-row {
	display: grid;
	gap: 0.9rem;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.nc-submit-field .nc-required {
	color: var(--nelson-error, #b91c1c);
}

.nc-submit-field .nc-field-hint {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.85rem;
	margin: 0.3rem 0 0;
}

.nc-submit-actions {
	margin-top: 0.5rem;
}

/* ---------------------------------------------------------------- *
 * Map view — Leaflet
 * Leaflet needs an explicit height on its container or it renders 0px.
 * ---------------------------------------------------------------- */

.nc-map-container[data-nc-map-ready] {
	height: 24rem;
	min-height: 24rem;
	overflow: hidden;
	z-index: 0; /* keep tiles beneath sticky headers */
}

.nc-map-container--unavailable,
.nc-map-container--empty {
	min-height: 0;
}

.nc-map-popup__title {
	display: block;
	font-weight: 700;
	margin-bottom: 0.15rem;
}

.nc-map-popup__venue,
.nc-map-popup__when {
	color: var(--nelson-text-light, #4b5563);
	display: block;
	font-size: 0.85rem;
}

/* ---------------------------------------------------------------- *
 * Organizers / facilitators
 * ---------------------------------------------------------------- */

.nc-organizers {
	margin: 2rem 0;
}

.nc-organizers__list {
	display: grid;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nc-organizer {
	align-items: flex-start;
	display: flex;
	gap: 1rem;
}

.nc-organizer__photo {
	border-radius: 50%;
	flex: 0 0 auto;
	height: 120px;
	object-fit: cover;
	width: 120px;
}

.nc-organizer__name {
	margin: 0 0 0.15rem;
}

.nc-organizer__title {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.9rem;
	margin: 0 0 0.5rem;
}

.nc-organizer__bio p:last-child {
	margin-bottom: 0;
}

@media (max-width: 480px) {
	.nc-organizer {
		flex-direction: column;
	}
}

/* ---------------------------------------------------------------- *
 * Related events
 * ---------------------------------------------------------------- */

.nc-related-events {
	margin: 2rem 0;
}

.nc-related-events__list {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.nc-related-event {
	background: var(--nelson-bg-light, #f9fafb);
	border: 1px solid var(--nelson-border, #e5e7eb);
	border-left: 4px solid var(--nc-event-color, var(--nelson-border, #e5e7eb));
	border-radius: 8px;
	display: flex;
	gap: 0.85rem;
	padding: 0.9rem 1rem;
}

.nc-related-event__date {
	background: var(--nc-event-color, var(--nelson-border, #e5e7eb));
	border-radius: 6px;
	color: var(--nelson-button-text, #ffffff);
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	line-height: 1.1;
	padding: 0.4rem 0.55rem;
	text-align: center;
}

.nc-related-event__month {
	font-size: 0.7rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.nc-related-event__day {
	font-size: 1.15rem;
	font-weight: 700;
}

.nc-related-event__title {
	font-size: 1rem;
	margin: 0 0 0.2rem;
}

.nc-related-event__when,
.nc-related-event__where {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.85rem;
	margin: 0 0 0.15rem;
}

.nc-related-event__link {
	display: inline-block;
	font-size: 0.85rem;
	margin-top: 0.3rem;
}

/* ---------------------------------------------------------------- *
 * Cost / price
 * ---------------------------------------------------------------- */

.nc-single-cost .nc-cost-value {
	font-weight: 600;
}

.nc-single-cost--free .nc-cost-value {
	color: var(--nelson-success, #15803d);
}

.nc-related-event__cost {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.85rem;
	font-weight: 600;
	margin: 0 0 0.15rem;
}

.nc-event-cost {
	font-size: 0.85rem;
	font-weight: 600;
}

/* ---------------------------------------------------------------- *
 * Seat picker (Pro seating charts, MDD §13.6)
 * ---------------------------------------------------------------- */

.nc-seat-picker {
	background: var(--nelson-bg-light, #f9fafb);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 6px;
	margin: 0.75rem 0;
	padding: 0.75rem 1rem;
}

.nc-seat-picker-legend {
	color: var(--nelson-text, #1f2937);
	font-size: 0.95rem;
	font-weight: 600;
	padding: 0 0.35rem;
}

.nc-seat-hint,
.nc-seat-count {
	color: var(--nelson-text-light, #4b5563);
	font-size: 0.8rem;
	margin: 0.25rem 0 0.5rem;
}

.nc-seat-row {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0.25rem 0;
}

.nc-seat-row-label {
	color: var(--nelson-text-light, #4b5563);
	font-weight: 600;
	min-width: 1.25rem;
	text-align: center;
}

.nc-seat {
	background: var(--nelson-bg-white, #ffffff);
	border: 1px solid var(--nelson-border, #d1d5db);
	border-radius: 4px;
	color: var(--nelson-text, #1f2937);
	cursor: pointer;
	font-size: 0.75rem;
	line-height: 1;
	min-height: 32px;
	min-width: 32px;
	padding: 0;
}

.nc-seat:hover:not(:disabled):not(.nc-seat--selected) {
	border-color: var(--nelson-primary, #2563eb);
}

.nc-seat:focus-visible {
	outline: 2px solid var(--nelson-input-focus-border, #2563eb);
	outline-offset: 1px;
}

.nc-seat--selected,
.nc-seat[aria-pressed="true"] {
	background: var(--nelson-primary, #2563eb);
	border-color: var(--nelson-primary, #2563eb);
	color: var(--nelson-button-text, #ffffff);
}

.nc-seat--taken,
.nc-seat:disabled {
	background: var(--nelson-bg-light, #f3f4f6);
	border-style: dashed;
	color: var(--nelson-text-light, #6b7280);
	cursor: not-allowed;
	text-decoration: line-through;
}
