/**
 * Ask the Experts — Frontend Stylesheet
 *
 * Styles for public-facing shortcodes and pages.
 */

/* ==================================================
   Question Form
   ================================================== */

.ate-question-form-wrapper {
	max-width: 600px;
	margin: 20px 0;
}

.ate-question-form {
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 20px;
}

.ate-form-group {
	margin-bottom: 16px;
}

.ate-form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: #333;
}

.ate-form-input,
.ate-form-select,
.ate-form-textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
}

.ate-form-textarea {
	resize: vertical;
	min-height: 100px;
}

.ate-form-input:focus,
.ate-form-select:focus,
.ate-form-textarea:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 2px rgba( 0, 115, 170, 0.1 );
}

/* ==================================================
   Related Questions Display
   ================================================== */

.ate-related-questions-wrapper {
	background: #f0f7ff;
	border-left: 4px solid #0073aa;
	padding: 12px;
	margin: 16px 0;
	border-radius: 2px;
}

.ate-related-questions-wrapper h4 {
	margin: 0 0 8px 0;
	color: #0073aa;
}

.ate-related-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ate-related-list li {
	padding: 6px 0;
	border-bottom: 1px solid #ddd;
}

.ate-related-list li:last-child {
	border-bottom: none;
}

.ate-related-list a {
	color: #0073aa;
	text-decoration: none;
}

.ate-related-list a:hover {
	text-decoration: underline;
}

/* ==================================================
   Buttons
   ================================================== */

.ate-button {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #f0f0f0;
	color: #333;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s;
}

.ate-button:hover {
	background: #e0e0e0;
	border-color: #999;
}

.ate-button-primary {
	background: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

.ate-button-primary:hover {
	background: #005a87;
	border-color: #005a87;
}

/* ==================================================
   Archive Display
   ================================================== */

.ate-archive-wrapper {
	margin: 20px 0;
}

.ate-archive-header {
	margin-bottom: 24px;
}

.ate-archive-header h2 {
	margin: 0 0 12px 0;
}

.ate-archive-controls {
	display: flex;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
	align-items: center;
}

.ate-archive-filter,
.ate-archive-search {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ate-archive-filter-select,
.ate-archive-search-input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.ate-archive-results {
	margin-bottom: 24px;
}

.ate-archive-result-item {
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 16px;
	margin-bottom: 16px;
	background: #fff;
	transition: box-shadow 0.2s;
}

.ate-archive-result-item:hover {
	box-shadow: 0 2px 4px rgba( 0, 0, 0, 0.1 );
}

.ate-archive-result-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 8px 0;
}

.ate-archive-result-title a {
	color: #0073aa;
	text-decoration: none;
}

.ate-archive-result-title a:hover {
	text-decoration: underline;
}

.ate-archive-result-meta {
	font-size: 13px;
	color: #666;
	margin-bottom: 12px;
}

.ate-archive-result-excerpt {
	color: #555;
	line-height: 1.6;
}

.ate-archive-pagination {
	text-align: center;
	margin-top: 24px;
}

.ate-archive-pagination a {
	padding: 8px 16px;
	margin: 0 4px;
	border: 1px solid #ddd;
	border-radius: 4px;
	color: #0073aa;
	text-decoration: none;
	transition: all 0.2s;
}

.ate-archive-pagination a:hover {
	background: #f0f0f0;
	border-color: #0073aa;
}

/* ==================================================
   Single Answer Page
   ================================================== */

.ate-single-answer {
	margin: 20px 0;
}

.ate-answer-article {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 24px;
}

.ate-answer-header {
	margin-bottom: 24px;
	border-bottom: 2px solid #f0f0f0;
	padding-bottom: 16px;
}

.ate-answer-title {
	margin: 0 0 12px 0;
	font-size: 28px;
	line-height: 1.3;
}

.ate-answer-meta {
	font-size: 13px;
	color: #666;
}

.ate-question-content,
.ate-answer-body {
	margin-bottom: 24px;
}

.ate-question-content h3,
.ate-answer-body h3 {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 12px 0;
	color: #333;
}

/* ==================================================
   Modern Design System
   ================================================== */

:root {
	--ate-primary: #2563eb;
	--ate-primary-light: #3b82f6;
	--ate-primary-dark: #1e40af;
	--ate-text-primary: #1f2937;
	--ate-text-secondary: #6b7280;
	--ate-border-light: #e5e7eb;
	--ate-bg-light: #f9fafb;
	--ate-bg-lighter: #f3f4f6;
	--ate-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--ate-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--ate-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--ate-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================================================
   Expert Card
   ================================================== */

.ate-expert-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	margin-bottom: 24px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.2s ease;
}

.ate-expert-card:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Header bar: name + role badge */
.ate-expert-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #f5f7fa;
	border-bottom: 1px solid #e5e7eb;
}

.ate-expert-header .ate-expert-name {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--ate-text-primary);
	letter-spacing: -0.3px;
}

.ate-expert-badge {
	display: inline-block;
	padding: 4px 14px;
	background: var(--ate-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 3px;
	line-height: 1.4;
}

/* Stats at top */
.ate-expert-stats-top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: #f5f7fa;
	color: var(--ate-text-primary);
	padding: 24px 20px;
	gap: 24px;
	border-bottom: 1px solid #e5e7eb;
}

.ate-stat-item {
	display: flex;
	flex-direction: column;
	text-align: center;
	justify-content: center;
}

.ate-stat-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	opacity: 0.7;
	margin-bottom: 8px;
	color: var(--ate-text-secondary);
}

.ate-stat-value {
	font-size: 36px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.5px;
}

/* Profile card content */
.ate-expert-card-content {
	display: flex;
	gap: 20px;
	padding: 24px;
	border-bottom: 1px solid var(--ate-border-light);
}

.ate-expert-headshot {
	flex-shrink: 0;
}

.ate-expert-image {
	width: 96px;
	height: 96px;
	border-radius: 4px;
	object-fit: cover;
	display: block;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: var(--ate-transition);
}

.ate-placeholder-silhouette {
	width: 96px;
	height: 96px;
	border-radius: 4px;
	background: #f3f4f6;
	display: block;
}

.ate-expert-info {
	flex-grow: 1;
}

.ate-expert-name {
	margin: 0 0 12px 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--ate-text-primary);
	letter-spacing: -0.3px;
}

.ate-expert-biography-heading {
	margin: 0 0 12px 0;
	font-size: 17px;
	font-weight: 600;
	color: var(--ate-text-primary);
	font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
}

.ate-expert-biography {
	margin-bottom: 14px;
	padding-top: 4px;
	color: var(--ate-text-secondary);
	font-size: 15px;
	line-height: 1.6;
}

.ate-expert-specialisms,
.ate-expert-credentials {
	margin-bottom: 10px;
	font-size: 14px;
	color: var(--ate-text-primary);
	font-weight: 600;
}

.ate-expert-specialisms-list,
.ate-expert-credentials-list {
	list-style: none;
	margin: 8px 0 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.ate-expert-specialisms-list li,
.ate-expert-credentials-list li {
	padding: 0;
	display: inline-block;
}

.ate-expert-specialisms-list li {
	background: #eef2ff;
	padding: 4px 10px;
	border-radius: 3px;
	font-size: 13px;
	color: var(--ate-text-secondary);
	border: 1px solid #c7d2fe;
}

.ate-expert-credentials-list a {
	color: #6b7280;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	transition: color 0.2s ease;
}

.ate-expert-credentials-list a:hover {
	color: var(--ate-primary);
}

.ate-expert-credentials-list a svg {
	width: 22px;
	height: 22px;
}

/* Actions */
.ate-expert-card-actions {
	padding: 16px 24px;
	background: var(--ate-bg-light);
}

.ate-expert-card-actions .button {
	width: 100%;
	text-align: center;
	padding: 12px 20px;
	border: none;
	background: var(--ate-primary);
	color: #fff;
	border-radius: 3px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	transition: var(--ate-transition);
}

.ate-expert-card-actions .button:hover {
	background: var(--ate-primary-dark);
}


/* Edit form wrapper */
.ate-edit-profile-form-wrapper {
	background: #fff;
	padding: 24px;
	border-top: 2px solid var(--ate-primary);
}

.ate-edit-profile-form-header {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--ate-primary);
}

.ate-edit-profile-form-header h4 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--ate-text-primary);
	letter-spacing: -0.2px;
}


.ate-profile-field {
	margin-bottom: 20px;
}

.ate-profile-field label {
	display: block;
	font-weight: 700;
	margin-bottom: 8px;
	font-size: 15px;
	color: var(--ate-text-primary);
	letter-spacing: -0.2px;
}

.ate-profile-field .description {
	margin-top: 6px;
	font-size: 13px;
	color: var(--ate-text-secondary);
	line-height: 1.5;
}

.ate-profile-textarea,
.ate-credential-username-input,
.ate-profile-headshot-input {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid #d1d5db;
	border-radius: 3px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
	background: #fff;
	color: var(--ate-text-primary);
	transition: var(--ate-transition);
}

.ate-profile-textarea,
.ate-credential-username-input,
.ate-profile-headshot-input:hover {
	border-color: #d1d5db;
}

.ate-profile-textarea:focus,
.ate-credential-username-input:focus,
.ate-profile-headshot-input:focus {
	outline: none;
	border-color: var(--ate-primary);
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
	background: #fff;
}

.ate-profile-textarea {
	min-height: 120px;
	resize: vertical;
	font-family: inherit;
}

.ate-profile-headshot-field {
	padding: 16px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 3px;
	transition: var(--ate-transition);
}

.ate-profile-headshot-field:hover {
	border-color: #d1d5db;
}

.ate-profile-headshot-preview {
	margin-bottom: 14px;
	text-align: center;
}

.ate-profile-headshot-preview img {
	max-width: 100%;
	max-height: 160px;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	transition: var(--ate-transition);
}

/* Credentials Fieldset */
.ate-profile-credentials-fieldset {
	border: none;
	padding: 0;
	margin: 0;
}

.ate-credential-platform {
	padding: 14px;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 3px;
	transition: var(--ate-transition);
}

.ate-credential-platform:hover {
	border-color: #d1d5db;
	background: #f9fafb;
}

.ate-credential-platform label {
	margin: 0;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	gap: 10px;
	align-items: center;
	color: var(--ate-text-primary);
	font-size: 15px;
}

.ate-credential-checkbox {
	width: 20px;
	height: 20px;
	cursor: pointer;
	flex-shrink: 0;
	accent-color: var(--ate-primary);
}

.ate-credential-username-input {
	margin-top: 10px !important;
}

.ate-specialisms {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ate-profile-specialisms label {
	margin: 0;
	font-weight: 500;
	cursor: pointer;
	display: flex;
	gap: 10px;
	align-items: center;
	color: var(--ate-text-primary);
	font-size: 15px;
	padding: 6px;
	border-radius: 6px;
	transition: var(--ate-transition);
}

.ate-profile-specialisms label:hover {
	background: var(--ate-bg-light);
}

.ate-profile-specialisms input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	cursor: pointer;
	flex-shrink: 0;
	accent-color: var(--ate-primary);
}

.ate-profile-status {
	padding: 14px 16px;
	border-radius: 3px;
	font-size: 14px;
	margin-bottom: 16px;
	border: none;
	border-left: 3px solid;
	background: transparent;
	line-height: 1.5;
}

.ate-profile-status.success {
	background: transparent;
	color: #16a34a;
	border-left-color: #16a34a;
}

.ate-profile-status.error {
	background: #fef2f2;
	color: #dc2626;
	border-left-color: #dc2626;
	padding: 14px 16px;
	margin-bottom: 16px;
}

.ate-profile-actions {
	display: flex;
	gap: 12px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--ate-border-light);
}

.ate-profile-actions .button {
	flex: 1;
	padding: 12px 20px;
	border: none;
	border-radius: 3px;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	transition: var(--ate-transition);
	letter-spacing: -0.1px;
}

.ate-profile-actions .button-primary {
	background: var(--ate-primary);
	color: #fff;
}

.ate-profile-actions .button-primary:hover {
	background: var(--ate-primary-dark);
}

.ate-profile-actions .button:not(.button-primary) {
	background: var(--ate-bg-lighter);
	color: var(--ate-text-primary);
	border: 1.5px solid var(--ate-border-light);
}

.ate-profile-actions .button:not(.button-primary):hover {
	background: #fff;
	border-color: var(--ate-text-secondary);
	box-shadow: var(--ate-shadow-sm);
}

/* ==================================================
   Related Answers Section
   ================================================== */

.ate-related-answers {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 2px solid #f0f0f0;
}

.ate-related-answers h4 {
	margin: 0 0 12px 0;
	font-size: 16px;
	font-weight: 600;
}

.ate-related-answers-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ate-related-answers-list li {
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.ate-related-answers-list li:last-child {
	border-bottom: none;
}

.ate-related-answers-list a {
	color: #0073aa;
	text-decoration: none;
}

.ate-related-answers-list a:hover {
	text-decoration: underline;
}

/* ==================================================
   Expert Profile Edit Form & Headshot Error
   ================================================== */

.ate-headshot-error {
	color: #dc2626;
	background: #fee2e2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 12px 14px;
	font-size: 14px;
	line-height: 1.5;
	margin-bottom: 12px;
	animation: slideDown 0.3s ease-out;
}

.ate-edit-profile-toggle {
	display: block;
	width: 100%;
	margin-top: 16px;
	padding: 14px 20px;
	text-align: center;
	font-weight: 600;
	font-size: 15px;
	background: var(--ate-primary);
	color: #fff;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	transition: var(--ate-transition);
	letter-spacing: -0.1px;
}

.ate-edit-profile-toggle:hover {
	background: var(--ate-primary-dark);
}

.ate-toggle-arrow {
	margin-left: 8px;
	display: inline-block;
	transition: var(--ate-transition);
	font-size: 12px;
}

.ate-toggle-arrow.open {
	transform: rotate(180deg);
}

.ate-edit-profile-form {
	padding: 20px;
	margin-top: 0;
	border: none;
	background: transparent;
	transition: var(--ate-transition);
}

.ate-edit-profile-form.visible {
	display: block;
}

/* ==================================================
   Registration Fields & GDPR Consent
   ================================================== */

.ate-registration-fields {
	background: #f0f7ff;
	border-left: 4px solid #0073aa;
	padding: 12px;
	margin-bottom: 16px;
	border-radius: 2px;
}

.ate-registration-fields h3 {
	margin: 0 0 8px 0;
	color: #0073aa;
	font-size: 16px;
}

.ate-registration-fields .description {
	margin: 8px 0 12px 0;
	font-size: 13px;
	color: #666;
	line-height: 1.5;
}

.ate-registration-fields label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	color: #333;
}

.ate-gdpr-field {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid #ddd;
}

.ate-gdpr-field--no-border {
	margin-top: 8px;
	padding-top: 0;
	border-top: none;
}

.ate-form-group .ate-gdpr-label {
	display: flex !important;
	gap: 8px;
	align-items: flex-start;
	font-size: 13px;
	font-weight: normal;
	cursor: pointer;
	line-height: 1.5;
	margin-bottom: 0;
}

.ate-form-group .ate-gdpr-label input[type="checkbox"] {
	margin-top: 3px;
	margin-right: 0;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	cursor: pointer;
	display: inline-block;
}

.ate-form-group .ate-gdpr-label a {
	color: #0073aa;
	text-decoration: none;
}

.ate-form-group .ate-gdpr-label a:hover {
	text-decoration: underline;
}

/* ==================================================
   Responsive
   ================================================== */

@media (max-width: 600px) {
	.ate-archive-controls {
		flex-direction: column;
		align-items: stretch;
	}

	.ate-archive-filter,
	.ate-archive-search {
		flex-direction: column;
	}

	.ate-archive-filter-select,
	.ate-archive-search-input {
		width: 100%;
	}

	.ate-expert-stats-top {
		grid-template-columns: 1fr;
	}

	.ate-expert-card-content {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.ate-expert-card-content .ate-expert-info {
		width: 100%;
	}


	.ate-answer-article {
		padding: 16px;
	}

	.ate-answer-title {
		font-size: 20px;
	}
}

/* ==================================================
   Upvote Button
   ================================================== */

.ate-upvote-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.ate-upvote-btn:hover:not(:disabled) {
	background: #e5e7eb;
	border-color: #9ca3af;
	color: #1f2937;
}

.ate-upvote-btn.ate-upvote-voted {
	background: #dbeafe;
	border-color: #7dd3fc;
	color: #0369a1;
}

.ate-upvote-btn.ate-upvote-voted:hover {
	background: #bfdbfe;
	border-color: #38bdf8;
	color: #0c4a6e;
}

.ate-upvote-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.ate-upvote-icon {
	font-size: 14px;
}

.ate-upvote-count {
	min-width: 20px;
	text-align: center;
}

/* ===================================================
 * Member Dashboard Button Styles
 * ===================================================
 * High-specificity selectors to override theme link colors.
 * Uses !important to ensure button text remains visible.
 */

.ate-dashboard-nav .ate-btn,
.ate-btn {
	display: inline-block;
	padding: 8px 16px;
	text-decoration: none;
	font-size: 13px;
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
}

.ate-dashboard-nav .ate-btn {
	display: block;
	padding: 12px 24px;
	line-height: 1.5;
	min-height: 44px;
	font-size: 13px;
	text-align: center;
}

.ate-dashboard-nav .ate-btn-primary,
.ate-btn-primary,
a.ate-btn-primary,
a.ate-btn-primary:visited {
	background: #0073aa;
	color: #fff !important;
}

.ate-dashboard-nav .ate-btn-primary:hover,
.ate-btn-primary:hover,
a.ate-btn-primary:hover {
	background: #005a87;
	color: #fff !important;
}

.ate-dashboard-nav .ate-btn-secondary,
.ate-btn-secondary,
a.ate-btn-secondary,
a.ate-btn-secondary:visited {
	background: #f0f0f0;
	color: #333 !important;
	border: 1px solid #ddd;
}

.ate-dashboard-nav .ate-btn-secondary:hover,
.ate-btn-secondary:hover,
a.ate-btn-secondary:hover {
	background: #e0e0e0;
	color: #333 !important;
}

/* Responsive button styles for mobile */
@media ( max-width: 600px ) {
	.ate-btn {
		display: block;
		width: 100%;
		text-align: center;
	}
}
