/* Changelog lightbox (shared: single theme shortcode + compare table) */

/* Shortcode [kthb_theme_changelog_link]: info card + modal trigger (.kthb-changelog-trigger) */
.kthb-changelog-card {
	box-sizing: border-box;
	margin: 0 0 1rem;
	padding: 0;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: var(--kthb-bg, #f8fafc);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	overflow: hidden;
}

.kthb-changelog-card__head {
	padding: 0.85rem 1rem 0.5rem;
	border-bottom: 1px solid #e2e8f0;
	background: #fff;
}

.kthb-changelog-card__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.35;
}

.kthb-changelog-card__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	line-height: 1.45;
	background: #fff;
}

.kthb-changelog-card__table tbody tr:not(.kthb-changelog-card__row-actions) {
	border-bottom: 1px solid #f1f5f9;
}

.kthb-changelog-card__label {
	width: 46%;
	padding: 0.65rem 0.85rem 0.65rem 1rem;
	text-align: start;
	vertical-align: top;
	font-weight: 600;
	color: #64748b;
}

.kthb-changelog-card__value {
	padding: 0.65rem 1rem 0.65rem 0.5rem;
	vertical-align: top;
	color: #0f172a;
}

.kthb-changelog-card__value--mono {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.85rem;
}

.kthb-changelog-card__row-actions .kthb-changelog-card__actions {
	padding: 0.85rem 1rem 1rem;
	text-align: center;
	vertical-align: middle;
	background: var(--kthb-bg, #f8fafc);
	border-top: 1px solid #e2e8f0;
}

.kthb-changelog-card__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0.55rem 1.15rem;
	border: 1px solid var(--kthb-primary, #111111);
	border-radius: 10px;
	background: #fff;
	color: var(--kthb-primary, #111111);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition:
		border-color 0.2s ease,
		background 0.2s ease,
		color 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.15s ease;
}

.kthb-changelog-card__trigger:hover {
	background: var(--kthb-bg, #f8fafc);
	border-color: var(--kthb-primary-hover, #3f3f3f);
	color: var(--kthb-primary-hover, #3f3f3f);
}

.kthb-changelog-card__trigger:focus-visible {
	outline: none;
	box-shadow:
		0 0 0 3px rgba(0, 0, 0, 0.22),
		0 4px 14px rgba(15, 23, 42, 0.08);
}

.kthb-changelog-modal {
	position: fixed;
	inset: 0;
	z-index: 10001;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.kthb-changelog-modal.is-open {
	display: flex;
}

.kthb-changelog-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

.kthb-changelog-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 560px;
	max-height: min(90vh, 640px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
	overflow: hidden;
}

.kthb-changelog-modal__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1rem 0.5rem;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.kthb-changelog-modal__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
}

.kthb-changelog-modal__close {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: -0.25rem -0.25rem 0 0;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: #64748b;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
}

.kthb-changelog-modal__close:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.kthb-changelog-modal__status {
	min-height: 1.25rem;
	padding: 0.5rem 1rem 0;
	font-size: 0.85rem;
	color: #64748b;
	flex-shrink: 0;
}

.kthb-changelog-modal__body {
	padding: 0.5rem 1rem 1rem;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

.kthb-changelog-modal__list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.kthb-changelog-modal__entry {
	padding-bottom: 1rem;
	border-bottom: 1px solid #e2e8f0;
}

.kthb-changelog-modal__entry:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.kthb-changelog-modal__entry-title {
	margin: 0 0 0.35rem;
	font-size: 0.95rem;
	font-weight: 700;
	color: #0f172a;
}

.kthb-changelog-modal__entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 0.75rem;
	margin-bottom: 0.35rem;
	font-size: 0.8rem;
	color: #64748b;
}

.kthb-changelog-modal__entry-date {
	font-weight: 600;
	color: #334155;
}

.kthb-changelog-modal__entry-version {
	font-family: ui-monospace, monospace;
	font-size: 0.75rem;
	background: #f1f5f9;
	padding: 0.15rem 0.45rem;
	border-radius: 6px;
}

.kthb-changelog-modal__entry-body {
	font-size: 0.9rem;
	line-height: 1.55;
	color: #1e293b;
}

.kthb-changelog-modal__entry-body p {
	margin: 0 0 0.5rem;
}

.kthb-changelog-modal__entry-body p:last-child {
	margin-bottom: 0;
}

/* Compare table: update count control */
.kthb-compare__changelog-count {
	display: inline;
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	font: inherit;
	color: var(--kthb-primary, #111111);
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
	text-align: inherit;
}

.kthb-compare__changelog-count:hover {
	color: var(--kthb-primary-hover, #3f3f3f);
}

.kthb-compare__changelog-count:focus-visible {
	outline: 2px solid var(--kthb-primary, #111111);
	outline-offset: 2px;
	border-radius: 2px;
}
