/*
 * Member-facing Pond shortcodes ([tdm_pond_members], [tdm_my_pond_affiliations],
 * [tdm_directory_actions]) and the Pond GravityView Single Entry layout. Every
 * rule is scoped to those roots, to the tdm-pond-profile__* classes set on
 * Pond View fields, or to the tdm-pond-single-entry body class, so other
 * directory screens and theme content are unaffected. Colours, radii and type
 * follow assets/tdm-single-entry-profile.css.
 */

/* Shared tokens */
.tdm-pond-members,
.tdm-pond-affiliations,
.tdm-directory-actions {
	--tdm-pond-ink: #172033;
	--tdm-pond-muted: #5d6670;
	--tdm-pond-border: #d9dee5;
	--tdm-pond-field-border: #c7ced6;
	--tdm-pond-surface: #f7f8fa;
	--tdm-pond-accent: #c9362b;
	--tdm-pond-success: #2e7d46;
	--tdm-pond-success-bg: #f2f8f4;
	--tdm-pond-error: #b32d2e;
	--tdm-pond-error-bg: #fcf0f1;
	--tdm-pond-shadow: 0 8px 24px rgba( 20, 31, 50, .07 );
	box-sizing: border-box;
	color: var( --tdm-pond-ink );
	line-height: 1.5;
}

.tdm-pond-members *,
.tdm-pond-affiliations *,
.tdm-directory-actions * {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ */
/* [tdm_pond_members] — confirmed members on the Pond Single Entry     */
/* ------------------------------------------------------------------ */

.tdm-pond-members {
	margin: 1.5rem 0 0;
}

/* The title is an <h4> that takes the theme's heading style, like the Pond
   page's other section headings; only spacing is set here. */
.tdm-pond-members .tdm-pond-members__title {
	margin: 0 0 .75rem;
}

.tdm-pond-members .tdm-pond-members__list {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 15rem, 1fr ) );
	gap: 0 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tdm-pond-members .tdm-pond-members__member {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .1rem .5rem;
	margin: 0;
	padding: .45rem 0;
	border-bottom: 1px solid #e5e8ec;
	list-style: none;
}

.tdm-pond-members .tdm-pond-members__member::before {
	content: none;
}

.tdm-pond-members .tdm-pond-members__name {
	font-weight: 700;
}

.tdm-pond-members .tdm-pond-members__role {
	color: var( --tdm-pond-muted );
	font-size: .85em;
}

.tdm-pond-members .tdm-pond-members__member--master-turtle .tdm-pond-members__role {
	color: var( --tdm-pond-accent );
	font-weight: 700;
}

.tdm-pond-members .tdm-pond-members__none {
	margin: 0;
	color: var( --tdm-pond-muted );
}

/* ------------------------------------------------------------------ */
/* [tdm_my_pond_affiliations] — My Account                             */
/* ------------------------------------------------------------------ */

.tdm-pond-affiliations {
	/* Sits inside the page's own content box (a Divi module on My Account),
	   so it adds no card of its own. */
	margin: 0;
	padding: .5rem 0;
	/* The heading is a login redirect target; keep it clear of sticky headers. */
	scroll-margin-top: 120px;
}

.tdm-pond-affiliations + .tdm-pond-affiliations--admin {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 3px solid var( --tdm-pond-ink );
}

.tdm-pond-affiliations .tdm-pond-affiliations__title {
	margin: 0 0 .75rem;
	padding: 0;
	font-size: 1.4rem;
	line-height: 1.25;
	scroll-margin-top: 120px;
}

.tdm-pond-affiliations h3 {
	margin: 0 0 .5rem;
	padding: 0;
	font-size: 1.1rem;
	line-height: 1.3;
}

.tdm-pond-affiliations p {
	margin: 0 0 .85rem;
	padding: 0;
}

.tdm-pond-affiliations .tdm-pond-affiliations__intro,
.tdm-pond-affiliations .tdm-pond-affiliations__help {
	color: var( --tdm-pond-muted );
	font-size: .95rem;
}

.tdm-pond-affiliations .tdm-pond-affiliations__notice {
	padding: .75rem 1rem;
	border-left: 4px solid var( --tdm-pond-success );
	border-radius: 6px;
	background: var( --tdm-pond-success-bg );
	font-weight: 600;
}

.tdm-pond-affiliations .tdm-pond-affiliations__notice--error {
	border-left-color: var( --tdm-pond-error );
	background: var( --tdm-pond-error-bg );
}

.tdm-pond-affiliations .tdm-pond-affiliations__callout {
	margin: 0 0 1rem;
	padding: .9rem 1rem;
	border: 1px solid #efd9a3;
	border-left: 4px solid #d4a017;
	border-radius: 6px;
	background: #fff9e8;
}

.tdm-pond-affiliations .tdm-pond-affiliations__callout p {
	margin-bottom: .5rem;
}

.tdm-pond-affiliations .tdm-pond-affiliations__target-list {
	margin: 0;
	padding-left: 1.2rem;
	font-weight: 600;
}

.tdm-pond-affiliations .tdm-pond-affiliations__empty {
	padding: .9rem 1rem;
	border: 1px dashed var( --tdm-pond-field-border );
	border-radius: 6px;
	background: var( --tdm-pond-surface );
	color: var( --tdm-pond-muted );
}

/* Affiliation and review rows */
.tdm-pond-affiliations .tdm-pond-affiliations__list {
	margin: 0 0 1.25rem;
	padding: 0;
	border: 1px solid var( --tdm-pond-border );
	border-radius: 8px;
	list-style: none;
	overflow: hidden;
}

.tdm-pond-affiliations .tdm-pond-affiliations__item {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .4rem .9rem;
	margin: 0;
	padding: .8rem 1rem;
	border-top: 1px solid #e5e8ec;
	list-style: none;
}

.tdm-pond-affiliations .tdm-pond-affiliations__item:first-child {
	border-top: 0;
}

.tdm-pond-affiliations .tdm-pond-affiliations__item::before {
	content: none;
}

.tdm-pond-affiliations .tdm-pond-affiliations__pond,
.tdm-pond-affiliations .tdm-pond-affiliations__person {
	font-weight: 700;
}

.tdm-pond-affiliations .tdm-pond-affiliations__meta {
	color: var( --tdm-pond-muted );
	font-size: .92rem;
}

.tdm-pond-affiliations .tdm-pond-affiliations__status {
	display: inline-flex;
	align-items: center;
	margin-left: auto;
	padding: .15rem .65rem;
	border-radius: 999px;
	background: #eef0f3;
	color: var( --tdm-pond-ink );
	font-size: .8rem;
	font-weight: 700;
	white-space: nowrap;
}

.tdm-pond-affiliations .tdm-pond-affiliations__status--approved {
	background: var( --tdm-pond-success-bg );
	color: var( --tdm-pond-success );
}

.tdm-pond-affiliations .tdm-pond-affiliations__status--pending {
	background: #fff9e8;
	color: #7a5a05;
}

.tdm-pond-affiliations .tdm-pond-affiliations__status--rejected,
.tdm-pond-affiliations .tdm-pond-affiliations__status--removed {
	background: var( --tdm-pond-error-bg );
	color: var( --tdm-pond-error );
}

.tdm-pond-affiliations .tdm-pond-affiliations__request {
	display: flex;
	flex: 1 1 18rem;
	flex-direction: column;
	gap: .15rem;
	min-width: 0;
}

.tdm-pond-affiliations .tdm-pond-affiliations__review-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.tdm-pond-affiliations .tdm-pond-affiliations__inline-form {
	display: inline;
	margin: 0;
}

/* Panels: request form and review queue */
.tdm-pond-affiliations .tdm-pond-affiliations__panel,
.tdm-pond-affiliations .tdm-pond-affiliations__details {
	margin: 1.25rem 0 0;
	padding: 1.1rem 1.15rem;
	border: 1px solid var( --tdm-pond-border );
	border-radius: 8px;
	background: var( --tdm-pond-surface );
}

.tdm-pond-affiliations .tdm-pond-affiliations__panel > :last-child {
	margin-bottom: 0;
}

.tdm-pond-affiliations .tdm-pond-affiliations__details > summary {
	cursor: pointer;
	font-weight: 700;
	list-style-position: inside;
}

.tdm-pond-affiliations .tdm-pond-affiliations__details[open] > summary {
	margin-bottom: .75rem;
}

/* Forms */
.tdm-pond-affiliations .tdm-pond-affiliations__form {
	margin: 0;
}

.tdm-pond-affiliations .tdm-pond-affiliations__form--grid {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: .25rem 1rem;
}

.tdm-pond-affiliations .tdm-pond-affiliations__field--wide {
	grid-column: 1 / -1;
}

.tdm-pond-affiliations .tdm-pond-affiliations__field label {
	display: block;
}

.tdm-pond-affiliations .tdm-pond-affiliations__label {
	display: block;
	margin-bottom: .3rem;
	font-weight: 700;
	font-size: .92rem;
}

.tdm-pond-affiliations input[type="text"],
.tdm-pond-affiliations select,
.tdm-pond-affiliations textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: .55rem .65rem;
	border: 1px solid var( --tdm-pond-field-border );
	border-radius: 6px;
	background: #fff;
	color: var( --tdm-pond-ink );
	font: inherit;
}

.tdm-pond-affiliations textarea {
	min-height: 110px;
}

.tdm-pond-affiliations input[type="text"]:focus,
.tdm-pond-affiliations select:focus,
.tdm-pond-affiliations textarea:focus {
	border-color: var( --tdm-pond-ink );
	outline: 2px solid rgba( 23, 32, 51, .2 );
	outline-offset: 1px;
}

.tdm-pond-affiliations .tdm-pond-affiliations__check label {
	display: inline-flex;
	align-items: flex-start;
	gap: .5rem;
	cursor: pointer;
}

.tdm-pond-affiliations .tdm-pond-affiliations__check input {
	margin-top: .3rem;
}

.tdm-pond-affiliations .tdm-pond-affiliations__actions {
	margin: .25rem 0 0;
}

/* Buttons (shared shape with .tdm-directory-actions__button) */
.tdm-pond-affiliations .tdm-pond-affiliations__button,
.tdm-directory-actions .tdm-directory-actions__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: .6rem 1.1rem;
	border: 1px solid var( --tdm-pond-ink );
	border-radius: 6px;
	background: var( --tdm-pond-ink );
	color: #fff;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, opacity .15s ease;
}

.tdm-pond-affiliations .tdm-pond-affiliations__button:hover,
.tdm-pond-affiliations .tdm-pond-affiliations__button:focus,
.tdm-directory-actions .tdm-directory-actions__button:hover,
.tdm-directory-actions .tdm-directory-actions__button:focus {
	opacity: .9;
	color: #fff;
	text-decoration: none;
}

.tdm-pond-affiliations .tdm-pond-affiliations__button:focus-visible,
.tdm-directory-actions .tdm-directory-actions__button:focus-visible {
	outline: 3px solid rgba( 23, 32, 51, .35 );
	outline-offset: 2px;
}

.tdm-pond-affiliations .tdm-pond-affiliations__button--secondary {
	background: #fff;
	color: var( --tdm-pond-ink );
	border-color: var( --tdm-pond-field-border );
}

.tdm-pond-affiliations .tdm-pond-affiliations__button--secondary:hover,
.tdm-pond-affiliations .tdm-pond-affiliations__button--secondary:focus {
	background: #f3f5f7;
	color: var( --tdm-pond-ink );
	opacity: 1;
}

/* ------------------------------------------------------------------ */
/* [tdm_directory_actions] — Directory landing                         */
/* ------------------------------------------------------------------ */

.tdm-directory-actions h2 {
	margin: 2rem 0 .75rem;
	padding: 0;
}

.tdm-directory-actions .tdm-directory-actions__browse,
.tdm-directory-actions .tdm-directory-actions__member {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 15rem, 1fr ) );
	gap: 1rem;
	margin: 0 0 1rem;
}

.tdm-directory-actions .tdm-directory-actions__card {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 1.15rem 1.25rem;
	border: 1px solid var( --tdm-pond-border );
	border-radius: 10px;
	background: #fff;
	box-shadow: var( --tdm-pond-shadow );
}

.tdm-directory-actions .tdm-directory-actions__card h3 {
	margin: 0 0 .4rem;
	padding: 0;
	font-size: 1.1rem;
	line-height: 1.3;
}

.tdm-directory-actions .tdm-directory-actions__card p {
	margin: 0 0 .9rem;
	padding: 0;
	color: var( --tdm-pond-muted );
}

/* Keep each card's button on the bottom edge so rows line up. */
.tdm-directory-actions .tdm-directory-actions__card p:last-child {
	margin: auto 0 0;
}

.tdm-directory-actions .tdm-directory-actions__note {
	padding: .85rem 1rem;
	border-left: 4px solid #d4a017;
	border-radius: 6px;
	background: #fff9e8;
}

/* ------------------------------------------------------------------ */
/* Small screens                                                        */
/* ------------------------------------------------------------------ */

@media ( max-width: 640px ) {


	.tdm-pond-affiliations .tdm-pond-affiliations__panel,
	.tdm-pond-affiliations .tdm-pond-affiliations__details {
		padding: .9rem;
	}

	.tdm-pond-affiliations .tdm-pond-affiliations__form--grid {
		grid-template-columns: minmax( 0, 1fr );
	}

	.tdm-pond-affiliations .tdm-pond-affiliations__status {
		margin-left: 0;
	}

	.tdm-pond-affiliations .tdm-pond-affiliations__button,
	.tdm-directory-actions .tdm-directory-actions__button {
		width: 100%;
	}

	.tdm-pond-affiliations .tdm-pond-affiliations__review-actions {
		width: 100%;
	}

	.tdm-pond-affiliations .tdm-pond-affiliations__review-actions .tdm-pond-affiliations__inline-form {
		flex: 1 1 0;
	}
}

/* ------------------------------------------------------------------ */
/* Pond GravityView Single Entry layout                                 */
/* The Pond View's fields carry these custom CSS classes:               */
/*   tdm-pond-profile__photos-heading  "Pond Photos" heading, rendered  */
/*                                     only when the Pond has photos    */
/*   tdm-pond-profile__photos          Pond photos field                */
/*   tdm-pond-profile__officers        Pond Officers heading and fields */
/*   tdm-pond-profile__members         [tdm_pond_members] field         */
/* in the order: primary info, photos heading, photos, officers,        */
/* members.                                                             */
/* ------------------------------------------------------------------ */

.gv-list-single-container .tdm-pond-profile__photos-heading,
.gv-list-single-container .tdm-pond-profile__photos {
	float: right;
	clear: right;
	width: calc( 50% - 1rem );
	margin: 0 0 0 2rem;
}

.gv-list-single-container .tdm-pond-profile__photos {
	margin-bottom: 1.5rem;
}

/* GravityView's field conditional logic treats a Pond with no stored photo
   value as "not empty", so the heading can render without photos. Hide it
   unless the photos field directly follows. */
.gv-list-single-container .tdm-pond-profile__photos-heading:not( :has( + .tdm-pond-profile__photos ) ) {
	display: none;
}

.gv-list-single-container .tdm-pond-profile__photos ~ .tdm-pond-profile__officers {
	margin-right: calc( 50% + 1rem );
}

.gv-list-single-container .tdm-pond-profile__photos ul {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	gap: .75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gv-list-single-container .tdm-pond-profile__photos li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gv-list-single-container .tdm-pond-profile__photos li::before {
	content: none;
}

.gv-list-single-container .tdm-pond-profile__photos li:first-child {
	grid-column: 1 / -1;
}

.gv-list-single-container .tdm-pond-profile__photos img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.gv-list-single-container .tdm-pond-profile__members {
	clear: both;
}

/* The Ponds page's "list a new Pond" section is only for the /ponds/ list. */
.tdm-pond-single-entry #form {
	display: none;
}

@media ( max-width: 767px ) {
	.gv-list-single-container .gv-list-view-content-description:has( .tdm-pond-profile__officers ) {
		display: flex;
		flex-direction: column;
	}

	.gv-list-single-container .tdm-pond-profile__photos-heading,
	.gv-list-single-container .tdm-pond-profile__photos {
		float: none;
		order: 2;
		width: auto;
		margin: 0;
	}

	.gv-list-single-container .tdm-pond-profile__photos {
		margin-bottom: 1rem;
	}

	.gv-list-single-container .tdm-pond-profile__officers {
		order: 1;
	}

	.gv-list-single-container .tdm-pond-profile__photos ~ .tdm-pond-profile__officers {
		margin-right: 0;
	}

	.gv-list-single-container .tdm-pond-profile__members {
		order: 3;
	}
}
