/* AI Author Hub Pro — public-facing styles (profile page + author box). */

.aahp-profile-page,
.aahp-author-box-wrap {
	--aahp-bg: #ffffff;
	--aahp-fg: #1d2327;
	--aahp-muted: #646970;
	--aahp-border: #dcdcde;
	--aahp-accent: #2271b1;
	--aahp-card-bg: #f6f7f7;

	max-width: 860px;
	margin: 0 auto;
	padding: 24px 16px;
	color: var(--aahp-fg);
}

/* Respect the OS preference automatically... */
@media (prefers-color-scheme: dark) {
	.aahp-profile-page,
	.aahp-author-box-wrap {
		--aahp-bg: #1d2327;
		--aahp-fg: #f0f0f1;
		--aahp-muted: #a7aaad;
		--aahp-border: #3c434a;
		--aahp-accent: #72aee6;
		--aahp-card-bg: #2c3338;
	}
}

/* ...and let the on-page toggle override it explicitly either way. */
.aahp-dark-mode-on {
	--aahp-bg: #1d2327;
	--aahp-fg: #f0f0f1;
	--aahp-muted: #a7aaad;
	--aahp-border: #3c434a;
	--aahp-accent: #72aee6;
	--aahp-card-bg: #2c3338;
}

.aahp-dark-mode-off {
	--aahp-bg: #ffffff;
	--aahp-fg: #1d2327;
	--aahp-muted: #646970;
	--aahp-border: #dcdcde;
	--aahp-accent: #2271b1;
	--aahp-card-bg: #f6f7f7;
}

/* ---- Profile header ---------------------------------------------- */

.aahp-profile-header {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	margin-bottom: 24px;
	position: relative;
}

.aahp-profile-header__photo img {
	border-radius: 50%;
	width: 120px;
	height: 120px;
	object-fit: cover;
}

.aahp-profile-header__name {
	margin: 0 0 4px;
	font-size: 28px;
}

.aahp-profile-header__role,
.aahp-profile-header__location {
	margin: 2px 0;
	color: var(--aahp-muted);
}

.aahp-profile-header__social {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 10px 0 0;
	padding: 0;
}

.aahp-profile-header__social a {
	color: var(--aahp-accent);
	text-decoration: none;
}

.aahp-dark-mode-toggle {
	position: absolute;
	top: 0;
	right: 0;
	background: none;
	border: 1px solid var(--aahp-border);
	border-radius: 4px;
	padding: 4px 8px;
	cursor: pointer;
	font-size: 16px;
}

/* ---- Bio / stats --------------------------------------------------- */

.aahp-profile-bio,
.aahp-profile-articles,
.aahp-profile-related,
.aahp-profile-share {
	margin-bottom: 28px;
}

.aahp-profile-stats {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 28px;
}

.aahp-stat {
	background: var(--aahp-card-bg);
	border: 1px solid var(--aahp-border);
	border-radius: 6px;
	padding: 14px 18px;
	flex: 1;
	min-width: 160px;
	text-align: center;
}

.aahp-stat--total {
	border-color: var(--aahp-accent);
}

.aahp-stat__value {
	display: block;
	font-size: 24px;
	font-weight: 700;
}

.aahp-stat__label {
	display: block;
	font-size: 12px;
	color: var(--aahp-muted);
}

.aahp-stat__note {
	display: block;
	font-size: 11px;
	color: var(--aahp-muted);
	font-style: italic;
	margin-top: 2px;
}

/* ---- Filters + article list ---------------------------------------- */

.aahp-profile-filters {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.aahp-profile-filters input[type="text"],
.aahp-profile-filters select {
	padding: 6px 8px;
	border: 1px solid var(--aahp-border);
	border-radius: 4px;
	background: var(--aahp-bg);
	color: var(--aahp-fg);
}

.aahp-profile-articles__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aahp-profile-article {
	display: flex;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--aahp-border);
	align-items: center;
}

.aahp-profile-article__thumb img {
	border-radius: 4px;
	width: 72px;
	height: 72px;
	object-fit: cover;
}

.aahp-profile-article__title {
	display: block;
	font-weight: 600;
	color: var(--aahp-fg);
	text-decoration: none;
}

.aahp-profile-article__date {
	font-size: 12px;
	color: var(--aahp-muted);
}

.aahp-profile-pagination {
	margin-top: 16px;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.aahp-profile-pagination .page-numbers {
	padding: 4px 10px;
	border: 1px solid var(--aahp-border);
	border-radius: 4px;
	text-decoration: none;
	color: var(--aahp-fg);
}

.aahp-profile-pagination .page-numbers.current {
	background: var(--aahp-accent);
	color: #fff;
	border-color: var(--aahp-accent);
}

/* ---- Related authors + share ---------------------------------------- */

.aahp-profile-related__list,
.aahp-profile-share__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 0;
	padding: 0;
}

.aahp-profile-related__list a {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: var(--aahp-fg);
}

.aahp-profile-related__list img {
	border-radius: 50%;
	width: 40px;
	height: 40px;
	object-fit: cover;
}

.aahp-profile-share__list a {
	color: var(--aahp-accent);
	text-decoration: none;
}

/* ---- Author box (beneath article content) --------------------------- */

.aahp-author-box-wrap {
	max-width: none;
	padding: 0;
	margin-top: 32px;
}

.aahp-author-box {
	display: flex;
	gap: 16px;
	background: var(--aahp-card-bg);
	border: 1px solid var(--aahp-border);
	border-radius: 8px;
	padding: 18px;
	margin-bottom: 12px;
}

.aahp-author-box__photo img {
	border-radius: 50%;
	width: 72px;
	height: 72px;
	object-fit: cover;
}

.aahp-author-box__name {
	display: block;
	font-weight: 700;
	font-size: 16px;
	color: var(--aahp-fg);
	text-decoration: none;
}

.aahp-author-box__role {
	display: block;
	font-size: 12px;
	color: var(--aahp-accent);
	text-transform: uppercase;
	letter-spacing: .04em;
	margin-bottom: 4px;
}

.aahp-author-box__bio {
	margin: 6px 0;
	color: var(--aahp-muted);
	font-size: 14px;
}

.aahp-author-box__stats {
	font-size: 12px;
	color: var(--aahp-muted);
	margin: 6px 0;
}

.aahp-author-box__link {
	display: inline-block;
	margin-top: 6px;
	padding: 6px 14px;
	border-radius: 4px;
	background: var(--aahp-accent);
	color: #fff;
	text-decoration: none;
	font-size: 13px;
}

/* ---- Byline shortcode ------------------------------------------------ */

.aahp-byline .aahp-byline-author {
	color: inherit;
	text-decoration: underline;
}

/* ---- Elementor widgets: grid + search -------------------------------- */

.aahp-widget-placeholder {
	color: var(--aahp-muted, #646970);
	font-style: italic;
}

.aahp-widget-grid {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(3, 1fr);
}

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

.aahp-widget-grid__item .aahp-author-card {
	background: var(--aahp-card-bg, #f6f7f7);
	border: 1px solid var(--aahp-border, #dcdcde);
	border-radius: 8px;
	padding: 16px;
	height: 100%;
}

@media (max-width: 782px) {
	.aahp-widget-grid--cols-3,
	.aahp-widget-grid--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.aahp-widget-grid {
		grid-template-columns: 1fr;
	}
}

.aahp-widget-search {
	position: relative;
	max-width: 420px;
}

.aahp-widget-search__input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--aahp-border, #dcdcde);
	border-radius: 6px;
}

.aahp-widget-search__results {
	position: absolute;
	z-index: 10;
	top: 100%;
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--aahp-border, #dcdcde);
	border-radius: 0 0 6px 6px;
	margin: -1px 0 0;
	padding: 0;
	list-style: none;
	box-shadow: 0 4px 10px rgba(0,0,0,.1);
}

.aahp-widget-search__results li {
	padding: 10px 14px;
	cursor: pointer;
}

.aahp-widget-search__results li:hover {
	background: #f6f7f7;
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 600px) {
	.aahp-profile-header {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}

	.aahp-dark-mode-toggle {
		position: static;
		margin-top: 10px;
	}

	.aahp-author-box {
		flex-direction: column;
		text-align: center;
		align-items: center;
	}

	.aahp-profile-stats {
		flex-direction: column;
	}
}
