/* ========================================
   Shared Profile Section Styles
   Used by Profile, About Club, etc.
   ======================================== */

.profile-section {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	margin-bottom: 25px;
	overflow: hidden;
}

.profile-section .section-title {
	font-size: 14px;
	font-weight: 700;
	color: #004165;
	/* Default to Toastmasters Blue, can be overridden */
	background: #fafafa;
	padding: 12px 15px;
	margin: 0;
	border-bottom: 1px solid #e0e0e0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* --- Row Structure --- */
.field-row {
	display: flex;
	align-items: center;
	padding: 0;
	border-bottom: 1px solid #eee;
	flex: 1;
	min-width: 0;
	overflow: visible;
	/* Allow content to wrap without box cutting */
}

.field-row-pair,
.field-row-group {
	display: flex;
	flex-direction: column;
	/* Stacked by default on desktop */
	gap: 0;
	border-bottom: 1px solid #eee;
	padding: 0;
}

.field-row-pair .field-row,
.field-row-group .field-row {
	border-bottom: 1px solid #eee;
	width: 100%;
}

.field-row-pair .field-row:last-child,
.field-row-group .field-row:last-child {
	border-bottom: none;
}

.field-row:last-child,
.field-row-pair:last-child,
.field-row-group:last-child {
	border-bottom: none;
}

/* --- Labels & Values --- */
.field-label {
	font-size: 13px;
	color: #1e293b;
	font-weight: 700;
	width: 170px;
	background: #f8fafc;
	padding: 12px 15px;
	border-right: 1px solid #e0e0e0;
	white-space: nowrap;
	flex-shrink: 0;
	align-self: stretch;
	display: flex;
	align-items: center;
}

.field-value {
	padding: 10px 15px;
	flex: 1;
	font-size: 14px;
	font-weight: 400;
	color: #334155;
	white-space: normal;
	/* Allow wrapping */
	overflow-wrap: anywhere;
	word-break: break-word;
	/* Ensure long text wraps correctly */
}

/* --- Inputs --- */
.field-input-wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	position: relative;
}

.field-input,
.field-textarea {
	width: calc(100% - 30px);
	max-width: calc(100% - 30px);
	/* Ensure it doesn't exceed container */
	min-width: 0;
	font-size: 15px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
	transition: all 0.2s ease;
}

.field-input {
	margin: 10px 15px;
	height: 44px;
	padding: 0 15px;
}

.profile-section .field-textarea {
	margin: 10px 15px;
	min-height: 72px;
	padding: 10px 15px;
	resize: vertical;
	font-family: inherit;
	font-weight: normal;
	color: #333;
	line-height: 1.5;
}

/* --- Club Introduction prose block (about_club page) --- */
.profile-section .club-intro-content {
	padding: 0;
}

.profile-section .club-intro-view {
	display: block;
	padding: 20px 22px;
	margin: 12px 15px;
	font-size: 15px;
	font-weight: 400;
	color: #2a2a2a;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-wrap: pretty;
}

.profile-section .club-intro-edit {
	margin: 12px 15px;
	min-height: 120px;
	padding: 12px 15px;
	resize: vertical;
	font-family: inherit;
	font-weight: normal;
	color: #333;
	line-height: 1.55;
}

.field-input:focus,
.field-textarea:focus,
.field-textarea-auto:focus {
	outline: none;
	border-color: #004165;
	box-shadow: 0 0 0 3px rgba(0, 65, 101, 0.1);
}

/* Custom Select Integration within Profile sections - Increased specificity to remove !important */
:root body .profile-page-container .profile-section .custom-select-wrapper {
	width: 100%;
	min-width: 0;
}

:root body .profile-page-container .profile-section .meeting-autocomplete-container {
	display: flex;
	margin: 10px 15px;
	width: calc(100% - 30px);
	max-width: calc(100% - 30px);
	height: auto;
}

:root body .profile-page-container .profile-section .custom-select-trigger {
	margin: 0;
	width: 100%;
	max-width: none;
	height: 44px;
	padding: 0 35px 0 15px;
	box-shadow: none;
	font-size: 15px;
	box-sizing: border-box;
}

.profile-section .custom-select-trigger:focus,
.profile-section .custom-select-trigger.active {
	border-color: #004165;
	box-shadow: 0 0 0 3px rgba(0, 65, 101, 0.1);
}

body .profile-section .autocomplete-results-dropdown {
	margin-left: 0;
	width: 100%;
	min-width: 100%;
	max-width: none;
	box-sizing: border-box;
}

body .profile-section .autocomplete-result-item {
	white-space: normal;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.field-row .note {
	display: block;
	font-size: 11px;
	color: #888;
	margin: 0 15px 12px;
	width: calc(100% - 30px);
	max-width: calc(100% - 30px);
	font-style: italic;
}

/* --- Mobile View (<= 768px) --- */
@media (max-width: 768px) {
	.profile-section {
		border-radius: 10px;
		margin-bottom: 20px;
		border-color: #e5e5e5;
	}

	.profile-section .section-title {
		font-size: 11px;
		font-weight: 800;
		padding: 12px 15px;
		letter-spacing: 0.8px;
		border-color: #e5e5e5;
	}

	.field-row-pair {
		flex-direction: column;
	}

	.field-row {
		flex-direction: column;
		align-items: stretch;
	}

	.field-row-pair .field-row {
		border-bottom: 1px solid #eee;
	}

	.field-row-pair .field-row:last-child {
		border-bottom: none;
	}

	.field-label {
		width: 100%;
		font-size: 10px;
		text-transform: uppercase;
		letter-spacing: 0.8px;
		color: #888;
		font-weight: 800;
		background: transparent;
		padding: 12px 15px 0;
		border-right: none;
		border-bottom: none;
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: break-all;
		/* Robust wrapping to prevent cut-off */
		flex-shrink: 1;
	}

	.field-value {
		padding: 4px 15px 12px;
		font-size: 14px;
		width: 100%;
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: break-all;
		/* Robust wrapping to prevent cut-off */
		box-sizing: border-box;
	}

	.field-input-wrapper {
		width: 100%;
	}

	.field-input,
	.field-textarea {
		margin: 8px 15px 12px;
		width: calc(100% - 30px);
		box-sizing: border-box;
		font-size: 14px;
	}

	:root body .profile-page-container .profile-section .meeting-autocomplete-container {
		display: flex;
		margin: 8px 15px 12px;
		width: calc(100% - 30px);
		max-width: calc(100% - 30px);
		height: auto;
		/* Overrides meeting_filter.css mobile fixed height */
	}

	:root body .profile-page-container .profile-section .custom-select-trigger {
		margin: 0;
		width: 100%;
		max-width: none;
		height: 38px;
		padding: 0 35px 0 10px;
		box-shadow: none;
		font-size: 14px;
		box-sizing: border-box;
	}

	/* --- Compact Layouts for Mobile --- */
	.field-row-pair.mobile-side-by-side,
	.field-row-group.mobile-side-by-side {
		flex-direction: row;
		flex-wrap: nowrap;
		width: 100%;
		overflow: hidden;
		/* Prevent container overflow */
	}

	.field-row-group.mobile-side-by-side {
		border: 0;
	}

	.field-row-pair.mobile-side-by-side .field-row,
	.field-row-group.mobile-side-by-side .field-row {
		border-bottom: none;
		border-right: 1px solid #eee;
		flex: 1;
		min-width: 0;
		display: flex;
		flex-direction: column;
	}

	.field-row-pair.mobile-side-by-side .field-row:last-child,
	.field-row-group.mobile-side-by-side .field-row:last-child {
		border-right: none;
	}

	/* .compact class for even tighter spacing in side-by-side rows */
	.field-row.compact .field-label {
		padding: 8px 15px 0;
		font-size: 9px;
		background: transparent;
		white-space: normal;
		overflow-wrap: anywhere;
		line-height: 1.1;
	}

	.field-row.compact .field-value {
		padding: 2px 15px 10px;
		font-size: 13px;
		font-weight: 700;
		white-space: normal;
		overflow-wrap: anywhere;
		line-height: 1.2;
	}

	.field-row.compact .field-input {
		margin: 5px 8px 10px;
		width: calc(100% - 16px);
		height: 36px;
		padding: 0 8px;
		font-size: 13px;
	}

	.field-row.mobile-inline {
		flex-direction: row;
		align-items: center;
	}

	.field-row.mobile-inline .field-label {
		width: 90px;
		padding: 8px 10px;
		border-bottom: none;
		border-right: 1px solid #eee;
		font-size: 9px;
		white-space: normal;
		overflow-wrap: anywhere;
		line-height: 1.1;
	}

	.field-row.mobile-inline .field-value {
		padding: 6px 10px;
		font-size: 12px;
		overflow-wrap: anywhere;
	}


	@media (max-width: 480px) {
		.field-row-group.mobile-side-by-side {
			flex-wrap: wrap;
		}

		.field-row-group.mobile-side-by-side .field-row {
			flex: 1 1 50%;
			border-bottom: 1px solid #eee;
		}

		.field-row-group.mobile-side-by-side .field-row:nth-child(even) {
			border-right: none;
		}
	}
}



/* --- Standardized Mobile Layout for About Club (Specificity Refinement) --- */
@media (max-width: 768px) {
	/* Prepending 'body' to increase specificity and avoid using priority overrides */

	/* Pinned header buttons specificity fix */
	body .about-club-container .settings-header .btn {
		width: auto;
		min-width: 100px;
		padding: 8px 16px;
		flex-grow: 0;
	}

	/* Global Row Standardization */
	body .about-club-container .field-row {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
		overflow: visible;
		border-bottom: 1px solid #eee;
	}

	/* Labels - Consistent stacked appearance */
	body .about-club-container .field-row .field-label {
		width: 100%;
		padding: 12px 15px 4px;
		background: transparent;
		border: none;
		font-size: 10px;
		text-transform: uppercase;
		letter-spacing: 0.8px;
		color: #888;
		font-weight: 800;
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: break-all;
		/* Robust wrapping to prevent cut-off */
	}

	/* Values & Inputs - Consistent alignment */
	body .about-club-container .field-row .field-value,
	body .about-club-container .field-row .field-input-wrapper {
		width: 100%;
		padding: 4px 15px 12px;
		/* Reduced top padding to match label-stacked structure */
		box-sizing: border-box;
		min-width: 0;
	}

	body .about-club-container .field-row .field-input,
	body .about-club-container .field-row .field-textarea {
		width: 100%;
		max-width: 100%;
		margin: 0;
		box-sizing: border-box;
	}

	/* Side-by-Side Override - Preserve grid where requested */
	body .about-club-container .field-row-pair.mobile-side-by-side,
	body .about-club-container .field-row-group.mobile-side-by-side {
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: stretch;
		border-bottom: 1px solid #eee;
	}

	body .about-club-container .mobile-side-by-side .field-row {
		flex: 1;
		flex-direction: column;
		/* Internal stack remains */
		border-bottom: none;
		border-right: 1px solid #eee;
		width: auto;
		max-width: none;
		min-width: 0;
	}

	body .about-club-container .mobile-side-by-side .field-row:last-child {
		border-right: none;
	}

	/* Compact override refinement */
	body .about-club-container .field-row.compact .field-label {
		padding: 8px 12px 2px;
	}

	body .about-club-container .field-row.compact .field-value,
	body .about-club-container .field-row.compact .field-input-wrapper {
		padding: 0 12px 8px;
	}

	/* Force single column in edit mode for mobile */
	body .about-club-container.edit-mode .field-row-pair.mobile-side-by-side,
	body .about-club-container.edit-mode .field-row-group.mobile-side-by-side {
		flex-direction: column;
	}

	body .about-club-container.edit-mode .mobile-side-by-side .field-row {
		border-right: none;
		border-bottom: 1px solid #eee;
		width: 100%;
	}

	body .about-club-container.edit-mode .mobile-side-by-side .field-row:last-child {
		border-bottom: none;
	}

	/* Hide native icons in edit mode */
	body .about-club-container.edit-mode input[type="date"]::-webkit-inner-spin-button,
	body .about-club-container.edit-mode input[type="date"]::-webkit-calendar-picker-indicator,
	body .about-club-container.edit-mode input[type="time"]::-webkit-inner-spin-button,
	body .about-club-container.edit-mode input[type="time"]::-webkit-calendar-picker-indicator {
		display: none;
		-webkit-appearance: none;
	}

	/* Auto-growing textarea for wrap-able fields */
	body .about-club-container.edit-mode .field-textarea-auto {
		width: 100%;
		max-width: 100%;
		margin: 0;
		box-sizing: border-box;
		min-height: 44px;
		padding: 10px 15px;
		font-size: 14px;
		font-weight: 700;
		border: 1px solid #ddd;
		border-radius: 8px;
		background: #fff;
		resize: none;
		overflow: hidden;
		line-height: 1.4;
		display: block;
	}

	}
}