/**
 * Nsemwokrom Authority Engine — front-end styles.
 *
 * @package Nsemwokrom\AuthorityEngine
 */

/* ---- Design tokens --------------------------------------------------- */
.nae-person-single,
.nae-person-archive,
.nae-related,
.nae-par {
	--nae-accent: #4f46e5;
	--nae-accent-2: #06b6d4;
	--nae-ink: #1d2327;
	--nae-muted: #6b7280;
	--nae-line: rgba(17, 24, 39, 0.1);
	--nae-radius: 16px;
}

/* ===================================================================== */
/* Single profile                                                        */
/* ===================================================================== */
.nae-person-single {
	max-width: 960px;
	margin: 2rem auto;
	padding: 0 1rem;
}

.nae-profile {
	background: #fff;
	color: var(--nae-ink);
	border-radius: var(--nae-radius);
	overflow: hidden;
	box-shadow: 0 10px 35px rgba(17, 24, 39, 0.1);
}

/* Cover banner — tinted featured image, or pure gradient as fallback. */
.nae-profile__cover {
	position: relative;
	height: 200px;
	background-color: var(--nae-accent);
	background-size: cover;
	background-position: center;
}

.nae-profile__cover-veil {
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg, var(--nae-accent) 0%, var(--nae-accent-2) 100%);
	opacity: 0.82;
}

/* Head — centered card; avatar overlaps the cover, text sits on white. */
.nae-profile__head {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 0 1.75rem 1.5rem;
	margin-top: -76px;
}

.nae-profile__avatar {
	flex: none;
	width: 148px;
	height: 148px;
	border-radius: 50%;
	overflow: hidden;
	border: 5px solid #fff;
	box-shadow: 0 8px 24px rgba(17, 24, 39, 0.18);
	background: #eef0f4;
	margin-bottom: 1rem;
}

.nae-profile__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nae-profile__avatar.is-initials {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 3rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	background: linear-gradient(135deg, var(--nae-accent), var(--nae-accent-2));
}

.nae-profile__intro {
	width: 100%;
	max-width: 640px;
}

.nae-profile__name {
	margin: 0;
	line-height: 1.15;
	font-size: clamp(1.7rem, 3.8vw, 2.4rem);
	color: var(--nae-ink);
}

.nae-profile__realname {
	margin: 0.3rem 0 0;
	color: var(--nae-muted);
	font-size: 0.95rem;
}

.nae-profile__types {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.7rem 0 0;
	justify-content: center;
}

.nae-pill {
	display: inline-block;
	padding: 0.22rem 0.75rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--nae-accent);
	background: rgba(79, 70, 229, 0.1);
	transition: background 0.15s ease, color 0.15s ease;
}

.nae-pill:hover {
	background: var(--nae-accent);
	color: #fff;
}

.nae-profile__tagline {
	margin: 0.7rem 0 0;
	color: var(--nae-muted);
	font-size: 0.98rem;
}

.nae-profile__socials {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
	justify-content: center;
}

.nae-social {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: var(--nae-ink);
	background: rgba(17, 24, 39, 0.06);
	transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.nae-social:hover {
	transform: translateY(-2px);
	color: #fff;
	background: var(--nae-accent);
}

/* Brand-tinted hovers. */
.nae-social--facebook:hover { background: #1877f2; }
.nae-social--x:hover { background: #000; }
.nae-social--instagram:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.nae-social--tiktok:hover { background: #010101; }
.nae-social--youtube:hover { background: #ff0000; }
.nae-social--website:hover { background: var(--nae-accent-2); }

/* Body — facts sidebar + main column. */
.nae-profile__body {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 2rem;
	padding: 0 1.75rem 1.75rem;
}

.nae-profile__facts {
	align-self: start;
}

.nae-profile__facts-title,
.nae-profile__section-title {
	margin: 0 0 0.9rem;
	padding-bottom: 0.5rem;
	font-size: 1.1rem;
	border-bottom: 2px solid rgba(79, 70, 229, 0.18);
}

.nae-fact-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.6rem;
	margin: 0;
}

.nae-fact {
	background: rgba(17, 24, 39, 0.03);
	border-left: 3px solid var(--nae-accent);
	border-radius: 10px;
	padding: 0.6rem 0.85rem;
}

.nae-fact dt {
	margin: 0;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--nae-muted);
}

.nae-fact dd {
	margin: 0.15rem 0 0;
	font-weight: 600;
}

.nae-profile__bio {
	margin-bottom: 2rem;
}

.nae-profile__bio-content {
	line-height: 1.75;
}

.nae-awards {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nae-awards li {
	position: relative;
	padding-left: 1.7rem;
	margin-bottom: 0.5rem;
	line-height: 1.5;
}

.nae-awards li::before {
	content: "\1F3C6"; /* trophy */
	position: absolute;
	left: 0;
	top: 0;
}

@media (max-width: 782px) {
	.nae-profile__body {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
}

/* ===================================================================== */
/* Archive grid                                                          */
/* ===================================================================== */
.nae-person-archive {
	max-width: 1100px;
	margin: 0 auto;
	padding: 1.5rem;
}

.nae-archive__header {
	margin-bottom: 1.5rem;
}

.nae-archive__title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.nae-archive__title::before {
	content: "";
	width: 5px;
	height: 1.1em;
	border-radius: 2px;
	background: linear-gradient(var(--nae-accent), var(--nae-accent-2));
}

.nae-archive__empty {
	color: var(--nae-muted);
}

.nae-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.25rem;
}

.nae-card {
	border: 1px solid var(--nae-line);
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nae-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12);
}

.nae-card__link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.nae-card__photo img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

.nae-card__body {
	padding: 0.85rem;
}

.nae-card__name {
	margin: 0 0 0.25rem;
	font-size: 1.05rem;
	line-height: 1.25;
}

.nae-card__meta {
	margin: 0;
	font-size: 0.85rem;
	color: var(--nae-muted);
}

/* ===================================================================== */
/* Related stories                                                       */
/* ===================================================================== */
.nae-related {
	margin: 2.5rem 0;
	clear: both;
}

.nae-related__title,
.nae-par__title {
	margin: 0 0 1rem;
	font-size: 1.3rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nae-related__title::before,
.nae-par__title::before {
	content: "";
	width: 4px;
	height: 1.1em;
	border-radius: 2px;
	background: linear-gradient(var(--nae-accent), var(--nae-accent-2));
}

.nae-related__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nae-related__item {
	margin-bottom: 0.75rem;
}

.nae-related__item a {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	text-decoration: none;
	color: inherit;
}

.nae-related__thumb img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.nae-related__name {
	font-weight: 600;
}

/* ===================================================================== */
/* People Also Read                                                      */
/* ===================================================================== */
.nae-par {
	margin: 2.5rem 0;
	clear: both;
}

.nae-card__badge {
	display: inline-block;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 700;
	background: var(--nae-accent);
	color: #fff;
	padding: 1px 7px;
	border-radius: 4px;
	margin-bottom: 4px;
}

.nae-card--person {
	border-color: rgba(79, 70, 229, 0.35);
}

/* ===================================================================== */
/* Profile share card                                                    */
/* ===================================================================== */
/* Icon-only share button, sitting inline with the social icons. */
.nae-share-btn {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #fff;
	background: linear-gradient(120deg, var(--nae-accent, #4f46e5), var(--nae-accent-2, #06b6d4));
	box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nae-share-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(79, 70, 229, 0.42);
	color: #fff;
}

/* Modal overlay. */
.nae-share-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.nae-share-modal[hidden] {
	display: none;
}

.nae-share-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.65);
	backdrop-filter: blur(4px);
}

body.nae-share-open {
	overflow: hidden;
}

.nae-share-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	background: #f4f5f9;
	border-radius: 22px;
	box-shadow: 0 24px 70px rgba(17, 24, 39, 0.4);
	animation: nae-share-pop 0.22s ease;
}

@keyframes nae-share-pop {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.nae-share-modal__close {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	z-index: 2;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	color: #fff;
	background: rgba(17, 24, 39, 0.35);
	transition: background 0.15s ease;
}

.nae-share-modal__close:hover {
	background: rgba(17, 24, 39, 0.6);
}

/* Share card — a clean "cover story" poster: full-bleed portrait with a
   masthead up top and a headline (category · name · role) over a dark scrim
   at the bottom, plus a small QR. Brand gold is the single accent. */
.nae-share-card {
	--nae-gold: #E2A618;
	position: relative;
	aspect-ratio: 540 / 675;
	text-align: left;
	background: #0E1013;
	color: #fff;
	border-radius: 22px 22px 0 0;
	overflow: hidden;
}

.nae-share-card__photo {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: #15171C;
}

.nae-share-card__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 22%;
	display: block;
}

/* Top + bottom scrims keep the masthead and headline legible. */
.nae-share-card__photo::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 26%;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

.nae-share-card__photo::after {
	content: "";
	position: absolute;
	inset: 30% 0 0 0;
	background: linear-gradient(
		180deg,
		rgba(8, 9, 11, 0) 0%,
		rgba(8, 9, 11, 0.7) 38%,
		rgba(8, 9, 11, 0.97) 62%,
		rgba(8, 9, 11, 1) 78%,
		rgba(8, 9, 11, 1) 100%
	);
}

.nae-share-card__photo.is-initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #2A2F3A, #12141A);
}

.nae-share-card__initials {
	font-size: 5rem;
	font-weight: 800;
	color: rgba(255, 255, 255, 0.9);
	transform: translateY(-14%);
}

/* Masthead wordmark, top-left, underlined with a short gold rule. */
.nae-share-card__brand {
	position: absolute;
	z-index: 2;
	top: 1.15rem;
	left: 1.3rem;
	display: inline-block;
	padding-bottom: 7px;
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #fff;
}

.nae-share-card__brand::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 34px;
	height: 3px;
	background: var(--nae-gold);
}

.nae-share-card__body {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0 1.3rem 1.25rem;
}

.nae-share-card__kicker {
	display: inline-block;
	font-size: 0.64rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--nae-gold);
}

.nae-share-card__name {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0.35rem 0 0;
	font-size: 1.85rem;
	font-weight: 800;
	line-height: 1.1;
	color: #fff;
}

.nae-share-card__badge {
	display: inline-flex;
	flex: none;
	line-height: 0;
}

.nae-share-card__badge svg {
	width: 1.05em;
	height: 1.05em;
}

.nae-share-card__tagline {
	margin: 0.3rem 0 0;
	font-size: 0.9rem;
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.78);
}

.nae-share-card__summary {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin: 0.4rem 0 0;
	font-size: 0.78rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.66);
}

.nae-share-card__footer {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.8rem;
}

.nae-share-card__scan {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.nae-share-card__hint {
	margin: 0;
	font-size: 0.6rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.6);
}

.nae-share-card__url {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: #fff;
	word-break: break-all;
}

.nae-share-card__qr {
	flex: none;
	padding: 7px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
	line-height: 0;
}

.nae-share-card__qr canvas {
	width: 60px;
	height: 60px;
	display: block;
}

/* Action row under the card. */
.nae-share-modal__actions {
	display: flex;
	gap: 0.6rem;
	padding: 1rem 1.2rem 1.2rem;
}

.nae-share-action {
	flex: 1;
	padding: 0.6rem 0.4rem;
	border: 1px solid rgba(79, 70, 229, 0.35);
	border-radius: 10px;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	color: var(--nae-accent, #4f46e5);
	background: #fff;
	transition: background 0.15s ease, color 0.15s ease;
}

.nae-share-action:hover {
	background: rgba(79, 70, 229, 0.08);
}

.nae-share-action--primary {
	border: 0;
	color: #fff;
	background: linear-gradient(120deg, var(--nae-accent, #4f46e5), var(--nae-accent-2, #06b6d4));
}

.nae-share-action--primary:hover {
	background: linear-gradient(120deg, #4338ca, #0891b2);
}

.nae-share-action:disabled {
	opacity: 0.75;
	cursor: default;
}

@media (max-width: 480px) {
	.nae-share-modal__actions {
		flex-direction: column;
	}
}


.nae-related-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:16px;margin-top:16px}
.nae-related-card{text-decoration:none;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:10px;text-align:center}
.nae-related-card img{width:80px;height:80px;object-fit:cover;border-radius:50%;margin:0 auto 8px}
.nae-related-name{display:block;font-weight:600;color:#111827}

.nae-news-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px;margin:20px 0}
.nae-news-card{display:block;text-decoration:none}
.nae-news-title{display:block;font-weight:600;margin-top:8px}

/* Advanced share UI refresh */
.nae-share-modal__dialog{border-radius:24px;overflow:hidden;box-shadow:0 25px 70px rgba(0,0,0,.25)}
.nae-share-action--primary{background:linear-gradient(135deg,#4f46e5,#06b6d4);color:#fff}

/* Grid/flex items refuse to shrink below their content's width by default
   (min-width:auto), so a wide table inside the profile body forces the whole
   layout past the viewport on phones instead of scrolling in its wrapper.
   min-width:0 restores normal shrinking; the wrapper then scrolls as intended. */
.nae-profile__main,
.nae-profile__bio-content,
.nae-profile__bio {
	min-width: 0;
	max-width: 100%;
}

/* Imported Wikipedia tables (search & pick "include tables" option).
   The wrapper scrolls horizontally; min-width keeps columns readable on
   phones instead of crushing them, and the layered background paints
   scroll-edge shadows so readers can see there is more to swipe. */
.nae-table-wrap{
	overflow-x:auto;
	-webkit-overflow-scrolling:touch;
	max-width:100%;
	margin:0 0 1.25em;
	background:
		linear-gradient(to right,#fff 30%,rgba(255,255,255,0)),
		linear-gradient(to left,#fff 30%,rgba(255,255,255,0)) 100% 0,
		radial-gradient(farthest-side at 0 50%,rgba(22,22,26,.18),rgba(22,22,26,0)),
		radial-gradient(farthest-side at 100% 50%,rgba(22,22,26,.18),rgba(22,22,26,0)) 100% 0;
	background-repeat:no-repeat;
	background-size:48px 100%,48px 100%,16px 100%,16px 100%;
	background-attachment:local,local,scroll,scroll;
}
.nae-wiki-table{width:100%;min-width:560px;border-collapse:collapse;font-size:.92em;background:transparent}
.nae-wiki-table th,.nae-wiki-table td{border:1px solid #e6e6e3;padding:.5em .7em;text-align:left;vertical-align:top}
.nae-wiki-table th{background:#f5f5f3;font-weight:600}
.nae-wiki-table caption{caption-side:top;font-weight:600;text-align:left;padding:.35em 0}
@media (max-width:600px){
	.nae-wiki-table{font-size:.85em;min-width:520px}
	.nae-wiki-table th,.nae-wiki-table td{padding:.45em .55em}
}

/* ===========================================================================
   FAQ accordion (theme-independent — self-contained styles).
   ======================================================================== */
.nae-faq{margin:2.5rem 0;}
.nae-faq__heading{font-size:1.5rem;line-height:1.3;margin:0 0 1rem;color:inherit;}
.nae-faq__list{display:flex;flex-direction:column;gap:.5rem;}
.nae-faq__item{border:1px solid rgba(0,0,0,.13);border-radius:10px;background:#fff;overflow:hidden;transition:border-color .15s ease;}
.nae-faq__q{cursor:pointer;list-style:none;padding:1rem 2.8rem 1rem 1.2rem;font-weight:600;font-size:1rem;position:relative;color:#161A1F;line-height:1.4;}
.nae-faq__q::-webkit-details-marker{display:none;}
.nae-faq__q::after{content:"+";position:absolute;right:1.1rem;top:50%;transform:translateY(-50%);font-weight:700;font-size:1.3rem;line-height:1;color:#C8920A;transition:opacity .2s ease;}
.nae-faq__item[open] .nae-faq__q::after{content:"\2212";}
.nae-faq__q:hover,.nae-faq__q:focus{background:rgba(0,0,0,.03);}
.nae-faq__a{padding:0 1.2rem 1.1rem;}
.nae-faq__a p{margin:0;line-height:1.7;color:#4B5563;}
/* Dark mode — prefers-color-scheme for standalone use */
@media (prefers-color-scheme:dark){
	.nae-faq__item{background:#17191E;border-color:rgba(255,255,255,.12);}
	.nae-faq__q{color:#ECEEF1;}
	.nae-faq__q::after{color:#D4A930;}
	.nae-faq__q:hover,.nae-faq__q:focus{background:rgba(255,255,255,.05);}
	.nae-faq__a p{color:#9AA1AC;}
}
/* Dark mode — html.agd-dark class (Agyedin theme toggle) */
html.agd-dark .nae-faq__item{background:var(--agd-card,#15181D);border-color:var(--agd-line,rgba(255,255,255,.12));}
html.agd-dark .nae-faq__q{color:var(--agd-ink,#ECEEF1);}
html.agd-dark .nae-faq__q::after{color:var(--agd-gold,#E2A618);}
html.agd-dark .nae-faq__q:hover,html.agd-dark .nae-faq__q:focus{background:rgba(255,255,255,.05);}
html.agd-dark .nae-faq__a p{color:var(--agd-muted,#9AA1AC);}

/* ===== Birthday card modal (canvas preview + actions) ===== */
.nae-bday-modal{position:fixed;inset:0;z-index:99999;display:flex;align-items:center;justify-content:center;padding:1rem;}
.nae-bday-modal[hidden]{display:none;}
body.nae-bday-open{overflow:hidden;}
.nae-bday-modal__backdrop{position:absolute;inset:0;background:rgba(17,24,39,.65);backdrop-filter:blur(4px);}
.nae-bday-modal__dialog{position:relative;width:100%;max-width:440px;max-height:calc(100vh - 2rem);overflow-y:auto;background:#0E1013;border-radius:22px;box-shadow:0 25px 70px rgba(0,0,0,.45);animation:nae-share-pop .22s ease;}
.nae-bday-modal__close{position:absolute;top:.6rem;right:.6rem;z-index:2;width:34px;height:34px;border:0;border-radius:50%;font-size:1.3rem;line-height:1;cursor:pointer;color:#fff;background:rgba(255,255,255,.18);transition:background .15s ease;}
.nae-bday-modal__close:hover{background:rgba(255,255,255,.34);}
.nae-bday-preview{display:block;width:100%;height:auto;border-radius:22px 22px 0 0;}
.nae-bday-modal__actions{display:flex;gap:.6rem;padding:1rem 1.2rem 1.2rem;}
.nae-bday-modal .nae-share-action{border-color:rgba(226,166,24,.4);color:#C8920A;}
.nae-bday-modal .nae-share-action:hover{background:rgba(226,166,24,.1);}
.nae-bday-modal .nae-share-action--primary{border:0;color:#15171C;background:linear-gradient(135deg,#E2A618,#C8920A);}
.nae-bday-modal .nae-share-action--primary:hover{background:linear-gradient(135deg,#E9B53A,#B5840A);}
@media (max-width:480px){.nae-bday-modal__actions{flex-direction:column;}}
