/* ============================================================================
   NNN Member Directory — Frontend CSS
   ============================================================================
   Design rules:
   - All backgrounds: crisp white (#FFFFFF)
   - Text: grey (no black, no charcoal)
   - Accents: NNN green (#7EBB3E / #4F8418)
   - Cards lift gently on hover, organisation logo overlays bottom-left of photo.
   - Postcard modal opens in place for full profile.
   ============================================================================ */

.nnn-md-section {
	--md-bg:        #FFFFFF;
	--md-bg-soft:   #FAFAFA;
	--md-heading:   #4A4A4A;
	--md-body:      #555555;
	--md-soft:      #7A7A7A;
	--md-line:      #E8E8E8;
	--md-line-soft: #F1F1F1;
	--md-green:     #7EBB3E;
	--md-green-dk:  #4F8418;
	--md-green-pale:#F4F9EB;
	--md-r:         12px;
	--md-r-md:      18px;
	--md-r-lg:      24px;

	background: var(--md-bg);
	padding: 48px 0 72px;
	color: var(--md-body);
	font-family: 'Lato', system-ui, -apple-system, sans-serif;
	box-sizing: border-box;
}
@media (min-width: 700px)  { .nnn-md-section { padding: 64px 0 88px; } }
@media (min-width: 1100px) { .nnn-md-section { padding: 88px 0 112px; } }

.nnn-md-section *,
.nnn-md-section *::before,
.nnn-md-section *::after { box-sizing: border-box; }

.nnn-md-section img { max-width: 100%; height: auto; display: block; }

.nnn-md-container {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 24px;
	width: 100%;
	position: relative;
}
@media (min-width: 700px) { .nnn-md-container { padding: 0 32px; } }

/* ━━━ TOOLBAR (filter + sort) ━━━ */
.nnn-md-toolbar {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-bottom: 24px;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--md-line);
}
@media (min-width: 800px) {
	.nnn-md-toolbar {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 24px;
	}
}

.nnn-md-filter {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	flex-wrap: wrap;
	min-width: 0;
	flex: 1;
}
.nnn-md-filter-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--md-soft);
	padding-top: 8px;
	white-space: nowrap;
}
.nnn-md-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-width: 0;
}
.nnn-md-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px 6px 13px;
	border: 1.5px solid var(--md-line);
	border-radius: 50px;
	background: var(--md-bg);
	color: var(--md-body);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	transition: all .2s;
	white-space: nowrap;
	line-height: 1.2;
}
.nnn-md-chip:hover {
	border-color: var(--md-green);
	color: var(--md-heading);
}
.nnn-md-chip.is-active {
	background: var(--md-heading);
	border-color: var(--md-heading);
	color: var(--md-bg);
}
.nnn-md-chip-count {
	font-size: 11px;
	font-weight: 700;
	padding: 1px 7px;
	border-radius: 50px;
	background: var(--md-bg-soft);
	color: var(--md-soft);
}
.nnn-md-chip.is-active .nnn-md-chip-count {
	background: rgba(255,255,255,.18);
	color: var(--md-bg);
}

.nnn-md-sort {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.10em;
	text-transform: uppercase;
	color: var(--md-soft);
	flex-shrink: 0;
}
.nnn-md-sort select {
	border: 1.5px solid var(--md-line);
	border-radius: 8px;
	padding: 7px 28px 7px 12px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--md-heading);
	background: var(--md-bg);
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
	min-height: 36px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7A7A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 10px center;
}
.nnn-md-sort select:focus {
	outline: none;
	border-color: var(--md-green);
	box-shadow: 0 0 0 3px rgba(126,187,62,.15);
}

/* ━━━ v1.5.0 — search box + multi-filter row ━━━ */
.nnn-md-toolbar { flex-direction: column; align-items: stretch; }
@media (min-width: 800px) { .nnn-md-toolbar { flex-direction: column; align-items: stretch; } }

.nnn-md-search {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	border: 1.5px solid var(--md-line);
	border-radius: 50px;
	background: var(--md-bg);
	color: var(--md-soft);
	transition: border-color .2s, box-shadow .2s;
}
.nnn-md-search:focus-within { border-color: var(--md-green); box-shadow: 0 0 0 3px rgba(126,187,62,.15); }
.nnn-md-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.nnn-md-search input {
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	font-size: 14.5px;
	color: var(--md-heading);
	width: 100%;
}

.nnn-md-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 16px 24px;
}
.nnn-md-filters .nnn-md-filter { flex: 0 1 auto; }
@media (min-width: 800px) { .nnn-md-filters .nnn-md-sort { margin-left: auto; } }

.nnn-md-filter--select {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
}
.nnn-md-filter--select .nnn-md-filter-label { padding-top: 0; }
.nnn-md-filter--select select {
	border: 1.5px solid var(--md-line);
	border-radius: 8px;
	padding: 7px 28px 7px 12px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	color: var(--md-heading);
	background: var(--md-bg);
	cursor: pointer;
	min-height: 36px;
	max-width: 240px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7A7A' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 10px center;
}
.nnn-md-filter--select select:focus { outline: none; border-color: var(--md-green); box-shadow: 0 0 0 3px rgba(126,187,62,.15); }

/* ━━━ GRID ━━━ */
.nnn-md-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}
@media (min-width: 700px)  { .nnn-md-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1000px) { .nnn-md-grid--cols-4 { grid-template-columns: repeat(4, 1fr); gap: 22px; } }
@media (min-width: 1000px) { .nnn-md-grid--cols-3 { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
@media (min-width: 1000px) { .nnn-md-grid--cols-2 { grid-template-columns: repeat(2, 1fr); gap: 22px; } }

/* ━━━ CARD ━━━ */
.nnn-md-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--md-bg);
	border: 1.5px solid var(--md-line);
	border-radius: var(--md-r-md);
	padding: 0;
	overflow: hidden;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
	transition: transform .25s cubic-bezier(.2,.8,.2,1),
				box-shadow .25s cubic-bezier(.2,.8,.2,1),
				border-color .25s;
	isolation: isolate;
}
.nnn-md-card:hover,
.nnn-md-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 20px 40px -20px rgba(42,42,42,.16);
	border-color: var(--md-green);
	outline: none;
}
.nnn-md-card:focus-visible {
	box-shadow: 0 0 0 3px rgba(126,187,62,.30), 0 20px 40px -20px rgba(42,42,42,.16);
}

.nnn-md-card-photo {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 5;
	background: var(--md-bg-soft);
	overflow: hidden;
}
.nnn-md-card-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.nnn-md-card:hover .nnn-md-card-photo img,
.nnn-md-card:focus-visible .nnn-md-card-photo img {
	transform: scale(1.04);
}
.nnn-md-card-photo-empty {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #C8C8C8;
	background: var(--md-bg-soft);
}
.nnn-md-card-photo-empty svg { width: 48px; height: 48px; }

/* Organisation logo overlay in bottom-left of profile photo */
.nnn-md-card-logo {
	position: absolute;
	left: 12px;
	bottom: 12px;
	width: 44px;
	height: 44px;
	background: var(--md-bg);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 5px;
	box-shadow: 0 4px 12px -2px rgba(0,0,0,.18);
	z-index: 1;
}
.nnn-md-card-logo img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Executive committee flag - top right */
.nnn-md-card-flag {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px 4px 8px;
	background: var(--md-green);
	color: var(--md-heading);
	border-radius: 50px;
	font-size: 10px;
	font-weight: 900;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	box-shadow: 0 4px 10px -3px rgba(0,0,0,.18);
}

.nnn-md-card-body {
	padding: 18px 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}
@media (min-width: 1000px) {
	.nnn-md-card-body { padding: 22px 22px 24px; }
}
.nnn-md-card-name {
	font-family: inherit;
	font-size: 16px;
	font-weight: 900;
	letter-spacing: -.005em;
	line-height: 1.25;
	color: var(--md-heading);
	margin: 0 0 4px;
}
@media (min-width: 1000px) {
	.nnn-md-card-name { font-size: 17px; }
}
.nnn-md-card-role {
	font-size: 13px;
	color: var(--md-body);
	margin: 0;
	line-height: 1.45;
}
.nnn-md-card-org {
	font-size: 12.5px;
	color: var(--md-soft);
	margin: 4px 0 0;
	line-height: 1.45;
	font-weight: 600;
}

/* ━━━ EMPTY STATES ━━━ */
.nnn-md-empty,
.nnn-md-empty-filter {
	text-align: center;
	padding: 40px 24px;
	background: var(--md-bg-soft);
	border: 1px dashed var(--md-line);
	border-radius: var(--md-r-md);
	margin: 32px 0;
	color: var(--md-soft);
}
.nnn-md-empty h2 {
	font-family: inherit;
	font-size: 18px;
	font-weight: 900;
	color: var(--md-heading);
	margin: 0 0 8px;
}
.nnn-md-empty p {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.6;
}
.nnn-md-empty-filter {
	padding: 32px 20px;
	font-size: 14px;
	font-weight: 600;
	color: var(--md-body);
}
.nnn-md-reset-link {
	border: 0;
	background: transparent;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--md-green-dk);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	padding: 0;
}
.nnn-md-reset-link:hover { color: var(--md-heading); }

/* ============================================================================
   MODAL (postcard-style)
   ============================================================================ */
.nnn-md-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(42,42,42,.50);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	z-index: 9998;
	opacity: 0;
	transition: opacity .25s;
}
.nnn-md-backdrop.is-open { opacity: 1; }
.nnn-md-backdrop[hidden] { display: none; }


/* ---------------------------------------------------------------------------
   Modal tokens.

   The dialog and backdrop are relocated to <body> on load (so the rest of the
   page can be marked inert while they are open). That move takes them out of
   .nnn-md-section, which is where these custom properties are declared — so
   without repeating them here every var() in the modal resolves to nothing and
   the card renders with no background at all.

   Declared on the elements themselves rather than :root, to avoid leaking
   generically named --md-* tokens into the rest of the page.
   ------------------------------------------------------------------------- */
.nnn-md-modal,
.nnn-md-backdrop {
	--md-bg:        #FFFFFF;
	--md-bg-soft:   #FAFAFA;
	--md-heading:   #4A4A4A;
	--md-body:      #555555;
	--md-soft:      #7A7A7A;
	--md-line:      #E8E8E8;
	--md-line-soft: #F1F1F1;
	--md-green:     #7EBB3E;
	--md-green-dk:  #4F8418;
	--md-green-pale:#F4F9EB;
	--md-r:         12px;
	--md-r-md:      18px;
	--md-r-lg:      24px;

	font-family: 'Lato', system-ui, -apple-system, sans-serif;
	color: var(--md-body);
	box-sizing: border-box;
}
.nnn-md-modal *,
.nnn-md-modal *::before,
.nnn-md-modal *::after { box-sizing: border-box; }

/* Explicit fallback: if a token is ever missing again, the card is still white
   rather than invisible. */
.nnn-md-modal { background: var(--md-bg, #FFFFFF); }

.nnn-md-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -48%);
	width: calc(100% - 32px);
	max-width: 880px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	background: var(--md-bg);
	border-radius: var(--md-r-lg);
	box-shadow: 0 40px 80px -20px rgba(42,42,42,.30);
	z-index: 9999;
	opacity: 0;
	transition: opacity .3s, transform .3s cubic-bezier(.2,.8,.2,1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.nnn-md-modal.is-open {
	opacity: 1;
	transform: translate(-50%, -50%);
}
.nnn-md-modal[hidden] { display: none; }

.nnn-md-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: var(--md-bg);
	color: var(--md-heading);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	transition: background .2s, color .2s, transform .2s;
	box-shadow: 0 4px 12px -2px rgba(0,0,0,.15);
}
.nnn-md-modal-close:hover,
.nnn-md-modal-close:focus-visible {
	background: var(--md-heading);
	color: var(--md-bg);
	outline: none;
	transform: rotate(90deg);
}

.nnn-md-modal-grid {
	display: grid;
	grid-template-columns: 1fr;
	overflow: hidden;
	max-height: inherit;
}
@media (min-width: 750px) {
	.nnn-md-modal-grid {
		grid-template-columns: 320px 1fr;
	}
}

/* ── LEFT COLUMN: photo + org logo tile ─────────────────────── */
.nnn-md-modal-left {
	background: var(--md-bg-soft);
	display: flex;
	flex-direction: column;
}
@media (min-width: 750px) {
	.nnn-md-modal-left {
		min-height: 100%;
	}
}

.nnn-md-modal-photo {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--md-bg-soft);
}
@media (min-width: 750px) {
	.nnn-md-modal-photo {
		aspect-ratio: 4 / 5;
	}
}
.nnn-md-modal-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.nnn-md-modal-photo-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #C8C8C8;
}

.nnn-md-modal-org-tile {
	background: #FFFFFF;
	margin: 14px 18px 18px;
	padding: 14px 16px;
	border-radius: 10px;
	border: 1px solid var(--md-line-soft);
	min-height: 76px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px -4px rgba(0,0,0,.06);
}
.nnn-md-modal-org-tile img {
	max-width: 100%;
	max-height: 56px;
	width: auto;
	height: auto;
	object-fit: contain;
}
.nnn-md-modal-org-tile.is-empty {
	background: transparent;
	border-style: dashed;
	border-color: var(--md-line);
	box-shadow: none;
}
.nnn-md-modal-org-tile-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	color: var(--md-soft);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.nnn-md-modal-org-tile-empty svg { opacity: .55; }

/* ── RIGHT COLUMN: header + details + bio + actions ─────────── */
.nnn-md-modal-content {
	padding: 28px 28px 32px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	max-height: calc(100dvh - 32px);
}
@media (min-width: 750px) {
	.nnn-md-modal-content { padding: 38px 42px 42px; }
}

.nnn-md-modal-eyebrow {
	display: inline-block;
	font-size: 10.5px;
	font-weight: 900;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--md-green-dk);
	margin-bottom: 10px;
	padding: 4px 10px;
	background: var(--md-green-pale);
	border-radius: 50px;
}
.nnn-md-modal-eyebrow:empty { display: none; }

.nnn-md-section .nnn-md-modal-name {
	font-family: inherit;
	font-size: clamp(22px, 3.5vw, 30px);
	font-weight: 900;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--md-heading);
	margin: 0 0 6px;
}
.nnn-md-modal-role {
	font-size: 15px;
	color: var(--md-body);
	margin: 0 0 22px;
	line-height: 1.5;
	font-weight: 500;
}

/* Structured details list — modern key/value rows with icons */
.nnn-md-modal-details {
	margin: 0 0 24px;
	padding: 18px 20px;
	background: var(--md-bg-soft);
	border-radius: 12px;
	display: grid;
	gap: 14px;
	grid-template-columns: 1fr;
}
@media (min-width: 540px) {
	.nnn-md-modal-details {
		grid-template-columns: 1fr 1fr;
		gap: 16px 24px;
	}
}
.nnn-md-modal-details:empty { display: none; }

.nnn-md-modal-detail {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}
.nnn-md-modal-detail dt {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: var(--md-soft);
	margin: 0;
}
.nnn-md-modal-detail dd {
	margin: 0;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--md-heading);
	line-height: 1.4;
	word-wrap: break-word;
}
.nnn-md-modal-detail-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	background: #FFFFFF;
	border-radius: 6px;
	color: var(--md-green-dk);
	box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.nnn-md-modal-bio {
	font-size: 14.5px;
	line-height: 1.65;
	color: var(--md-body);
}
.nnn-md-modal-bio p:first-child { margin-top: 0; }
.nnn-md-modal-bio p:last-child  { margin-bottom: 0; }
.nnn-md-modal-bio-empty {
	color: var(--md-soft);
	font-style: italic;
	margin: 0;
}

.nnn-md-modal-actions {
	margin-top: 26px;
	padding-top: 22px;
	border-top: 1px solid var(--md-line-soft);
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.nnn-md-modal-actions:empty {
	display: none;
}

.nnn-md-modal-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 50px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: all .2s;
	border: 1.5px solid transparent;
}
.nnn-md-modal-action svg { width: 15px; height: 15px; flex-shrink: 0; }

.nnn-md-modal-linkedin {
	background: var(--md-green-dk);
	color: var(--md-bg);
}
.nnn-md-modal-linkedin:hover {
	background: var(--md-heading);
	transform: translateY(-2px);
	box-shadow: 0 10px 20px -8px rgba(42,42,42,.20);
	color: var(--md-bg);
}

.nnn-md-modal-profile {
	background: var(--md-bg);
	color: var(--md-heading);
	border-color: var(--md-line);
}
.nnn-md-modal-profile:hover {
	border-color: var(--md-green-dk);
	color: var(--md-green-dk);
	transform: translateY(-2px);
	box-shadow: 0 10px 20px -8px rgba(0,0,0,.10);
}

/* No scroll when modal open */
body.nnn-md-modal-open { overflow: hidden; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
	.nnn-md-section *,
	.nnn-md-modal,
	.nnn-md-backdrop {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* ── Structured bio / info in the pop-out ─────────────────── */
.nnn-md-bio-info{margin-top:20px;display:flex;flex-direction:column;gap:15px}
.nnn-md-bio-label{font-weight:800;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:#4F8418}
.nnn-md-bio-row{font-size:15px;color:#3a403a;line-height:1.5}
.nnn-md-bio-row .nnn-md-bio-val{color:#3a403a;font-weight:600}
.nnn-md-bio-block .nnn-md-bio-label{display:block;margin-bottom:7px}
.nnn-md-bio-list{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px}
.nnn-md-bio-list li{font-size:15px;color:#54604a;line-height:1.5}
.nnn-md-bio-block p.nnn-md-bio-val{margin:0;font-size:15px;color:#54604a;line-height:1.55}
