/* File path: /plugins/afed-communications/assets/css/portal.css */

/* =======================================================================
   AFED DESIGN SYSTEM - structural tokens (redesign session)
   =======================================================================
   Brand colors (--afed-primary/--afed-accent) come from the Membership
   plugin's portal.css, which always loads first in the shared portal
   shell - not redeclared here.
   ======================================================================= */
:root {
	--afed-bg: #f3f4f6;
	--afed-surface: #ffffff;
	--afed-surface-alt: #f6f7f9;
	--afed-border: #e2e4e9;
	--afed-border-strong: #cbd0d8;
	--afed-text: #1a1d29;
	--afed-text-muted: #5b6270;
	--afed-text-faint: #8b93a1;
	--afed-primary-tint: #eef1f8;
	--afed-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.04);
	--afed-radius: 10px;
	--afed-radius-sm: 6px;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--afed-bg: #12141c;
		--afed-surface: #1a1d29;
		--afed-surface-alt: #21242f;
		--afed-border: #2e3240;
		--afed-border-strong: #3a3f4f;
		--afed-text: #e8e9ed;
		--afed-text-muted: #a3a9b8;
		--afed-text-faint: #767c8c;
		--afed-primary-tint: #232a3f;
		--afed-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.25);
	}
}

[data-theme="dark"] {
	--afed-bg: #12141c;
	--afed-surface: #1a1d29;
	--afed-surface-alt: #21242f;
	--afed-border: #2e3240;
	--afed-border-strong: #3a3f4f;
	--afed-text: #e8e9ed;
	--afed-text-muted: #a3a9b8;
	--afed-text-faint: #767c8c;
	--afed-primary-tint: #232a3f;
	--afed-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.25);
}
/* ======================================================================= */

/*
 * BUG FIX (form controls session): this was flex-wrap + a fixed
 * min-width per ROW - on a narrow screen, flexbox wraps rows into new
 * lines using the CONTAINER's available width divided awkwardly against
 * each row's min-width, and rows can end up visually overlapping the row
 * above/below rather than cleanly stacking. Grid with auto-fill/minmax
 * doesn't have this failure mode - it always computes a clean column
 * count from the container's actual width, so rows never collide.
 */
.afed-comm-checkbox-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 12px 16px;
	background: var(--afed-surface);
	border: 1px solid var(--afed-border);
	border-radius: var(--afed-radius);
	padding: 14px 18px;
	margin: 6px 0 18px;
	max-height: 280px;
	overflow-y: auto;
}

.afed-comm-checkbox-row {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: normal;
	margin: 0;
	min-width: 0; /* Lets the label truncate/wrap inside its grid cell instead of forcing the row wider than the cell. */
}

.afed-comm-checkbox-row span,
.afed-comm-checkbox-row {
	overflow-wrap: anywhere;
}

/* ADDED (checkbox UX session): the Select All/Deselect All button pair
   above each checkbox section. */
.afed-comm-select-all-row {
	display: flex;
	gap: 8px;
	margin: 6px 0 4px;
}

/* ADDED (merge-tag insert buttons session): the row of "insert at
   cursor" tag buttons under a Message textarea. */
.afed-comm-tag-buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
}

.afed-comm-tag-buttons-label {
	font-size: 12px;
	color: var(--afed-text-muted);
	margin-right: 2px;
}

.afed-comm-tag-button {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	border: 1px solid var(--afed-border-strong);
	background: var(--afed-surface);
	color: var(--afed-text);
	font-size: 12px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.afed-comm-tag-button:hover {
	background: var(--afed-primary-tint);
	border-color: var(--afed-accent);
}
