/**
 * Site chrome + SPA shell — colors from --ad-* (Vue / autodidacte-chrome.js).
 * Height chain mirrors Readerforbooks so the empty js-embed mount
 * keeps a stable height while Vue assets load (no layout jump).
 * No PHP site header — footer only on the home list.
 * Legal pages (article.autodidacte-page) must NOT stretch like the SPA.
 */

:root {
	--ad-bg: #e8ece7;
	--ad-bg-soft: #f4f6f2;
	--ad-chrome: rgba(244, 246, 242, 0.95);
	--ad-chrome-solid: #f4f6f2;
	--ad-border: rgba(28, 43, 38, 0.12);
	--ad-ink: #1c2b26;
	--ad-ink-muted: #5a6b64;
	--ad-accent: #0d9488;
	--ad-accent-hover: #0f766e;
	--ad-on-accent: #ffffff;
	/* Approx. PHP footer only */
	--ad-chrome-offset: 5rem;
}

html,
body {
	margin: 0;
	padding: 0;
	background-color: var(--ad-bg);
	color: var(--ad-ink);
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	background-color: var(--ad-bg);
	color: var(--ad-ink);
	transition: background-color 180ms ease, color 180ms ease;
}

#content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	margin: 0;
	padding: 0;
	width: 100%;
}

/*
 * Stretch only the SPA mount — not legal / editorial pages (article.autodidacte-page).
 * js-embed wraps: #content > div > #jsembed-app-autodidacte
 */
#content > div:has([id^="jsembed-app-"]),
#content > div:has([id^="jsembed-app-"]) > [id^="jsembed-app-"],
#content [id^="jsembed-app-"] {
	margin: 0;
	padding: 0;
	width: 100%;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	min-height: 0;
}

#content > div:has([id^="jsembed-app-"]),
#content [id^="jsembed-app-"] {
	/* Fill viewport minus footer so footer stays pinned at bottom. */
	min-height: calc(100vh - var(--ad-chrome-offset));
	min-height: calc(100dvh - var(--ad-chrome-offset));
	flex: 1 1 auto;
}

.autodidacte-site-footer {
	flex: 0 0 auto;
	flex-shrink: 0;
	margin: 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow-x: clip;
	border-top: 1px solid var(--ad-border);
	background: var(--ad-chrome-solid);
	color: var(--ad-ink-muted);
}

.autodidacte-site-footer__inner {
	max-width: 64rem;
	width: 100%;
	margin: 0 auto;
	padding: 1rem 1.5rem;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--ad-ink-muted);
}

.autodidacte-site-footer__meta,
.autodidacte-site-footer__legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.35rem 0.5rem;
	max-width: 100%;
	min-width: 0;
	text-align: center;
}

.autodidacte-site-footer__meta a,
.autodidacte-site-footer__legal a {
	color: inherit;
	text-decoration: none;
}

.autodidacte-site-footer__meta a:hover,
.autodidacte-site-footer__legal a:hover {
	color: var(--ad-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (min-width: 640px) {
	.autodidacte-site-footer__inner {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: space-between;
		align-items: center;
		gap: 0.75rem 1.25rem;
		font-size: 0.875rem;
	}

	.autodidacte-site-footer__meta,
	.autodidacte-site-footer__legal {
		justify-content: flex-start;
		text-align: left;
	}
}

/* Pages légales / contenu éditorial — indépendant du shell SPA. */
.autodidacte-page {
	width: 100%;
	max-width: 42rem;
	margin-left: auto;
	margin-right: auto;
	padding: 2.5rem 1.5rem 3.5rem;
	box-sizing: border-box;
	flex: 0 0 auto;
	color: var(--ad-ink);
}

.autodidacte-page__back {
	margin: 0 0 1.25rem;
}

.autodidacte-page__back a {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.85rem 0.45rem 0.55rem;
	border-radius: 0.5rem;
	border: 1px solid var(--ad-border);
	background: var(--ad-chrome-solid);
	color: var(--ad-ink-muted);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.autodidacte-page__back a:hover {
	color: var(--ad-ink);
	background: var(--ad-bg-soft);
	border-color: color-mix(in srgb, var(--ad-ink) 22%, transparent);
}

.autodidacte-page__back svg {
	flex-shrink: 0;
	display: block;
}

.autodidacte-page__title {
	margin: 0 0 1.25rem;
	font-size: 1.75rem;
	line-height: 1.25;
	font-weight: 650;
	color: var(--ad-ink);
}

.autodidacte-page__content {
	line-height: 1.65;
	font-size: 1rem;
	color: var(--ad-ink-muted);
}

.autodidacte-page__content > * + * {
	margin-top: 0.9rem;
}

.autodidacte-page__content h2 {
	margin-top: 1.75rem;
	margin-bottom: 0.65rem;
	font-size: 1.15rem;
	line-height: 1.35;
	font-weight: 650;
	color: var(--ad-ink);
}

.autodidacte-page__content p {
	margin: 0;
}

.autodidacte-page__content a {
	color: var(--ad-accent);
}

.autodidacte-page__content a:hover {
	color: var(--ad-accent-hover);
}

.autodidacte-site-footer__cookie-btn {
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	cursor: pointer;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.autodidacte-site-footer__cookie-btn:hover {
	color: var(--ad-ink);
}

/* Cookie consent — center privacy link; --cc-* set by autodidacte-chrome.js per theme */
.cm__link-group {
	justify-content: center !important;
	text-align: center !important;
	width: 100%;
}

/* Reject only (data-role=necessary) — outline; preferences keep secondary fill */
#cc-main button[data-role='necessary'] {
	background-color: transparent !important;
	border: 1px solid var(--cc-btn-primary-bg) !important;
	color: var(--cc-btn-primary-bg) !important;
}

#cc-main button[data-role='necessary']:hover {
	background-color: color-mix(in srgb, var(--cc-btn-primary-bg) 12%, transparent) !important;
	border-color: var(--cc-btn-primary-hover-bg) !important;
	color: var(--cc-btn-primary-hover-bg) !important;
}



