/**
 * Shared Basic / Advanced mode switch + pane visibility.
 * Used by curlo/article and curlo/text (via curlo/article-pane).
 */

.curlo-mode-switch {
	margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
}

.curlo-mode-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.curlo-mode-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	padding: 0.5rem 1.05rem;
	border-radius: 999px;
	border: 1.5px solid var(--curlo-primary, #1a7f4b);
	background: transparent;
	color: var(--curlo-primary, #1a7f4b);
	font-family: var(--curlo-font-sans, Inter, system-ui, sans-serif);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.curlo-mode-btn:hover {
	background: color-mix(in srgb, var(--curlo-primary, #1a7f4b) 8%, transparent);
}

.curlo-mode-btn.is-active {
	background: var(--curlo-primary, #1a7f4b);
	border-color: var(--curlo-primary, #1a7f4b);
	color: #fff;
}

.curlo-mode-btn.is-active:hover {
	background: var(--curlo-primary-ink, #15803d);
	border-color: var(--curlo-primary-ink, #15803d);
	color: #fff;
}

.curlo-mode-check {
	font-size: 0.85em;
	line-height: 1;
	font-weight: 700;
}

.curlo-mode-hint {
	margin: 0.65rem 0 0;
	font-size: 0.8rem;
	color: var(--curlo-muted, #5b6675);
}

.curlo-article-entry--pro .curlo-mode-btn,
.curlo-article-entry--code .curlo-mode-btn,
.curlo-text--pro .curlo-mode-btn,
.curlo-text--code .curlo-mode-btn {
	border-color: var(--curlo-green, #4ade80);
	color: var(--curlo-green, #4ade80);
}

.curlo-article-entry--pro .curlo-mode-btn.is-active,
.curlo-article-entry--code .curlo-mode-btn.is-active,
.curlo-text--pro .curlo-mode-btn.is-active,
.curlo-text--code .curlo-mode-btn.is-active {
	background: var(--curlo-green, #4ade80);
	border-color: var(--curlo-green, #4ade80);
	color: #0b0e14;
}

/* Front: only the active / default pane is visible */
.curlo-article-entry--modes .curlo-mode-pane,
.curlo-text--modes .curlo-mode-pane {
	display: none;
}

.curlo-article-entry--modes[data-default-mode="advanced"]:not([data-active-mode]) .curlo-mode-pane--advanced,
.curlo-article-entry--modes[data-default-mode="basic"]:not([data-active-mode]) .curlo-mode-pane--basic,
.curlo-article-entry--modes[data-active-mode="advanced"] .curlo-mode-pane--advanced,
.curlo-article-entry--modes[data-active-mode="basic"] .curlo-mode-pane--basic,
.curlo-text--modes[data-default-mode="advanced"]:not([data-active-mode]) .curlo-mode-pane--advanced,
.curlo-text--modes[data-default-mode="basic"]:not([data-active-mode]) .curlo-mode-pane--basic,
.curlo-text--modes[data-active-mode="advanced"] .curlo-mode-pane--advanced,
.curlo-text--modes[data-active-mode="basic"] .curlo-mode-pane--basic,
.curlo-article-entry--modes .curlo-mode-pane.is-active,
.curlo-article-entry--modes .curlo-mode-pane.is-editing,
.curlo-text--modes .curlo-mode-pane.is-active,
.curlo-text--modes .curlo-mode-pane.is-editing {
	display: block;
}

.curlo-mode-pane.is-editing {
	margin: 0 0 1.25rem;
	padding: 1rem 1rem 0.25rem;
	border: 1px dashed var(--curlo-line, #d8dee6);
	border-radius: 8px;
	background: color-mix(in srgb, var(--curlo-surface-2, #f4f6f8) 70%, transparent);
}

.curlo-mode-pane-editor-label {
	margin: 0 0 0.75rem;
	font-family: var(--curlo-font-mono, "JetBrains Mono", monospace);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--curlo-muted, #5b6675);
}

/* Back-compat aliases (older article markup) */
.curlo-article-entry__mode-switch { margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem); }
.curlo-article-entry__mode-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.curlo-article-entry__mode-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	padding: 0.5rem 1.05rem;
	border-radius: 999px;
	border: 1.5px solid var(--curlo-primary, #1a7f4b);
	background: transparent;
	color: var(--curlo-primary, #1a7f4b);
	font-family: var(--curlo-font-sans, Inter, system-ui, sans-serif);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}
.curlo-article-entry__mode-btn.is-active {
	background: var(--curlo-primary, #1a7f4b);
	border-color: var(--curlo-primary, #1a7f4b);
	color: #fff;
}
.curlo-article-entry--modes .curlo-article-entry__pane { display: none; }
.curlo-article-entry--modes[data-default-mode="advanced"]:not([data-active-mode]) .curlo-article-entry__pane--advanced,
.curlo-article-entry--modes[data-default-mode="basic"]:not([data-active-mode]) .curlo-article-entry__pane--basic,
.curlo-article-entry--modes[data-active-mode="advanced"] .curlo-article-entry__pane--advanced,
.curlo-article-entry--modes[data-active-mode="basic"] .curlo-article-entry__pane--basic,
.curlo-article-entry--modes .curlo-article-entry__pane.is-active,
.curlo-article-entry--modes .curlo-article-entry__pane.is-editing {
	display: block;
}

/* —— Shared further reading (article + text) —— */

.curlo-further,
.curlo-article-entry__further {
	margin: clamp(3rem, 6vw, 4.5rem) 0 0;
	color: var(--curlo-text);
}

.curlo-further__label,
.curlo-article-entry__further-label {
	font-family: var(--curlo-font-mono, "JetBrains Mono", monospace);
	font-size: 0.7rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--curlo-muted, #5b6675);
	margin: 0 0 1rem;
}

.curlo-further__list,
.curlo-article-entry__further-list {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	padding-inline-start: 0;
	list-style: none;
}

.curlo-further__list > li,
.curlo-article-entry__further-list > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.curlo-further__item,
.curlo-article-entry__further-item {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.35rem 1rem;
	padding: 1rem 0;
	border-top: 1px solid var(--curlo-line, #d8dee6);
	text-decoration: none;
	color: inherit;
	box-shadow: none;
	min-width: 0;
	max-width: 100%;
	box-sizing: border-box;
}

.curlo-further__item:hover,
.curlo-further__item:focus,
.curlo-article-entry__further-item:hover,
.curlo-article-entry__further-item:focus {
	text-decoration: none;
	color: inherit;
}

.curlo-further__list li:last-child .curlo-further__item,
.curlo-article-entry__further-list li:last-child .curlo-article-entry__further-item {
	border-bottom: 1px solid var(--curlo-line, #d8dee6);
}

.curlo-article-entry--pro .curlo-further__item,
.curlo-article-entry--pro .curlo-article-entry__further-item,
.curlo-article-entry--code .curlo-further__item,
.curlo-article-entry--code .curlo-article-entry__further-item,
.curlo-text--pro .curlo-further__item,
.curlo-text--pro .curlo-article-entry__further-item,
.curlo-text--code .curlo-further__item,
.curlo-text--code .curlo-article-entry__further-item {
	border-color: rgba(255, 255, 255, 0.12);
}

.curlo-further__title,
.curlo-article-entry__further-title {
	font-family: var(--curlo-font-sans, Inter, sans-serif);
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: inherit;
	line-height: 1.35;
	flex: 1 1 12rem;
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.curlo-further__item:hover .curlo-further__title,
.curlo-article-entry__further-item:hover .curlo-article-entry__further-title {
	color: var(--curlo-primary-ink, #15803d);
}

.curlo-article-entry--pro .curlo-further__item:hover .curlo-further__title,
.curlo-article-entry--pro .curlo-article-entry__further-item:hover .curlo-article-entry__further-title,
.curlo-article-entry--code .curlo-further__item:hover .curlo-further__title,
.curlo-article-entry--code .curlo-article-entry__further-item:hover .curlo-article-entry__further-title,
.curlo-text--pro .curlo-further__item:hover .curlo-further__title,
.curlo-text--pro .curlo-article-entry__further-item:hover .curlo-article-entry__further-title,
.curlo-text--code .curlo-further__item:hover .curlo-further__title,
.curlo-text--code .curlo-article-entry__further-item:hover .curlo-article-entry__further-title {
	color: var(--curlo-green, #4ade80);
}

.curlo-further__tag,
.curlo-article-entry__further-tag {
	font-family: var(--curlo-font-mono, "JetBrains Mono", monospace);
	font-size: 0.7rem;
	line-height: 1.4;
	color: var(--curlo-muted, #5b6675);
	flex: 0 1 auto;
	max-width: 100%;
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
	text-align: right;
}

@media (max-width: 600px) {
	.curlo-further__item,
	.curlo-article-entry__further-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.4rem;
	}

	.curlo-further__title,
	.curlo-article-entry__further-title {
		flex: 1 1 auto;
		width: 100%;
	}

	.curlo-further__tag,
	.curlo-article-entry__further-tag {
		text-align: left;
		width: 100%;
	}
}

.curlo-article-entry--pro .curlo-further__label,
.curlo-article-entry--pro .curlo-further__tag,
.curlo-article-entry--code .curlo-further__label,
.curlo-article-entry--code .curlo-further__tag,
.curlo-text--pro .curlo-further__label,
.curlo-text--pro .curlo-further__tag,
.curlo-text--code .curlo-further__label,
.curlo-text--code .curlo-further__tag,
.curlo-article-entry--pro .curlo-article-entry__further-label,
.curlo-article-entry--pro .curlo-article-entry__further-tag,
.curlo-article-entry--code .curlo-article-entry__further-label,
.curlo-article-entry--code .curlo-article-entry__further-tag,
.curlo-text--pro .curlo-article-entry__further-label,
.curlo-text--pro .curlo-article-entry__further-tag,
.curlo-text--code .curlo-article-entry__further-label,
.curlo-text--code .curlo-article-entry__further-tag {
	color: var(--curlo-code-muted, #7e8ca0);
}
