/*
 * FAQ Architecture — Frontend Styles
 * Scoped to .faqarch-hub and .faqarch-question.
 * --faqarch-accent is injected inline by FAQARCH_Frontend::enqueue_assets().
 */

/* ── Custom properties ───────────────────────────────────────────── */
:root {
	--faqarch-accent: #2563eb; /* fallback; overridden by inline style from FAQARCH_Frontend::enqueue_assets() */
	--faqarch-accent-light: color-mix(in srgb, var(--faqarch-accent) 12%, white);
	--faqarch-radius: 6px;
	--faqarch-text: #1a1a1a;
	--faqarch-text-muted: #6b7280;
	--faqarch-border: #e5e7eb;
	--faqarch-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Base wrappers ───────────────────────────────────────────────── */
.faqarch-hub,
.faqarch-question {
	font-family: var(--faqarch-font);
	color: var(--faqarch-text);
	max-width: 1100px;
	margin: 0 auto;
	padding: 1.5rem 1rem;
	box-sizing: border-box;
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.faqarch-breadcrumb {
	font-size: 0.85rem;
	color: var(--faqarch-text-muted);
	margin-bottom: 1.5rem;
}

.faqarch-breadcrumb a {
	color: var(--faqarch-accent);
	text-decoration: none;
}

.faqarch-breadcrumb a:hover {
	text-decoration: underline;
}

/* ── Hub header ──────────────────────────────────────────────────── */
.faqarch-hub__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--faqarch-border);
}

.faqarch-hub__header-text {
	flex: 1 1 0;
	min-width: 0;
}

.faqarch-hub__header-text h1 {
	margin: 0 0 0.5rem;
	font-size: clamp(1.5rem, 3vw, 2rem);
	line-height: 1.2;
}

.faqarch-hub__intro {
	color: var(--faqarch-text-muted);
	margin: 0;
	line-height: 1.6;
}

/* ── Count badge ─────────────────────────────────────────────────── */
.faqarch-count-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--faqarch-accent);
	color: #fff;
	border-radius: var(--faqarch-radius);
	padding: 0.75rem 1.25rem;
	min-width: 7rem;
	text-align: center;
	flex-shrink: 0;
}

.faqarch-count-badge__number {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1;
}

.faqarch-count-badge__label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.9;
	margin-top: 0.25rem;
}

/* ── Mode A: numbered question list ─────────────────────────────── */
.faqarch-question-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.faqarch-question-list__item a {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.875rem 0.75rem;
	border-bottom: 1px solid var(--faqarch-border);
	text-decoration: none;
	color: var(--faqarch-text);
	border-radius: var(--faqarch-radius);
	transition: background 0.15s ease;
}

.faqarch-question-list__item:last-child a {
	border-bottom: none;
}

.faqarch-question-list__item a:hover {
	background: var(--faqarch-accent-light);
}

.faqarch-q-number {
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--faqarch-accent);
	min-width: 2rem;
	font-variant-numeric: tabular-nums;
	flex-shrink: 0;
}

.faqarch-q-text {
	flex: 1;
	line-height: 1.4;
}

.faqarch-q-arrow {
	color: var(--faqarch-accent);
	opacity: 0.7;
	flex-shrink: 0;
}

/* ── Tag groups (Mode A) ─────────────────────────────────────────── */
.faqarch-tag-group {
	margin-bottom: 2.5rem;
}

.faqarch-tag-group__heading {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 0.5rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--faqarch-accent);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
}

.faqarch-tag-group__name {
	color: var(--faqarch-text);
	flex: 1;
}

.faqarch-tag-group__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--faqarch-accent);
	color: #fff;
	border-radius: 2rem;
	padding: 0.1rem 0.55rem;
	font-size: 0.75rem;
	font-weight: 700;
	min-width: 1.4rem;
}

.faqarch-tag-group--untagged .faqarch-tag-group__heading {
	border-bottom-color: var(--faqarch-border);
}

.faqarch-tag-group--untagged .faqarch-tag-group__count {
	background: var(--faqarch-text-muted);
}

/* ── Mode B: inline Q&A blocks ───────────────────────────────────── */
.faqarch-qa-item {
	margin-bottom: 1.5rem;
}

.faqarch-qa-item__question {
	margin: 0 0 0.5rem;
	padding-left: 0.75rem;
	border-left: 3px solid var(--faqarch-accent);
	font-size: 1.2rem;
	line-height: 1.3;
}

.faqarch-qa-item__answer {
	background: var(--faqarch-accent-light);
	border-radius: var(--faqarch-radius);
	padding: 1rem 1.25rem;
	line-height: 1.7;
}

.faqarch-qa-item__answer p:first-child { margin-top: 0; }
.faqarch-qa-item__answer p:last-child  { margin-bottom: 0; }

.faqarch-qa-item__answer strong {
	font-weight: 600;
	color: var(--faqarch-text);
}

/* ── Question page layout ────────────────────────────────────────── */
.faqarch-question__layout {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.faqarch-question__title {
	margin: 0 0 1rem;
	font-size: clamp(1.4rem, 3vw, 1.9rem);
	line-height: 1.25;
}

.faqarch-question__answer {
	line-height: 1.75;
}

.faqarch-question__answer p:first-child { margin-top: 0; }

.faqarch-question__answer strong {
	font-weight: 600;
	color: var(--faqarch-text);
}

/* ── Trust block ─────────────────────────────────────────────────── */
.faqarch-trust {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 1.25rem;
	font-size: 0.85rem;
	color: var(--faqarch-text-muted);
	background: var(--faqarch-accent-light);
	border-radius: var(--faqarch-radius);
	padding: 0.75rem 1rem;
	margin-bottom: 1.5rem;
}

/* ── Cite button ─────────────────────────────────────────────────── */
.faqarch-cite-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	background: none;
	border: 1px solid var(--faqarch-accent);
	color: var(--faqarch-accent);
	border-radius: var(--faqarch-radius);
	padding: 0.3rem 0.75rem;
	font-size: 0.8rem;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	margin-left: auto;
}

.faqarch-cite-btn:hover,
.faqarch-cite-btn.is-copied {
	background: var(--faqarch-accent);
	color: #fff;
}

/* ── Comments wrapper ────────────────────────────────────────────── */
.faqarch-question__comments {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid var(--faqarch-border);
}

/* ── Sidebar (hidden on mobile, shown on tablet+) ────────────────── */
.faqarch-question__sidebar {
	display: none;
}

.faqarch-related__heading {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--faqarch-text-muted);
	margin: 0 0 0.75rem;
}

.faqarch-related__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.faqarch-related__list li {
	border-bottom: 1px solid var(--faqarch-border);
}

.faqarch-related__list a {
	display: block;
	padding: 0.6rem 0;
	font-size: 0.9rem;
	color: var(--faqarch-text);
	text-decoration: none;
	line-height: 1.4;
}

.faqarch-related__list a:hover {
	color: var(--faqarch-accent);
}

.faqarch-related__back {
	display: block;
	margin-top: 1.25rem;
	font-size: 0.85rem;
	color: var(--faqarch-accent);
	text-decoration: none;
}

.faqarch-related__back:hover {
	text-decoration: underline;
}

/* ── Mobile related strip ────────────────────────────────────────── */
.faqarch-related-strip {
	display: flex;
	gap: 0.75rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	margin-bottom: 1.5rem;
	scrollbar-width: thin;
}

.faqarch-related-strip a {
	display: inline-block;
	white-space: nowrap;
	background: var(--faqarch-accent-light);
	border: 1px solid var(--faqarch-border);
	border-radius: 2rem;
	padding: 0.35rem 0.9rem;
	font-size: 0.82rem;
	color: var(--faqarch-text);
	text-decoration: none;
	flex-shrink: 0;
}

.faqarch-related-strip a:hover {
	background: var(--faqarch-accent);
	color: #fff;
	border-color: var(--faqarch-accent);
}

/* ── Comment thread ─────────────────────────────────────────────── */
.faqarch-thread__heading {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--faqarch-text-muted);
	margin: 0 0 1.5rem;
}

.faqarch-thread__list,
.faqarch-comment__replies {
	list-style: none;
	margin: 0;
	padding: 0;
}

.faqarch-comment {
	margin-bottom: 1.5rem;
}

.faqarch-comment__inner {
	display: flex;
	gap: 0.875rem;
	align-items: flex-start;
}

.faqarch-comment__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}

.faqarch-comment__body {
	flex: 1;
	min-width: 0;
}

.faqarch-comment__reply-to {
	display: block;
	font-size: 0.78rem;
	color: var(--faqarch-text-muted);
	margin-bottom: 0.3rem;
}

.faqarch-comment__reply-to strong {
	color: var(--faqarch-accent);
	font-weight: 600;
}

.faqarch-comment__meta {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin-bottom: 0.375rem;
	flex-wrap: wrap;
}

.faqarch-comment__author {
	font-size: 0.875rem;
	font-weight: 600;
}

.faqarch-comment__date {
	font-size: 0.78rem;
	color: var(--faqarch-text-muted);
}

.faqarch-comment__text {
	font-size: 0.925rem;
	line-height: 1.65;
}

.faqarch-comment__text p:first-child { margin-top: 0; }
.faqarch-comment__text p:last-child  { margin-bottom: 0; }

.faqarch-comment__replies {
	margin-top: 1rem;
	padding-left: 1.25rem;
	border-left: 2px solid var(--faqarch-border);
}

/* ── Tablet: two columns (≥768px) ────────────────────────────────── */
/* 1.8.0 — sidebar renders on the LEFT (row-reverse) so the related-question
   nav reads as a primary-navigation column rather than a trailing aside. */
@media (min-width: 768px) {
	.faqarch-question__layout {
		flex-direction: row-reverse;
		align-items: flex-start;
		justify-content: flex-end;
	}

	.faqarch-question__main {
		flex: 0 0 67%;
		min-width: 0;
	}

	.faqarch-question__sidebar {
		display: block;
		flex: 0 0 calc(33% - 2rem);
		min-width: 0;
	}

	.faqarch-related-strip {
		display: none;
	}
}

/* ── Desktop: wider sidebar + sticky (≥1024px) ───────────────────── */
@media (min-width: 1024px) {
	.faqarch-question__main {
		flex: 0 0 65%;
	}

	.faqarch-question__sidebar {
		flex: 0 0 calc(35% - 2rem);
		position: sticky;
		top: 2rem;
	}
}
