/**
 * Logline Engine front-end styles. Deliberately small and theme-neutral: the
 * plugin owns behaviour/layout of its own components, the theme owns chrome.
 * Uses CSS custom properties so a theme can retheme without overriding rules.
 *
 * @package LoglineEngine
 */

.logline-single,
.logline-archive,
.logline-profile {
	--le-gap: 1rem;
	/* Inherit the theme's brand accent when it sets one; otherwise fall back. */
	--le-accent: var(--brand-accent, #2563eb);
	--le-accent-contrast: var(--brand-accent-contrast, #fff);
	--le-border: var(--brand-border, #d9dde1);
	--le-muted: var(--brand-muted, #5a6472);
	max-width: 44rem;
	margin: 0 auto;
	padding: var(--le-gap);
}

/* Vote control ---------------------------------------------------------- */
.logline-vote {
	flex: 0 0 auto;
}

.logline-vote-btn {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15em;
	min-width: 3rem;
	padding: 0.4rem 0.5rem;
	border: 1px solid var(--le-border);
	border-radius: 8px;
	background: #fff;
	color: var(--le-muted);
	font: inherit;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
}

.logline-vote-btn .logline-vote-icon {
	font-size: 1.1em;
}

.logline-vote-btn .logline-vote-score {
	font-weight: 600;
	color: #1a1f26;
}

.logline-vote-btn:hover,
.logline-vote-btn:focus-visible {
	border-color: var(--le-accent);
	color: var(--le-accent);
}

.logline-vote-btn.is-voted {
	border-color: var(--le-accent);
	background: var(--le-accent);
	color: var(--le-accent-contrast);
}

.logline-vote-btn.is-voted .logline-vote-score {
	color: var(--le-accent-contrast);
}

.logline-vote-static {
	cursor: default;
}

/* Single logline -------------------------------------------------------- */
.logline-header {
	display: flex;
	gap: var(--le-gap);
	align-items: flex-start;
}

.logline-title {
	margin: 0 0 0.25rem;
	font-size: 1.5rem;
	line-height: 1.3;
}

.logline-byline {
	margin: 0;
	color: var(--le-muted);
	font-size: 0.9rem;
}

/* Author name links to the member's profile but reads as a name, not a loud
   link, until hovered. */
.logline-author {
	color: inherit;
	font-weight: 600;
	text-decoration: none;
}

.logline-author:hover,
.logline-author:focus-visible {
	text-decoration: underline;
}

.logline-review-own,
.logline-review-login {
	color: var(--le-muted);
	font-style: italic;
}

.logline-byline time::before {
	content: " · ";
}

.logline-level {
	font-weight: 700;
}

.logline-body {
	margin: var(--le-gap) 0 2rem;
}

/* Reviews --------------------------------------------------------------- */
.logline-reviews h2 {
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--le-border);
}

.logline-review {
	display: flex;
	gap: var(--le-gap);
	padding: var(--le-gap) 0;
	border-bottom: 1px solid var(--le-border);
}

.logline-review.is-accepted {
	background: #f2fbf6;
	border-left: 3px solid #1eaf88;
	padding-left: 0.75rem;
}

.logline-review-main {
	flex: 1 1 auto;
	min-width: 0;
}

.logline-review-meta {
	margin-bottom: 0.4rem;
	color: var(--le-muted);
	font-size: 0.85rem;
}

.logline-review-meta time::before {
	content: " · ";
}

.logline-accepted-badge {
	margin-left: 0.4rem;
	color: #1a8a68;
	font-weight: 700;
}

.logline-review-body {
	overflow-wrap: break-word;
}

.logline-accept-btn {
	margin-top: 0.5rem;
	padding: 0.3rem 0.7rem;
	border: 1px solid var(--le-border);
	border-radius: 6px;
	background: #fff;
	font: inherit;
	font-size: 0.85rem;
	cursor: pointer;
}

.logline-accept-btn.is-accepted {
	border-color: #1eaf88;
	color: #1a8a68;
	font-weight: 700;
}

/* Review form ----------------------------------------------------------- */
.logline-review-form {
	margin-top: 1.5rem;
}

.logline-form-field label {
	display: block;
	margin-bottom: 0.3rem;
	font-weight: 600;
}

.logline-review-form textarea {
	width: 100%;
	padding: 0.6rem;
	border: 1px solid var(--le-border);
	border-radius: 8px;
	font: inherit;
	box-sizing: border-box;
}

.logline-submit-btn {
	padding: 0.55rem 1.1rem;
	border: 0;
	border-radius: 8px;
	background: var(--le-accent);
	color: var(--le-accent-contrast);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.logline-submit-btn:disabled {
	opacity: 0.6;
	cursor: progress;
}

.logline-form-status {
	margin-left: 0.6rem;
	color: #b3261e;
}

/* Archive --------------------------------------------------------------- */
.logline-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.logline-list-item {
	display: flex;
	gap: var(--le-gap);
	align-items: baseline;
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--le-border);
}

.logline-list-score {
	flex: 0 0 auto;
	min-width: 3rem;
	color: var(--le-muted);
	font-weight: 600;
	text-align: right;
}

/* A logline with no votes/reviews yet: recede the score, and phrase the
   review count as a gentle invitation instead of a stark "0". */
.logline-list-score.is-quiet {
	opacity: 0.4;
	font-weight: 400;
}

.logline-meta-quiet {
	font-style: italic;
}

.logline-list-title {
	margin: 0 0 0.2rem;
	font-size: 1.1rem;
	line-height: 1.35;
}

.logline-list-meta {
	margin: 0;
	color: var(--le-muted);
	font-size: 0.85rem;
}

.logline-pagination {
	margin-top: 1.5rem;
}

.logline-pagination .page-numbers {
	padding: 0.3rem 0.6rem;
	margin-right: 0.25rem;
	border: 1px solid var(--le-border);
	border-radius: 6px;
	text-decoration: none;
}

.logline-pagination .page-numbers.current {
	background: var(--le-accent);
	color: var(--le-accent-contrast);
	border-color: var(--le-accent);
}

/* Archive header: title + jump-to-year, and the load-more button. */
.logline-archive-header {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.logline-archive-header h1 {
	margin: 0;
}

.logline-yearjump {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.logline-yearjump label {
	color: var(--le-muted);
	font-weight: 600;
}

.logline-yearjump select {
	padding: 0.35rem 0.5rem;
	border: 1px solid var(--le-border);
	border-radius: 8px;
	font: inherit;
	background: var(--brand-bg, #fff);
	color: inherit;
}

.logline-loadmore-wrap {
	margin-top: 1.5rem;
	text-align: center;
}

.logline-loadmore {
	font: inherit;
	font-weight: 600;
	padding: 0.6rem 1.5rem;
	border: 1px solid var(--le-border);
	border-radius: 999px;
	background: transparent;
	color: var(--le-accent);
	cursor: pointer;
}

.logline-loadmore:hover {
	border-color: var(--le-accent);
	background: color-mix(in srgb, var(--le-accent) 8%, transparent);
}

.logline-loadmore:disabled {
	opacity: 0.6;
	cursor: progress;
}

/* Profile --------------------------------------------------------------- */
.profile-header {
	display: flex;
	gap: var(--le-gap);
	align-items: flex-start;
	padding-bottom: 1.25rem;
	margin-bottom: 1.5rem;
	border-bottom: 2px solid var(--le-border);
}

.profile-avatar-img {
	border-radius: 50%;
}

.profile-name {
	margin: 0 0 0.25rem;
	font-size: 1.6rem;
	line-height: 1.2;
}

.profile-rep {
	margin: 0 0 0.35rem;
	font-size: 1.05rem;
}

.profile-level {
	font-weight: 700;
}

.profile-next-level {
	margin: 0 0 0.5rem;
	color: var(--le-muted);
	font-size: 0.9rem;
}

.profile-stats {
	display: flex;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--le-muted);
	font-size: 0.9rem;
}

.badge-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
}

.badge-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.25rem 0.7rem;
	border: 1px solid var(--le-border);
	border-radius: 999px;
	font-size: 0.85rem;
}

.badge-dot {
	width: 0.7em;
	height: 0.7em;
	border-radius: 50%;
	background: var(--le-muted);
}

.logline-profile section {
	margin-bottom: 2rem;
}

.logline-profile h2 {
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--le-border);
}

.profile-review-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.profile-review-item {
	padding: 0.85rem 0;
	border-bottom: 1px solid var(--le-border);
}

.profile-review-on {
	margin: 0 0 0.3rem;
	color: var(--le-muted);
	font-size: 0.9rem;
}

.profile-review-excerpt {
	overflow-wrap: break-word;
}

.logline-empty {
	color: var(--le-muted);
}

@media (max-width: 480px) {
	.logline-title {
		font-size: 1.25rem;
	}

	.profile-header {
		flex-direction: column;
	}
}
