/**
 * RocketCite Blocks — Shared Frontend Styles
 *
 * Design tokens and base visual language for all citation-ready blocks.
 * Uses CSS custom properties so themes can override brand colors.
 * Loaded only when RocketCite blocks are present on the page.
 *
 * @package RocketCite
 */

/* Design tokens — override these in your theme to match your brand. */
.rocketcite-block {
	--rc-block-accent: #F15A27;
	--rc-block-accent-light: #FFF4F0;
	--rc-block-bg: #FAFAFA;
	--rc-block-border: #E5E7EB;
	--rc-block-text: #1F2937;
	--rc-block-text-muted: #6B7280;
	--rc-block-accent-hover: #D94E1F;
}

/* Block wrapper — subtle tinted card with refined border. */
.rocketcite-block {
	background: var(--rc-block-bg);
	border: 1px solid var(--rc-block-border);
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 1.5em;
	color: var(--rc-block-text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Citation-ready indicator badge — hidden on frontend by default. */
.rocketcite-block__badge {
	display: none;
}

/* Semantic content sections within blocks. */
.rocketcite-block__content {
	font-size: inherit;
	line-height: inherit;
}

/* Source link — branded accent color. */
.rocketcite-block__source {
	font-size: 0.875em;
	color: var(--rc-block-text-muted);
	margin-top: 12px;
}

.rocketcite-block__source a {
	color: var(--rc-block-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.rocketcite-block__source a:hover {
	color: var(--rc-block-accent-hover);
}

/**
 * Answer Capsule — Frontend Styles
 *
 * Premium callout card design for the AI Answer Capsule.
 * Extends the shared rocketcite-block styles from shared/styles/frontend.css.
 *
 * @package RocketCite
 */

/* Category badge — brand accent on light accent background. */
.rc-answer-capsule .rc-answer-capsule__category {
	display: inline-block;
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--rc-block-accent);
	background: var(--rc-block-accent-light);
	padding: 3px 10px;
	border-radius: 4px;
	margin-bottom: 10px;
	line-height: 1.4;
}

/* Topic/question — visually prominent heading. */
.rc-answer-capsule .rc-answer-capsule__topic {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--rc-block-text);
	margin: 0 0 0.5em;
	line-height: 1.35;
}

/* Answer text. */
.rc-answer-capsule .rc-answer-capsule__answer {
	font-size: inherit;
	line-height: 1.65;
	color: var(--rc-block-text);
}

.rc-answer-capsule .rc-answer-capsule__answer p {
	margin: 0;
}

/* Source link — subtle icon-like treatment with link icon prefix. */
.rc-answer-capsule .rocketcite-block__source {
	display: flex;
	align-items: baseline;
	gap: 0.35em;
	font-size: 0.8125rem;
	color: var(--rc-block-text-muted);
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--rc-block-border);
}

/* Link icon before "Source:" text. */
.rc-answer-capsule .rocketcite-block__source::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	/* Link icon as inline SVG data URI — chain link. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2714%27 height=%2714%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%236B7280%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71%27/%3E%3Cpath d=%27M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71%27/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	position: relative;
	top: 2px;
}

/* Mobile: stack gracefully. */
@media (max-width: 480px) {
	.rc-answer-capsule .rc-answer-capsule__topic {
		font-size: 1rem;
	}
}

/**
 * FAQ — Frontend Styles
 *
 * Accordion styles for the AI FAQ block using native <details>/<summary>.
 * CSS-only open/close animation via grid-based height transition.
 * Extends the shared rocketcite-block styles from shared/styles/frontend.css.
 *
 * @package RocketCite
 */

/* Accordion item. */
.rc-faq .rc-faq__pair {
	border-bottom: 1px solid var(--rc-block-border, #e5e7eb);
}

.rc-faq .rc-faq__pair:last-child {
	border-bottom: none;
}

/* Question summary — clickable toggle. */
.rc-faq .rc-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 0;
	font-size: 1rem;
	font-weight: 600;
	color: inherit;
	cursor: pointer;
	list-style: none;
}

/* Remove default marker in WebKit/Blink. */
.rc-faq .rc-faq__question::-webkit-details-marker {
	display: none;
}

/* Chevron indicator via CSS. */
.rc-faq .rc-faq__question::after {
	content: "";
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	background: var(--rc-block-text-muted, #6b7280);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2720%27 height=%2720%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2720%27 height=%2720%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27currentColor%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27m6 9 6 6 6-6%27/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.2s ease;
}

/* Rotate chevron when open. */
.rc-faq details[open] > .rc-faq__question::after {
	transform: rotate(180deg);
}

/* Grid-based height animation for smooth open/close. */
.rc-faq .rc-faq__answer {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.25s ease;
}

.rc-faq details[open] > .rc-faq__answer {
	grid-template-rows: 1fr;
}

.rc-faq .rc-faq__answer > div {
	overflow: hidden;
	padding: 0 0 14px;
}

.rc-faq .rc-faq__answer a {
	color: var(--rc-block-accent, #F15A27);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.rc-faq .rc-faq__answer a:hover {
	color: var(--rc-block-accent-hover);
}

/**
 * Comparison Table — Frontend Styles
 *
 * Modern data table with alternating rows, hover states, brand-accented header,
 * winner column prominence, and responsive horizontal scroll with fade shadows.
 * Extends the shared rocketcite-block styles from shared/styles/frontend.css.
 *
 * @package RocketCite
 */

/* Scroll wrapper — horizontal scroll on overflow with fade shadows. */
.rc-comparison-table__scroll {
	position: relative;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

/* Fade shadow on the right edge to hint at scrollable content.
   Only shown below the responsive breakpoint where the table overflows. */
.rc-comparison-table__scroll::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 32px;
	background: linear-gradient(to right, transparent, var(--rc-block-bg, #FAFAFA));
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

/* Table reset. */
.rc-comparison-table table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	font-size: inherit;
	line-height: inherit;
	min-width: 400px;
}

/* Caption. */
.rc-comparison-table .rc-comparison-table__caption {
	font-size: 1.1em;
	font-weight: 700;
	text-align: left;
	margin-bottom: 0.75em;
	caption-side: top;
	color: var(--rc-block-text);
}

/* Header cells — brand accent background. */
.rc-comparison-table th {
	font-weight: 600;
	text-align: left;
	padding: 0.625em 0.875em;
	border-bottom: 2px solid var(--rc-block-accent);
	background: var(--rc-block-accent-light);
	color: var(--rc-block-text);
}

/* Criteria column header — smaller, muted, uppercase label. */
.rc-comparison-table .rc-comparison-table__header--criteria {
	min-width: 120px;
	color: var(--rc-block-text-muted);
	background: transparent;
	font-size: 0.8125em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom-color: var(--rc-block-border);
}

/* Winner column highlight — stronger accent treatment. */
.rc-comparison-table .rc-comparison-table__header--winner {
	background: var(--rc-block-accent);
	color: #fff;
	border-bottom-color: var(--rc-block-accent);
	font-weight: 700;
}

.rc-comparison-table .rc-comparison-table__cell--winner {
	background: var(--rc-block-accent-light);
	font-weight: 600;
}

/* Row headers — criteria names. */
.rc-comparison-table .rc-comparison-table__row-header {
	font-weight: 600;
	background: transparent;
	border-bottom: 1px solid var(--rc-block-border);
	color: var(--rc-block-text);
}

/* Data cells. */
.rc-comparison-table td {
	padding: 0.625em 0.875em;
	border-bottom: 1px solid var(--rc-block-border);
}

/* Alternating row backgrounds. */
.rc-comparison-table tbody tr:nth-child(even) td,
.rc-comparison-table tbody tr:nth-child(even) th {
	background-color: rgba(0, 0, 0, 0.015);
}

/* Winner cells on even rows keep accent tint. */
.rc-comparison-table tbody tr:nth-child(even) .rc-comparison-table__cell--winner {
	background: var(--rc-block-accent-light);
}

/* Row hover state. */
.rc-comparison-table tbody tr:hover td,
.rc-comparison-table tbody tr:hover th {
	background-color: rgba(0, 0, 0, 0.035);
}

.rc-comparison-table tbody tr:hover .rc-comparison-table__cell--winner {
	background: var(--rc-block-accent-light);
}

/* Remove bottom border on last row. */
.rc-comparison-table tr:last-child td,
.rc-comparison-table tr:last-child th {
	border-bottom: none;
}

/* Indicator icons — semantic color backgrounds. */
.rc-comparison-table .rc-comparison-table__indicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25em;
	height: 1.25em;
	font-size: 0.75em;
	font-weight: 700;
	border-radius: 50%;
	margin-right: 0.375em;
	vertical-align: middle;
	line-height: 1;
}

/* Check = green. */
.rc-comparison-table .rc-comparison-table__cell--check .rc-comparison-table__indicator {
	color: #15803d;
	background: #dcfce7;
}

/* Cross = red. */
.rc-comparison-table .rc-comparison-table__cell--cross .rc-comparison-table__indicator {
	color: #dc2626;
	background: #fee2e2;
}

/* Tilde = amber. */
.rc-comparison-table .rc-comparison-table__cell--tilde .rc-comparison-table__indicator {
	color: #b45309;
	background: #fef3c7;
}

/* Source attribution (inherits from shared .rocketcite-block__source). */
.rc-comparison-table .rocketcite-block__source {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--rc-block-border);
}

.rc-comparison-table .rocketcite-block__source a {
	color: var(--rc-block-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.rc-comparison-table .rocketcite-block__source a:hover {
	color: var(--rc-block-accent-hover);
}

/* Mobile: ensure scroll wrapper is visible. */
@media (max-width: 600px) {
	.rc-comparison-table__scroll::after {
		opacity: 1;
	}
}

/**
 * Expert Authority — Frontend Styles
 *
 * Author bio card design with clear hierarchy and credential tags.
 * Extends the shared rocketcite-block styles from shared/styles/frontend.css.
 *
 * @package RocketCite
 */

/* Header: avatar + identity side by side. */
.rc-expert-authority .rc-expert-authority__header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

/* Avatar — subtle ring border for premium feel. */
.rc-expert-authority .rc-expert-authority__avatar {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid var(--rc-block-border);
	box-shadow: 0 0 0 3px var(--rc-block-accent-light);
}

/* Name heading — strong hierarchy. */
.rc-expert-authority .rc-expert-authority__name {
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--rc-block-text);
	margin: 0;
	line-height: 1.3;
}

/* Role/org — secondary text with clear hierarchy. */
.rc-expert-authority .rc-expert-authority__role {
	font-size: 0.8125rem;
	color: var(--rc-block-text-muted);
	margin: 3px 0 0;
	line-height: 1.4;
}

/* Bio text. */
.rc-expert-authority .rc-expert-authority__bio {
	font-size: inherit;
	line-height: 1.65;
	color: var(--rc-block-text);
	margin-bottom: 12px;
}

/* Credentials — inline tag treatment. */
.rc-expert-authority .rc-expert-authority__credentials {
	font-size: 0.8125rem;
	color: var(--rc-block-text);
	margin-bottom: 12px;
	line-height: 1.8;
}

.rc-expert-authority .rc-expert-authority__credentials strong {
	font-weight: 600;
	color: var(--rc-block-text-muted);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	display: block;
	margin-bottom: 6px;
}

/* Profile link — subtle with icon prefix. */
.rc-expert-authority .rc-expert-authority__profile {
	font-size: 0.8125rem;
	margin: 0;
	padding-top: 10px;
	border-top: 1px solid var(--rc-block-border);
}

.rc-expert-authority .rc-expert-authority__profile a {
	color: var(--rc-block-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	display: inline-flex;
	align-items: baseline;
	gap: 0.35em;
}

/* External link icon before profile URL. */
.rc-expert-authority .rc-expert-authority__profile a::before {
	content: "";
	display: inline-block;
	width: 13px;
	height: 13px;
	flex-shrink: 0;
	background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2713%27 height=%2713%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%23F15A27%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6%27/%3E%3Cpolyline points=%2715 3 21 3 21 9%27/%3E%3Cline x1=%2710%27 y1=%2714%27 x2=%2721%27 y2=%273%27/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	position: relative;
	top: 2px;
}

.rc-expert-authority .rc-expert-authority__profile a:hover {
	color: var(--rc-block-accent-hover);
}

/* Mobile: stack header vertically. */
@media (max-width: 480px) {
	.rc-expert-authority .rc-expert-authority__header {
		flex-direction: column;
		text-align: center;
	}
}

/**
 * Statistic — Frontend Styles
 *
 * Visual stat cards with brand accent values, card-within-card separation,
 * and stronger typographic hierarchy.
 * Extends the shared rocketcite-block styles from shared/styles/frontend.css.
 *
 * @package RocketCite
 */

/* Statistic list layout. */
.rc-statistic .rc-statistic__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Individual statistic — card-within-card visual separation. */
.rc-statistic .rc-statistic__item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 16px;
	margin: 0;
	background: #fff;
	border: 1px solid var(--rc-block-border);
	border-radius: 6px;
	transition: box-shadow 0.15s ease;
}

.rc-statistic .rc-statistic__item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Large statistic value — brand accent, visually prominent. */
.rc-statistic .rc-statistic__value {
	flex: 0 0 auto;
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.1;
	color: var(--rc-block-accent);
	min-width: 80px;
	letter-spacing: -0.02em;
}

/* Body with description + source. */
.rc-statistic .rc-statistic__body {
	flex: 1;
	min-width: 0;
}

/* Description text. */
.rc-statistic .rc-statistic__description {
	font-size: 1rem;
	line-height: 1.55;
	color: var(--rc-block-text);
	margin: 0 0 0.375em;
}

/* Source citation. */
.rc-statistic .rc-statistic__source {
	display: block;
	font-size: 0.8125rem;
	color: var(--rc-block-text-muted);
	font-style: normal;
}

.rc-statistic .rc-statistic__source-link {
	color: var(--rc-block-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.rc-statistic .rc-statistic__source-link:hover {
	color: var(--rc-block-accent-hover);
}

/* Date display. */
.rc-statistic .rc-statistic__date {
	color: var(--rc-block-text-muted);
}

/* Methodology note. */
.rc-statistic .rc-statistic__methodology {
	display: block;
	font-size: 0.75rem;
	color: var(--rc-block-text-muted);
	margin-top: 0.35em;
	opacity: 0.8;
}

/* Mobile: stack value on top. */
@media (max-width: 480px) {
	.rc-statistic .rc-statistic__item {
		flex-direction: column;
		gap: 8px;
	}

	.rc-statistic .rc-statistic__value {
		min-width: unset;
		font-size: 1.75rem;
	}
}

