/**
 * DevHub Project Hub — Pages tab.
 *
 * Split layout: drafts list on the left, target-preview iframe on the
 * right. Visual language matches the Blocks tab + Co-pilot rail
 * (dark theme, #1a1d21 panels, 8px radius, #68de7c accent).
 *
 * @since plan #202
 */

.tf-pages {
	max-width: none;
	display: flex;
	flex-direction: column;
	gap: 16px;
	height: 100%;
}

.tf-pages__intro {
	color: #d4d4d4;
	font-size: 13px;
	line-height: 1.6;
	margin: 0;
}

.tf-pages__intro strong {
	color: #e0e0e0;
	font-weight: 600;
}

.tf-pages--unavailable {
	max-width: 700px;
}

/* ── Split layout ─────────────────────────────────────────────────── */

.tf-pages__layout {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 16px;
	flex: 1 1 auto;
	min-height: 0;
}

/* List column (left) */

.tf-pages__list {
	background: #1a1d21;
	border: 1px solid #2a2d31;
	border-radius: 8px;
	overflow-y: auto;
	min-height: 0;
}

.tf-pages__empty {
	color: #888;
	font-size: 13px;
	padding: 20px;
	margin: 0;
	line-height: 1.5;
}

.tf-pages__items {
	list-style: none;
	margin: 0;
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.tf-pages__item {
	margin: 0;
}

.tf-pages__item-button {
	width: 100%;
	background: transparent;
	border: 1px solid transparent;
	color: #d4d4d4;
	font-family: inherit;
	text-align: left;
	padding: 10px 12px;
	border-radius: 6px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.tf-pages__item-button:hover,
.tf-pages__item-button:focus-visible {
	background: rgba(255, 255, 255, 0.03);
	border-color: #2f3439;
	outline: none;
}

.tf-pages__item--selected .tf-pages__item-button {
	background: rgba(104, 222, 124, 0.06);
	border-color: rgba(104, 222, 124, 0.4);
}

.tf-pages__item-title {
	font-size: 13px;
	font-weight: 600;
	color: #e0e0e0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tf-pages__item-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 11px;
	color: #888;
}

.tf-pages__status {
	font-size: 10px;
	font-weight: 600;
	padding: 1px 6px;
	border-radius: 999px;
	letter-spacing: 0.02em;
}

.tf-pages__status--composed {
	background: rgba(244, 196, 48, 0.08);
	color: #f4c430;
	border: 1px solid rgba(244, 196, 48, 0.25);
}

.tf-pages__status--deployed-draft {
	background: rgba(104, 222, 124, 0.06);
	color: #68de7c;
	border: 1px solid rgba(104, 222, 124, 0.25);
}

.tf-pages__status--published {
	background: rgba(104, 222, 124, 0.15);
	color: #68de7c;
	border: 1px solid #68de7c;
}

.tf-pages__item-target {
	color: #888;
}

.tf-pages__item-modified {
	color: #777;
	margin-left: auto;
}

/* Preview column (right) */

.tf-pages__preview {
	background: #1a1d21;
	border: 1px solid #2a2d31;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.tf-pages__preview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-bottom: 1px solid #2a2d31;
	flex-shrink: 0;
}

.tf-pages__preview-title {
	color: #e0e0e0;
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1 1 auto;
}

.tf-pages__preview-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.tf-pages__action {
	background: #1f2429;
	border: 1px solid #2f3439;
	color: #d4d4d4;
	font-family: inherit;
	font-size: 11px;
	padding: 5px 11px;
	border-radius: 6px;
	cursor: pointer;
}

.tf-pages__action:hover:not(:disabled),
.tf-pages__action:focus-visible:not(:disabled) {
	background: #262b30;
	border-color: rgba(104, 222, 124, 0.4);
	color: #e0e0e0;
}

.tf-pages__action:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.tf-pages__action--publish {
	border-color: rgba(104, 222, 124, 0.3);
	color: #68de7c;
}

.tf-pages__action--publish:hover:not(:disabled),
.tf-pages__action--publish:focus-visible:not(:disabled) {
	background: rgba(104, 222, 124, 0.08);
	border-color: #68de7c;
	color: #68de7c;
}

.tf-pages__action--delete {
	border-color: rgba(255, 107, 107, 0.25);
	color: #ff8a8a;
}

.tf-pages__action--delete:hover:not(:disabled),
.tf-pages__action--delete:focus-visible:not(:disabled) {
	background: rgba(255, 107, 107, 0.06);
	border-color: #ff6b6b;
	color: #ff6b6b;
}

.tf-pages__preview-status {
	font-size: 11px;
	padding: 6px 16px;
	background: rgba(255, 255, 255, 0.04);
	color: #d4d4d4;
	border-bottom: 1px solid #2a2d31;
}

.tf-pages__preview-status[data-kind="success"] { color: #68de7c; }
.tf-pages__preview-status[data-kind="error"]   { color: #ff6b6b; }
.tf-pages__preview-status[data-kind="pending"] { color: #d4d4d4; }

.tf-pages__preview-frame {
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #0f1216;
}

.tf-pages__preview-empty {
	margin: auto;
	padding: 40px 20px;
	text-align: center;
	color: #888;
	font-size: 13px;
	line-height: 1.5;
}

.tf-pages__preview-empty strong {
	color: #e0e0e0;
	font-weight: 600;
}

.tf-pages__preview-iframe {
	display: block;
	border: 0;
	width: 100%;
	height: 100%;
	background: #fff;
}

@media (max-width: 1100px) {
	.tf-pages__layout {
		grid-template-columns: 1fr;
	}
	.tf-pages__list {
		max-height: 240px;
	}
}
