/*
 * AK Scholar — component styles.
 *
 * Only the furniture around the author's text: the source line, byline, action
 * row, abstract, table wrapper, notes, references and citation block. Body prose
 * typography belongs to the AK Child theme, not here.
 *
 * Every custom property falls back, so this file is legible even if the theme
 * has not loaded its tokens.
 */

.ak-source-line {
	font-family: var(--ak-font-sans, system-ui, -apple-system, "Segoe UI", sans-serif);
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ak-muted, #6b6558);
	margin: 0 0 0.75rem;
}

.ak-subtitle {
	font-family: var(--ak-font-serif, Georgia, "Times New Roman", serif);
	font-size: clamp(1.125rem, 2.2vw, 1.5rem);
	font-style: italic;
	line-height: 1.35;
	color: var(--ak-muted, #6b6558);
	margin: -0.25rem 0 1rem;
}

.ak-byline {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.9375rem;
	color: var(--ak-ink, #23201b);
	margin: 0 0 1.25rem;
}

/* ---------- Action row ---------- */

.ak-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	padding: 0.875rem 0;
	margin: 0 0 2rem;
	border-top: 1px solid var(--ak-rule, #ded7c9);
	border-bottom: 1px solid var(--ak-rule, #ded7c9);
}

.ak-action {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.9375rem;
	text-decoration: none;
	color: var(--ak-accent, #1f5140);
	border-bottom: 1px solid transparent;
}

.ak-action:hover,
.ak-action:focus-visible {
	border-bottom-color: currentColor;
}

/* ---------- Abstract ---------- */

.ak-abstract {
	background: var(--ak-tint, #f4f1e9);
	border-left: 3px solid var(--ak-accent, #1f5140);
	padding: 1.25rem 1.5rem;
	margin: 0 0 2.5rem;
}

.ak-abstract__label {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ak-muted, #6b6558);
	margin: 0 0 0.75rem;
}

.ak-abstract p {
	font-size: 1rem;
	line-height: 1.6;
	margin: 0 0 0.75rem;
	text-indent: 0;
}

.ak-abstract p:last-child {
	margin-bottom: 0;
}

.ak-abstract strong {
	font-weight: 600;
}

/* ---------- Tables ----------
 * The wrapper scrolls; the table itself never collapses into a single column,
 * because a stacked comparison table is no longer a comparison.
 */

.ak-table-scroll {
	overflow-x: auto;
	max-width: 100%;
	margin: 0 0 0.5rem;
	-webkit-overflow-scrolling: touch;
}

.ak-table-scroll:focus-visible {
	outline: 2px solid var(--ak-accent, #1f5140);
	outline-offset: 2px;
}

.ak-table-scroll table {
	border-collapse: collapse;
	width: 100%;
	min-width: 32rem;
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.9375rem;
	line-height: 1.45;
}

.ak-table-scroll th,
.ak-table-scroll td {
	padding: 0.625rem 0.875rem;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--ak-rule, #ded7c9);
}

.ak-table-scroll thead th {
	font-weight: 600;
	border-bottom: 2px solid var(--ak-ink, #23201b);
	white-space: nowrap;
}

/* Caption sits ABOVE the table, matching the source's own convention. */
.ak-table-caption {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ak-ink, #23201b);
	margin: 2rem 0 0.5rem;
}

/* ---------- Figures ---------- */

.ak-figure {
	margin: 2rem 0;
}

.ak-figure img {
	max-width: 100%;
	height: auto;
	display: block;
}

.ak-figure figcaption {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.875rem;
	color: var(--ak-muted, #6b6558);
	margin-top: 0.625rem;
}

/* ---------- Notes and references ---------- */

.ak-notes,
.ak-references {
	margin: 3rem 0 0;
	padding-top: 1.5rem;
	border-top: 1px solid var(--ak-rule, #ded7c9);
}

.ak-notes h2,
.ak-references h2 {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ak-muted, #6b6558);
	margin: 0 0 1rem;
}

.ak-notes ol {
	list-style: none;
	padding: 0;
	margin: 0;
	counter-reset: ak-note;
}

.ak-notes li {
	font-size: 0.9375rem;
	line-height: 1.55;
	margin: 0 0 0.75rem;
	padding-left: 2.25rem;
	text-indent: -2.25rem;
}

.ak-references ol {
	list-style: none;
	padding: 0;
	margin: 0;
}

/* Hanging indent, the way a reference list is set in print. */
.ak-references li {
	font-size: 0.9375rem;
	line-height: 1.55;
	margin: 0 0 0.75rem;
	padding-left: 1.75rem;
	text-indent: -1.75rem;
}

/* In-text note marker */
.ak-noteref {
	font-size: 0.8em;
	vertical-align: super;
	line-height: 0;
	text-decoration: none;
	padding: 0 0.1em;
}

.ak-noteref:hover,
.ak-noteref:focus-visible {
	text-decoration: underline;
}

/* Back-link from a note to where it was cited */
.ak-backref {
	text-decoration: none;
	margin-left: 0.35em;
}

/* Briefly mark whatever was just jumped to, so the reader's eye lands. */
:target {
	background: var(--ak-tint, #f4f1e9);
	scroll-margin-top: 2rem;
}

/* ---------- Citation block ---------- */

.ak-cite {
	margin: 3rem 0 0;
	padding-top: 1.5rem;
	border-top: 1px solid var(--ak-rule, #ded7c9);
}

.ak-cite h2 {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ak-muted, #6b6558);
	margin: 0 0 1rem;
}

.ak-cite__row {
	margin: 0 0 1.25rem;
}

.ak-cite__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.375rem;
}

.ak-cite__style {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ak-muted, #6b6558);
}

.ak-cite__copy {
	font-family: var(--ak-font-sans, system-ui, sans-serif);
	font-size: 0.8125rem;
	color: var(--ak-accent, #1f5140);
	background: none;
	border: 1px solid var(--ak-rule, #ded7c9);
	border-radius: 3px;
	padding: 0.2rem 0.6rem;
	cursor: pointer;
}

.ak-cite__copy:hover,
.ak-cite__copy:focus-visible {
	border-color: var(--ak-accent, #1f5140);
}

.ak-cite__text {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.8125rem;
	line-height: 1.5;
	background: var(--ak-tint, #f4f1e9);
	padding: 0.875rem 1rem;
	margin: 0;
	overflow-x: auto;
	white-space: pre-wrap;
	word-break: break-word;
}

/* ---------- Print ----------
 * Notes and references print in full; interface furniture drops away.
 */

@media print {
	.ak-actions,
	.ak-cite__copy {
		display: none;
	}

	.ak-table-scroll {
		overflow: visible;
	}

	.ak-table-scroll table {
		min-width: 0;
	}

	.ak-abstract {
		border-left-color: #000;
		background: none;
	}
}
