/**
 * Community Listings — Public styles.
 * All styles scoped under .cl-listings-wrap
 */

.cl-listings-wrap {
	font-family: inherit;
	max-width: 100%;
}

/* Visual Grid */
.cl-grid {
	display: grid;
	gap: 24px;
}

.cl-grid-2 { grid-template-columns: repeat(2, 1fr); }
.cl-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cl-grid-4 { grid-template-columns: repeat(4, 1fr); }

.cl-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s;
}

.cl-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.cl-card-image {
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.cl-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cl-card-body {
	padding: 16px;
}

.cl-card-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 8px;
}

.cl-card-title a {
	color: inherit;
	text-decoration: none;
}

.cl-card-title a:hover {
	text-decoration: underline;
}

.cl-card-address {
	font-size: 14px;
	color: #666;
	margin: 0 0 8px;
}

.cl-card-excerpt {
	font-size: 14px;
	color: #444;
	margin: 0;
}

/* Structured Table */
.cl-table {
	width: 100%;
	border-collapse: collapse;
}

.cl-table th,
.cl-table td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid #e0e0e0;
	font-size: 14px;
}

.cl-table th {
	font-weight: 600;
	background: #f8f9fa;
}

.cl-table td a {
	color: inherit;
}

.cl-table tr:hover {
	background: #f8f9fa;
}

/* Pagination */
.cl-pagination {
	margin-top: 24px;
	text-align: center;
}

.cl-pagination .page-numbers {
	display: inline-block;
	padding: 8px 12px;
	margin: 0 2px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
	font-size: 14px;
}

.cl-pagination .page-numbers.current {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

/* Submit Form */
.cl-submit-wrap {
	max-width: 640px;
}

.cl-submit-form .cl-field {
	margin-bottom: 16px;
}

.cl-submit-form label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 6px;
}

.cl-submit-form label .required {
	color: #d63638;
}

.cl-submit-form input[type="text"],
.cl-submit-form input[type="email"],
.cl-submit-form input[type="url"],
.cl-submit-form select,
.cl-submit-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
}

.cl-submit-form input:focus,
.cl-submit-form select:focus,
.cl-submit-form textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
}

.cl-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.cl-field-hint {
	font-size: 12px;
	color: #666;
	margin: 4px 0 0;
}

/* Buttons */
.cl-btn {
	display: inline-block;
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: opacity 0.2s;
}

.cl-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

.cl-btn-primary {
	background: #0073aa;
	color: #fff;
}

.cl-btn-primary:hover {
	opacity: 0.9;
}

/* Messages */
.cl-message {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 14px;
}

.cl-message-success {
	background: #e8fde8;
	color: #1d7e1d;
	border: 1px solid #b8f0b8;
}

.cl-message-error {
	background: #fde8e8;
	color: #7e1d1d;
	border: 1px solid #f0b8b8;
}

/* Login Required */
.cl-login-required {
	text-align: center;
	padding: 40px 20px;
	background: #f8f9fa;
	border-radius: 8px;
}

.cl-no-listings {
	text-align: center;
	padding: 40px;
	color: #666;
}

/* My Listings */
.cl-my-listings-wrap {
	max-width: 900px;
}

.cl-my-listings-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.cl-my-listings-header h3 {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
}

.cl-my-listings-table {
	width: 100%;
	border-collapse: collapse;
}

.cl-my-listings-table th,
.cl-my-listings-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #e0e0e0;
	font-size: 14px;
}

.cl-my-listings-table th {
	font-weight: 600;
	background: #f8f9fa;
}

.cl-my-listings-table tr:hover {
	background: #f8f9fa;
}

.cl-no-listings-text {
	color: #666;
	font-style: italic;
}

/* Status Badges */
.cl-status-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.cl-status-live {
	background: #e8fde8;
	color: #1d7e1d;
}

.cl-status-pending {
	background: #fff8e1;
	color: #f57f17;
}

.cl-status-draft {
	background: #eceff1;
	color: #607d8b;
}

/* Action Buttons */
.cl-actions {
	display: flex;
	gap: 6px;
}

.cl-btn-edit,
.cl-btn-delete {
	padding: 4px 10px;
	font-size: 12px;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	transition: background 0.2s;
}

.cl-btn-edit:hover {
	background: #e8f4fd;
	border-color: #0073aa;
	color: #0073aa;
}

.cl-btn-delete:hover {
	background: #fde8e8;
	border-color: #d63638;
	color: #d63638;
}

/* Edit Modal */
.cl-edit-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.cl-edit-modal-content {
	background: #fff;
	border-radius: 8px;
	width: 100%;
	max-width: 560px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 24px;
}

.cl-edit-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.cl-edit-modal-header h3 {
	margin: 0;
	font-size: 18px;
}

.cl-edit-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	padding: 0 4px;
}

.cl-edit-actions {
	display: flex;
	gap: 8px;
	margin-top: 16px;
}

/* Dashboard Layout */
.cl-dashboard-wrap {
	max-width: 720px;
	margin: 0 auto;
}

/* Dashboard Header */
.cl-dash-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 12px;
	margin-bottom: 40px;
}

.cl-dash-user {
	display: flex;
	align-items: center;
	gap: 14px;
}

.cl-dash-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #111;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.5px;
	flex-shrink: 0;
}

.cl-dash-user-details {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cl-dash-name {
	font-size: 15px;
	font-weight: 600;
	color: #111;
	line-height: 1.3;
}

.cl-dash-email {
	font-size: 13px;
	color: #888;
	line-height: 1.3;
}

.cl-dash-logout {
	font-size: 13px;
	color: #888;
	text-decoration: none;
	padding: 8px 16px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	transition: all 0.15s ease;
	background: none;
	font-weight: 500;
}

.cl-dash-logout:hover {
	color: #111;
	border-color: #111;
	background: #f8f8f8;
}

/* Dashboard Sections */
.cl-dash-section {
	margin-bottom: 48px;
}

.cl-dash-section-title {
	font-size: 18px;
	font-weight: 600;
	color: #111;
	margin: 0 0 24px;
	padding-bottom: 12px;
	border-bottom: 1px solid #eee;
}

/* Override nested shortcode max-widths inside dashboard */
.cl-dashboard-wrap .cl-submit-wrap {
	max-width: 100%;
}

.cl-dashboard-wrap .cl-my-listings-wrap {
	max-width: 100%;
}

/* Refine form inside dashboard */
.cl-dashboard-wrap .cl-submit-form input[type="text"],
.cl-dashboard-wrap .cl-submit-form input[type="email"],
.cl-dashboard-wrap .cl-submit-form input[type="url"],
.cl-dashboard-wrap .cl-submit-form select,
.cl-dashboard-wrap .cl-submit-form textarea {
	border-color: #e0e0e0;
	border-radius: 8px;
	padding: 12px 14px;
	transition: border-color 0.15s ease;
}

.cl-dashboard-wrap .cl-submit-form input:focus,
.cl-dashboard-wrap .cl-submit-form select:focus,
.cl-dashboard-wrap .cl-submit-form textarea:focus {
	border-color: #111;
	box-shadow: none;
}

.cl-dashboard-wrap .cl-btn-primary {
	background: #111;
	border-radius: 8px;
	padding: 12px 28px;
	font-size: 14px;
	transition: background 0.15s ease;
}

.cl-dashboard-wrap .cl-btn-primary:hover {
	background: #333;
	opacity: 1;
}

/* Refine table inside dashboard */
.cl-dashboard-wrap .cl-my-listings-table {
	border: 1px solid #eee;
	border-radius: 12px;
	overflow: hidden;
	border-collapse: separate;
	border-spacing: 0;
}

.cl-dashboard-wrap .cl-my-listings-table th {
	background: #fafafa;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #888;
	font-weight: 600;
	border-bottom: 1px solid #eee;
}

.cl-dashboard-wrap .cl-my-listings-table td {
	border-bottom: 1px solid #f5f5f5;
}

.cl-dashboard-wrap .cl-my-listings-table tr:last-child td {
	border-bottom: none;
}

.cl-dashboard-wrap .cl-my-listings-table tr:hover {
	background: #fafafa;
}

/* Refined status badges */
.cl-dashboard-wrap .cl-status-badge {
	border-radius: 6px;
	padding: 3px 10px;
	font-size: 11px;
	letter-spacing: 0.3px;
}

/* Refined action buttons */
.cl-dashboard-wrap .cl-btn-edit,
.cl-dashboard-wrap .cl-btn-delete {
	border-radius: 6px;
	border-color: #e0e0e0;
	font-size: 12px;
}

/* Edit modal refinements */
.cl-dashboard-wrap .cl-edit-modal-content {
	border-radius: 12px;
	padding: 28px;
}

/* Login required screen */
.cl-dashboard-wrap .cl-login-required,
.cl-login-required {
	text-align: center;
	padding: 60px 24px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 12px;
}

.cl-login-required p {
	font-size: 15px;
	color: #666;
	margin: 0 0 20px;
}

/* No listings empty state */
.cl-dashboard-wrap .cl-no-listings-text {
	text-align: center;
	padding: 32px 20px;
	color: #999;
	font-style: normal;
	font-size: 14px;
}

/* Inline shortcode elements */
.cl-dash-avatar-inline {
	display: inline-flex;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #111;
	color: #fff;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	font-weight: 600;
	vertical-align: middle;
}

.cl-dash-name-inline {
	font-size: 15px;
	font-weight: 600;
	color: #111;
}

.cl-dash-email-inline {
	font-size: 14px;
	color: #888;
}

/* Profile Card */
.cl-profile-card {
	background: #fff;
	border: 1px solid #eee;
	border-radius: 16px;
	overflow: hidden;
	max-width: 360px;
}

.cl-profile-top {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 36px 28px 28px;
	text-align: center;
}

.cl-profile-avatar {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #111;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	font-weight: 600;
	letter-spacing: 1px;
	margin-bottom: 16px;
}

.cl-profile-name {
	font-size: 20px;
	font-weight: 700;
	color: #111;
	margin: 0 0 4px;
	line-height: 1.3;
}

.cl-profile-email {
	font-size: 14px;
	color: #666;
	margin-bottom: 6px;
}

.cl-profile-since {
	font-size: 12px;
	color: #aaa;
	margin-top: 4px;
}

.cl-profile-bottom {
	padding: 16px 28px;
	border-top: 1px solid #f0f0f0;
	text-align: center;
}

.cl-profile-logout {
	display: inline-block;
	font-size: 13px;
	color: #999;
	text-decoration: none;
	padding: 8px 24px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	transition: all 0.15s ease;
	font-weight: 500;
}

.cl-profile-logout:hover {
	color: #111;
	border-color: #111;
	background: #fafafa;
}

/* Responsive */
@media (max-width: 768px) {
	.cl-grid-3,
	.cl-grid-4 {
		grid-template-columns: repeat(2, 1fr);
	}

	.cl-field-row {
		grid-template-columns: 1fr;
	}

	.cl-table th:nth-child(3),
	.cl-table td:nth-child(3) {
		display: none;
	}

	.cl-dash-header {
		flex-direction: column;
		gap: 16px;
		align-items: flex-start;
		padding: 16px 18px;
	}

	.cl-dash-logout {
		align-self: flex-end;
	}

	.cl-dashboard-wrap .cl-my-listings-table th:nth-child(4),
	.cl-dashboard-wrap .cl-my-listings-table td:nth-child(4) {
		display: none;
	}
}

@media (max-width: 480px) {
	.cl-grid-2,
	.cl-grid-3,
	.cl-grid-4 {
		grid-template-columns: 1fr;
	}
}
