/**
 * Columbus Links Portal — member-area styles.
 * Tokens are simple; can be made theme-overridable later.
 */
:root {
	--clp-bg: #f8fafc;
	--clp-surface: #ffffff;
	--clp-border: #e2e8f0;
	--clp-text: #1e293b;
	--clp-text-muted: #475569;
	--clp-faint: #94a3b8;
	--clp-primary: #1d4ed8;
	--clp-primary-hover: #1e3a8a;
	--clp-accent: #059669;
	--clp-danger: #b91c1c;
	/* Chapter brand greens — sampled from columbuschapterlinks.org. */
	--clp-brand-green: #00442B;       /* deep forest, used for Admin chip + admin subnav */
	--clp-brand-green-mid: #00A05E;   /* mid green, used for active/hover states */
	--clp-brand-green-soft: #0a5538;  /* one-step-lighter for hover on the deep ground */
	--clp-radius: 8px;
	--clp-radius-lg: 14px;
	--clp-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
	--clp-shadow-md: 0 4px 10px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }

html, body.clp-body {
	margin: 0;
	background: var(--clp-bg);
	color: var(--clp-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.clp-container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 20px;
}

.clp-topbar {
	background: #ffffff;
	border-bottom: 1px solid var(--clp-border);
	box-shadow: var(--clp-shadow);
}
.clp-topbar .clp-container {
	display: flex;
	align-items: center;
	gap: 20px;
	padding-top: 14px;
	padding-bottom: 14px;
}
.clp-brand {
	font-weight: 700;
	color: var(--clp-text);
	text-decoration: none;
	font-size: 16px;
}
.clp-nav {
	margin-left: auto;
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}
.clp-nav a {
	color: var(--clp-text-muted);
	text-decoration: none;
	font-weight: 500;
}
.clp-nav a:hover { color: var(--clp-primary); }

/* Hamburger toggle — hidden on desktop, shown on tablet/mobile (≤768px). */
.clp-nav-toggle {
	display: none;
	margin-left: auto;
	background: transparent;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
	padding: 8px 10px;
	cursor: pointer;
	flex-direction: column;
	gap: 4px;
	align-items: center;
	justify-content: center;
}
.clp-nav-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--clp-brand-green);
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}
.clp-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.clp-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.clp-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
/* Specificity matches .clp-nav a above so the deep-green ground beats the
   muted-grey default text color. */
.clp-nav a.clp-nav-admin {
	padding: 5px 14px;
	background: var(--clp-brand-green);
	color: #ffffff;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.clp-nav a.clp-nav-admin:hover {
	background: var(--clp-brand-green-soft);
	color: #ffffff;
}

.clp-main { padding: 32px 0 64px; }
.clp-footer {
	border-top: 1px solid var(--clp-border);
	padding: 20px 0;
	color: var(--clp-faint);
	text-align: center;
}

.clp-stack > * + * { margin-top: 20px; }

.clp-card {
	background: var(--clp-surface);
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius-lg);
	padding: 24px;
	box-shadow: var(--clp-shadow);
}
.clp-card-narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.clp-card h1 { margin: 0 0 8px; font-size: 24px; }
.clp-card h2 { margin: 0 0 12px; font-size: 18px; }
.clp-card h3 { margin: 0 0 8px; font-size: 16px; }
.clp-card p { margin: 0 0 12px; }
.clp-lede { color: var(--clp-text-muted); margin-bottom: 16px !important; }
.clp-meta { color: var(--clp-text-muted); font-size: 13px; margin: 0; }
.clp-faint { color: var(--clp-faint); }

.clp-card-link { display: block; text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.clp-card-link:hover { transform: translateY(-2px); box-shadow: var(--clp-shadow-md); }
.clp-card-cta { margin-top: 8px; color: var(--clp-primary); font-weight: 600; }

.clp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.clp-grid-dense { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.clp-form { display: block; }
.clp-field { display: block; margin: 0 0 14px; }
.clp-field > span { display: block; font-weight: 600; margin-bottom: 4px; font-size: 13px; }

/*
 * One styling block for every text-like input in the portal. Listing each
 * type explicitly is more maintainable than `input:not([type="..."])` because
 * the negation excludes a long list (hidden, submit, button, radio, checkbox,
 * file, color, image, range, reset). Native-styled selects + textareas get
 * the same treatment so the visual grid stays consistent.
 *
 * The same selector also applies to filter bars and the .clp-side-by-side
 * containers, so admins see a single look across browse, edit, and search.
 */
.clp-field input[type="text"],
.clp-field input[type="email"],
.clp-field input[type="tel"],
.clp-field input[type="url"],
.clp-field input[type="password"],
.clp-field input[type="search"],
.clp-field input[type="number"],
.clp-field input[type="date"],
.clp-field input[type="time"],
.clp-field input[type="datetime-local"],
.clp-field input[type="month"],
.clp-field input[type="week"],
.clp-field textarea,
.clp-field select,
.clp-filterbar input[type="text"],
.clp-filterbar input[type="email"],
.clp-filterbar input[type="search"],
.clp-filterbar input[type="number"],
.clp-filterbar input[type="date"],
.clp-filterbar select {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
	padding: 9px 11px;
	font: inherit;
	background: #fff;
	color: var(--clp-text);
	line-height: 1.4;
	transition: border-color .12s ease, box-shadow .12s ease;
	-webkit-appearance: none;
	appearance: none;
}
/* number inputs keep their spinners — undo the appearance: none for them */
.clp-field input[type="number"],
.clp-filterbar input[type="number"] {
	-webkit-appearance: auto;
	appearance: auto;
}
/* datetime-local / date / time: keep the native picker icon (Chrome shows a
   calendar/clock on the right). We just need consistent height so the field
   doesn't look shorter than its <select> neighbors. */
.clp-field input[type="date"],
.clp-field input[type="time"],
.clp-field input[type="datetime-local"],
.clp-field input[type="month"],
.clp-field input[type="week"],
.clp-filterbar input[type="date"] {
	-webkit-appearance: auto;
	appearance: auto;
	min-height: 40px;
}
.clp-field input[type="date"]::-webkit-calendar-picker-indicator,
.clp-field input[type="time"]::-webkit-calendar-picker-indicator,
.clp-field input[type="datetime-local"]::-webkit-calendar-picker-indicator {
	cursor: pointer;
	opacity: 0.6;
}
.clp-field input[type="date"]:hover::-webkit-calendar-picker-indicator,
.clp-field input[type="time"]:hover::-webkit-calendar-picker-indicator,
.clp-field input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator {
	opacity: 1;
}
/* selects: re-introduce a chevron since we suppressed the OS arrow */
.clp-field select,
.clp-filterbar select {
	padding-right: 32px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%23475569' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: right 11px center;
	background-size: 12px 8px;
}
/* Filter-bar inputs shouldn't stretch full width — they live inline. */
.clp-filterbar input[type="text"],
.clp-filterbar input[type="email"],
.clp-filterbar input[type="search"],
.clp-filterbar input[type="number"],
.clp-filterbar input[type="date"],
.clp-filterbar select {
	width: auto;
	padding-top: 7px;
	padding-bottom: 7px;
}
/* max-content forces a <select> to reserve room for its WIDEST <option>,
   not just the currently-selected option's text. Without this, Safari
   (and some mobile browsers) clip long committee / document-group names. */
.clp-filterbar select {
	min-width: max-content;
}
.clp-field input:focus,
.clp-field textarea:focus,
.clp-field select:focus,
.clp-filterbar input:focus,
.clp-filterbar select:focus {
	outline: none;
	border-color: var(--clp-primary);
	box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}

/*
 * File inputs are tricky — the field itself can't be fully styled, but the
 * button portion can via ::file-selector-button (modern browsers, all
 * evergreen as of 2024). Treating the button like a .clp-btn keeps the
 * upload UI on-brand.
 */
.clp-field input[type="file"] {
	display: block;
	width: 100%;
	padding: 6px;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
	background: #fff;
	font: inherit;
	color: var(--clp-text-muted);
}
.clp-field input[type="file"]:focus {
	outline: none;
	border-color: var(--clp-primary);
	box-shadow: 0 0 0 3px rgba(29, 78, 216, .15);
}
.clp-field input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 7px 14px;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
	background: #fff;
	color: var(--clp-text);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	transition: background .12s ease, border-color .12s ease;
}
.clp-field input[type="file"]::file-selector-button:hover {
	background: #f1f5f9;
	border-color: var(--clp-primary);
	color: var(--clp-primary);
}

/* Checkbox + radio: bigger hit targets, brand-color accent. */
.clp-field input[type="checkbox"],
.clp-field input[type="radio"],
.clp-checkbox input[type="checkbox"],
.clp-checkbox input[type="radio"],
.clp-privacy input[type="radio"],
.clp-checkbox-grid input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--clp-primary);
	cursor: pointer;
	vertical-align: middle;
}

/* Inline checkboxes that appear inside admin tables (e.g. chair-role
   assignment) get the same accent and a centered hit target. */
.clp-table input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--clp-primary);
	cursor: pointer;
	vertical-align: middle;
}

.clp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.clp-checkbox { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 14px; cursor: pointer; }
.clp-req { color: var(--clp-danger); }

/* Helper text under fields */
.clp-field small {
	display: block;
	margin-top: 4px;
	color: var(--clp-text-muted);
	font-size: 12px;
}

.clp-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }

.clp-btn {
	display: inline-block;
	padding: 9px 16px;
	border-radius: var(--clp-radius);
	border: 1px solid var(--clp-border);
	background: #fff;
	color: var(--clp-text);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	transition: background .12s ease, border-color .12s ease;
}
.clp-btn:hover { background: #f1f5f9; }
.clp-btn-primary { background: var(--clp-primary); border-color: var(--clp-primary); color: #fff; }
.clp-btn-primary:hover { background: var(--clp-primary-hover); border-color: var(--clp-primary-hover); }
.clp-btn-ghost { border-color: transparent; color: var(--clp-text-muted); background: transparent; }

.clp-link { color: var(--clp-primary); text-decoration: none; font-weight: 500; }
.clp-link:hover { text-decoration: underline; }

.clp-alert { padding: 12px 14px; border-radius: var(--clp-radius); margin-bottom: 14px; font-size: 14px; }
.clp-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.clp-alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.clp-filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.clp-filterbar input[type="search"], .clp-filterbar select {
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
	padding: 7px 10px;
	font: inherit;
}

.clp-member-card { display: flex; gap: 14px; align-items: center; }
.clp-member-card h3 { margin: 0 0 2px; font-size: 15px; }
.clp-member-photo img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.clp-photo-placeholder {
	width: 64px; height: 64px; border-radius: 50%;
	background: #e2e8f0; color: #475569;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 24px;
}
.clp-photo-large { width: 120px; height: 120px; font-size: 42px; }
.clp-pronouns { font-size: 12px; color: var(--clp-text-muted); margin: 0 0 2px; }

.clp-profile-header { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.clp-profile-photo img { width: 120px; height: 120px; border-radius: 14px; object-fit: cover; }

.clp-dl { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; margin: 0; }
.clp-dl dt { color: var(--clp-text-muted); font-size: 13px; font-weight: 600; }
.clp-dl dd { margin: 0; }

.clp-field-with-privacy { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: start; margin-bottom: 16px; }
.clp-field-with-privacy .clp-field { margin-bottom: 0; }
.clp-privacy { border: 1px solid var(--clp-border); border-radius: var(--clp-radius); padding: 8px 10px; font-size: 13px; }
.clp-privacy legend { font-weight: 600; padding: 0 4px; color: var(--clp-text-muted); font-size: 12px; }
.clp-privacy label { display: block; margin: 2px 0; }

.clp-photo-picker { display: flex; gap: 14px; align-items: center; }
.clp-photo-picker .clp-photo-placeholder, .clp-photo-picker img { width: 80px; height: 80px; border-radius: 12px; font-size: 28px; object-fit: cover; }

.clp-error-code { font-size: 56px; font-weight: 800; color: var(--clp-faint); margin: 0; line-height: 1; }
.clp-error h1 { margin-top: 4px; }

@media (max-width: 768px) {
	.clp-topbar .clp-container { flex-wrap: wrap; }
	.clp-nav-toggle { display: flex; }
	/* Hide the portal nav by default; the toggle opens it as a stacked panel
	   that spans the full width below the brand + toggle row. */
	.clp-nav {
		display: none;
		flex-basis: 100%;
		flex-direction: column;
		gap: 4px;
		margin-left: 0;
		margin-top: 8px;
		padding-top: 8px;
		border-top: 1px solid var(--clp-border);
	}
	.clp-nav.is-open { display: flex; }
	.clp-nav a {
		padding: 10px 4px;
		font-size: 15px;
	}
	.clp-nav a.clp-nav-admin {
		align-self: flex-start;
		margin-top: 4px;
	}
}

@media (max-width: 640px) {
	.clp-field-row, .clp-field-with-privacy { grid-template-columns: 1fr; }
	.clp-dl { grid-template-columns: 1fr; gap: 2px 0; }
	.clp-dl dd { margin-bottom: 8px; }
}

/* ---------- Admin section (0.7.0) ---------- */

.clp-subnav {
	display: flex;
	gap: 2px;
	flex-wrap: wrap;
	background: var(--clp-brand-green);
	border-radius: var(--clp-radius);
	padding: 4px;
	margin: 0 0 20px;
}
.clp-subnav-item {
	padding: 9px 16px;
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	letter-spacing: .04em;
	text-transform: uppercase;
	border-radius: calc(var(--clp-radius) - 2px);
	transition: background-color .12s ease;
}
.clp-subnav-item:hover {
	background: rgba(255, 255, 255, .12);
	color: #ffffff;
}
.clp-subnav-item.is-active {
	background: var(--clp-brand-green-mid);
	color: #ffffff;
}

.clp-tabs {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	border-bottom: 1px solid var(--clp-border);
	margin: 4px 0 16px;
}
.clp-tab {
	padding: 8px 14px;
	color: var(--clp-text-muted);
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}
.clp-tab:hover { color: var(--clp-primary); }
.clp-tab.is-active { color: var(--clp-primary); border-bottom-color: var(--clp-primary); }
.clp-tab-count { color: var(--clp-faint); font-weight: 400; margin-left: 2px; }

.clp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.clp-table th, .clp-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid var(--clp-border);
}
.clp-table th {
	background: #f8fafc;
	font-weight: 600;
	font-size: 13px;
	color: var(--clp-text-muted);
}
.clp-table tr:hover { background: #fafbfc; }
.clp-table code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px; font-size: 12px; }

.clp-stat-card { text-align: left; }
.clp-stat-label {
	margin: 0 0 4px;
	color: var(--clp-text-muted);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.clp-stat-value {
	margin: 0;
	font-size: 36px;
	font-weight: 700;
	color: var(--clp-text);
	line-height: 1.1;
}

.clp-row-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}
.clp-row-between h1 { margin: 0; }

.clp-side-by-side {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 24px;
	align-items: start;
}
@media (max-width: 640px) {
	.clp-side-by-side { grid-template-columns: 1fr; }
}

.clp-checkbox-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 6px 14px;
	padding: 8px 0;
}

.clp-btn-small { padding: 5px 10px; font-size: 13px; }
.clp-btn-danger { background: var(--clp-danger); border-color: var(--clp-danger); color: #fff; }
.clp-btn-danger:hover { background: #991b1b; border-color: #991b1b; }
.clp-btn-danger-text { color: var(--clp-danger); }
.clp-btn-danger-text:hover { color: #991b1b; background: #fef2f2; }

.clp-alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---------- Events (1.1.0) ---------- */

.clp-month { font-size: 16px; color: var(--clp-text-muted); margin: 0 0 12px; }
.clp-month-past { font-size: 14px; color: var(--clp-faint); margin: 16px 0 8px; }

.clp-event-list { display: flex; flex-direction: column; gap: 10px; }

.clp-event-card {
	display: flex;
	gap: 16px;
	padding: 14px;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: border-color .12s ease, box-shadow .12s ease;
}
.clp-event-card:hover { border-color: var(--clp-primary); box-shadow: var(--clp-shadow-md); }
.clp-event-card.is-cancelled { opacity: 0.6; }
.clp-event-card.is-cancelled .clp-event-day { color: var(--clp-danger); }

.clp-event-when {
	flex: 0 0 80px;
	text-align: center;
	padding: 6px 0;
	background: #f8fafc;
	border-radius: var(--clp-radius);
}
.clp-event-day { font-weight: 700; font-size: 14px; color: var(--clp-text); }
.clp-event-time { font-size: 12px; color: var(--clp-text-muted); }

.clp-event-body h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; }

.clp-event-description { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--clp-border); }
.clp-event-description p { margin: 0 0 10px; }

.clp-pill {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: #f1f5f9;
	color: var(--clp-text-muted);
}
.clp-pill-published { background: #d1fae5; color: #065f46; }
.clp-pill-draft     { background: #fef3c7; color: #92400e; }
.clp-pill-cancelled { background: #fecaca; color: #991b1b; }

.clp-rsvp-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.clp-rsvp-buttons .clp-btn { min-width: 130px; }

.clp-slot-list { display: flex; flex-direction: column; gap: 8px; }
.clp-slot {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 14px;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
}
.clp-slot.is-mine { border-color: var(--clp-accent); background: #f0fdf4; }
.clp-slot.is-full { background: #f8fafc; opacity: 0.7; }
.clp-slot-info { flex: 1 1 auto; }
.clp-slot-info strong { display: block; margin-bottom: 2px; }
.clp-slot-info .clp-meta { margin-top: 2px; }
.clp-slot-action { flex: 0 0 auto; }

.clp-notes { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.clp-note {
	padding: 12px 14px;
	background: #f8fafc;
	border-radius: var(--clp-radius);
	border-left: 3px solid var(--clp-primary);
}
.clp-note-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.clp-note p { margin: 0; }

.clp-bare { list-style: none; margin: 0; padding: 0; }
.clp-bare li { padding: 4px 0; border-bottom: 1px solid var(--clp-border); }
.clp-bare li:last-child { border-bottom: 0; }

@media (max-width: 640px) {
	.clp-event-card { flex-direction: column; gap: 8px; }
	.clp-event-when { flex: 0 0 auto; display: flex; gap: 12px; padding: 8px 14px; text-align: left; }
	.clp-slot { flex-direction: column; align-items: flex-start; }
}

/* ---------- Documents (1.4.0) ---------- */

.clp-doc-row { display: flex; gap: 16px; align-items: center; }
.clp-doc-meta { flex: 1 1 auto; }
.clp-doc-action { flex: 0 0 auto; }
.clp-tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.clp-tag {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	background: #eff6ff;
	color: #1e40af;
}

@media (max-width: 640px) {
	.clp-doc-row { flex-direction: column; align-items: flex-start; }
}

/* ---------- Drag-and-drop reorder (1.5.0) ---------- */

[data-clp-reorder] tbody tr[draggable="true"] { cursor: grab; }
[data-clp-reorder] tbody tr[draggable="true"]:active { cursor: grabbing; }
[data-clp-reorder] tbody tr.is-dragging { opacity: 0.4; background: #eff6ff; }

.clp-drag-handle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	color: var(--clp-faint);
	-webkit-user-select: none;
	user-select: none;
	font-size: 16px;
	line-height: 1;
}
[data-clp-reorder] tbody tr:hover .clp-drag-handle { color: var(--clp-primary); }
.clp-drag-handle-col { width: 28px; text-align: center; padding-right: 0 !important; }

/* Tiny status pill, bottom-right, used by drag-drop save feedback. */
.clp-status-pill {
	position: fixed;
	right: 20px;
	bottom: 20px;
	padding: 10px 16px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	box-shadow: var(--clp-shadow-md);
	z-index: 9999;
	display: none;
}
.clp-status-pill.is-ok      { background: #d1fae5; color: #065f46; }
.clp-status-pill.is-error   { background: #fecaca; color: #991b1b; }
.clp-status-pill.is-pending { background: #fef3c7; color: #92400e; }

/* ---------- Avatar rows (1.7.0) ---------- */

/*
 * Stacked circular avatars. Subsequent avatars overlap the previous one with
 * a small negative margin and a white ring (via box-shadow) to keep them
 * legible. Used on the event-detail page next to the Going count and inside
 * each task slot.
 */
.clp-avatar-row {
	display: inline-flex;
	align-items: center;
	margin-top: 6px;
	padding-left: 4px; /* compensate for the overlap on the first item */
}
.clp-avatar-row .clp-avatar { margin-left: -6px; }
.clp-avatar-row .clp-avatar:first-child { margin-left: 0; }

.clp-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	overflow: hidden;
	background: #e2e8f0;
	color: #475569;
	font-weight: 700;
	font-size: 13px;
	text-decoration: none;
	box-shadow: 0 0 0 2px #fff;
	transition: transform .12s ease, box-shadow .12s ease;
	flex-shrink: 0;
	position: relative;
}
.clp-avatar:hover {
	transform: translateY(-2px) scale(1.08);
	box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(15, 23, 42, .12);
	z-index: 2;
}
.clp-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.clp-avatar-initial {
	line-height: 1;
}
.clp-avatar-overflow {
	background: #f1f5f9;
	color: var(--clp-text-muted);
	font-size: 12px;
	font-weight: 600;
	cursor: default;
}
.clp-avatar-overflow:hover { transform: none; box-shadow: 0 0 0 2px #fff; }

/* When the avatar row sits inside the .clp-dl <dd>, give it its own line so
   it doesn't crowd the count text. */
.clp-dl dd .clp-avatar-row { display: flex; flex-wrap: wrap; }

/* ---------- Public [clp_events] shortcode (1.6.0) ---------- */

/* Lives inside the host theme's content area, so we don't reset body / topbar
   chrome. Just scope everything to .clp-shortcode-events. */
.clp-shortcode-events { margin: 1em 0; }
.clp-shortcode-events-heading { margin: 0 0 12px; font-size: 22px; }
.clp-shortcode-events-empty { color: var(--clp-text-muted); }
.clp-shortcode-events-past-heading { margin: 24px 0 8px; font-size: 16px; color: var(--clp-text-muted); }

/* Inner <ul> wrapper holding cards. The outer .clp-shortcode-events-list is
   now a generic container (data-clp-events-list) that can be hidden when a
   detail panel is showing. */
.clp-shortcode-events-ul {
	list-style: none;
	margin: 0 0 14px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.clp-shortcode-events-past .clp-shortcode-event-link { opacity: 0.75; }

/* In-place detail panel (1.9.0, polished 1.10.0). One per event, hidden
   until JS reveals. */
.clp-shortcode-event-detail {
	padding: 28px;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius-lg);
	background: #fff;
	box-shadow: var(--clp-shadow);
}
.clp-shortcode-event-detail[hidden] { display: none; }

/* Back button: text-link with arrow, no chrome. Matches the "← All events"
   style used on the authenticated event-detail page so the interaction reads
   the same in both contexts. */
.clp-shortcode-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 18px;
	padding: 4px 0;
	background: transparent;
	border: 0;
	color: var(--clp-primary);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
}
.clp-shortcode-back:hover,
.clp-shortcode-back:focus-visible {
	text-decoration: underline;
	outline: none;
}
.clp-shortcode-back span[aria-hidden] { font-size: 16px; line-height: 1; }

/* Two-column layout for event details (1.10.2). Info on the left, image
   on the right at ~320px on desktop. Below the 720px breakpoint the layout
   collapses to a single column with info on top, image below.
   .is-imageless modifier collapses the image column when the event has no
   image so the info isn't constrained to half-width unnecessarily. */
.clp-event-layout,
.clp-shortcode-event-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	align-items: start;
}
@media (min-width: 720px) {
	.clp-event-layout,
	.clp-shortcode-event-layout {
		grid-template-columns: minmax(0, 1fr) 320px;
	}
	.clp-event-layout.is-imageless,
	.clp-shortcode-event-layout.is-imageless {
		grid-template-columns: 1fr;
	}
}
.clp-event-info,
.clp-shortcode-event-info { min-width: 0; }

/* Image column. Maintains a 4:3 aspect on desktop so any source ratio
   renders as a predictable card-shape. object-fit: cover crops cleanly. */
.clp-event-image-col,
.clp-shortcode-event-image-col {
	width: 100%;
}
.clp-shortcode-event-image,
.clp-event-hero-image {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--clp-radius);
	margin: 0;
}
/* On narrow screens, give the image a sensible height cap so it doesn't
   take over the viewport. */
@media (max-width: 719px) {
	.clp-shortcode-event-image,
	.clp-event-hero-image {
		aspect-ratio: auto;
		max-height: 280px;
	}
}

.clp-shortcode-event-detail .clp-shortcode-event-title {
	font-size: 26px;
	font-weight: 700;
	color: var(--clp-text);
	line-height: 1.25;
	margin: 0 0 14px;
}

/* Meta strip: label/value pairs as flex columns with a subtle divider below. */
.clp-shortcode-event-meta {
	list-style: none;
	margin: 0 0 18px;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--clp-border);
	display: flex;
	flex-wrap: wrap;
	gap: 14px 32px;
}
.clp-shortcode-event-meta li { display: flex; flex-direction: column; gap: 2px; }
.clp-shortcode-event-meta-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--clp-text-muted);
}
.clp-shortcode-event-meta-value { font-size: 15px; color: var(--clp-text); }

.clp-shortcode-event-description {
	margin: 0 0 20px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--clp-text);
}
.clp-shortcode-event-description p { margin: 0 0 12px; }
.clp-shortcode-event-description p:last-child { margin-bottom: 0; }

.clp-shortcode-event-rsvp-cta {
	margin: 0;
	padding: 14px 16px;
	background: var(--clp-bg);
	border-radius: var(--clp-radius);
	font-size: 14px;
	color: var(--clp-text-muted);
}
.clp-shortcode-event-rsvp-cta a {
	color: var(--clp-primary);
	font-weight: 600;
	text-decoration: none;
}
.clp-shortcode-event-rsvp-cta a:hover { text-decoration: underline; }

@media (max-width: 540px) {
	.clp-shortcode-event-detail { padding: 18px; }
	.clp-shortcode-event-detail .clp-shortcode-event-title { font-size: 22px; }
}

/* ---------- Admin Help page (1.11.0) ---------- */

.clp-help h2 {
	margin: 0 0 6px;
	font-size: 22px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--clp-primary);
	display: inline-block;
}
.clp-help h3 {
	margin: 24px 0 8px;
	font-size: 16px;
	color: var(--clp-text);
}
.clp-help h3:first-of-type { margin-top: 18px; }
.clp-help ol {
	margin: 0 0 8px;
	padding-left: 22px;
	line-height: 1.6;
}
.clp-help ol li { margin-bottom: 4px; }
.clp-help code {
	background: #f1f5f9;
	color: #1e293b;
	padding: 1px 6px;
	border-radius: 4px;
	font-size: 13px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.clp-help-toc {
	margin-top: 12px;
	padding: 12px 14px;
	background: var(--clp-bg);
	border-radius: var(--clp-radius);
	font-size: 14px;
}
.clp-help-toc a {
	color: var(--clp-primary);
	text-decoration: none;
	font-weight: 500;
}
.clp-help-toc a:hover { text-decoration: underline; }

/* Admin event-image preview keeps the same square shape as profile photo. */
.clp-event-image-preview { width: 80px; height: 80px; border-radius: 12px; overflow: hidden; }
.clp-event-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.clp-shortcode-event { margin: 0; padding: 0; }
.clp-shortcode-event-link {
	display: flex;
	gap: 16px;
	padding: 14px;
	border: 1px solid var(--clp-border);
	border-radius: var(--clp-radius);
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: border-color .12s ease, box-shadow .12s ease;
}
.clp-shortcode-event-link:hover { border-color: var(--clp-primary); box-shadow: var(--clp-shadow-md); }

.clp-shortcode-event-when {
	flex: 0 0 110px;
	padding: 6px 10px;
	background: #f8fafc;
	border-radius: var(--clp-radius);
	text-align: center;
}
.clp-shortcode-event-date {
	font-weight: 700;
	font-size: 14px;
	color: var(--clp-text);
	margin: 0;
}
.clp-shortcode-event-time {
	font-size: 12px;
	color: var(--clp-text-muted);
	margin: 2px 0 0;
}
.clp-shortcode-event-body { flex: 1 1 auto; min-width: 0; }
.clp-shortcode-event-title {
	margin: 0 0 4px;
	font-size: 16px;
	font-weight: 600;
	color: var(--clp-text);
}
.clp-shortcode-event-location,
.clp-shortcode-event-excerpt {
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--clp-text-muted);
	line-height: 1.4;
}
.clp-shortcode-event-excerpt { color: var(--clp-text); }

@media (max-width: 540px) {
	.clp-shortcode-event-link { flex-direction: column; gap: 8px; }
	.clp-shortcode-event-when {
		flex: 0 0 auto;
		display: inline-flex;
		gap: 10px;
		padding: 6px 12px;
		text-align: left;
	}
}


