/*
 * Networking Events — frontend styles.
 *
 * Mobile-first. Two breakpoints:
 *   600px  — tablet portrait
 *   960px  — desktop
 *
 * All interactive controls are at least 44x44px to meet touch-target
 * guidelines. Colours use the --ne-brand / --ne-brand-contrast custom
 * properties injected by Frontend\Branding, with hard-coded fallbacks.
 */

.ne-notice {
	padding: 12px 14px;
	margin: 1em 0;
	border-left: 4px solid var(--ne-brand, #008080);
	background: #f7f7f7;
	font-size: 0.95rem;
	line-height: 1.5;
	border-radius: 2px;
}

.ne-notice code {
	background: #eee;
	padding: 1px 4px;
	border-radius: 2px;
	font-size: 0.9em;
}

.ne-notice-warn {
	border-left-color: #dba617;
}

.ne-coming-soon {
	font-style: italic;
	color: #444;
}

.ne-button {
	display: inline-block;
	min-height: 44px;
	padding: 10px 18px;
	background: var(--ne-brand, #008080);
	color: var(--ne-brand-contrast, #ffffff);
	border: 1px solid var(--ne-brand, #008080);
	border-radius: 3px;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	text-align: center;
	box-sizing: border-box;
}

.ne-button:hover,
.ne-button:focus {
	filter: brightness(0.92);
	color: var(--ne-brand-contrast, #ffffff);
}

.ne-button--secondary {
	background: transparent;
	color: var(--ne-brand, #008080);
}

.ne-button--secondary:hover,
.ne-button--secondary:focus {
	background: var(--ne-brand, #008080);
	color: var(--ne-brand-contrast, #ffffff);
}

/* Utility wrappers for future list / form components. */
.ne-stack > * + * {
	margin-top: 1rem;
}

.ne-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 600px) {
	.ne-grid--2 {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 960px) {
	.ne-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}
}

/*
 * v0.2.0 additions — listings grid, event details, forms, badges, thank-you.
 */

.ne-shortcode + .ne-shortcode {
	margin-top: 2rem;
}

/* ---------- Listings grid ---------- */

.ne-listings-grid {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
}

@media (min-width: 600px) {
	.ne-listings-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.ne-listings-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.ne-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #e5e5e5;
	border-top: 4px solid var( --ne-event-brand, var( --ne-brand, #008080 ) );
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.15s ease-in-out;
}

.ne-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ne-card-image {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f0f0f1;
}

.ne-card-img,
.ne-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ne-card-img-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #eee, #ddd);
}

.ne-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ne-badge-free {
	background: #0a8a5f;
	color: #fff;
}

.ne-badge-paid {
	background: var(--ne-brand, #008080);
	color: var(--ne-brand-contrast, #fff);
}

.ne-card-body {
	padding: 1rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ne-card-title {
	margin: 0 0 0.2rem;
	font-size: 1.1rem;
	line-height: 1.3;
}

.ne-card-title a {
	color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
	text-decoration: none;
}

.ne-card-title a:hover,
.ne-card-title a:focus {
	text-decoration: underline;
}

.ne-card-organiser,
.ne-card-when,
.ne-card-venue {
	margin: 0;
	font-size: 0.9rem;
	color: #4a4a4a;
	line-height: 1.4;
}

.ne-card-when {
	font-weight: 600;
	color: #222;
}

.ne-card-book {
	margin-top: auto;
	align-self: flex-start;
}

.ne-empty {
	padding: 2rem;
	text-align: center;
	color: #555;
	background: #fafafa;
	border: 1px dashed #ddd;
	border-radius: 6px;
}

/* ---------- Pagination ---------- */

.ne-pagination {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid #eee;
	flex-wrap: wrap;
}

.ne-pagination a {
	display: inline-block;
	min-height: 44px;
	padding: 10px 14px;
	line-height: 1.4;
	border: 1px solid var(--ne-brand, #008080);
	color: var(--ne-brand, #008080);
	border-radius: 3px;
	text-decoration: none;
}

.ne-pagination a:hover,
.ne-pagination a:focus {
	background: var(--ne-brand, #008080);
	color: var(--ne-brand-contrast, #fff);
}

.ne-page-info {
	color: #555;
}

/* ---------- Join page ---------- */

.ne-join-intro {
	margin-bottom: 1.5rem;
}

.ne-join-ctas {
	margin-bottom: 2.5rem;
}

.ne-cta-form {
	margin: 0 0 1rem;
}

.ne-cta-note {
	margin: 0.4rem 0 0;
	font-size: 0.85rem;
	color: #666;
}

.ne-resend {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid #eee;
}

.ne-resend h3 {
	margin: 0 0 0.4rem;
	font-size: 1.1rem;
}

.ne-resend-form {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	max-width: 400px;
}

.ne-resend-link {
	margin-top: 0.6rem;
	word-break: break-all;
}

/* ---------- Submit-event form ---------- */

.ne-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	max-width: 640px;
}

.ne-field {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.ne-label {
	font-weight: 600;
	font-size: 0.95rem;
}

.ne-input,
.ne-textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 3px;
	font-size: 1rem;
	font-family: inherit;
	background: #fff;
	box-sizing: border-box;
}

.ne-textarea {
	min-height: 120px;
	resize: vertical;
}

.ne-input:focus,
.ne-textarea:focus {
	outline: 2px solid var(--ne-brand, #008080);
	outline-offset: 1px;
}

.ne-form-row {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 600px) {
	.ne-form-row {
		grid-template-columns: 2fr 1fr;
	}
}

fieldset.ne-field {
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 0.75rem 1rem;
}

fieldset.ne-field legend {
	padding: 0 0.4rem;
	font-weight: 600;
}

fieldset.ne-field label {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-right: 1.25rem;
}

/* ---------- Event details (single-page rendering) ---------- */

.ne-event {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	border-top: 4px solid var( --ne-event-brand, var( --ne-brand, #008080 ) );
	padding-top: 1.25rem;
}

.ne-event-venue h3 {
	margin: 0 0 0.3rem;
	font-size: 1rem;
	font-weight: 700;
	color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
}

.ne-event-image {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 6px;
}

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

.ne-event-meta {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.4rem 1rem;
	margin: 0;
}

.ne-event-meta dt {
	font-weight: 600;
	color: #333;
}

.ne-event-meta dd {
	margin: 0;
}

.ne-event-description {
	line-height: 1.6;
}

/* ---------- Thank-you page ---------- */

.ne-thankyou h2 {
	margin-top: 0;
}

.ne-thankyou-link {
	background: #f0f9f5;
	border-left-color: #0a8a5f;
}

.ne-big-link {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0.8rem 0;
}

/*
 * v0.3.0 — account page, subscriber dashboard, status badges.
 */

.ne-account h2,
.ne-my-events h2 {
	margin-top: 0;
}

.ne-account-status {
	margin: 1rem 0 1.5rem;
	padding: 1rem 1.25rem;
	background: #fafafa;
	border-radius: 4px;
	border: 1px solid #eee;
}

.ne-account-status h3 {
	margin: 0 0 0.6rem;
	font-size: 1rem;
}

.ne-account-meta {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.4rem 1rem;
	margin: 0;
}

.ne-account-meta dt {
	font-weight: 600;
	color: #333;
}

.ne-account-meta dd {
	margin: 0;
}

.ne-account-billing {
	margin: 1rem 0 1.5rem;
}

/* Subscriber dashboard table. */
.ne-events-table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
}

.ne-events-table th,
.ne-events-table td {
	padding: 0.6rem 0.8rem;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: middle;
}

.ne-events-table th {
	font-weight: 600;
	background: #fafafa;
	font-size: 0.9rem;
}

.ne-event-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ne-status-publish {
	background: #0a8a5f;
	color: #fff;
}

.ne-status-draft {
	background: #888;
	color: #fff;
}

.ne-status-pending {
	background: #dba617;
	color: #000;
}

.ne-status-other {
	background: #eee;
	color: #333;
}

@media (max-width: 599px) {
	.ne-events-table {
		font-size: 0.9rem;
	}
	.ne-events-table th,
	.ne-events-table td {
		padding: 0.5rem 0.5rem;
	}
}

/* v0.3.2 — subscriber dashboard add-event button + row actions. */
.ne-add-event {
	margin: 0.5rem 0 1rem;
}
.ne-row-actions a {
	white-space: nowrap;
}

/* v0.4.0 — hCaptcha widget spacing. */
.ne-captcha {
	margin: 1rem 0;
}

/*
 * v0.5.1 — [ne_schedule] agenda view.
 *
 * Brand-coloured tastefully:
 *   - Day heading: full-bleed bar in brand colour with contrast text
 *   - Event name: dark grey, weight 700, becomes brand colour on hover
 *   - Organiser: muted, brand-tinted
 *   - Free/Paid: coloured pills
 *   - Card: white, soft brand-tinted border on the left edge
 */

.ne-schedule {
	margin: 1rem 0;
}

.ne-schedule__day {
	margin: 0 0 1.5rem;
	padding: 0;
}

.ne-schedule__day-heading {
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var( --ne-brand-contrast, #fff );
	background: var( --ne-brand, #008080 );
	padding: 0.5rem 0.85rem;
	border-radius: 4px;
	margin: 0 0 0.6rem;
}
.ne-schedule__row {
	display: block;
	padding: 0.85rem 1rem;
	margin: 0 0 0.5rem;
	background: #fff;
	border: 1px solid #eee;
	border-left: 4px solid var( --ne-event-brand, var( --ne-brand, #008080 ) );
	border-radius: 0 4px 4px 0;
	transition: box-shadow 120ms ease;
}

.ne-schedule__row:hover {
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.06 );
}

.ne-schedule__title {
	margin: 0 0 0.2rem;
	font-size: 1.1rem;
	line-height: 1.3;
	font-weight: 700;
}

.ne-schedule__title a {
	color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.ne-schedule__title a:hover,
.ne-schedule__title a:focus {
	color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
	filter: brightness( 0.85 );
	text-decoration: underline;
}

.ne-schedule__organiser {
	color: #555;
	font-size: 0.95rem;
	margin: 0 0 0.15rem;
}

.ne-schedule__dateline {
	color: #666;
	font-size: 0.92rem;
	margin: 0 0 0.5rem;
	line-height: 1.4;
}

/* Free / Paid pills. */
.ne-pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.4;
}

.ne-pill--free {
	background: #1a8a5a;
	color: #fff;
}

.ne-pill--paid {
	background: #d99a1a;
	color: #fff;
}

/* Sentinel + loading spinner. */
.ne-schedule__sentinel {
	padding: 1rem 0;
	text-align: center;
	color: #888;
	font-size: 0.9rem;
}

.ne-schedule__loading::after {
	content: '';
	display: inline-block;
	width: 0.6rem;
	height: 0.6rem;
	margin-left: 0.4rem;
	border: 2px solid #ccc;
	border-top-color: var( --ne-brand, #008080 );
	border-radius: 50%;
	animation: ne-spin 0.7s linear infinite;
	vertical-align: middle;
}

@keyframes ne-spin {
	to { transform: rotate( 360deg ); }
}

/* v0.5.3 — accent colour picker on the submit form. */
.ne-field--accent {
	display: block;
}

.ne-accent-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: 0.3rem;
}

.ne-accent-input {
	width: 3rem;
	height: 2.4rem;
	padding: 2px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	flex: 0 0 auto;
}

.ne-accent-hex {
	flex: 1 1 16rem;
	min-width: 12rem;
	height: 2.4rem;
	padding: 0 0.6rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.95rem;
}

.ne-accent-clear {
	flex: 0 0 auto;
}

.ne-help {
	display: block;
	margin-top: 0.4rem;
	color: #666;
	font-size: 0.85rem;
}

/*
 * v0.5.6 / v0.5.7 — Desktop layout for [ne_event_details].
 *
 * Mobile (default, < 960px): single column — UNCHANGED.
 * Desktop (≥ 960px):
 *   - Top row: image on the left at 50%, info column on the right at 50%
 *   - Bottom row: description block, full width, with "About This Event" heading
 *
 * Implementation: flex-wrap on .ne-event, image and info each at ~50% of the
 * row, and the description forced to flex-basis: 100% so it wraps onto its
 * own row below.
 */

@media (min-width: 960px) {
	.ne-event {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 1.5rem 2rem; /* row-gap, column-gap */
	}

	.ne-event-image {
		flex: 0 0 calc(50% - 1rem);
		margin: 0;
	}

	.ne-event-info {
		flex: 1 1 calc(50% - 1rem);
		display: flex;
		flex-direction: column;
		gap: 1.25rem;
	}

	.ne-event-description {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/*
 * v0.5.7 — "About This Event" description heading and clickable organiser.
 *
 * The heading appears in bold on every viewport (it's a meaningful section
 * marker, not a layout-driven element). The organiser link uses the same
 * "obviously clickable" treatment as the schedule card: brand colour,
 * underlined at default state, no hover requirement.
 */

.ne-event-description-heading {
	margin: 0 0 0.6rem;
	font-size: 1.1rem;
	font-weight: 700;
	color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
}

.ne-organiser-link {
	color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.ne-organiser-link:hover,
.ne-organiser-link:focus {
	color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
	filter: brightness( 0.85 );
	text-decoration: underline;
}

/*
 * v0.5.8 — Per-event accent on Book Here buttons.
 *
 * The base .ne-button uses --ne-brand site-wide. Inside a card or detail
 * page wrapper that has --ne-event-brand set inline, Book Here adopts that
 * colour instead. Falls back to --ne-brand when no per-event colour is set.
 *
 * Scoped to .ne-card and .ne-event so other buttons (Submit Event,
 * Save changes, account actions) keep the site brand colour.
 */

.ne-card .ne-card-book,
.ne-event .ne-event-book .ne-button {
	background: var( --ne-event-brand, var( --ne-brand, #008080 ) );
	border-color: var( --ne-event-brand, var( --ne-brand, #008080 ) );
}

.ne-card .ne-card-book:hover,
.ne-card .ne-card-book:focus,
.ne-event .ne-event-book .ne-button:hover,
.ne-event .ne-event-book .ne-button:focus {
	filter: brightness( 0.88 );
}

/*
 * v0.5.9 — Submit-event page CTA for anonymous visitors.
 * Shown when someone navigates directly to /submit-event/ without a
 * valid submission token and isn't a logged-in subscriber.
 */

.ne-submit-cta {
	padding: 1.25rem 1.5rem;
}

.ne-submit-cta__heading {
	margin: 0 0 0.6rem;
	font-size: 1.15rem;
	font-weight: 700;
}

.ne-submit-cta__intro {
	margin: 0 0 0.9rem;
}

.ne-submit-cta__options {
	margin: 0 0 1rem;
	padding-left: 1.2rem;
}

.ne-submit-cta__options li + li {
	margin-top: 0.4rem;
}

.ne-submit-cta__actions {
	margin: 0 0 0.9rem;
}

.ne-submit-cta__lost {
	margin: 0;
	font-size: 0.92rem;
	color: #555;
}

/*
 * v0.5.11 — Clone button on the subscriber dashboard.
 *
 * The clone action mutates state, so it has to be a POST form (not a link).
 * But visually we want it to read as one of the row actions ("Edit ·
 * View · Clone"), not as a chunky button. Inline-block the form,
 * unstyle the button to look like a link.
 */

.ne-clone-form {
	display: inline-block;
	margin: 0;
	padding: 0;
}

.ne-link-button {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	color: var( --ne-brand, #008080 );
	text-decoration: underline;
	cursor: pointer;
}

.ne-link-button:hover,
.ne-link-button:focus {
	filter: brightness( 0.85 );
	text-decoration: underline;
}

/*
 * v0.6.0 — quota panel and locked organiser identity styling.
 */

/* Form field rendered as readonly (subscriber's locked organiser
   identity on the submit form). Slightly muted to make it obvious
   that this isn't an editable field. */
.ne-field--locked .ne-input {
	background: #f5f5f5;
	color: #555;
	cursor: not-allowed;
}

.ne-help {
	display: block;
	margin: 0.4rem 0 0;
	color: #666;
	font-size: 0.85rem;
}

.ne-help a {
	color: var( --ne-brand, #008080 );
}

/* Account page — organiser identity editor section. */
.ne-account-identity {
	margin: 1.5rem 0;
	padding: 1.25rem;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 4px;
}

.ne-account-identity h3 {
	margin: 0 0 0.5rem;
	font-size: 1.1rem;
	font-weight: 700;
}

/* Subscriber dashboard — monthly allowance panel. */
.ne-quota-panel {
	margin: 1rem 0 1.5rem;
	padding: 1rem 1.25rem;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 4px;
}

.ne-quota-panel h3 {
	margin: 0 0 0.6rem;
	font-size: 1rem;
	font-weight: 700;
}

.ne-quota-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 0.4rem 0.6rem;
	margin: 0 0 0.3rem;
	background: #fff;
	border-left: 4px solid #ccc;
	border-radius: 0 4px 4px 0;
}

.ne-quota-row--warn {
	border-left-color: #d99a1a;
}

.ne-quota-row--full {
	border-left-color: #c43030;
	background: #fff5f5;
}

.ne-quota-label {
	font-weight: 600;
	color: #333;
}

.ne-quota-count {
	font-variant-numeric: tabular-nums;
	color: #555;
	font-size: 0.95rem;
}

.ne-quota-row--full .ne-quota-count {
	color: #c43030;
	font-weight: 700;
}

.ne-quota-note {
	margin: 0.6rem 0 0;
	font-size: 0.85rem;
	color: #666;
}

/* v0.6.2 — first-time organiser identity setup gets stronger styling so
   the choice feels deliberate. Slightly larger heading, brand-coloured
   border. */
.ne-account-identity--first-time {
	border-color: var( --ne-brand, #008080 );
	border-width: 2px;
}

.ne-account-identity--first-time h3 {
	font-size: 1.25rem;
}

/* v0.6.4 — post-first-save CTA banner. The subscriber's mental model
   right after choosing their organiser name is "great, now let me list
   an event"; this banner gives them an obvious primary action.
   Brand-coloured fill makes it the focal point of the page. */
.ne-account-next-step {
	margin: 1rem 0 1.5rem;
	padding: 1.5rem;
	background: var( --ne-brand, #008080 );
	color: var( --ne-brand-contrast, #ffffff );
	border-radius: 4px;
	text-align: center;
}

.ne-account-next-step h3 {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: inherit;
}

.ne-account-next-step p {
	margin: 0 0 1rem;
	color: inherit;
}

.ne-account-next-step p:last-child {
	margin-bottom: 0;
}

/* Override default button colours inside the brand-filled banner so the
   button stays visible. White button with brand text is the inverse of
   the usual primary button. */
.ne-account-next-step .ne-button--primary {
	background: var( --ne-brand-contrast, #ffffff );
	color: var( --ne-brand, #008080 );
	border: none;
	padding: 0.75rem 1.5rem;
	font-weight: 700;
}

.ne-account-next-step .ne-button--primary:hover,
.ne-account-next-step .ne-button--primary:focus {
	opacity: 0.9;
}
