/**
 * Next.io Author Blocks — front end + editor styles.
 *
 * Colours use theme palette tokens so light / dark mode toggles recolour the blocks.
 * Optional overrides (set them on .nextio-authors-hub, not :root, and use tokens so dark mode still works):
 *   .nextio-authors-hub { --nextio-authors-accent: var(--wp--preset--color--primary); }
 */

/* ---------- Shared ---------- */
.nextio-author-avatar {
	--nextio-avatar-size: 96px;
	width: var(--nextio-avatar-size);
	max-width: 100%;
	flex: 0 0 auto;
}
.nextio-author-avatar.aligncenter { margin-left: auto; margin-right: auto; }
.nextio-author-avatar img,
.nextio-author-avatar__img {
	display: block;
	width: var(--nextio-avatar-size);
	height: var(--nextio-avatar-size);
	max-width: 100%;
	object-fit: cover;
	border-radius: 50%;
}
.nextio-author-avatar.is-square img { border-radius: 4px; }
.nextio-author-avatar__link { display: inline-block; line-height: 0; }

.nextio-author-title {
	margin: 0;
	color: var(--nextio-accent, var(--nextio-authors-accent, currentColor));
	font-weight: 700;
}
.nextio-author-title.is-uppercase {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 0.8125em;
}

.nextio-author-credentials { margin: 0; opacity: 0.85; }
.nextio-author-credentials__label { font-weight: 700; opacity: 1; }

.nextio-author-beats { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em; }
.nextio-author-beats.is-style-list { display: block; }
.nextio-author-beats__label {
	font-weight: 700;
	font-size: 0.8125em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.nextio-author-beats__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0;
	padding: 0;
	list-style: none;
}
.nextio-author-beats__pills .nextio-author-beats__item {
	margin: 0;
	padding: 0.3em 0.8em;
	border: 1px solid var(--nextio-accent, var(--nextio-authors-accent, currentColor));
	border-radius: 999px;
	color: var(--nextio-accent, var(--nextio-authors-accent, currentColor));
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.nextio-author-beats__list { margin: 0.25em 0 0; }

.nextio-author-bio > :first-child { margin-top: 0; }
.nextio-author-bio > :last-child { margin-bottom: 0; }

.nextio-author-social .wp-block-social-links { margin: 0; padding: 0; }
.nextio-author-social .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.nextio-authors-notice {
	padding: 12px 14px;
	border: 1px dashed currentColor;
	border-radius: 4px;
	font-size: 13px;
	opacity: 0.7;
}

/* ---------- Author Profile ---------- */
.nextio-author-profile {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
}
.nextio-author-profile__aside {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	max-width: 260px;
}
.nextio-author-profile__aside .nextio-author-social { align-self: stretch; }
.nextio-author-profile__main {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.nextio-author-profile__name { margin: 0; }
.nextio-author-profile .nextio-author-title {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 0.875em;
}
.nextio-author-profile .nextio-author-bio { margin-top: 0.5rem; }

@media (max-width: 781px) {
	.nextio-author-profile { grid-template-columns: 1fr; }
	.nextio-author-profile__aside { align-items: flex-start; max-width: none; }
}

/* ---------- Authors Hub ----------
 * Colours come from the theme palette tokens (--nextio-tk-* are printed inline on the block:
 * base / contrast / accent = e.g. var(--wp--preset--color--base)). Because they are resolved on the
 * block element, a dark mode toggle that redefines the theme tokens (Next Dark Mode Toggle,
 * html.nxdm-dark) recolours the cards automatically. Hex values are only fallbacks for themes
 * without matching palette slugs.
 *
 * "Dark cards" (default): card = contrast token, text = base token.
 * "Light cards":          card = base token,     text = contrast token.
 * Muted text and borders are mixed from the card's own text + background, so they follow too.
 */
.nextio-authors-hub {
	--nextio-accent-default: var(--nextio-authors-accent, var(--nextio-tk-accent, #f5c400));
	--nextio-card-bg: var(--nextio-authors-card-bg, var(--nextio-tk-contrast, #1b1b1b));
	--nextio-card-text: var(--nextio-authors-card-text, var(--nextio-tk-base, #ffffff));
	--nextio-cols: 4;
	--nextio-cols-md: 3;
	--nextio-cols-sm: 2;
}
.nextio-authors-hub.is-style-light,
.is-style-light > .nextio-authors-hub {
	--nextio-accent-default: var(--nextio-authors-accent-light, var(--nextio-tk-accent, #9a6f00));
	--nextio-card-bg: var(--nextio-authors-card-bg-light, var(--nextio-tk-base, #ffffff));
	--nextio-card-text: var(--nextio-authors-card-text-light, var(--nextio-tk-contrast, #111111));
}
.nextio-authors-hub,
.nextio-authors-hub.is-style-light,
.is-style-light > .nextio-authors-hub {
	--nextio-card-muted: var(--nextio-authors-card-muted, color-mix(in srgb, var(--nextio-card-text) 70%, var(--nextio-card-bg)));
	--nextio-card-border: var(--nextio-authors-card-border, color-mix(in srgb, var(--nextio-card-text) 12%, var(--nextio-card-bg)));
}

.nextio-authors-hub__header {
	text-align: center;
	margin: 0 auto 2rem;
	max-width: 48rem;
}
.nextio-authors-hub__heading { margin: 0 0 0.5rem; }
.nextio-authors-hub__subheading { margin: 0; opacity: 0.75; }

.nextio-authors-hub__grid {
	display: grid;
	grid-template-columns: repeat(var(--nextio-cols), minmax(0, 1fr));
	gap: 16px;
}
@media (max-width: 1024px) {
	.nextio-authors-hub__grid { grid-template-columns: repeat(var(--nextio-cols-md), minmax(0, 1fr)); }
}
@media (max-width: 781px) {
	.nextio-authors-hub__grid { grid-template-columns: repeat(var(--nextio-cols-sm), minmax(0, 1fr)); }
}
@media (max-width: 480px) {
	.nextio-authors-hub__grid { grid-template-columns: 1fr; }
}

.nextio-author-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	height: 100%;
	box-sizing: border-box;
	padding: 20px;
	background: var(--nextio-card-bg);
	border: 1px solid var(--nextio-card-border);
	border-radius: 4px;
	color: var(--nextio-card-text);
	transition: border-color 0.2s ease;
}
.nextio-author-card:hover,
.nextio-author-card:focus-within {
	border-color: var(--nextio-accent, var(--nextio-accent-default));
}
.nextio-authors-hub.is-card-align-center .nextio-author-card { align-items: center; text-align: center; }
.nextio-authors-hub.is-card-align-center .nextio-author-beats__pills,
.nextio-authors-hub.is-card-align-center .wp-block-social-links { justify-content: center; }

.nextio-author-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.nextio-author-card__name {
	margin: 0;
	color: var(--nextio-card-text);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}
.nextio-author-card__name a {
	color: inherit;
	text-decoration: none;
}
.nextio-author-card__name a:hover,
.nextio-author-card__name a:focus { color: var(--nextio-accent, var(--nextio-accent-default)); }
.nextio-author-card__role {
	margin: 0;
	color: var(--nextio-accent, var(--nextio-accent-default));
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.nextio-author-card__credentials {
	margin: 0;
	color: var(--nextio-card-text);
	font-size: 0.75rem;
	font-style: italic;
	opacity: 0.85;
}
.nextio-author-card__bio {
	margin: 4px 0 0;
	color: var(--nextio-card-muted);
	font-size: 0.8125rem;
	line-height: 1.55;
}
.nextio-author-card .nextio-author-beats__pills .nextio-author-beats__item {
	border-color: var(--nextio-accent, var(--nextio-accent-default));
	color: var(--nextio-accent, var(--nextio-accent-default));
	font-size: 0.625rem;
}
.nextio-author-card__social { margin-top: auto; padding-top: 6px; color: var(--nextio-card-text); }

/* Monochrome social icons inside hub cards (NEXTPredict style); hover uses the accent. */
.nextio-author-card .wp-block-social-links.is-style-logos-only .wp-social-link {
	color: var(--nextio-card-muted);
}
.nextio-author-card .wp-block-social-links.is-style-logos-only .wp-social-link:hover,
.nextio-author-card .wp-block-social-links.is-style-logos-only .wp-social-link:focus-within {
	color: var(--nextio-accent, var(--nextio-accent-default));
}
.nextio-author-card .wp-block-social-links.is-style-logos-only .wp-social-link svg { fill: currentColor; }

/* Social links alignment (left / center / right). */
.nextio-author-social.is-justify-left .wp-block-social-links { justify-content: flex-start; }
.nextio-author-social.is-justify-center .wp-block-social-links { justify-content: center; }
.nextio-author-social.is-justify-right .wp-block-social-links { justify-content: flex-end; }
